| version 1.16, 2018/02/11 21:39:12 |
version 1.17, 2024/11/20 15:48:04 |
|
|
| * http://platon.sk/projects/phpMyEdit/ |
* http://platon.sk/projects/phpMyEdit/ |
| */ |
*/ |
| |
|
| /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.225 2017/11/08 05:27:43 nepto Exp $ */ |
/* $Platon: Metafox/lib/phpMyEdit/phpMyEdit.class.php,v 1.16 2018/02/11 21:39:12 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. |
|
|
| ($this->filter_operation() && stristr($options, 'F')) || |
($this->filter_operation() && stristr($options, 'F')) || |
| ($this->list_operation() && stristr($options, 'L')); |
($this->list_operation() && stristr($options, 'L')); |
| } /* }}} */ |
} /* }}} */ |
| |
|
| function debug_var($name, $val) /* {{{ */ |
function debug_var($name, $val) /* {{{ */ |
| { |
{ |
| if (is_array($val) || is_object($val)) { |
if (is_array($val) || is_object($val)) { |
|
|
| : @mysql_connect($this->hn, $this->un, $this->pw, false, $flags); |
: @mysql_connect($this->hn, $this->un, $this->pw, false, $flags); |
| } |
} |
| } /* }}} */ |
} /* }}} */ |
| |
|
| |
|
| function sql_disconnect() /* {{{ */ |
function sql_disconnect() /* {{{ */ |
| { |
{ |
|
|
| return $ret; |
return $ret; |
| } /* }}} */ |
} /* }}} */ |
| |
|
| /* end of sql functions */ |
/* end of sql functions */ |
| |
|
| function make_language_labels($language) /* {{{ */ |
function make_language_labels($language) /* {{{ */ |
| { |
{ |
| Line 1165 function '.$this->js['prefix'].'filter_h |
|
| Line 1165 function '.$this->js['prefix'].'filter_h |
|
| // Simple edit box required |
// Simple edit box required |
| $len_props = ''; |
$len_props = ''; |
| $maxlen = intval($this->fdd[$k]['maxlen']); |
$maxlen = intval($this->fdd[$k]['maxlen']); |
| $size = isset($this->fdd[$k]['size']) ? $this->fdd[$k]['size'] : min($maxlen, 60); |
$size = isset($this->fdd[$k]['size']) ? $this->fdd[$k]['size'] : min($maxlen, 60); |
| if ($size > 0) { |
if ($size > 0) { |
| $len_props .= ' size="'.$size.'"'; |
$len_props .= ' size="'.$size.'"'; |
| } |
} |
| Line 1267 function '.$this->js['prefix'].'filter_h |
|
| Line 1267 function '.$this->js['prefix'].'filter_h |
|
| } |
} |
| } /* }}} */ |
} /* }}} */ |
| |
|
| function display_change_field($row, $k) /* {{{ */ |
function display_change_field($row, $k) /* {{{ */ |
| { |
{ |
| $css_postfix = @$this->fdd[$k]['css']['postfix']; |
$css_postfix = @$this->fdd[$k]['css']['postfix']; |
| $css_class_name = $this->getCSSclass('input', null, true, $css_postfix); |
$css_class_name = $this->getCSSclass('input', null, true, $css_postfix); |
| Line 1296 function '.$this->js['prefix'].'filter_h |
|
| Line 1296 function '.$this->js['prefix'].'filter_h |
|
| } else { |
} else { |
| $len_props = ''; |
$len_props = ''; |
| $maxlen = intval($this->fdd[$k]['maxlen']); |
$maxlen = intval($this->fdd[$k]['maxlen']); |
| $size = isset($this->fdd[$k]['size']) ? $this->fdd[$k]['size'] : min($maxlen, 60); |
$size = isset($this->fdd[$k]['size']) ? $this->fdd[$k]['size'] : min($maxlen, 60); |
| if ($size > 0) { |
if ($size > 0) { |
| $len_props .= ' size="'.$size.'"'; |
$len_props .= ' size="'.$size.'"'; |
| } |
} |
| Line 1320 function '.$this->js['prefix'].'filter_h |
|
| Line 1320 function '.$this->js['prefix'].'filter_h |
|
| echo $this->getColAttributes($k),">\n"; |
echo $this->getColAttributes($k),">\n"; |
| $len_props = ''; |
$len_props = ''; |
| $maxlen = intval($this->fdd[$k]['maxlen']); |
$maxlen = intval($this->fdd[$k]['maxlen']); |
| $size = isset($this->fdd[$k]['size']) ? $this->fdd[$k]['size'] : min($maxlen, 60); |
$size = isset($this->fdd[$k]['size']) ? $this->fdd[$k]['size'] : min($maxlen, 60); |
| if ($size > 0) { |
if ($size > 0) { |
| $len_props .= ' size="'.$size.'"'; |
$len_props .= ' size="'.$size.'"'; |
| } |
} |
| Line 2214 function '.$this->js['prefix'].'filter_h |
|
| Line 2214 function '.$this->js['prefix'].'filter_h |
|
| * Draw the filter and fill it with any data typed in last pass and stored |
* Draw the filter and fill it with any data typed in last pass and stored |
| * in the array parameter keyword 'filter'. Prepare the SQL WHERE clause. |
* in the array parameter keyword 'filter'. Prepare the SQL WHERE clause. |
| */ |
*/ |
| |
|
| // Filter row retrieval |
// Filter row retrieval |
| /*$fields = false; |
/*$fields = false; |
| $filter_row = array();//$row; |
$filter_row = array();//$row; |
| Line 2319 function '.$this->js['prefix'].'filter_h |
|
| Line 2319 function '.$this->js['prefix'].'filter_h |
|
| .$this->qfn.$this->cgi['persist']); |
.$this->qfn.$this->cgi['persist']); |
| echo '">',$this->labels['Clear'],'</a></td>',"\n"; |
echo '">',$this->labels['Clear'],'</a></td>',"\n"; |
| echo '<td class="',$css_class_name,'" colspan="',$this->num_fields_displayed,'">'; |
echo '<td class="',$css_class_name,'" colspan="',$this->num_fields_displayed,'">'; |
| echo $this->labels['Sorted By'],': ',join(', ', $this->sort_fields_w),'</td></tr>',"\n"; |
echo $this->labels['Sorted By'],': ',join(', ', $this->sort_fields_w),'</td></tr>',"\n"; |
| } /* }}} */ |
} /* }}} */ |
| |
|
| function display_current_query() /* {{{ */ |
function display_current_query() /* {{{ */ |
| Line 2476 function '.$this->js['prefix'].'filter_h |
|
| Line 2476 function '.$this->js['prefix'].'filter_h |
|
| if ($qparts['orderby'] && $this->display['sort']) $this->display_sorting_sequence(); |
if ($qparts['orderby'] && $this->display['sort']) $this->display_sorting_sequence(); |
| // Display the current query |
// Display the current query |
| if($this->display['query']) $this->display_current_query(); |
if($this->display['query']) $this->display_current_query(); |
| |
|
| if ($this->nav_text_links() || $this->nav_graphic_links()) { |
if ($this->nav_text_links() || $this->nav_graphic_links()) { |
| $qstrparts = array(); |
$qstrparts = array(); |
| strlen($this->fl) > 0 && $qstrparts[] = $this->cgi['prefix']['sys'].'fl'.'='.$this->fl; |
strlen($this->fl) > 0 && $qstrparts[] = $this->cgi['prefix']['sys'].'fl'.'='.$this->fl; |
| Line 2716 function '.$this->js['prefix'].'filter_h |
|
| Line 2716 function '.$this->js['prefix'].'filter_h |
|
| echo '</table>',"\n"; |
echo '</table>',"\n"; |
| if ($this->tabs_enabled()) { |
if ($this->tabs_enabled()) { |
| echo '</div>',"\n"; |
echo '</div>',"\n"; |
| } |
} |
| $this->display_record_buttons('down'); |
$this->display_record_buttons('down'); |
| |
|
| $this->form_end(); |
$this->form_end(); |
| Line 3046 function '.$this->js['prefix'].'filter_h |
|
| Line 3046 function '.$this->js['prefix'].'filter_h |
|
| $oldvals = $newvals = $changed = array(); |
$oldvals = $newvals = $changed = array(); |
| return $this->exec_triggers($op, $step, $oldvals, $changed, $newvals); |
return $this->exec_triggers($op, $step, $oldvals, $changed, $newvals); |
| } /* }}} */ |
} /* }}} */ |
| |
|
| /* |
/* |
| * Recreate functions |
* Recreate functions |
| */ |
*/ |
| Line 3226 function '.$this->js['prefix'].'filter_h |
|
| Line 3226 function '.$this->js['prefix'].'filter_h |
|
| } |
} |
| return true; |
return true; |
| } /* }}} */ |
} /* }}} */ |
| |
|
| /* |
/* |
| * The workhorse |
* The workhorse |
| */ |
*/ |
| function execute() /* {{{ */ |
function execute($opts = array()) /* {{{ */ |
| { |
{ |
| // DEBUG - uncomment to enable |
// DEBUG - uncomment to enable |
| /* |
/* |
| Line 3248 function '.$this->js['prefix'].'filter_h |
|
| Line 3248 function '.$this->js['prefix'].'filter_h |
|
| |
|
| // Let's do explicit quoting - it's safer |
// Let's do explicit quoting - it's safer |
| // (but 5.3 does not have this at all) |
// (but 5.3 does not have this at all) |
| if (version_compare(PHP_VERSION, '5.3.0', '<')) { |
if (version_compare(PHP_VERSION, '5.3.0', '<')) { |
| set_magic_quotes_runtime(0); |
set_magic_quotes_runtime(0); |
| } |
} |
| |
|
| Line 3381 function '.$this->js['prefix'].'filter_h |
|
| Line 3381 function '.$this->js['prefix'].'filter_h |
|
| if (! isset($this->page_name)) { |
if (! isset($this->page_name)) { |
| $this->page_name = basename($this->get_server_var('PHP_SELF')); |
$this->page_name = basename($this->get_server_var('PHP_SELF')); |
| isset($this->page_name) || $this->page_name = $this->tb; |
isset($this->page_name) || $this->page_name = $this->tb; |
| } |
} |
| $this->display['query'] = @$opts['display']['query']; |
$this->display['query'] = @$opts['display']['query']; |
| $this->display['sort'] = @$opts['display']['sort']; |
$this->display['sort'] = @$opts['display']['sort']; |
| $this->display['time'] = @$opts['display']['time']; |
$this->display['time'] = @$opts['display']['time']; |
| Line 3472 function '.$this->js['prefix'].'filter_h |
|
| Line 3472 function '.$this->js['prefix'].'filter_h |
|
| elseif($navfmup!=NULL && $navfmup != $this->fm) $this->navfm = $navfmup; |
elseif($navfmup!=NULL && $navfmup != $this->fm) $this->navfm = $navfmup; |
| elseif($navpndown!=NULL && ($navpndown-1)*$this->inc != $this->fm) $this->navfm = ($navpndown-1)*$this->inc; |
elseif($navpndown!=NULL && ($navpndown-1)*$this->inc != $this->fm) $this->navfm = ($navpndown-1)*$this->inc; |
| elseif($navpnup!=NULL && ($navpnup-1)*$this->inc != $this->fm) $this->navfm = ($navpnup-1)*$this->inc; |
elseif($navpnup!=NULL && ($navpnup-1)*$this->inc != $this->fm) $this->navfm = ($navpnup-1)*$this->inc; |
| else $this->navfm = $this->fm; |
else $this->navfm = $this->fm; |
| $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)) { |