Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, April 19, 2024

Diff for phpMyEdit/phpMyEdit.class.php between version 1.93 and 1.94

version 1.93, 2003/08/16 14:01:17 version 1.94, 2003/08/18 20:31:58
Line 19 
Line 19 
  * http://www.platon.sk/projects/phpMyEdit/   * http://www.platon.sk/projects/phpMyEdit/
  */   */
   
 /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.92 2003/08/16 01:41:26 nepto Exp $ */  /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.93 2003/08/16 14:01:17 nepto Exp $ */
   
 /*  This is a generic table editing program. The table and fields to be  /*  This is a generic table editing program. The table and fields to be
         edited are defined in the calling program.          edited are defined in the calling program.
Line 385  class phpMyEdit
Line 385  class phpMyEdit
                 return $values;                  return $values;
         } /* }}} */          } /* }}} */
   
         /*          function fqn($field, $dont_desc = false, $dont_cols = false) /* {{{ */
          * get the table/field name  
          */  
         function fqn($field, $use_qfx = false, $dont_desc = false, $dont_cols = false) /* {{{ */  
         {          {
                 is_numeric($field) || $field = array_search($field, $this->fds);                  is_numeric($field) || $field = array_search($field, $this->fds);
                 // use_qfx                  // if read SQL expression exists use it
                 if ($use_qfx)                  if (isset($this->fdd[$field]['sql']))
                         return 'qf'.$field;                          return $this->fdd[$field]['sql'];
                 // on copy/change always use simple key retrieving                  // on copy/change always use simple key retrieving
                 if ($this->add_operation()                  if ($this->add_operation()
                                 || $this->copy_operation()                                  || $this->copy_operation()
                                 || $this->change_operation()) {                                  || $this->change_operation()) {
                                 $ret = 'PMEtable0.'.$this->fds[$field];                                  $ret = 'PMEtable0.'.$this->fds[$field];
                 } else {                  } else {
                         if (isset($this->fdd[$field]['sql'])) {                          if ($this->fdd[$this->fds[$field]]['values']['description'] && ! $dont_desc) {
                                 $ret = $this->fdd[$field]['sql'];  
                         } elseif ($this->fdd[$this->fds[$field]]['values']['description'] && ! $dont_desc) {  
                                 $desc = &$this->fdd[$this->fds[$field]]['values']['description'];                                  $desc = &$this->fdd[$this->fds[$field]]['values']['description'];
                                 if (is_array($desc) && is_array($desc['columns'])) {                                  if (is_array($desc) && is_array($desc['columns'])) {
                                         $ret      = 'CONCAT('; // )                                          $ret      = 'CONCAT('; // )
Line 447  class phpMyEdit
Line 442  class phpMyEdit
                         }                          }
                         $fields[] = $this->fqn($k).' AS qf'.$k;                          $fields[] = $this->fqn($k).' AS qf'.$k;
                         if ($this->col_has_values($k)) {                          if ($this->col_has_values($k)) {
                                 $fields[] = $this->fqn($k, false, true, true).' AS qf'.$k.'_idx';                                  $fields[] = $this->fqn($k, true, true).' AS qf'.$k.'_idx';
                         }                          }
                         if ($this->col_has_datemask($k)) {                          if ($this->col_has_datemask($k)) {
                                 $fields[] = 'UNIX_TIMESTAMP('.$this->fqn($k).') AS qf'.$k.'_timestamp';                                  $fields[] = 'UNIX_TIMESTAMP('.$this->fqn($k).') AS qf'.$k.'_timestamp';
Line 619  class phpMyEdit
Line 614  class phpMyEdit
                                         // XXX: $dont_desc and $dont_cols hack                                          // XXX: $dont_desc and $dont_cols hack
                                         $dont_desc = isset($this->fdd[$k]['values']['description']);                                          $dont_desc = isset($this->fdd[$k]['values']['description']);
                                         $dont_cols = isset($this->fdd[$k]['values']['column']);                                          $dont_cols = isset($this->fdd[$k]['values']['column']);
                                         $qo[$this->fqn($k, false, $dont_desc, $dont_cols)] =                                          $qo[$this->fqn($k, $dont_desc, $dont_cols)] =
                                                 array('oper'  => $qf_op, 'value' => "($qf_val)"); // )                                                  array('oper'  => $qf_op, 'value' => "($qf_val)"); // )
                                 }                                  }
                         } else if (isset($mi)) {                          } else if (isset($mi)) {
Line 630  class phpMyEdit
Line 625  class phpMyEdit
                                         continue;                                          continue;
                                 }                                  }
                                 $afilter = addslashes($mi);                                  $afilter = addslashes($mi);
                                 $qo[$this->fqn($k, false, true, true)] = array('oper'  => '=', 'value' => "'$afilter'");                                  $qo[$this->fqn($k, true, true)] = array('oper'  => '=', 'value' => "'$afilter'");
                                 $this->qfn .= '&'.$li.'='.rawurlencode($mi);                                  $this->qfn .= '&'.$li.'='.rawurlencode($mi);
                         } else if (isset($m)) {                          } else if (isset($m)) {
                                 if ($m == '*') {                                  if ($m == '*') {
Line 657  class phpMyEdit
Line 652  class phpMyEdit
                                                         }                                                          }
                                                 }                                                  }
                                                 if (count($ids) > 0) {                                                  if (count($ids) > 0) {
                                                         $ar[$this->fqn($k, false, true, true)]                                                          $ar[$this->fqn($k, true, true)]
                                                                 = array('oper'  => 'IN', 'value' => '('.join(',', $ids).')');                                                                  = array('oper'  => 'IN', 'value' => '('.join(',', $ids).')');
                                                 }                                                  }
                                         }                                          }

Legend:
Removed from v.1.93  
changed lines
  Added in v.1.94

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top