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

Diff for Metafox/lib/phpMyEdit/phpMyEdit.class.php between version 1.1 and 1.2

version 1.1, 2005/06/05 12:14:52 version 1.2, 2006/03/29 09:24:58
Line 9 
Line 9 
  * Copyright (c) 1999-2002 John McCreesh <jpmcc@users.sourceforge.net>   * Copyright (c) 1999-2002 John McCreesh <jpmcc@users.sourceforge.net>
  * Copyright (c) 2001-2002 Jim Kraai <jkraai@users.sourceforge.net>   * Copyright (c) 2001-2002 Jim Kraai <jkraai@users.sourceforge.net>
  * Versions 5.0 and higher developed by Ondrej Jombik <nepto@php.net>   * Versions 5.0 and higher developed by Ondrej Jombik <nepto@php.net>
  * Copyright (c) 2002-2004 Platon SDG, http://platon.sk/   * Copyright (c) 2002-2006 Platon Group, http://platon.sk/
  * All rights reserved.   * All rights reserved.
  *   *
  * See README file for more information about this software.   * See README file for more information about this software.
Line 19 
Line 19 
  * http://platon.sk/projects/phpMyEdit/   * http://platon.sk/projects/phpMyEdit/
  */   */
   
 /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.165 2005/03/12 10:16:49 nepto Exp $ */  /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.167 2005/04/03 09:55:38 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 167  class phpMyEdit
Line 167  class phpMyEdit
                         'P' => 'copy',                          'P' => 'copy',
                         'D' => 'delete'                          'D' => 'delete'
                         );                          );
           var $default_buttons = array(
                           'L' => array('<<','<','add','view','change','copy','delete','>','>>','goto','goto_combo'),
                           'F' => array('<<','<','add','view','change','copy','delete','>','>>','goto','goto_combo'),
                           'A' => array('save','more','cancel'),
                           'C' => array('save','more','cancel'),
                           'P' => array('save', 'cancel'),
                           'D' => array('save','cancel'),
                           'V' => array('change','cancel')
                           );
         // }}}          // }}}
   
         /*          /*
Line 190  class phpMyEdit
Line 199  class phpMyEdit
         function nav_buttons()       { return stristr($this->navigation, 'B'); }          function nav_buttons()       { return stristr($this->navigation, 'B'); }
         function nav_text_links()    { return stristr($this->navigation, 'T'); }          function nav_text_links()    { return stristr($this->navigation, 'T'); }
         function nav_graphic_links() { return stristr($this->navigation, 'G'); }          function nav_graphic_links() { return stristr($this->navigation, 'G'); }
         function nav_up()            { return stristr($this->navigation, 'U'); }          function nav_up()            { return (stristr($this->navigation, 'U') && !($this->buttons[$this->page_type]['up'] === false)); }
         function nav_down()          { return stristr($this->navigation, 'D'); }          function nav_down()          { return (stristr($this->navigation, 'D') && !($this->buttons[$this->page_type]['down'] === false)); }
   
         /*          /*
          * functions for indicating whether operations are enabled           * functions for indicating whether operations are enabled
Line 218  class phpMyEdit
Line 227  class phpMyEdit
         function list_operation()   { /* covers also filtering page */ return ! $this->change_operation()          function list_operation()   { /* covers also filtering page */ return ! $this->change_operation()
                                                                                 && ! $this->add_operation()    && ! $this->copy_operation()                                                                                  && ! $this->add_operation()    && ! $this->copy_operation()
                                                                                 && ! $this->delete_operation() && ! $this->view_operation(); }                                                                                  && ! $this->delete_operation() && ! $this->view_operation(); }
         function next_operation()       { return $this->navop == $this->labels['Next']; }          function next_operation()       { return ($this->navop == $this->labels['Next']) || ($this->navop == '>'); }
         function prev_operation()       { return $this->navop == $this->labels['Prev']; }          function prev_operation()       { return ($this->navop == $this->labels['Prev']) || ($this->navop == '<'); }
         function first_operation()      { return $this->navop == $this->labels['First']; }          function first_operation()      { return ($this->navop == $this->labels['First']) || ($this->navop == '<<'); }
         function last_operation()       { return $this->navop == $this->labels['Last']; }          function last_operation()       { return ($this->navop == $this->labels['Last']) || ($this->navop == '>>'); }
         function goto_operation()       { return $this->navop == $this->labels['Go to']; }          function goto_operation()       { return $this->navop == $this->labels['Go to']; }
         function clear_operation()      { return $this->sw == $this->labels['Clear'];  }          function clear_operation()      { return $this->sw == $this->labels['Clear'];  }
   
Line 287  class phpMyEdit
Line 296  class phpMyEdit
                         echo "</pre>\n";                          echo "</pre>\n";
                 } else {                  } else {
                         echo 'debug_var()::<i>',htmlspecialchars($name),'</i>';                          echo 'debug_var()::<i>',htmlspecialchars($name),'</i>';
                         echo '::<b>',htmlspecialchars($val),'</b>::',"<br>\n";                          echo '::<b>',htmlspecialchars($val),'</b>::',"<br />\n";
                 }                  }
         } /* }}} */          } /* }}} */
   
Line 296  class phpMyEdit
Line 305  class phpMyEdit
                 global $debug_query;                  global $debug_query;
                 if ($debug_query || $debug) {                  if ($debug_query || $debug) {
                         $line = intval($line);                          $line = intval($line);
                         echo '<h4>MySQL query at line ',$line,'</h4>',htmlspecialchars($qry),'<hr>',"\n";                          echo '<h4>MySQL query at line ',$line,'</h4>',htmlspecialchars($qry),'<hr />',"\n";
                 }                  }
                 if (isset($this->db)) {                  if (isset($this->db)) {
                         $ret = @mysql_db_query($this->db, $qry, $this->dbh);                          $ret = @mysql_db_query($this->db, $qry, $this->dbh);
Line 305  class phpMyEdit
Line 314  class phpMyEdit
                 }                  }
                 if (! $ret) {                  if (! $ret) {
                         echo '<h4>MySQL error ',mysql_errno($this->dbh),'</h4>';                          echo '<h4>MySQL error ',mysql_errno($this->dbh),'</h4>';
                         echo htmlspecialchars(mysql_error($this->dbh)),'<hr>',"\n";                          echo htmlspecialchars(mysql_error($this->dbh)),'<hr />',"\n";
                 }                  }
                 return $ret;                  return $ret;
         } /* }}} */          } /* }}} */
Line 314  class phpMyEdit
Line 323  class phpMyEdit
         {          {
                 // just try the first language and variant                  // just try the first language and variant
                 // this isn't content-negotiation rfc compliant                  // this isn't content-negotiation rfc compliant
                 $language = strtoupper(substr($language,0,5));                  $language = strtoupper($language);
   
                 // try the full language w/ variant                  // try the full language w/ variant
                 $file = $this->dir['lang'].'PME.lang.'.$language.'.inc';                  $file = $this->dir['lang'].'PME.lang.'.$language.'.inc';
Line 393  class phpMyEdit
Line 402  class phpMyEdit
                                 $qparts['orderby'] = $key;                                  $qparts['orderby'] = $key;
                         }                          }
                         $qparts['from'] = "$dbp$table";                          $qparts['from'] = "$dbp$table";
                         $qparts['where'] = $this->fdd[$field_num]['values']['filters'];                          $ar = array(
                                           'table'       => $table,
                                           'column'      => $column,
                                           'description' => $desc);
                           $qparts['where'] = $this->substituteVars($this->fdd[$field_num]['values']['filters'], $ar);
                         if ($this->fdd[$field_num]['values']['orderby']) {                          if ($this->fdd[$field_num]['values']['orderby']) {
                                 $qparts['orderby'] = $this->fdd[$field_num]['values']['orderby'];                                  $qparts['orderby'] = substituteVars($this->fdd[$field_num]['values']['orderby'], $ar);
                         }                          }
                 } else { /* simple value extraction */                  } else { /* simple value extraction */
                         $key = &$this->fds[$field_num];                          $key = &$this->fds[$field_num];
Line 547  class phpMyEdit
Line 560  class phpMyEdit
                                                 'join_table'       => $join_table,                                                  'join_table'       => $join_table,
                                                 'join_column'      => $join_column,                                                  'join_column'      => $join_column,
                                                 'join_description' => $join_desc);                                                  'join_description' => $join_desc);
                                 $join_clause .= " LEFT OUTER JOIN $dbp$table AS $join_table ON ";                                  $join_clause .= " LEFT OUTER JOIN $dbp$table AS $join_table ON (";
                                 $join_clause .= isset($this->fdd[$main_column]['values']['join'])                                  $join_clause .= isset($this->fdd[$main_column]['values']['join'])
                                         ? $this->substituteVars($this->fdd[$main_column]['values']['join'], $ar)                                          ? $this->substituteVars($this->fdd[$main_column]['values']['join'], $ar)
                                         : "$join_table.$join_column = $main_table.$main_column";                                          : "$join_table.$join_column = $main_table.$main_column";
                                   if (isset($this->fdd[$main_column]['values']['filters'])) {
                                           $join_clause .= ' AND ';
                                           $join_clause .= $this->substituteVars($this->fdd[$main_column]['values']['filters'], $ar);
                                   }
                                   $join_clause .= ')';
                         }                          }
                 }                  }
                 return $join_clause;                  return $join_clause;
Line 878  function '.$this->js['prefix'].'filter_h
Line 896  function '.$this->js['prefix'].'filter_h
                 }                  }
   
                 if ($this->display['form']) {                  if ($this->display['form']) {
                         echo '<form class="',$this->getCSSclass('form'),'" method="POST"';                          echo '<form class="',$this->getCSSclass('form'),'" method="post"';
                         echo ' action="',$page_name,'" name="'.$this->cgi['prefix']['sys'].'form">',"\n";                          echo ' action="',$page_name,'" name="'.$this->cgi['prefix']['sys'].'form">',"\n";
                 }                  }
                 return true;                  return true;
Line 896  function '.$this->js['prefix'].'filter_h
Line 914  function '.$this->js['prefix'].'filter_h
                 if (! is_array($this->tabs)) {                  if (! is_array($this->tabs)) {
                         return false;                          return false;
                 }                  }
                 echo '<table class="',$this->getCSSclass('tab', $position),'">',"\n";                  echo '<table summary="labels" class="',$this->getCSSclass('tab', $position),'">',"\n";
                 echo '<tr class="',$this->getCSSclass('tab', $position),'">',"\n";                  echo '<tr class="',$this->getCSSclass('tab', $position),'">',"\n";
                 for ($i = ($this->tabs[0] == 'PMEtab0' ? 1 : 0); $i < count($this->tabs); $i++) {                  for ($i = ($this->tabs[0] == 'PMEtab0' ? 1 : 0); $i < count($this->tabs); $i++) {
                         $css_class_name = $this->getCSSclass($i != $this->cur_tab ? 'tab' : 'tab-selected', $position);                          $css_class_name = $this->getCSSclass($i != $this->cur_tab ? 'tab' : 'tab-selected', $position);
Line 974  function '.$this->js['prefix'].'filter_h
Line 992  function '.$this->js['prefix'].'filter_h
                                 echo ($this->readonly($k) ? ' disabled' : '');                                  echo ($this->readonly($k) ? ' disabled' : '');
                                 echo ' name="',$this->cgi['prefix']['data'].$this->fds[$k],'"';                                  echo ' name="',$this->cgi['prefix']['data'].$this->fds[$k],'"';
                                 echo $size_ml_props,' value="';                                  echo $size_ml_props,' value="';
                                 echo htmlspecialchars($this->fdd[$k]['default']),'">';                                  echo htmlspecialchars($this->fdd[$k]['default']),'" />';
                         }                          }
                         echo '</td>',"\n";                          echo '</td>',"\n";
                         if ($this->guidance) {                          if ($this->guidance) {
Line 1100  function '.$this->js['prefix'].'filter_h
Line 1118  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="';
                         echo htmlspecialchars($row["qf$k"]),'" ',$size_ml_props,'>',"\n";                          echo htmlspecialchars($row["qf$k"]),'" ',$size_ml_props,' />',"\n";
                 }                  }
                 echo '</td>',"\n";                  echo '</td>',"\n";
         } /* }}} */          } /* }}} */
Line 1118  function '.$this->js['prefix'].'filter_h
Line 1136  function '.$this->js['prefix'].'filter_h
                 echo '<input class="',$this->getCSSclass('value', null, true, $css_postfix),'" type="password" ';                  echo '<input class="',$this->getCSSclass('value', null, true, $css_postfix),'" type="password" ';
                 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="';
                 echo htmlspecialchars($row["qf$k"]),'" ',$size_ml_props,'>',"\n";                  echo htmlspecialchars($row["qf$k"]),'" ',$size_ml_props,' />',"\n";
                 echo '</td>',"\n";                  echo '</td>',"\n";
         } /* }}} */          } /* }}} */
   
Line 1331  function '.$this->js['prefix'].'filter_h
Line 1349  function '.$this->js['prefix'].'filter_h
          * @param       css_class_name  CSS class name           * @param       css_class_name  CSS class name
          * @param       js_validation   if add JavaScript validation subroutine to button           * @param       js_validation   if add JavaScript validation subroutine to button
          * @param       disabled                if mark the button as disabled           * @param       disabled                if mark the button as disabled
            * @param       js              any extra text in tags
          */           */
         function htmlSubmit($name, $label, $css_class_name, $js_validation = true, $disabled = false) /* {{{ */          function htmlSubmit($name, $label, $css_class_name, $js_validation = true, $disabled = false, $js = NULL) /* {{{ */
         {          {
                 // Note that <input disabled> isn't valid HTML, but most browsers support it                  // Note that <input disabled> isn't valid HTML, but most browsers support it
                 $markdisabled = $disabled ? ' disabled' : '';                  $markdisabled = $disabled ? ' disabled' : '';
Line 1342  function '.$this->js['prefix'].'filter_h
Line 1361  function '.$this->js['prefix'].'filter_h
                 if ($js_validation) {                  if ($js_validation) {
                         $ret .= '" onClick="return '.$this->js['prefix'].'form_control(this.form);';                          $ret .= '" onClick="return '.$this->js['prefix'].'form_control(this.form);';
                 }                  }
                 $ret .= '" />';                  $ret .='"';
                   if(isset($js)) $ret .= ' '.$js;
                   $ret .= ' />';
                 return $ret;                  return $ret;
         } /* }}} */          } /* }}} */
   
Line 1366  function '.$this->js['prefix'].'filter_h
Line 1387  function '.$this->js['prefix'].'filter_h
         function htmlHidden($name, $value) /* {{{ */          function htmlHidden($name, $value) /* {{{ */
         {          {
                 return '<input type="hidden" name="'.htmlspecialchars($name)                  return '<input type="hidden" name="'.htmlspecialchars($name)
                         .'" value="'.htmlspecialchars($value).'"/>'."\n";                          .'" value="'.htmlspecialchars($value).'" />'."\n";
         } /* }}} */          } /* }}} */
   
         /**          /**
Line 1421  function '.$this->js['prefix'].'filter_h
Line 1442  function '.$this->js['prefix'].'filter_h
      *                                  if null, empty values will be skipped       *                                  if null, empty values will be skipped
      * @return                          get HTML code of original varaibles       * @return                          get HTML code of original varaibles
      */       */
     function get_origvars_html($origvars, $method = 'POST', $default_value = '') /* {{{ */      function get_origvars_html($origvars, $method = 'post', $default_value = '') /* {{{ */
     {      {
         $ret    = '';          $ret    = '';
         $method = strtoupper($method);          $method = strtoupper($method);
Line 1515  function '.$this->js['prefix'].'filter_h
Line 1536  function '.$this->js['prefix'].'filter_h
                 return phpMyEdit::get_cgi_var(phpMyEdit::get_default_cgi_prefix('data').$name, $default_value);                  return phpMyEdit::get_cgi_var(phpMyEdit::get_default_cgi_prefix('data').$name, $default_value);
         } /* }}} */          } /* }}} */
   
         function get_cgi_var($name, $default_value = null) /* {{{ */      function get_cgi_var($name, $default_value = null) /* {{{ */
         {      {
                 if (isset($this) && isset($this->cgi['overwrite'][$name])) {                  if (isset($this) && isset($this->cgi['overwrite'][$name])) {
                         return $this->cgi['overwrite'][$name];                          return $this->cgi['overwrite'][$name];
                 }                  }
   
                 static $magic_quotes_gpc = null;          static $magic_quotes_gpc = null;
                 if ($magic_quotes_gpc === null) {          if ($magic_quotes_gpc === null) {
                         $magic_quotes_gpc = get_magic_quotes_gpc();              $magic_quotes_gpc = get_magic_quotes_gpc();
                 }          }
                 global $HTTP_GET_VARS;          $var = @$_GET[$name];
                 $var = @$HTTP_GET_VARS[$name];          if (! isset($var)) {
                 if (! isset($var)) {              $var = @$_POST[$name];
                         global $HTTP_POST_VARS;          }
                         $var = @$HTTP_POST_VARS[$name];          if (isset($var)) {
                 }              if ($magic_quotes_gpc) {
                 if (isset($var)) {                  if (is_array($var)) {
                         if ($magic_quotes_gpc) {                      foreach (array_keys($var) as $key) {
                                 if (is_array($var)) {                          $var[$key] = stripslashes($var[$key]);
                                         foreach (array_keys($var) as $key) {                      }
                                                 $var[$key] = stripslashes($var[$key]);                  } else {
                                         }                      $var = stripslashes($var);
                                 } else {                  }
                                         $var = stripslashes($var);              }
                                 }          } else {
                         }              $var = @$default_value;
                 } else {          }
                         $var = @$default_value;  
                 }  
   
                 if (isset($this) && $var === null && isset($this->cgi['append'][$name])) {                  if (isset($this) && $var === null && isset($this->cgi['append'][$name])) {
                         return $this->cgi['append'][$name];                          return $this->cgi['append'][$name];
                 }                  }
                 return $var;          return $var;
         } /* }}} */      } /* }}} */
   
         function get_server_var($name) /* {{{ */          function get_server_var($name) /* {{{ */
         {          {
Line 1573  function '.$this->js['prefix'].'filter_h
Line 1591  function '.$this->js['prefix'].'filter_h
   
         function print_get_vars ($miss = 'No GET variables found') // debug only /* {{{ */          function print_get_vars ($miss = 'No GET variables found') // debug only /* {{{ */
         {          {
                 global $HTTP_GET_VARS;  
   
                 // we parse form GET variables                  // we parse form GET variables
                 if (is_array($HTTP_GET_VARS)) {                  if (is_array($_GET)) {
                         echo "<p> Variables per GET ";                          echo "<p> Variables per GET ";
                         foreach ($HTTP_GET_VARS as $k => $v) {                          foreach ($_GET as $k => $v) {
                                 if (is_array($v)) {                                  if (is_array($v)) {
                                         foreach ($v as $akey => $aval) {                                          foreach ($v as $akey => $aval) {
                                                 // $HTTP_GET_VARS[$k][$akey] = strip_tags($aval);                                                  // $_GET[$k][$akey] = strip_tags($aval);
                                                 // $$k[$akey] = strip_tags($aval);                                                  // $$k[$akey] = strip_tags($aval);
                                                 echo "$k\[$akey\]=$aval   ";                                                  echo "$k\[$akey\]=$aval   ";
                                         }                                          }
                                 } else {                                  } else {
                                         // $HTTP_GET_VARS[$k] = strip_tags($val);                                          // $_GET[$k] = strip_tags($val);
                                         // $$k = strip_tags($val);                                          // $$k = strip_tags($val);
                                         echo "$k=$v   ";                                          echo "$k=$v   ";
                                 }                                  }
Line 1601  function '.$this->js['prefix'].'filter_h
Line 1617  function '.$this->js['prefix'].'filter_h
   
         function print_post_vars($miss = 'No POST variables found')  // debug only /* {{{ */          function print_post_vars($miss = 'No POST variables found')  // debug only /* {{{ */
         {          {
                 global $HTTP_POST_VARS;                  global $_POST;
                 // we parse form POST variables                  // we parse form POST variables
                 if (is_array($HTTP_POST_VARS)) {                  if (is_array($_POST)) {
                         echo "<p>Variables per POST ";                          echo "<p>Variables per POST ";
                         foreach ($HTTP_POST_VARS as $k => $v) {                          foreach ($_POST as $k => $v) {
                                 if (is_array($v)) {                                  if (is_array($v)) {
                                         foreach ($v as $akey => $aval) {                                          foreach ($v as $akey => $aval) {
                                                 // $HTTP_POST_VARS[$k][$akey] = strip_tags($aval);                                                  // $_POST[$k][$akey] = strip_tags($aval);
                                                 // $$k[$akey] = strip_tags($aval);                                                  // $$k[$akey] = strip_tags($aval);
                                                 echo "$k\[$akey\]=$aval   ";                                                  echo "$k\[$akey\]=$aval   ";
                                         }                                          }
                                 } else {                                  } else {
                                         // $HTTP_POST_VARS[$k] = strip_tags($val);                                          // $_POST[$k] = strip_tags($val);
                                         // $$k = strip_tags($val);                                          // $$k = strip_tags($val);
                                         echo "$k=$v   ";                                          echo "$k=$v   ";
                                 }                                  }
Line 1667  function '.$this->js['prefix'].'filter_h
Line 1683  function '.$this->js['prefix'].'filter_h
         /*          /*
          * Display buttons at top and bottom of page           * Display buttons at top and bottom of page
          */           */
         function display_list_table_buttons($total_recs, $position) /* {{{ */          function display_list_table_buttons($position, $listall = false) /* {{{ */
         {          {
                 echo '<table class="',$this->getCSSclass('navigation', $position),'">',"\n";                  if (($but_str = $this->display_buttons($position)) === null)
                           return;
                   if($position == 'down') echo '<hr class="'.$this->getCSSclass('hr', 'down').'" />'."\n";
                   echo '<table summary="navigation" class="',$this->getCSSclass('navigation', $position),'">',"\n";
                 echo '<tr class="',$this->getCSSclass('navigation', $position),'">',"\n";                  echo '<tr class="',$this->getCSSclass('navigation', $position),'">',"\n";
                 echo '<td class="',$this->getCSSclass('buttons', $position),'">',"\n";                  echo '<td class="',$this->getCSSclass('buttons', $position),'">',"\n";
                 $listall      = $this->inc <= 0; // Are we doing a listall?                  echo $but_str,'</td>',"\n";
                 $disabledprev = !($this->fm > 0 && !$listall);  
                 $disablednext = !($this->fm + $this->inc < $total_recs && ! $listall);  
                 $disabledgoto = !($listall || ($disablednext && $disabledprev)) ? '' : ' disabled';  
                 if (!$listall) {  
                         $current_page = intval($this->fm / $this->inc) + 1;  
                         $total_pages  = max(1, ceil($total_recs / abs($this->inc)));  
                 }  
                 if (!$listall) {  
                         echo $this->htmlSubmit('navop', 'First', $this->getCSSclass('first', $position), false, $disabledprev), '&nbsp;';  
                         echo $this->htmlSubmit('navop', 'Prev', $this->getCSSclass('prev', $position), false, $disabledprev), '&nbsp;';  
                 }  
                 if ($this->add_enabled()) {  
                         echo $this->htmlSubmit('operation', 'Add', $this->getCSSclass('add', $position), false, false), '&nbsp;';  
                 }  
                 if ($this->nav_buttons()) {  
                         if ($this->view_enabled()) {  
                                 echo $this->htmlSubmit('operation', 'View', $this->getCSSclass('view', $position), false, !$total_recs), '&nbsp;';  
                         }  
                         if ($this->change_enabled()) {  
                                 echo $this->htmlSubmit('operation', 'Change', $this->getCSSclass('change', $position), false, !$total_recs), '&nbsp;';  
                         }  
                         if ($this->copy_enabled()) {  
                                 echo $this->htmlSubmit('operation', 'Copy', $this->getCSSclass('copy', $position), false, !$total_recs), '&nbsp;';  
                         }  
                         if ($this->delete_enabled()) {  
                                 echo $this->htmlSubmit('operation', 'Delete', $this->getCSSclass('delete', $position), false, !$total_recs), '&nbsp;';  
                         }  
                 }  
                 if (!$listall) { //nav buttons are not displayed if explicit listall  
                         echo $this->htmlSubmit('navop', 'Next', $this->getCSSclass('next', $position), false, $disablednext), '&nbsp;';  
                         echo $this->htmlSubmit('navop', 'Last', $this->getCSSclass('last', $position), false, $disablednext), '&nbsp;';  
                         echo $this->htmlSubmit('navop', 'Go to', $this->getCSSclass('goto', $position), false,  
                                 ($listall || ($disablednext && $disabledprev)));  
                         echo '<select',$disabledgoto,' class="',$this->getCSSclass('goto', $position);  
                         echo '" name="',$this->cgi['prefix']['sys'].ltrim($disabledgoto).'navfm',$position,'" onChange="return this.form.submit();">',"\n";  
                         for ($i = 0; $i < $total_pages; $i++) {  
                                 echo '<option',($this->fm == $this->inc * $i) ? ' selected' : '';  
                                 echo ' value="',$this->inc * $i,'">',$i + 1,'</option>',"\n";  
                         }  
                         echo '</select>';  
                 }  
                 echo '</td>',"\n";  
                 // Message is now written here                  // Message is now written here
                 if (strlen(@$this->message) > 0) {                  if (strlen(@$this->message) > 0) {
                         echo '<td class="',$this->getCSSclass('message', $position),'">',$this->message,'</td>',"\n";                          echo '<td class="',$this->getCSSclass('message', $position),'">',$this->message,'</td>',"\n";
                 }                  }
                 // Display page and records statistics                  if($this->display['num_pages'] || $this->display['num_records'])
                 echo '<td class="',$this->getCSSclass('stats', $position),'">',"\n";                          echo '<td class="',$this->getCSSclass('stats', $position),'">',"\n";
                 if ($listall) {                  if($this->display['num_pages']) {
                         echo $this->labels['Page'],':&nbsp;1&nbsp;',$this->labels['of'],'&nbsp;1';                          if ($listall) {
                 } else {                                  echo $this->labels['Page'],':&nbsp;1&nbsp;',$this->labels['of'],'&nbsp;1';
                         echo $this->labels['Page'],':&nbsp;',$current_page;                          } else {
                         echo '&nbsp;',$this->labels['of'],'&nbsp;',$total_pages;                                  $current_page = intval($this->fm / $this->inc) + 1;
                                   $total_pages  = max(1, ceil($this->total_recs / abs($this->inc)));
                                   echo $this->labels['Page'],':&nbsp;',$current_page;
                                   echo '&nbsp;',$this->labels['of'],'&nbsp;',$total_pages;
                           }
                 }                  }
                 echo '&nbsp; ',$this->labels['Records'],':&nbsp;',$total_recs;                  if($this->display['num_records'])
                 echo '</td></tr></table>',"\n";                          echo '&nbsp; ',$this->labels['Records'],':&nbsp;',$this->total_recs;
                   if($this->display['num_pages'] || $this->display['num_records']) echo '</td>';
                   echo '</tr></table>',"\n";
                   if($position == 'up') echo '<hr class="'.$this->getCSSclass('hr', 'up').'" />'."\n";
         } /* }}} */          } /* }}} */
   
         /*          /*
Line 1736  function '.$this->js['prefix'].'filter_h
Line 1720  function '.$this->js['prefix'].'filter_h
          */           */
         function display_record_buttons($position) /* {{{ */          function display_record_buttons($position) /* {{{ */
         {          {
                 echo '<table class="',$this->getCSSclass('navigation', $position),'">',"\n";                  if (($but_str = $this->display_buttons($position)) === null)
                           return;
                   if ($position == 'down') {
                           if ($this->tabs_enabled()) $this->display_tab_labels('down');
                           echo '<hr class="',$this->getCSSclass('hr', 'down'),'" />',"\n";
                   }
                   echo '<table summary="navigation" class="',$this->getCSSclass('navigation', $position),'">',"\n";
                 echo '<tr class="',$this->getCSSclass('navigation', $position),'">',"\n";                  echo '<tr class="',$this->getCSSclass('navigation', $position),'">',"\n";
                 echo '<td class="',$this->getCSSclass('buttons', $position),'">',"\n";                  echo '<td class="',$this->getCSSclass('buttons', $position),'">',"\n";
                 if ($this->change_operation()) {                  echo $but_str,'</td>',"\n";
                         echo $this->htmlSubmit('savechange', 'Save', $this->getCSSclass('save', $position), true), '&nbsp;';  
                         echo $this->htmlSubmit('morechange', 'Apply', $this->getCSSclass('more', $position), true), '&nbsp;';  
                         echo $this->htmlSubmit('cancelchange', 'Cancel', $this->getCSSclass('cancel', $position), false);  
                 } elseif ($this->add_operation()) {  
                         echo $this->htmlSubmit('saveadd', 'Save', $this->getCSSclass('save', $position), true), '&nbsp;';  
                         echo $this->htmlSubmit('moreadd', 'More', $this->getCSSclass('more', $position), true), '&nbsp;';  
                         echo $this->htmlSubmit('canceladd', 'Cancel', $this->getCSSclass('cancel', $position), false);  
                 } elseif ($this->copy_operation()) {  
                         echo $this->htmlSubmit('savecopy', 'Save', $this->getCSSclass('save', $position), true), '&nbsp;';  
                         echo $this->htmlSubmit('cancelcopy', 'Cancel', $this->getCSSclass('cancel', $position), false);  
                 } elseif ($this->delete_operation()) {  
                         echo $this->htmlSubmit('savedelete', 'Delete', $this->getCSSclass('save', $position), false), '&nbsp;';  
                         echo $this->htmlSubmit('canceldelete', 'Cancel', $this->getCSSclass('cancel', $position), false);  
                 } elseif ($this->view_operation()) {  
                         if ($this->change_enabled()) {  
                                 echo $this->htmlSubmit('operation', 'Change', $this->getCSSclass('save', $position), false), '&nbsp;';  
                         }  
                         echo $this->htmlSubmit('cancelview', 'Cancel', $this->getCSSclass('cancel', $position), false);  
                 }  
                 // Message is now written here                  // Message is now written here
                 echo '</td>',"\n";                  //echo '</td>',"\n";
                 if (strlen(@$this->message) > 0) {                  if (strlen(@$this->message) > 0) {
                         echo '<td class="',$this->getCSSclass('message', $position),'">',$this->message,'</td>',"\n";                          echo '<td class="',$this->getCSSclass('message', $position),'">',$this->message,'</td>',"\n";
                 }                  }
                 echo '</tr></table>',"\n";                  echo '</tr></table>',"\n";
                   if ($position == 'up') {
                           if ($this->tabs_enabled()) $this->display_tab_labels('up');
                           echo '<hr class="',$this->getCSSclass('hr', 'up'),'" />',"\n";
                   }
           } /* }}} */
   
           function display_buttons($position) /* {{{ */
           {
                   $nav_fnc = 'nav_'.$position;
                   if(! $this->$nav_fnc())
                           return;
                   $buttons = (is_array($this->buttons[$this->page_type][$position]))
                           ? $this->buttons[$this->page_type][$position]
                           : $buttons = $this->default_buttons[$this->page_type];
                   foreach ($buttons as $name) {
                           $ret .= $this->display_button($name, $position)."\n";
                   }
                   return $ret;
           } /* }}} */
   
           function display_button($name, $position = 'up') /* {{{ */
           {
                   if (is_array($name)) {
                           if (isset($name['code'])) return $name['code'];
                           return $this->htmlSubmit($name['name'], $name['value'], $name['css'], $name['disabled'], $name['js']);
                   }
                   $disabled = 1; // show disabled by default
                   if ($name[0] == '+') { $name = substr($name, 1); $disabled =  0; } // always show disabled as enabled
                   if ($name[0] == '-') { $name = substr($name, 1); $disabled = -1; } // don't show disabled
                   if ($name == 'cancel') {
                           return $this->htmlSubmit('cancel'.$this->page_types[$this->page_type], 'Cancel',
                                           $this->getCSSclass('cancel', $position), false);
                   }
                   if (in_array($name, array('add','view','change','copy','delete'))) {
                           $enabled_fnc = $name.'_enabled';
                           $enabled     = $this->$enabled_fnc();
                           if ($name != 'add' && ! $this->total_recs && strstr('LF', $this->page_type))
                                   $enabled = false;
                           return $this->htmlSubmit('operation', ucfirst($name),
                                           $this->getCSSclass($name, $position), false, $enabled ? 0 : $disabled);
                   }
                   if ($name == 'savedelete') {
                           $enabled     = $this->delete_enabled();
                           $js = 'onClick="return confirm(\''.$this->labels['Delete'].' ?\');"';
                           return $this->htmlSubmit('savedelete', 'Delete',
                                           $this->getCSSclass('save', $position), false, $enabled ? 0 : $disabled, $js);
                   }
                   if (in_array($name, array('save','more'))) {
                           $validation = true; // if js validation
                           if     ($this->page_type == 'D' && $name == 'save' ) { $value = 'Delete'; $validation = false; }
                           elseif ($this->page_type == 'C' && $name == 'more' ) { $value = 'Apply'; }
                           else $value = ucfirst($name);
                           return $this->htmlSubmit($name.$this->page_types[$this->page_type], $value,
                                           $this->getCSSclass($name, $position), $validation);
                   }
                   $listall = $this->inc <= 0;
                   if ($listall) {
                           $disabledprev = true;
                           $disablednext = true;
                           $total_pages  = 1;
                           $current_page = 1;
                   } else {
                           $disabledprev = $this->fm <= 0;
                           $disablednext =  $this->fm + $this->inc >= $this->total_recs;
                           $total_pages  = max(1, ceil($this->total_recs / abs($this->inc)));
                           $current_page = ceil($this->fm / abs($this->inc)); // must + 1
                   }
                   $disabledfirst = $disabledprev;
                   $disabledlast  = $disablednext;
                   // some statistics first
                   if ($name == 'total_pages') return $total_pages;
                   if ($name == 'current_page') return ($current_page+1);
                   if ($name == 'total_recs') return ($this->total_recs);
                   // now some goto buttons/dropdowns/inputs...
                   if ($name == 'goto_text') {
                           $ret = '<input type="text" class="'.$this->getCSSclass('gotopn', $position).'"';
                           $ret .= ' name="navpn'.$position.'" value="'.($current_page+1).'"';
                           $ret .= ' size="'.(strlen($total_pages)+1).'" maxlength="'.(strlen($total_pages)+1).'"';
                           // TODO some js here.... on enter submit, on click erase ?...
                           $ret .=' />';
                           return $ret;
                   }
                   if ($name == 'goto_combo') {
                           $disabledgoto = !($listall || ($disablednext && $disabledprev)) ? '' : ' disabled';
                           if ($disablegoto != '' && $disabled < 0) return;
                           $kv_array = array();
                           for ($i = 0; $i < $total_pages; $i++) {
                                   $kv_array[$this->inc * $i] = $i + 1;
                           }
                           // TODO: add onChange="return this.form.submit();"
                           return $this->htmlSelect($this->cgi['prefix']['sys'].ltrim($disabledgoto).'navfm'.$position,
                                           $this->getCSSclass('goto', $position), $kv_array, (string)$this->fm, false, $disabledgoto);
                   }
                   if ($name == 'goto') {
                           return $this->htmlSubmit('navop', 'Go to', $this->getCSSclass('goto', $position),
                                           false, ($listall || ($disablednext && $disabledprev)) ? $disabled : 0);
                   }
                   if (in_array($name, array('first','prev','next','last','<<','<','>','>>'))) {
                           $disabled_var = 'disabled'.$name;
                           if (strlen($name) <= 2) {
                                   $nav_values = array('<<' => 'first', '<' => 'prev', '>' => 'next', '>>' => 'last');
                                   $disabled_var = 'disabled'.$nav_values[$name];
                           }
                           return $this->htmlSubmit('navop', ucfirst($name),
                                           $this->getCSSclass($name, $position), false, $$disabled_var ? $disabled : 0);
                   }
                   if(isset($this->labels[$name])) return $this->labels[$name];
                   return $name;
           } /* }}} */
   
           function number_of_recs() /* {{{ */
           {
                   $count_parts = array(
                                   'type'   => 'select',
                                   'select' => 'count(*)',
                                   'from'   => $this->get_SQL_join_clause(),
                                   'where'  => $this->get_SQL_where_from_query_opts());
                   $res = $this->myquery($this->get_SQL_query($count_parts), __LINE__);
                   $row = @mysql_fetch_array($res, MYSQL_NUM);
                   $this->total_recs = $row[0];
         } /* }}} */          } /* }}} */
   
         /*          /*
Line 1790  function '.$this->js['prefix'].'filter_h
Line 1881  function '.$this->js['prefix'].'filter_h
                 if ($this->goto_operation()) {                  if ($this->goto_operation()) {
                         $this->fm = $this->navfm;                          $this->fm = $this->navfm;
                 }                  }
                   $this->number_of_recs();
                   if ($this->last_operation() || $this->fm > $this->total_recs) { // if goto_text is badly set
                           $this->fm = (int)(($this->total_recs - 1)/$this->inc)*$this->inc;
                   }
                 // If sort sequence has changed, restart listing                  // If sort sequence has changed, restart listing
                 $this->qfn != $this->prev_qfn && $this->fm = 0;                  $this->qfn != $this->prev_qfn && $this->fm = 0;
                 if (0) { // DEBUG                  if (0) { // DEBUG
                         echo 'qfn vs. prev_qfn comparsion ';                          echo 'qfn vs. prev_qfn comparsion ';
                         echo '[<b>',htmlspecialchars($this->qfn),'</b>]';                          echo '[<b>',htmlspecialchars($this->qfn),'</b>]';
                         echo '[<b>',htmlspecialchars($this->prev_qfn),'</b>]<br>';                          echo '[<b>',htmlspecialchars($this->prev_qfn),'</b>]<br />';
                         echo 'comparsion <u>',($this->qfn == $this->prev_qfn ? 'proved' : 'failed'),'</u>';                          echo 'comparsion <u>',($this->qfn == $this->prev_qfn ? 'proved' : 'failed'),'</u>';
                         echo '<hr>';                          echo '<hr />';
                 }                  }
                 /*                  /*
                  * If user is allowed to Change/Delete records, we need an extra column                   * If user is allowed to Change/Delete records, we need an extra column
Line 1814  function '.$this->js['prefix'].'filter_h
Line 1909  function '.$this->js['prefix'].'filter_h
                 echo $this->get_origvars_html($this->get_sfn_cgi_vars());                  echo $this->get_origvars_html($this->get_sfn_cgi_vars());
                 echo $this->htmlHiddenSys('fl', $this->fl);                  echo $this->htmlHiddenSys('fl', $this->fl);
                 // Display buttons at top and/or bottom of page.                  // Display buttons at top and/or bottom of page.
                 // Setup query to get num_rows. (sparky)                  $this->display_list_table_buttons('up', $listall);
                 $total_recs  = 0;  
                 $count_parts = array(  
                                 'type'   => 'select',  
                                 'select' => 'count(*)',  
                                 'from'   => $this->get_SQL_join_clause(),  
                                 'where'  => $this->get_SQL_where_from_query_opts());  
                 $res = $this->myquery($this->get_SQL_query($count_parts), __LINE__);  
                 $row = @mysql_fetch_array($res, MYSQL_NUM);  
                 $total_recs = $row[0];  
                 if ($this->last_operation()) {  
                         $this->fm = (int)(($total_recs-1)/$this->inc)*$this->inc;  
                 }  
                 if ($this->nav_up()) {  
                         $this->display_list_table_buttons($total_recs, 'up');  
                         echo '<hr class="',$this->getCSSclass('hr', 'up'),'">',"\n";  
                 }  
                 if ($this->cgi['persist'] != '') {                  if ($this->cgi['persist'] != '') {
                         echo $this->get_origvars_html($this->cgi['persist']);                          echo $this->get_origvars_html($this->cgi['persist']);
                 }                  }
Line 2035  function '.$this->js['prefix'].'filter_h
Line 2114  function '.$this->js['prefix'].'filter_h
                                                 }                                                  }
                                                 echo '<input class="',$css_class_name,'" value="',htmlspecialchars(@$m);                                                  echo '<input class="',$css_class_name,'" value="',htmlspecialchars(@$m);
                                                 echo '" type="text" name="'.$this->cgi['prefix']['sys'].'qf'.$k.'"',$size_ml_props;                                                  echo '" type="text" name="'.$this->cgi['prefix']['sys'].'qf'.$k.'"',$size_ml_props;
                                                 echo ' onKeyPress="return '.$this->js['prefix'].'filter_handler(this.form, event);">';                                                  echo ' onKeyPress="return '.$this->js['prefix'].'filter_handler(this.form, event);" />';
                                         } else {                                          } else {
                                                 echo '&nbsp;';                                                  echo '&nbsp;';
                                         }                                          }
Line 2133  function '.$this->js['prefix'].'filter_h
Line 2212  function '.$this->js['prefix'].'filter_h
                                                         echo '<a class="',$css_class_name,'" href="',$viewQuery,'"><img class="';                                                          echo '<a class="',$css_class_name,'" href="',$viewQuery,'"><img class="';
                                                         echo $css_class_name,'" src="',$this->url['images'];                                                          echo $css_class_name,'" src="',$this->url['images'];
                                                         echo 'pme-view.png" height="15" width="16" border="0" ';                                                          echo 'pme-view.png" height="15" width="16" border="0" ';
                                                         echo 'alt="',$viewTitle,'" title="',$viewTitle,'"></a>';                                                          echo 'alt="',$viewTitle,'" title="',$viewTitle,'" /></a>';
                                                 }                                                  }
                                                 if ($this->change_enabled()) {                                                  if ($this->change_enabled()) {
                                                         $printed_out && print('&nbsp;');                                                          $printed_out && print('&nbsp;');
Line 2141  function '.$this->js['prefix'].'filter_h
Line 2220  function '.$this->js['prefix'].'filter_h
                                                         echo '<a class="',$css_class_name,'" href="',$changeQuery,'"><img class="';                                                          echo '<a class="',$css_class_name,'" href="',$changeQuery,'"><img class="';
                                                         echo $css_class_name,'" src="',$this->url['images'];                                                          echo $css_class_name,'" src="',$this->url['images'];
                                                         echo 'pme-change.png" height="15" width="16" border="0" ';                                                          echo 'pme-change.png" height="15" width="16" border="0" ';
                                                         echo 'alt="',$changeTitle,'" title="',$changeTitle,'"></a>';                                                          echo 'alt="',$changeTitle,'" title="',$changeTitle,'" /></a>';
                                                 }                                                  }
                                                 if ($this->copy_enabled()) {                                                  if ($this->copy_enabled()) {
                                                         $printed_out && print('&nbsp;');                                                          $printed_out && print('&nbsp;');
Line 2149  function '.$this->js['prefix'].'filter_h
Line 2228  function '.$this->js['prefix'].'filter_h
                                                         echo '<a class="',$css_class_name,'" href="',$copyQuery,'"><img class="';                                                          echo '<a class="',$css_class_name,'" href="',$copyQuery,'"><img class="';
                                                         echo $css_class_name,'" src="',$this->url['images'];                                                          echo $css_class_name,'" src="',$this->url['images'];
                                                         echo 'pme-copy.png" height="15" width="16" border="0" ';                                                          echo 'pme-copy.png" height="15" width="16" border="0" ';
                                                         echo 'alt="',$copyTitle,'" title="',$copyTitle,'"></a>';                                                          echo 'alt="',$copyTitle,'" title="',$copyTitle,'" /></a>';
                                                 }                                                  }
                                                 if ($this->delete_enabled()) {                                                  if ($this->delete_enabled()) {
                                                         $printed_out && print('&nbsp;');                                                          $printed_out && print('&nbsp;');
Line 2157  function '.$this->js['prefix'].'filter_h
Line 2236  function '.$this->js['prefix'].'filter_h
                                                         echo '<a class="',$css_class_name,'" href="',$deleteQuery,'"><img class="';                                                          echo '<a class="',$css_class_name,'" href="',$deleteQuery,'"><img class="';
                                                         echo $css_class_name,'" src="',$this->url['images'];                                                          echo $css_class_name,'" src="',$this->url['images'];
                                                         echo 'pme-delete.png" height="15" width="16" border="0" ';                                                          echo 'pme-delete.png" height="15" width="16" border="0" ';
                                                         echo 'alt="',$deleteTitle,'" title="',$deleteTitle,'"></a>';                                                          echo 'alt="',$deleteTitle,'" title="',$deleteTitle,'" /></a>';
                                                 }                                                  }
                                         }                                          }
                                         if ($this->nav_text_links()) {                                          if ($this->nav_text_links()) {
Line 2192  function '.$this->js['prefix'].'filter_h
Line 2271  function '.$this->js['prefix'].'filter_h
                                                 echo '<td class="',$css_class_name,'"><input class="',$css_class_name;                                                  echo '<td class="',$css_class_name,'"><input class="',$css_class_name;
                                                 echo '" type="radio" name="'.$this->cgi['prefix']['sys'].'rec';                                                  echo '" type="radio" name="'.$this->cgi['prefix']['sys'].'rec';
                                                 echo '" value="',htmlspecialchars($key_rec),'"';                                                  echo '" value="',htmlspecialchars($key_rec),'"';
                                                 if ($first) {                                                  if (($this->rec == '' && $first) || ($this->rec == $key_rec)) {
                                                         echo ' checked';                                                          echo ' checked';
                                                         $first = false;                                                          $first = false;
                                                 }                                                  }
                                                 echo '></td>',"\n";                                                  echo ' /></td>',"\n";
                                         }                                          }
                                 } elseif ($this->filter_enabled()) {                                  } elseif ($this->filter_enabled()) {
                                         echo '<td class="',$css_class_name,'" colspan=',$sys_cols,'>&nbsp;</td>',"\n";                                          echo '<td class="',$css_class_name,'" colspan=',$sys_cols,'>&nbsp;</td>',"\n";
Line 2264  function '.$this->js['prefix'].'filter_h
Line 2343  function '.$this->js['prefix'].'filter_h
                         echo '</tr>',"\n";                          echo '</tr>',"\n";
                 }                  }
                 echo '</table>',"\n"; // end of table rows listing                  echo '</table>',"\n"; // end of table rows listing
                 if ($this->nav_down()) {                  $this->display_list_table_buttons('down', $listall);
                         echo '<hr class="',$this->getCSSclass('hr', 'down'),'">',"\n";  
                         $this->display_list_table_buttons($total_recs, 'down');  
                 }  
                 $this->form_end();                  $this->form_end();
         } /* }}} */          } /* }}} */
   
Line 2309  function '.$this->js['prefix'].'filter_h
Line 2385  function '.$this->js['prefix'].'filter_h
                 echo $this->htmlHiddenSys('rec', $this->copy_operation() ? '' : $this->rec);                  echo $this->htmlHiddenSys('rec', $this->copy_operation() ? '' : $this->rec);
                 echo $this->htmlHiddenSys('fm', $this->fm);                  echo $this->htmlHiddenSys('fm', $this->fm);
                 echo $this->htmlHiddenSys('fl', $this->fl);                  echo $this->htmlHiddenSys('fl', $this->fl);
                 if ($this->nav_up()) {                  $this->display_record_buttons('up');
                         $this->display_record_buttons('up');  
                         echo '<hr class="',$this->getCSSclass('hr', 'up'),'">',"\n";  
                         if ($this->tabs_enabled()) {  
                                 $this->display_tab_labels('up');  
                         }  
                 }  
                 if ($this->tabs_enabled()) {                  if ($this->tabs_enabled()) {
                         echo '<div id="'.$this->dhtml['prefix'].'tab0">',"\n";                          echo '<div id="'.$this->dhtml['prefix'].'tab0">',"\n";
                 }                  }
Line 2326  function '.$this->js['prefix'].'filter_h
Line 2396  function '.$this->js['prefix'].'filter_h
                         $this->display_copy_change_delete_record();                          $this->display_copy_change_delete_record();
                 }                  }
                 echo '</table>',"\n";                  echo '</table>',"\n";
                   if ($this->tabs_enabled()) {
                 echo '</div>',"\n";                  echo '</div>',"\n";
                 if ($this->nav_down()) {                  }              
                         if ($this->tabs_enabled()) {                  $this->display_record_buttons('down');
                                 $this->display_tab_labels('down');  
                         }  
                         echo '<hr class="',$this->getCSSclass('hr', 'down'),'">',"\n";  
                         $this->display_record_buttons('down');  
                 }  
                 $this->form_end();                  $this->form_end();
         } /* }}} */          } /* }}} */
   
Line 2813  function '.$this->js['prefix'].'filter_h
Line 2880  function '.$this->js['prefix'].'filter_h
         {          {
                 echo '<h1>phpMyEdit error: ',htmlspecialchars($message),'</h1>',"\n";                  echo '<h1>phpMyEdit error: ',htmlspecialchars($message),'</h1>',"\n";
                 if ($additional_info != '') {                  if ($additional_info != '') {
                         echo '<hr>',htmlspecialchars($additional_info);                          echo '<hr />',htmlspecialchars($additional_info);
                 }                  }
                 return false;                  return false;
         } /* }}} */          } /* }}} */
Line 2834  function '.$this->js['prefix'].'filter_h
Line 2901  function '.$this->js['prefix'].'filter_h
                         $this->error('no table defined');                          $this->error('no table defined');
                         return false;                          return false;
                 }                  }
                 if ($this->dbh = @mysql_pconnect($this->hn, $this->un, $this->pw)) {                  $this->dbh = @ini_get('allow_persistent')
                 } else {                          ? @mysql_pconnect($this->hn, $this->un, $this->pw)
                           : @mysql_connect($this->hn, $this->un, $this->pw);
                   if (!$this->dbh) {
                         $this->error('could not connect to MySQL');                          $this->error('could not connect to MySQL');
                         return false;                          return false;
                 }                  }
Line 3012  function '.$this->js['prefix'].'filter_h
Line 3081  function '.$this->js['prefix'].'filter_h
                         ? $opts['display']['tabs'] : true;                          ? $opts['display']['tabs'] : true;
                 $this->display['form'] = isset($opts['display']['form'])                  $this->display['form'] = isset($opts['display']['form'])
                         ? $opts['display']['form'] : true;                          ? $opts['display']['form'] : true;
                   $this->display['num_records'] = isset($opts['display']['num_records'])
                           ? $opts['display']['num_records'] : true;
                   $this->display['num_pages'] = isset($opts['display']['num_pages'])
                           ? $opts['display']['num_pages'] : true;
                 // Creating directory variables                  // Creating directory variables
                 $this->dir['root'] = dirname(realpath(__FILE__))                  $this->dir['root'] = dirname(realpath(__FILE__))
                         . (strlen(dirname(realpath(__FILE__))) > 0 ? '/' : '');                          . (strlen(dirname(realpath(__FILE__))) > 0 ? '/' : '');
Line 3041  function '.$this->js['prefix'].'filter_h
Line 3114  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'];
                 // 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 3074  function '.$this->js['prefix'].'filter_h
Line 3148  function '.$this->js['prefix'].'filter_h
                 // Form variables all around                  // Form variables all around
                 $this->fl    = intval($this->get_sys_cgi_var('fl'));                  $this->fl    = intval($this->get_sys_cgi_var('fl'));
                 $this->fm    = intval($this->get_sys_cgi_var('fm'));                  $this->fm    = intval($this->get_sys_cgi_var('fm'));
   //              $old_page = ceil($this->fm / abs($this->inc)) + 1;
                 $this->qfn   = $this->get_sys_cgi_var('qfn');                  $this->qfn   = $this->get_sys_cgi_var('qfn');
                 $this->sw    = $this->get_sys_cgi_var('sw');                  $this->sw    = $this->get_sys_cgi_var('sw');
                 $this->rec   = $this->get_sys_cgi_var('rec', '');                  $this->rec   = $this->get_sys_cgi_var('rec', '');
                 $this->navop = $this->get_sys_cgi_var('navop');                  $this->navop = $this->get_sys_cgi_var('navop');
                 if (($this->navfm = $this->get_sys_cgi_var('navfmup', $this->fm)) != $this->fm) {                  $navfmup     = intval($this->get_sys_cgi_var('navfmup'));
                         $this->navop = $this->labels['Go to'];                  $navfmdown   = intval($this->get_sys_cgi_var('navfmdown'));
                 } else if (($this->navfm = $this->get_sys_cgi_var('navfmdown', $this->navfm)) != $this->fm) {                  $this->navfm = $navfmup != $this->fm ? $navfmup : $navfmdown;
                         $this->navop = $this->labels['Go to'];  
                 }  
                 $this->operation = $this->get_sys_cgi_var('operation');                  $this->operation = $this->get_sys_cgi_var('operation');
                 $oper_prefix_len = strlen($this->cgi['prefix']['operation']);                  $oper_prefix_len = strlen($this->cgi['prefix']['operation']);
                 if (! strncmp($this->cgi['prefix']['operation'], $this->operation, $oper_prefix_len)) {                  if (! strncmp($this->cgi['prefix']['operation'], $this->operation, $oper_prefix_len)) {

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

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