Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Thursday, October 15, 2026

Diff for phpMyEdit/phpMyEdit.class.php between version 1.213 and 1.214

version 1.213, 2010/09/20 01:08:46 version 1.214, 2011/01/09 18:02:40
Line 19 
Line 19 
  * http://platon.sk/projects/phpMyEdit/   * http://platon.sk/projects/phpMyEdit/
  */   */
   
 /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.212 2008-11-11 04:46:36 nepto Exp $ */  /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.213 2010-09-20 01:08:46 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 120  class phpMyEdit
Line 120  class phpMyEdit
         var $qfn;               // value of all filters used during the last pass          var $qfn;               // value of all filters used during the last pass
         var $sfn;               // sort field number (- = descending sort order)          var $sfn;               // sort field number (- = descending sort order)
         var $cur_tab;   // current selected tab          var $cur_tab;   // current selected tab
           var $page_type; // current page type
   
         // Operation          // Operation
         var $navop;             // navigation buttons/operations          var $navop;             // navigation buttons/operations
Line 147  class phpMyEdit
Line 148  class phpMyEdit
         var $notify;            // change notification e-mail adresses          var $notify;            // change notification e-mail adresses
         var $logtable;          // name of optional logtable          var $logtable;          // name of optional logtable
         var $navigation;        // navigation style          var $navigation;        // navigation style
           var $buttons;
         var $tabs;                      // TAB names          var $tabs;                      // TAB names
         var $timer = null;      // phpMyEdit_timer object          var $timer = null;      // phpMyEdit_timer object
         var $sd; var $ed;       // sql start and end delimiters '`' in case of MySQL          var $sd; var $ed;       // sql start and end delimiters '`' in case of MySQL
Line 192  class phpMyEdit
Line 194  class phpMyEdit
         function col_has_multiple($k)          function col_has_multiple($k)
         { return $this->col_has_multiple_select($k) || $this->col_has_checkboxes($k); }          { return $this->col_has_multiple_select($k) || $this->col_has_checkboxes($k); }
         function col_has_multiple_select($k)          function col_has_multiple_select($k)
         { return $this->fdd[$k]['select'] == 'M' && ! $this->fdd[$k]['values']['table']; }          { return $this->fdd[$k]['select'] == 'M' && ! @$this->fdd[$k]['values']['table']; }
         function col_has_checkboxes($k)          function col_has_checkboxes($k)
         { return $this->fdd[$k]['select'] == 'C' && ! $this->fdd[$k]['values']['table']; }          { return $this->fdd[$k]['select'] == 'C' && ! @$this->fdd[$k]['values']['table']; }
         function col_has_radio_buttons($k)          function col_has_radio_buttons($k)
         { return $this->fdd[$k]['select'] == 'O' && ! $this->fdd[$k]['values']['table']; }          { return $this->fdd[$k]['select'] == 'O' && ! @$this->fdd[$k]['values']['table']; }
         function col_has_datemask($k)          function col_has_datemask($k)
         { return isset($this->fdd[$k]['datemask']) || isset($this->fdd[$k]['strftimemask']); }          { return isset($this->fdd[$k]['datemask']) || isset($this->fdd[$k]['strftimemask']); }
   
Line 221  class phpMyEdit
Line 223  class phpMyEdit
         function view_enabled()   { return stristr($this->options, 'V'); }          function view_enabled()   { return stristr($this->options, 'V'); }
         function copy_enabled()   { return stristr($this->options, 'P') && $this->add_enabled(); }          function copy_enabled()   { return stristr($this->options, 'P') && $this->add_enabled(); }
         function tabs_enabled()   { return $this->display['tabs'] && count($this->tabs) > 0; }          function tabs_enabled()   { return $this->display['tabs'] && count($this->tabs) > 0; }
         function hidden($k)       { return stristr($this->fdd[$k]['input'],'H'); }          function hidden($k)       { return stristr(@$this->fdd[$k]['input'],'H'); }
         function password($k)     { return stristr($this->fdd[$k]['input'],'W'); }          function password($k)     { return stristr(@$this->fdd[$k]['input'],'W'); }
         function readonly($k)     { return stristr($this->fdd[$k]['input'],'R') || $this->virtual($k);     }          function readonly($k)     { return stristr(@$this->fdd[$k]['input'],'R') || $this->virtual($k);     }
         function virtual($k)      { return stristr($this->fdd[$k]['input'],'V') && $this->col_has_sql($k); }          function virtual($k)      { return stristr(@$this->fdd[$k]['input'],'V') && $this->col_has_sql($k); }
   
         function add_operation()    { return $this->operation == $this->labels['Add']    && $this->add_enabled();    }          function add_operation()    { return $this->operation == $this->labels['Add']    && $this->add_enabled();    }
         function change_operation() { return $this->operation == $this->labels['Change'] && $this->change_enabled(); }          function change_operation() { return $this->operation == $this->labels['Change'] && $this->change_enabled(); }
Line 510  class phpMyEdit
Line 512  class phpMyEdit
                                 || $this->change_operation()) {                                  || $this->change_operation()) {
                                 $ret = $this->sd.'PMEtable0'.$this->ed.'.'.$this->sd.$this->fds[$field].$this->ed;                                  $ret = $this->sd.'PMEtable0'.$this->ed.'.'.$this->sd.$this->fds[$field].$this->ed;
                 } else {                  } else {
                         if ($this->fdd[$this->fds[$field]]['values']['description'] && ! $dont_desc) {                          if (isset($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 533  class phpMyEdit
Line 535  class phpMyEdit
                                 } else {                                  } else {
                                         $ret = $this->sd.'PMEjoin'.$field.$this->ed.'.'.$this->sd.$this->fdd[$this->fds[$field]]['values']['description'].$this->ed;                                          $ret = $this->sd.'PMEjoin'.$field.$this->ed.'.'.$this->sd.$this->fdd[$this->fds[$field]]['values']['description'].$this->ed;
                                 }                                  }
                         // TODO: remove me  
                         } elseif (0 && $this->fdd[$this->fds[$field]]['values']['column'] && ! $dont_cols) {  
                                 $ret = $this->sd.'PMEjoin'.$field.$this->ed.'.'.$this->fdd[$this->fds[$field]]['values']['column'];  
                         } else {                          } else {
                                 $ret = $this->sd.'PMEtable0'.$this->ed.'.'.$this->sd.$this->fds[$field].$this->ed;                                  $ret = $this->sd.'PMEtable0'.$this->ed.'.'.$this->sd.$this->fds[$field].$this->ed;
                         }                          }
                         // TODO: not neccessary, remove me!  
                         if (is_array($this->fdd[$this->fds[$field]]['values2'])) {  
                         }  
                 }                  }
                 return $ret;                  return $ret;
         } /* }}} */          } /* }}} */
Line 554  class phpMyEdit
Line 550  class phpMyEdit
                 $qparts['type']   = 'select';                  $qparts['type']   = 'select';
                 $qparts['select'] = $this->get_SQL_column_list();                  $qparts['select'] = $this->get_SQL_column_list();
                 // Even if the key field isn't displayed, we still need its value                  // Even if the key field isn't displayed, we still need its value
                 if ($select_recs) {                  if (!in_array ($this->key, $this->fds)) {
                         if (!in_array ($this->key, $this->fds)) {                          $qparts['select'] .= ','.$this->fqn($this->key);
                                 $qparts['select'] .= ','.$this->fqn($this->key);  
                         }  
                 }                  }
                 $qparts['from']  = $this->get_SQL_join_clause();                  $qparts['from']  = @$this->get_SQL_join_clause();
                 $qparts['where'] = $this->get_SQL_where_from_query_opts();                  $qparts['where'] = $this->get_SQL_where_from_query_opts();
                 // build up the ORDER BY clause                  // build up the ORDER BY clause
                 if (isset($this->sfn)) {                  if (isset($this->sfn)) {
Line 594  class phpMyEdit
Line 588  class phpMyEdit
                 return $qparts;                  return $qparts;
         } /* }}} */          } /* }}} */
   
   
         function get_SQL_main_list_query($qparts) /* {{{ */          function get_SQL_main_list_query($qparts) /* {{{ */
         {          {
                 return $this->get_SQL_query($qparts);                  return $this->get_SQL_query($qparts);
         } /* }}} */          } /* }}} */
   
   
   
         function get_SQL_query($parts) /* {{{ */          function get_SQL_query($parts) /* {{{ */
         {          {
                 foreach ($parts as $k => $v) {                  foreach ($parts as $k => $v) {
                         $parts[$k] = trim($parts[$k]);                          $parts[$k] = trim($parts[$k]);
                 }                  }
                 switch ($parts['type']) {                  switch (strtoupper($parts['type'])) {
                         case 'select':                          case 'SELECT':
                                 $ret  = 'SELECT ';                                  $ret  = 'SELECT ';
                                 if ($parts['DISTINCT'])  
                                         $ret .= 'DISTINCT ';  
                                 $ret .= $parts['select'];                                  $ret .= $parts['select'];
                                 $ret .= ' FROM '.$parts['from'];                                  $ret .= ' FROM '.$parts['from'];
                                 if ($parts['where'] != '')                                  if (strlen(@$parts['where']) > 0) {
                                         $ret .= ' WHERE '.$parts['where'];                                          $ret .= ' WHERE '.$parts['where'];
                                 if ($parts['groupby'] != '')                                  }
                                   if (strlen(@$parts['groupby']) > 0) {
                                         $ret .= ' GROUP BY '.$parts['groupby'];                                          $ret .= ' GROUP BY '.$parts['groupby'];
                                 if ($parts['having'] != '')                                  }
                                   if (strlen(@$parts['having']) > 0) {
                                         $ret .= ' HAVING '.$parts['having'];                                          $ret .= ' HAVING '.$parts['having'];
                                 if ($parts['orderby'] != '')                                  }
                                   if (strlen(@$parts['orderby']) > 0) {
                                         $ret .= ' ORDER BY '.$parts['orderby'];                                          $ret .= ' ORDER BY '.$parts['orderby'];
                                 if ($parts['limit'] != '')                                  }
                                   if (strlen(@$parts['limit']) > 0) {
                                         $ret .= ' '.$parts['limit'];                                          $ret .= ' '.$parts['limit'];
                                 if ($parts['procedure'] != '')                                  }
                                   if (strlen(@$parts['procedure']) > 0) {
                                         $ret .= ' PROCEDURE '.$parts['procedure'];                                          $ret .= ' PROCEDURE '.$parts['procedure'];
                                   }
                                 break;                                  break;
                         case 'update':                          case 'UPDATE':
                                 $ret  = 'UPDATE '.$parts['table'];                                  $ret  = 'UPDATE '.$parts['table'];
                                 $ret .= ' SET '.$parts['fields'];                                  $ret .= ' SET '.$parts['fields'];
                                 if ($parts['where'] != '')                                  if ($parts['where'] != '')
                                         $ret .= ' WHERE '.$parts['where'];                                          $ret .= ' WHERE '.$parts['where'];
                                 break;                                  break;
                         case 'insert':                          case 'INSERT':
                                 $ret  = 'INSERT INTO '.$parts['table'];                                  $ret  = 'INSERT INTO '.$parts['table'];
                                 $ret .= ' VALUES '.$parts['values'];                                  $ret .= ' VALUES '.$parts['values'];
                                 break;                                  break;
                         case 'delete':                          case 'DELETE':
                                 $ret  = 'DELETE FROM '.$parts['table'];                                  $ret  = 'DELETE FROM '.$parts['table'];
                                 if ($parts['where'] != '')                                  if ($parts['where'] != '')
                                         $ret .= ' WHERE '.$parts['where'];                                          $ret .= ' WHERE '.$parts['where'];
Line 674  class phpMyEdit
Line 669  class phpMyEdit
                 $join_clause = $this->sd.$this->tb.$this->ed." AS $main_table";                  $join_clause = $this->sd.$this->tb.$this->ed." AS $main_table";
                 for ($k = 0, $numfds = sizeof($this->fds); $k < $numfds; $k++) {                  for ($k = 0, $numfds = sizeof($this->fds); $k < $numfds; $k++) {
                         $main_column = $this->fds[$k];                          $main_column = $this->fds[$k];
                         if($this->fdd[$main_column]['values']['db']) {                          if (isset($this->fdd[$main_column]['values']['db'])) {
                                 $dbp = $this->sd.$this->fdd[$main_column]['values']['db'].$this->ed.'.';                                  $dbp = $this->sd.$this->fdd[$main_column]['values']['db'].$this->ed.'.';
                         } else {                          } else {
                                 //$dbp = $this->dbp;                                  //$dbp = $this->dbp;
Line 914  function '.$this->js['prefix'].'show_tab
Line 909  function '.$this->js['prefix'].'show_tab
                         $first_required = true;                          $first_required = true;
                         for ($k = 0; $k < $this->num_fds; $k++) {                          for ($k = 0; $k < $this->num_fds; $k++) {
                                 if ($this->displayed[$k] && ! $this->readonly($k) && ! $this->hidden($k)                                  if ($this->displayed[$k] && ! $this->readonly($k) && ! $this->hidden($k)
                                                 && ($this->fdd[$k]['js']['required'] || isset($this->fdd[$k]['js']['regexp']))) {                                                  && (@$this->fdd[$k]['js']['required'] || isset($this->fdd[$k]['js']['regexp']))) {
                                         if ($first_required) {                                          if ($first_required) {
                                                 $first_required = false;                                                  $first_required = false;
                                                 echo '<script type="text/javascript"><!--',"\n";                                                  echo '<script type="text/javascript"><!--',"\n";
Line 1100  function '.$this->js['prefix'].'filter_h
Line 1095  function '.$this->js['prefix'].'filter_h
                                                         $strip_tags, $escape);                                                          $strip_tags, $escape);
                                 }                                  }
                         } elseif (isset ($this->fdd[$k]['textarea'])) {                          } elseif (isset ($this->fdd[$k]['textarea'])) {
                                 echo $this->htmlTextarea($this->cgi['prefix']['data'].$this->fds[$k], $css_class_name, $k, $this->fdd[$k]['default']);                                  echo $this->htmlTextarea($this->cgi['prefix']['data'].$this->fds[$k], $css_class_name, $k, $this->fdd[$k]['default'], $escape);
                         } elseif ($this->col_has_php($k)) {                          } elseif ($this->col_has_php($k)) {
                                 echo include($this->fdd[$k]['php']);                                  echo include($this->fdd[$k]['php']);
                         } else {                          } else {
Line 1140  function '.$this->js['prefix'].'filter_h
Line 1135  function '.$this->js['prefix'].'filter_h
                  */                   */
   
                 $qparts['type']   = 'select';                  $qparts['type']   = 'select';
                 $qparts['select'] = $this->get_SQL_column_list();                  $qparts['select'] = @$this->get_SQL_column_list();
                 $qparts['from']   = $this->get_SQL_join_clause();                  $qparts['from']   = @$this->get_SQL_join_clause();
                 $qparts['where']  = '('.$this->fqn($this->key).'='                  $qparts['where']  = '('.$this->fqn($this->key).'='
                         .$this->key_delim.$this->rec.$this->key_delim.')';                          .$this->key_delim.$this->rec.$this->key_delim.')';
   
Line 1232  function '.$this->js['prefix'].'filter_h
Line 1227  function '.$this->js['prefix'].'filter_h
                                                 $strip_tags, $escape);                                                  $strip_tags, $escape);
                         }                          }
                 } elseif (isset($this->fdd[$k]['textarea'])) {                  } elseif (isset($this->fdd[$k]['textarea'])) {
                         echo $this->htmlTextarea($this->cgi['prefix']['data'].$this->fds[$k], $css_class_name, $k, $row["qf$k"]);                          echo $this->htmlTextarea($this->cgi['prefix']['data'].$this->fds[$k], $css_class_name, $k, $row["qf$k"], $escape);
                 } elseif ($this->col_has_php($k)) {                  } elseif ($this->col_has_php($k)) {
                         echo include($this->fdd[$k]['php']);                          echo include($this->fdd[$k]['php']);
                 } else {                  } else {
Line 1248  function '.$this->js['prefix'].'filter_h
Line 1243  function '.$this->js['prefix'].'filter_h
                         echo '<input class="',$css_class_name,'" type="text"';                          echo '<input class="',$css_class_name,'" type="text"';
                         echo ($this->readonly($k) ? ' disabled' : '');                          echo ($this->readonly($k) ? ' disabled' : '');
                         echo ' name="',$this->cgi['prefix']['data'].$this->fds[$k],'" value="';                          echo ' name="',$this->cgi['prefix']['data'].$this->fds[$k],'" value="';
                         if($escape) echo htmlspecialchars($row["qf$k"]);                          if ($escape) echo htmlspecialchars($row["qf$k"]);
                         else echo $row["qf$k"];                          else echo $row["qf$k"];
                         echo '"',$len_props,' />',"\n";                          echo '"',$len_props,' />',"\n";
                 }                  }
Line 1460  function '.$this->js['prefix'].'filter_h
Line 1455  function '.$this->js['prefix'].'filter_h
                                 $value = number_format($value, $nbDec, $decPoint, $thSep);                                  $value = number_format($value, $nbDec, $decPoint, $thSep);
                         }                          }
                 }                  }
                 if (intval($this->fdd[$k]['trimlen']) > 0 && strlen($value) > $this->fdd[$k]['trimlen']) {                  if (intval(@$this->fdd[$k]['trimlen']) > 0 && strlen($value) > $this->fdd[$k]['trimlen']) {
                         $value = ereg_replace("[\r\n\t ]+",' ',$value);                          $value = ereg_replace("[\r\n\t ]+",' ',$value);
                         $value = substr($value, 0, $this->fdd[$k]['trimlen'] - 3).'...';                          $value = substr($value, 0, $this->fdd[$k]['trimlen'] - 3).'...';
                 }                  }
Line 1624  function '.$this->js['prefix'].'filter_h
Line 1619  function '.$this->js['prefix'].'filter_h
                 return $ret;                  return $ret;
         } /* }}} */          } /* }}} */
   
         function htmlTextarea($name, $css, $k, $value = null, $js = NULL)          function htmlTextarea($name, $css, $k, $value = null, $escape = true)
         {          {
                 $ret = '<textarea class="'.$css.'" name="'.$name.'"';                  $ret = '<textarea class="'.$css.'" name="'.$name.'"';
                 $ret .= ($this->readonly($k) ? ' disabled' : '');                  $ret .= ($this->readonly($k) ? ' disabled' : '');
Line 1640  function '.$this->js['prefix'].'filter_h
Line 1635  function '.$this->js['prefix'].'filter_h
                         $ret .= ' wrap="virtual"';                          $ret .= ' wrap="virtual"';
                 }                  }
                 $ret .= '>';                  $ret .= '>';
                 if($escape) $ret .= htmlspecialchars($value);                  if ($escape) {
                 else $ret .= $value;                          $ret .= htmlspecialchars($value);
                   } else {
                           $ret .= $value;
                   }
                 $ret .= '</textarea>'."\n";                  $ret .= '</textarea>'."\n";
                 return $ret;                  return $ret;
         } /* }}} */          } /* }}} */
Line 1957  function '.$this->js['prefix'].'filter_h
Line 1955  function '.$this->js['prefix'].'filter_h
   
         function display_buttons($position) /* {{{ */          function display_buttons($position) /* {{{ */
         {          {
                   $ret = '';
                 $nav_fnc = 'nav_'.$position;                  $nav_fnc = 'nav_'.$position;
                 if(! $this->$nav_fnc())                  if(! $this->$nav_fnc())
                         return;                          return;
Line 2033  function '.$this->js['prefix'].'filter_h
Line 2032  function '.$this->js['prefix'].'filter_h
                 }                  }
                 if ($name == 'goto_combo') {                  if ($name == 'goto_combo') {
                         $disabledgoto = !($listall || ($disablednext && $disabledprev)) ? '' : ' disabled';                          $disabledgoto = !($listall || ($disablednext && $disabledprev)) ? '' : ' disabled';
                         if ($disablegoto != '' && $disabled < 0) return;                          if ($disabledgoto != '' && $disabled < 0) return;
                         $kv_array = array();                          $kv_array = array();
                         for ($i = 0; $i < $total_pages; $i++) {                          for ($i = 0; $i < $total_pages; $i++) {
                                 $kv_array[$this->inc * $i] = $i + 1;                                  $kv_array[$this->inc * $i] = $i + 1;
Line 2065  function '.$this->js['prefix'].'filter_h
Line 2064  function '.$this->js['prefix'].'filter_h
         function number_of_recs() /* {{{ */          function number_of_recs() /* {{{ */
         {          {
                 $count_parts = array(                  $count_parts = array(
                                 'type'   => 'select',                                  'type'   => 'SELECT',
                                 'select' => 'count(*)',                                  'select' => 'COUNT(*)',
                                 'from'   => $this->get_SQL_join_clause(),                                  'from'   => @$this->get_SQL_join_clause(),
                                 'where'  => $this->get_SQL_where_from_query_opts());                                  'where'  => @$this->get_SQL_where_from_query_opts());
                 $res = $this->myquery($this->get_SQL_main_list_query($count_parts), __LINE__);                  $res = $this->myquery($this->get_SQL_main_list_query($count_parts), __LINE__);
                 $row = $this->sql_fetch($res, 'n');                  $row = $this->sql_fetch($res, 'n');
                 $this->total_recs = $row[0];                  $this->total_recs = $row[0];
Line 2376  function '.$this->js['prefix'].'filter_h
Line 2375  function '.$this->js['prefix'].'filter_h
                         echo '<tr class="',$this->getCSSclass('row', null, 'next'),'">',"\n";                          echo '<tr class="',$this->getCSSclass('row', null, 'next'),'">',"\n";
                         if ($this->sys_cols) { /* {{{ */                          if ($this->sys_cols) { /* {{{ */
                                 $key_rec     = $row['qf'.$this->key_num];                                  $key_rec     = $row['qf'.$this->key_num];
                                 $queryAppend = htmlspecialchars('&'.$this->cgi['prefix']['sys'].'rec'.'='.$key_rec);  
                                 $viewQuery   = $qpviewStr   . $queryAppend;  
                                 $copyQuery   = $qpcopyStr   . $queryAppend;  
                                 $changeQuery = $qpchangeStr . $queryAppend;  
                                 $deleteQuery = $qpdeleteStr . $queryAppend;  
                                 $viewTitle   = htmlspecialchars($this->labels['View']);  
                                 $changeTitle = htmlspecialchars($this->labels['Change']);  
                                 $copyTitle   = htmlspecialchars($this->labels['Copy']);  
                                 $deleteTitle = htmlspecialchars($this->labels['Delete']);  
                                 $css_class_name = $this->getCSSclass('navigation', null, true);                                  $css_class_name = $this->getCSSclass('navigation', null, true);
                                 if ($select_recs) {                                  if ($select_recs) {
                                         if (! $this->nav_buttons() || $this->sys_cols > 1) {                                          if (! $this->nav_buttons() || $this->sys_cols > 1) {
                                                 echo '<td class="',$css_class_name,'">';                                                  echo '<td class="',$css_class_name,'">';
                                         }                                          }
                                           if ($this->nav_text_links() || $this->nav_graphic_links()) {
                                                   $queryAppend = htmlspecialchars('&'.$this->cgi['prefix']['sys'].'rec'.'='.$key_rec);
                                                   $viewQuery   = $qpviewStr   . $queryAppend;
                                                   $copyQuery   = $qpcopyStr   . $queryAppend;
                                                   $changeQuery = $qpchangeStr . $queryAppend;
                                                   $deleteQuery = $qpdeleteStr . $queryAppend;
                                                   $viewTitle   = htmlspecialchars($this->labels['View']);
                                                   $changeTitle = htmlspecialchars($this->labels['Change']);
                                                   $copyTitle   = htmlspecialchars($this->labels['Copy']);
                                                   $deleteTitle = htmlspecialchars($this->labels['Delete']);
                                           }
                                         if ($this->nav_graphic_links()) {                                          if ($this->nav_graphic_links()) {
                                                 $printed_out = false;                                                  $printed_out = false;
                                                 if ($this->view_enabled()) {                                                  if ($this->view_enabled()) {
Line 2489  function '.$this->js['prefix'].'filter_h
Line 2490  function '.$this->js['prefix'].'filter_h
                  * XXX this feature does not work yet!!!                   * XXX this feature does not work yet!!!
                  */                   */
                 // aggregates listing (if any)                  // aggregates listing (if any)
                 if ($$var_to_total) {                  if (0 && $$var_to_total) {
                         // do the aggregate query if necessary                          // do the aggregate query if necessary
                         //if ($vars_to_total) {                          //if ($vars_to_total) {
                                 $qp = array();                                  $qp = array();
                                 $qp['type'] = 'select';                                  $qp['type'] = 'select';
                                 $qp['select'] = $aggr_from_clause;                                  $qp['select'] = $aggr_from_clause;
                                 $qp['from']   = $this->get_SQL_join_clause();                                  $qp['from']   = @$this->get_SQL_join_clause();
                                 $qp['where']  = $this->get_SQL_where_from_query_opts();                                  $qp['where']  = @$this->get_SQL_where_from_query_opts();
                                 $tot_query    = $this->get_SQL_query($qp);                                  $tot_query    = @$this->get_SQL_query($qp);
                                 $totals_result = $this->myquery($tot_query,__LINE__);                                  $totals_result = $this->myquery($tot_query,__LINE__);
                                 $tot_row       = $this->sql_fetch($totals_result);                                  $tot_row       = $this->sql_fetch($totals_result);
                         //}                          //}
Line 3151  function '.$this->js['prefix'].'filter_h
Line 3152  function '.$this->js['prefix'].'filter_h
                 // Save/More Button - database operations                  // Save/More Button - database operations
                 if ($this->saveadd == $this->labels['Save'] || $this->savecopy == $this->labels['Save']) {                  if ($this->saveadd == $this->labels['Save'] || $this->savecopy == $this->labels['Save']) {
                         $this->add_enabled() && $this->do_add_record();                          $this->add_enabled() && $this->do_add_record();
                         unset($this->saveadd);                          $this->saveadd  = null; // unset($this->saveadd)
                         unset($this->savecopy);                          $this->savecopy = null; // unset($this->savecopy)
                         $this->recreate_fdd();                          $this->recreate_fdd();
                 }                  }
                 elseif ($this->moreadd == $this->labels['More']) {                  elseif ($this->moreadd == $this->labels['More']) {
Line 3164  function '.$this->js['prefix'].'filter_h
Line 3165  function '.$this->js['prefix'].'filter_h
                 }                  }
                 elseif ($this->savechange == $this->labels['Save']) {                  elseif ($this->savechange == $this->labels['Save']) {
                         $this->change_enabled() && $this->do_change_record();                          $this->change_enabled() && $this->do_change_record();
                         unset($this->savechange);                          $this->savechange = null; // unset($this->savechange)
                         $this->recreate_fdd();                          $this->recreate_fdd();
                 }                  }
                 elseif ($this->morechange == $this->labels['Apply']) {                  elseif ($this->morechange == $this->labels['Apply']) {
Line 3176  function '.$this->js['prefix'].'filter_h
Line 3177  function '.$this->js['prefix'].'filter_h
                 }                  }
                 elseif ($this->savedelete == $this->labels['Delete']) {                  elseif ($this->savedelete == $this->labels['Delete']) {
                         $this->delete_enabled() && $this->do_delete_record();                          $this->delete_enabled() && $this->do_delete_record();
                         unset($this->savedelete);                          $this->savedelete = null; // unset($this->savedelete)
                         $this->recreate_fdd();                          $this->recreate_fdd();
                 }                  }
   
Line 3213  function '.$this->js['prefix'].'filter_h
Line 3214  function '.$this->js['prefix'].'filter_h
          */           */
         function phpMyEdit($opts) /* {{{ */          function phpMyEdit($opts) /* {{{ */
         {          {
                 // Set desirable error reporting level  
                 $error_reporting = error_reporting(E_ALL & ~E_NOTICE);  
                 // Database handle variables                  // Database handle variables
                 $this->sql_delimiter();                  $this->sql_delimiter();
                 if (isset($opts['dbh'])) {                  if (isset($opts['dbh'])) {
Line 3291  function '.$this->js['prefix'].'filter_h
Line 3290  function '.$this->js['prefix'].'filter_h
                 if (! $this->nav_up() && ! $this->nav_down()) {                  if (! $this->nav_up() && ! $this->nav_down()) {
                         $this->navigation .= 'D'; // down position is default                          $this->navigation .= 'D'; // down position is default
                 }                  }
                 $this->buttons = $opts['buttons'];                  $this->buttons = @$opts['buttons'];
                 // Language labels (must go after navigation)                  // Language labels (must go after navigation)
                 $this->labels = $this->make_language_labels(isset($opts['language'])                  $this->labels = $this->make_language_labels(isset($opts['language'])
                                 ? $opts['language'] : $this->get_server_var('HTTP_ACCEPT_LANGUAGE'));                                  ? $opts['language'] : $this->get_server_var('HTTP_ACCEPT_LANGUAGE'));
Line 3387  function '.$this->js['prefix'].'filter_h
Line 3386  function '.$this->js['prefix'].'filter_h
                 // Call to action                  // Call to action
                 !isset($opts['execute']) && $opts['execute'] = 1;                  !isset($opts['execute']) && $opts['execute'] = 1;
                 $opts['execute'] && $this->execute();                  $opts['execute'] && $this->execute();
                 // Restore original error reporting level  
                 error_reporting($error_reporting);  
         } /* }}} */          } /* }}} */
   
 }  }

Legend:
Removed from v.1.213  
changed lines
  Added in v.1.214

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