| version 1.98, 2003/12/10 21:16:16 |
version 1.99, 2003/12/11 12:27:42 |
|
|
| * http://platon.sk/projects/phpMyEdit/ |
* http://platon.sk/projects/phpMyEdit/ |
| */ |
*/ |
| |
|
| /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.97 2003/12/09 11:16:13 nepto Exp $ */ |
/* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.98 2003/12/10 21:16:16 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 823 function phpMyEdit_form_control(theForm) |
|
| Line 823 function phpMyEdit_form_control(theForm) |
|
| return true; |
return true; |
| }',"\n\n"; |
}',"\n\n"; |
| echo '// --></script>', "\n"; |
echo '// --></script>', "\n"; |
| echo '<form class="',$this->getCSSclass('form'); |
if ($this->display['form']) { |
| echo '" action="',$page_name,'" method="POST"'; |
echo '<form class="',$this->getCSSclass('form'); |
| echo ' onSubmit="return phpMyEdit_form_control(this);">',"\n"; |
echo '" action="',$page_name,'" method="POST"'; |
| |
echo ' onSubmit="return phpMyEdit_form_control(this);">',"\n"; |
| |
} |
| return true; |
return true; |
| } |
} |
| } |
} |
| |
|
| echo '<form class="',$this->getCSSclass('form'),'" action="',$page_name,'" method="POST">',"\n"; |
if ($this->display['form']) { |
| |
echo '<form class="',$this->getCSSclass('form'); |
| |
echo '" action="',$page_name,'" method="POST">',"\n"; |
| |
} |
| return true; |
return true; |
| } /* }}} */ |
} /* }}} */ |
| |
|
| Line 853 function phpMyEdit_form_control(theForm) |
|
| Line 858 function phpMyEdit_form_control(theForm) |
|
| echo '</table>',"\n"; |
echo '</table>',"\n"; |
| } /* }}} */ |
} /* }}} */ |
| |
|
| |
|
| |
|
| |
|
| /* |
/* |
| * Display functions |
* Display functions |
| */ |
*/ |
| Line 1183 function phpMyEdit_form_control(theForm) |
|
| Line 1185 function phpMyEdit_form_control(theForm) |
|
| |
|
| function cellDisplay($k, $row, $css) /* {{{ */ |
function cellDisplay($k, $row, $css) /* {{{ */ |
| { |
{ |
| $escape = true; |
$escape = isset($this->fdd[$k]['escape']) ? $this->fdd[$k]['escape'] : true; |
| $key_rec = $row['qf'.$this->key_num]; |
$key_rec = $row['qf'.$this->key_num]; |
| if (@$this->fdd[$k]['datemask']) { |
if (@$this->fdd[$k]['datemask']) { |
| $value = $row["qf$k".'_timestamp']; |
$value = intval($row["qf$k".'_timestamp']); |
| strlen($value) && $value = @date($this->fdd[$k]['datemask'], $value); |
$value = $value ? @date($this->fdd[$k]['datemask'], $value) : ''; |
| } else if (@$this->fdd[$k]['strftimemask']) { |
} else if (@$this->fdd[$k]['strftimemask']) { |
| $value = $row["qf$k".'_timestamp']; |
$value = intval($row["qf$k".'_timestamp']); |
| strlen($value) && $value = @strftime($this->fdd[$k]['strftimemask'], $value); |
$value = $value ? @strftime($this->fdd[$k]['strftimemask'], $value) : ''; |
| } else if ($this->is_values2($k, $row["qf$k"])) { |
} else if ($this->is_values2($k, $row["qf$k"])) { |
| $value = $row['qf'.$k.'_idx']; |
$value = $row['qf'.$k.'_idx']; |
| if ($this->fdd[$k]['select'] == 'M') { |
if ($this->fdd[$k]['select'] == 'M') { |
| Line 1654 function phpMyEdit_form_control(theForm) |
|
| Line 1656 function phpMyEdit_form_control(theForm) |
|
| /* |
/* |
| * Display the MySQL table in an HTML table |
* Display the MySQL table in an HTML table |
| */ |
*/ |
| echo '<form class="',$this->getCSSclass('form'),'" action="'; |
if ($this->display['form']) { |
| echo htmlspecialchars($this->page_name),'" method="POST">',"\n"; |
echo '<form class="',$this->getCSSclass('form'),'" action="'; |
| |
echo htmlspecialchars($this->page_name),'" method="POST">',"\n"; |
| |
} |
| echo $this->get_origvars_html($this->get_sfn_cgi_vars()); |
echo $this->get_origvars_html($this->get_sfn_cgi_vars()); |
| echo '<input type="hidden" name="fl" value="',$this->fl,'">',"\n"; |
echo '<input type="hidden" name="fl" value="',$this->fl,'">',"\n"; |
| // Display buttons at top and/or bottom of page. |
// Display buttons at top and/or bottom of page. |
| Line 2119 function phpMyEdit_form_control(theForm) |
|
| Line 2123 function phpMyEdit_form_control(theForm) |
|
| echo '<hr class="',$this->getCSSclass('hr', 'down'),'">',"\n"; |
echo '<hr class="',$this->getCSSclass('hr', 'down'),'">',"\n"; |
| $this->display_list_table_buttons($total_recs, 'down'); |
$this->display_list_table_buttons($total_recs, 'down'); |
| } |
} |
| echo '</form>',"\n"; |
if ($this->display['form']) { |
| |
echo '</form>',"\n"; |
| |
} |
| } /* }}} */ |
} /* }}} */ |
| |
|
| function display_record() /* {{{ */ |
function display_record() /* {{{ */ |
| Line 2159 function phpMyEdit_form_control(theForm) |
|
| Line 2165 function phpMyEdit_form_control(theForm) |
|
| echo '<hr class="',$this->getCSSclass('hr', 'down'),'">',"\n"; |
echo '<hr class="',$this->getCSSclass('hr', 'down'),'">',"\n"; |
| $this->display_record_buttons(); |
$this->display_record_buttons(); |
| } |
} |
| echo '</form>',"\n"; |
if ($this->display['form']) { |
| |
echo '</form>',"\n"; |
| |
} |
| } /* }}} */ |
} /* }}} */ |
| |
|
| /* |
/* |
| Line 2739 function phpMyEdit_form_control(theForm) |
|
| Line 2747 function phpMyEdit_form_control(theForm) |
|
| } |
} |
| $this->display['tabs'] = isset($opts['display']['tabs']) |
$this->display['tabs'] = isset($opts['display']['tabs']) |
| ? $opts['display']['tabs'] : true; |
? $opts['display']['tabs'] : true; |
| |
$this->display['form'] = isset($opts['display']['form']) |
| |
? $opts['display']['form'] : 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 ? '/' : ''); |