| version 1.26, 2002/11/03 15:29:10 |
version 1.27, 2002/11/12 21:41:43 |
|
|
| * http://www.platon.sk/projects/phpMyEdit/ |
* http://www.platon.sk/projects/phpMyEdit/ |
| */ |
*/ |
| |
|
| /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.25 2002/11/02 19:19:34 nepto Exp $ */ |
/* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.26 2002/11/03 15:29:10 nepto Exp $ */ |
| |
|
| /* phpMyEdit intro {{{ */ |
/* phpMyEdit intro {{{ */ |
| /* |
/* |
| Line 1363 function form_control(theForm) |
|
| Line 1363 function form_control(theForm) |
|
| |
|
| // 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 |
| // TODO: classify this table and cells |
// TODO: classify this table and cells |
| echo '<table border=0 cellpadding=0 cellspacing=0 width="100%" style="border:0;padding:0;">'; |
echo '<table border="0" cellpadding="0" cellspacing="0" width="100%" style="border:0;padding:0;">'; |
| echo '<tr><td align=left style="text-align:left;border:0;padding:0;" nowrap>' . "\n"; |
echo '<tr><td align=left style="text-align:left;border:0;">' . "\n"; |
| $disabled = ($this->fm > 0 && ! $listall) ? '' : ' disabled'; |
$disabled = ($this->fm > 0 && ! $listall) ? '' : ' disabled'; |
| echo '<input'.$disabled.' type="submit" name="'.ltrim($disabled).'prev" value="' |
echo '<input'.$disabled.' type="submit" name="'.ltrim($disabled).'prev" value="' |
| .$this->labels['Prev'].'"> '; |
.$this->labels['Prev'].'"> '; |
| Line 1400 function form_control(theForm) |
|
| Line 1400 function form_control(theForm) |
|
| .$this->labels['Next'].'">'; |
.$this->labels['Next'].'">'; |
| |
|
| // Message is now written here |
// Message is now written here |
| echo '</td><td align=center style="text-align:center;border:0;padding:0;" nowrap><b>'.$this->message.'</b></td>'; |
echo '</td><td align="center" style="text-align:center;border:0;" ><b>'.$this->message.'</b></td>'; |
| |
|
| // display page and records statistics |
// display page and records statistics |
| echo '<td align=right style="text-align:right;border:0;padding:0;" nowrap>' . "\n"; |
echo '<td align="right" style="text-align:right;border:0;" >' . "\n"; |
| if ($listall) { |
if ($listall) { |
| echo $this->labels['Page'].': 1 '.$this->labels['of'].' 1'; |
echo $this->labels['Page'].': 1 '.$this->labels['of'].' 1'; |
| } else { |
} else { |
| Line 1422 function form_control(theForm) |
|
| Line 1422 function form_control(theForm) |
|
| function display_record_buttons() /* {{{ */ |
function display_record_buttons() /* {{{ */ |
| { |
{ |
| // TODO: classify this table and cells |
// TODO: classify this table and cells |
| echo '<table border=0 cellpadding=0 cellspacing=0 width="100%" style="border:0;padding:0;">'; |
echo '<table border="0" cellpadding="0" cellspacing="0" width="100%" style="border:0;">'; |
| echo '<tr><td align=left style="text-align:left;border:0;padding:0;" nowrap>' . "\n"; |
echo '<tr><td align="left" style="text-align:left;border:0;">' . "\n"; |
| if ($this->change_operation()) { |
if ($this->change_operation()) { |
| echo '<input type="submit" name="savechange" value="'.$this->labels['Save'].'" />'."\n"; |
echo '<input type="submit" name="savechange" value="'.$this->labels['Save'].'" />'."\n"; |
| echo '<input type="button" name="cancel" value="'.$this->labels['Cancel'].'" onClick="form.submit();" />'."\n"; |
echo '<input type="button" name="cancel" value="'.$this->labels['Cancel'].'" onClick="form.submit();" />'."\n"; |
| Line 1556 function form_control(theForm) |
|
| Line 1556 function form_control(theForm) |
|
| * if we have filters, Changes or Deletes enabled |
* if we have filters, Changes or Deletes enabled |
| */ |
*/ |
| if ($sys_cols) { |
if ($sys_cols) { |
| echo '<th colspan='.$sys_cols.' align="center" nowrap width="1%">'; |
echo '<th colspan="'.$sys_cols.'" align="center" width="1%">'; |
| if ($this->filter_enabled()) { |
if ($this->filter_enabled()) { |
| if ($this->fl) { |
if ($this->fl) { |
| echo '<input type=submit name=sw value="'.$this->labels['Hide'].'">'; |
echo '<input type=submit name=sw value="'.$this->labels['Hide'].'">'; |
| Line 1919 function form_control(theForm) |
|
| Line 1919 function form_control(theForm) |
|
| $qdeleteStr = $qpdeleteStr.'&rec='.$key_rec; |
$qdeleteStr = $qpdeleteStr.'&rec='.$key_rec; |
| if ($select_recs) { |
if ($select_recs) { |
| if (! $this->nav_buttons() || $sys_cols > 1) { |
if (! $this->nav_buttons() || $sys_cols > 1) { |
| echo '<td nowrap align=center width="1%">'; |
echo '<td style="white-space:nowrap;text-align:center;" width="1%">'; |
| } |
} |
| if ($this->nav_graphic_links()) { |
if ($this->nav_graphic_links()) { |
| $printed_out = false; |
$printed_out = false; |
| Line 1928 function form_control(theForm) |
|
| Line 1928 function form_control(theForm) |
|
| echo '<a class="pme_a_t" href="'; |
echo '<a class="pme_a_t" href="'; |
| echo htmlspecialchars($this->page_name.$qviewStr); |
echo htmlspecialchars($this->page_name.$qviewStr); |
| echo '"><img src="'.$this->url['images'].'pme-view.png"'; |
echo '"><img src="'.$this->url['images'].'pme-view.png"'; |
| echo ' height=15 width=16 border=none alt="' |
echo ' height="15" width="16" border="0" alt="' |
| .htmlspecialchars($this->labels['View']).'"></a>'; |
.htmlspecialchars($this->labels['View']).'"></a>'; |
| } |
} |
| if ($this->change_enabled()) { |
if ($this->change_enabled()) { |
| Line 1937 function form_control(theForm) |
|
| Line 1937 function form_control(theForm) |
|
| echo '<a class="pme_a_t" href="'; |
echo '<a class="pme_a_t" href="'; |
| echo htmlspecialchars($this->page_name.$qchangeStr); |
echo htmlspecialchars($this->page_name.$qchangeStr); |
| echo '"><img src="'.$this->url['images'].'pme-change.png"'; |
echo '"><img src="'.$this->url['images'].'pme-change.png"'; |
| echo ' height=15 width=16 border=none alt="' |
echo ' height="15" width="16" border="0" alt="' |
| .htmlspecialchars($this->labels['Change']).'"></a>'; |
.htmlspecialchars($this->labels['Change']).'"></a>'; |
| } |
} |
| if ($this->copy_enabled()) { |
if ($this->copy_enabled()) { |
| Line 1946 function form_control(theForm) |
|
| Line 1946 function form_control(theForm) |
|
| echo '<a class="pme_a_t" href="'; |
echo '<a class="pme_a_t" href="'; |
| echo htmlspecialchars($this->page_name.$qcopyStr); |
echo htmlspecialchars($this->page_name.$qcopyStr); |
| echo '"><img src="'.$this->url['images'].'pme-copy.png"'; |
echo '"><img src="'.$this->url['images'].'pme-copy.png"'; |
| echo ' height=15 width=16 border=none alt="' |
echo ' height="15" width="16" border="0" alt="' |
| .htmlspecialchars($this->labels['Copy']).'"></a>'; |
.htmlspecialchars($this->labels['Copy']).'"></a>'; |
| } |
} |
| if ($this->delete_enabled()) { |
if ($this->delete_enabled()) { |
| Line 1955 function form_control(theForm) |
|
| Line 1955 function form_control(theForm) |
|
| echo '<a class="pme_a_t" href="'; |
echo '<a class="pme_a_t" href="'; |
| echo htmlspecialchars($this->page_name.$qdeleteStr); |
echo htmlspecialchars($this->page_name.$qdeleteStr); |
| echo '"><img src="'.$this->url['images'].'pme-delete.png"'; |
echo '"><img src="'.$this->url['images'].'pme-delete.png"'; |
| echo ' height=15 width=16 border=none alt="' |
echo ' height="15" width="16" border="0" alt="' |
| .htmlspecialchars($this->labels['Delete']).'"></a>'; |
.htmlspecialchars($this->labels['Delete']).'"></a>'; |
| } |
} |
| } |
} |
| Line 1992 function form_control(theForm) |
|
| Line 1992 function form_control(theForm) |
|
| echo '</td>'."\n"; |
echo '</td>'."\n"; |
| } |
} |
| if ($this->nav_buttons()) { |
if ($this->nav_buttons()) { |
| echo '<td nowrap align=center width=1>'; |
echo '<td align="center" width="1">'; |
| echo '<input type=radio name=rec value="'.htmlspecialchars($key_rec).'"'; |
echo '<input type=radio name=rec value="'.htmlspecialchars($key_rec).'"'; |
| if ($first) { |
if ($first) { |
| echo ' checked'; |
echo ' checked'; |
| Line 2631 echo '<h5>'.mysql_affected_rows ().' '.$ |
|
| Line 2631 echo '<h5>'.mysql_affected_rows ().' '.$ |
|
| |
|
| function recreate_displayed($sort_field = '') /* {{{ */ |
function recreate_displayed($sort_field = '') /* {{{ */ |
| { |
{ |
| |
/* $sort_field initialization here is currently not used |
| |
it may be useful in future if we will want to initialize initial |
| |
sort also by column name, not only by column number */ |
| |
|
| $field_num = 0; |
$field_num = 0; |
| $num_fields_displayed = 0; |
$num_fields_displayed = 0; |
| $this->fds = array(); |
$this->fds = array(); |
| Line 2873 echo '<h5>'.mysql_affected_rows ().' '.$ |
|
| Line 2877 echo '<h5>'.mysql_affected_rows ().' '.$ |
|
| $this->fl = intval($this->get_cgi_var('fl')); |
$this->fl = intval($this->get_cgi_var('fl')); |
| $this->fm = intval($this->get_cgi_var('fm')); |
$this->fm = intval($this->get_cgi_var('fm')); |
| |
|
| $this->sfn = $this->get_cgi_var('sfn'); |
$this->sfn = $this->get_cgi_var('sfn', $opts['sort_field']); |
| $this->sort_asc = $this->sfn[0] != '-'; |
$this->sort_asc = $this->sfn[0] != '-'; |
| $this->sfn = abs(intval($this->sfn)); |
$this->sfn = abs(intval($this->sfn)); |
| |
|