| version 1.17, 2002/10/21 21:30:41 |
version 1.18, 2002/10/23 19:10:07 |
|
|
| * http://www.platon.sk/projects/phpMyEdit/ |
* http://www.platon.sk/projects/phpMyEdit/ |
| */ |
*/ |
| |
|
| /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.16 2002/10/20 22:04:19 nepto Exp $ */ |
/* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.17 2002/10/21 21:30:41 nepto Exp $ */ |
| |
|
| /* phpMyEdit intro {{{ */ |
/* phpMyEdit intro {{{ */ |
| /* |
/* |
|
|
| $ret = @include($this->dir['lang'].'PME.lang.'.substr($language,0,2).'.inc'); |
$ret = @include($this->dir['lang'].'PME.lang.'.substr($language,0,2).'.inc'); |
| } |
} |
| if (! $ret) { |
if (! $ret) { |
| // default to English-U.S. |
// default to classical English |
| $ret = @include($this->dir['lang'].'PME.lang.EN-US.inc'); |
$ret = @include($this->dir['lang'].'PME.lang.EN.inc'); |
| |
} |
| |
!isset($ret['of']) && $ret['of'] = '/'; |
| |
$small = array( |
| |
'Search' => 'v', |
| |
'Hide' => '^', |
| |
'Clear' => 'X', |
| |
'Query' => htmlspecialchars('>')); |
| |
if ((!$this->nav_text_links() && !$this->nav_graphic_links()) |
| |
|| !isset($ret['Search']) || !isset($ret['Query']) |
| |
|| !isset($ret['Hide']) || !isset($ret['Clear'])) { |
| |
foreach ($small as $key => $val) { |
| |
$ret[$key] = $val; |
| |
} |
| } |
} |
| if (!isset($ret['Search'])) $ret['Search'] = 'v'; |
|
| if (!isset($ret['Hide'])) $ret['Hide'] = '^'; |
|
| if (!isset($ret['Go'])) $ret['Go'] = htmlspecialchars('>'); |
|
| if (!isset($ret['of'])) $ret['of'] = '/'; |
|
| return $ret; |
return $ret; |
| } /* }}} */ |
} /* }}} */ |
| |
|
|
|
| } |
} |
| } |
} |
| $qparts['select'] .= ') AS select_alias_'.$field_num; |
$qparts['select'] .= ') AS select_alias_'.$field_num; |
| $qparts['orderby'] = $desc['orderby']; |
$qparts['orderby'] = empty($desc['orderby']) |
| |
? 'select_alias_'.$field_num : $desc['orderby']; |
| } else { |
} else { |
| $qparts['select'] .= ','.$desc; |
$qparts['select'] .= ','.$desc; |
| $qparts['orderby'] = $desc; |
$qparts['orderby'] = $desc; |
|
|
| } |
} |
| $options = $this->fdd[$k]['options']; |
$options = $this->fdd[$k]['options']; |
| |
|
| return ! isset($options) || |
if (! isset($options)) |
| (! $this->hidden($k) && ( |
return true; |
| |
if ($this->hidden($k)) |
| |
return false; |
| |
|
| |
return |
| ($this->add_operation() && stristr($options, 'A')) || |
($this->add_operation() && stristr($options, 'A')) || |
| ($this->view_operation() && stristr($options, 'V')) || |
($this->view_operation() && stristr($options, 'V')) || |
| ($this->change_operation() && stristr($options, 'C')) || |
($this->change_operation() && stristr($options, 'C')) || |
| ($this->copy_operation() && stristr($options, 'P')) || |
($this->copy_operation() && stristr($options, 'P')) || |
| ($this->delete_operation() && stristr($options, 'D')) || |
($this->delete_operation() && stristr($options, 'D')) || |
| ($this->filter_operation() && stristr($options, 'F')) || |
((stristr($options,'L') |
| (stristr($options,'L') && |
|| ($this->filter_operation() && stristr($options, 'F'))) && |
| ! $this->add_operation() && |
! $this->add_operation() && |
| ! $this->view_operation() && |
! $this->view_operation() && |
| ! $this->change_operation() && |
! $this->change_operation() && |
| ! $this->copy_operation() && |
! $this->copy_operation() && |
| ! $this->delete_operation() && |
! $this->delete_operation()); |
| ! $this->filter_operation()) |
|
| )); |
|
| } /* }}} */ |
} /* }}} */ |
| |
|
| /* |
/* |
|
|
| |
|
| function display_add_record() /* {{{ */ |
function display_add_record() /* {{{ */ |
| { |
{ |
| echo ' <tr>'."\n"; |
if (0) { // XXX: WTF? |
| echo ' <th>Field</th>'."\n"; |
|
| echo ' <th>Value</th>'."\n"; |
|
| if ($this->guidance) |
|
| echo ' <th>Guidance</th>'."\n"; |
|
| echo ' </tr>'."\n"; |
|
| for ($k = 0; $k < $this->num_fds; $k++) { |
|
| echo ' <tr>'."\n"; |
echo ' <tr>'."\n"; |
| |
echo ' <th>Field</th>'."\n"; |
| |
echo ' <th>Value</th>'."\n"; |
| |
if ($this->guidance) |
| |
echo ' <th>Guidance</th>'."\n"; |
| |
echo ' </tr>'."\n"; |
| |
} |
| |
for ($k = 0; $k < $this->num_fds; $k++) { |
| |
echo '<tr>'."\n"; |
| if ($this->displayed[$k]) { |
if ($this->displayed[$k]) { |
| echo ' <td>'.$this->fdd[$k]['name'].'</td>'."\n"; |
echo '<td>'.$this->fdd[$k]['name'].'</td>'."\n"; |
| |
|
| if ($this->fdd[$k]['select'] == 'M') |
if ($this->fdd[$k]['select'] == 'M') |
| { $a = ' multiple size="'.$this->multiple.'"'; } else { $a=''; } |
{ $a = ' multiple size="'.$this->multiple.'"'; } else { $a=''; } |
| if ($this->col_has_values($k)) { |
if ($this->col_has_values($k)) { |
| echo ' <td>' ."\n"; |
echo ' <td>' ."\n"; |
| $vals = isset($this->fdd[$k]['values']['table']) |
$vals = isset($this->fdd[$k]['values']['table']) |
| ? $this->set_values_from_table($k) |
? $this->set_values_from_table($k) |
| : (array) $this->fdd[$k]['values2'] + (array) $this->fdd[$k]['values']; |
: (array) $this->fdd[$k]['values2'] + (array) $this->fdd[$k]['values']; |
| echo $this->htmlSelect($this->fds[$k], $vals, '', $this->col_is_set($k)); |
echo $this->htmlSelect($this->fds[$k], $vals, '', $this->col_is_set($k)); |
| echo ' </td>'."\n"; |
echo '</td>'."\n"; |
| } elseif (isset ($this->fdd[$k]['textarea'])) { |
} elseif (isset ($this->fdd[$k]['textarea'])) { |
| echo ' <td><textarea '; |
echo '<td><textarea '; |
| if (isset ($this->fdd[$k]['textarea']['rows'])) { |
if (isset ($this->fdd[$k]['textarea']['rows'])) { |
| echo 'rows="'.$this->fdd[$k]['textarea']['rows'].'" '; |
echo 'rows="'.$this->fdd[$k]['textarea']['rows'].'" '; |
| } |
} |
|
|
| } |
} |
| echo 'name="'.$this->fds[$k].'" wrap="virtual">'; |
echo 'name="'.$this->fds[$k].'" wrap="virtual">'; |
| echo $this->htmlDisplay( |
echo $this->htmlDisplay( |
| $this->fdd[$k], |
$this->fdd[$k], |
| $this->fdd[$k]['default'], |
$this->fdd[$k]['default'], |
| false, false); |
false, false); |
| echo '</textarea></td>'."\n"; |
echo '</textarea></td>'."\n"; |
| } else { |
} else { |
| // Simple edit box required |
// Simple edit box required |
| $type = $this->fdd[$k]['type']; |
$type = $this->fdd[$k]['type']; |
| echo ' '; |
|
| echo '<td>'; |
echo '<td>'; |
| if ($this->readonly($k)) { |
if ($this->readonly($k)) { |
| echo $this->htmlDisplay($this->fdd[$k],'',false,false) |
echo $this->htmlDisplay($this->fdd[$k],'',false,false) |
|
|
| // string type |
// string type |
| $maxwidth = intval($this->fdd[$k]['maxlen']); |
$maxwidth = intval($this->fdd[$k]['maxlen']); |
| $size = min(60,$maxwidth); |
$size = min(60,$maxwidth); |
| echo '<input type="text" name="'.$this->fds[$k].'" size="'.$size.'" maxwidth="'.$maxwidth.'" value="' |
echo '<input type="text" name="'.$this->fds[$k] |
| .$this->htmlDisplay($this->fdd[$k],$this->fdd[$k]['default'],false,false) |
.'" size="'.$size.'" maxwidth="'.$maxwidth.'" value="' |
| .'" />'; |
.$this->htmlDisplay($this->fdd[$k],$this->fdd[$k]['default'], |
| |
false, false) |
| |
.'" />'; |
| } elseif ($this->col_is_date($k)) { |
} elseif ($this->col_is_date($k)) { |
| // date type, get date components |
// date type, get date components |
| //if ($this->fdd[$k]['default']) |
//if ($this->fdd[$k]['default']) |
|
|
| //echo $this->mdate_disperse($k,$value,true); |
//echo $this->mdate_disperse($k,$value,true); |
| // string type |
// string type |
| $maxwidth = intval($this->fdd[$k]['maxlen']); |
$maxwidth = intval($this->fdd[$k]['maxlen']); |
| $size = min(60,$maxwidth); |
$size = min(60, $maxwidth); |
| echo '<input type="text" name="'.$this->fds[$k].'" size="'.$size.'" maxwidth="'.$maxwidth.'" value="' |
echo '<input type="text" name="'.$this->fds[$k] |
| .$this->htmlDisplay($this->fdd[$k],$this->fdd[$k]['default'],false,false) |
.'" size="'.$size.'" maxwidth="'.$maxwidth.'" value="' |
| |
.$this->htmlDisplay($this->fdd[$k],$this->fdd[$k]['default'], |
| |
false, false) |
| .'" />'; |
.'" />'; |
| } else { |
} else { |
| // unknown type |
// unknown type |
| echo '<input type="text" name="'.$this->fds[$k].'" value="' |
echo '<input type="text" name="'.$this->fds[$k].'" value="' |
| .$this->htmlDisplay($this->fdd[$k],$this->fdd[$k]['default'],false,false) |
.$this->htmlDisplay($this->fdd[$k],$this->fdd[$k]['default'], |
| .'" />'; |
false, false) |
| |
.'" />'; |
| } |
} |
| } |
} |
| echo '</td>'; |
echo '</td>'; |
| } // if elseif else |
} // if elseif else |
| if ($this->guidance) |
if ($this->guidance) { |
| if ($this->fdd[$k]['help']) |
if ($this->fdd[$k]['help']) |
| echo ' <td>'.$this->fdd[$k]['help'].'</td>'."\n"; |
echo '<td>'.$this->fdd[$k]['help'].'</td>'."\n"; |
| else |
} else { |
| echo "<td> </td>\n"; |
echo "<td> </td>\n"; |
| echo ' </tr>'."\n"; |
} |
| |
echo '</tr>'."\n"; |
| } |
} |
| } // for k < this->num_fds |
} // for k < this->num_fds |
| } // display_add_record /* }}} */ |
} // display_add_record /* }}} */ |
|
|
| * 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">'; |
echo '<th colspan='.$sys_cols.' align="center" nowrap width="1%">'; |
| if ($this->filter_enabled()) { |
if ($this->filter_enabled()) { |
| echo '<input type="submit" name="sw" value="' |
if ($this->fl) { |
| .($this->fl ? $this->labels['Hide'] : $this->labels['Search']).'">'; |
echo '<input type=submit name=sw value="'.$this->labels['Hide'].'">'; |
| |
echo '<input type=submit name=sw value="'.$this->labels['Clear'].'"><br>'; |
| |
//echo '<input type=submit name=filter value="'.$this->labels['Query'].'">'; |
| |
} else { |
| |
echo '<input type=submit name=sw value="'.$this->labels['Search'].'">'; |
| |
} |
| } else { |
} else { |
| echo ' '; |
echo ' '; |
| } |
} |
|
|
| } |
} |
| if (isset($this->default_sort_columns)) { |
if (isset($this->default_sort_columns)) { |
| foreach ($this->default_sort_columns as $dsc) { |
foreach ($this->default_sort_columns as $dsc) { |
| if (substr($dsc, 0, 1) == '-') { |
if ($dsc[0] == '-') { |
| $field = substr($dsc, 1); |
$field = substr($dsc, 1); |
| $desc = true; |
$desc = true; |
| } else { |
} else { |
|
|
| echo '<tr>'; |
echo '<tr>'; |
| if ($this->sfn != 0) { |
if ($this->sfn != 0) { |
| echo '<td align="center">'. |
echo '<td align="center">'. |
| '<a class="pme_a_t" href="'.$PHP_SELF.'">Clear</a>'. |
'<a class="pme_a_t" href="'.$PHP_SELF.'">'.$this->labels['Clear'].'</a>'. |
| '</td>'; |
'</td>'; |
| echo '<td colspan="'.($this->num_fields_displayed + $sys_cols - 1).'">Sorted By: '; |
echo '<td colspan="'.($this->num_fields_displayed + $sys_cols - 1).'">Sorted By: '; |
| } else { |
} else { |
|
|
| */ |
*/ |
| |
|
| if ($this->fl) { |
if ($this->fl) { |
| echo '<tr><td colspan='.$sys_cols.' align="center"><input type="submit" name="filter" value="' |
echo '<tr>'; |
| .$this->labels['Go'].'" /></td>'."\n"; |
echo '<td colspan='.$sys_cols.' align="center">'; |
| |
echo '<input type="submit" name="filter" value="' |
| |
.$this->labels['Query'].'" /></td>'."\n"; |
| for ($k = 0; $k < $this->num_fds; $k++) { |
for ($k = 0; $k < $this->num_fds; $k++) { |
| $this->field_name = $this->fds[$k]; |
$this->field_name = $this->fds[$k]; |
| $fd = $this->field_name; |
$fd = $this->field_name; |
|
|
| if ($this->sfn) { |
if ($this->sfn) { |
| echo "?sfn=".($this->sort_asc?'':'-').$this->sfn."&fl=".$this->fl."&fm=".$this->fm; |
echo "?sfn=".($this->sort_asc?'':'-').$this->sfn."&fl=".$this->fl."&fm=".$this->fm; |
| } |
} |
| echo '">Clear</a></td>'; |
echo '">'.$this->labels['Clear'].'</a></td>'; |
| echo '<td colspan="'.$this->num_fields_displayed.'">Current Query: ' |
echo '<td colspan="'.$this->num_fields_displayed.'">Current Query: ' |
| .htmlspecialchars(stripslashes(stripslashes(stripslashes($text_query)))) |
.htmlspecialchars(stripslashes(stripslashes(stripslashes($text_query)))) |
| .'</td></tr>'."\n"; |
.'</td></tr>'."\n"; |
|
|
| $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>'; |
echo '<td nowrap align=center width="1%">'; |
| } |
} |
| if ($this->nav_graphic_links()) { |
if ($this->nav_graphic_links()) { |
| |
$printed_out = false; |
| if ($this->view_enabled()) { |
if ($this->view_enabled()) { |
| |
$printed_out = true; |
| 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="'.htmlspecialchars($this->labels['View']).'"></a> '; |
echo ' height=15 width=16 border=none alt="' |
| |
.htmlspecialchars($this->labels['View']).'"></a>'; |
| } |
} |
| if ($this->change_enabled()) { |
if ($this->change_enabled()) { |
| |
$printed_out && print(' '); |
| |
$printed_out = true; |
| 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="'.htmlspecialchars($this->labels['Change']).'"></a> '; |
echo ' height=15 width=16 border=none alt="' |
| |
.htmlspecialchars($this->labels['Change']).'"></a>'; |
| } |
} |
| if ($this->copy_enabled()) { |
if ($this->copy_enabled()) { |
| |
$printed_out && print(' '); |
| |
$printed_out = true; |
| 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="'.htmlspecialchars($this->labels['Copy']).'"></a> '; |
echo ' height=15 width=16 border=none alt="' |
| |
.htmlspecialchars($this->labels['Copy']).'"></a>'; |
| } |
} |
| if ($this->delete_enabled()) { |
if ($this->delete_enabled()) { |
| |
$printed_out && print(' '); |
| |
$printed_out = true; |
| 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="'.htmlspecialchars($this->labels['Delete']).'"></a> '; |
echo ' height=15 width=16 border=none alt="' |
| |
.htmlspecialchars($this->labels['Delete']).'"></a>'; |
| } |
} |
| } |
} |
| if ($this->nav_text_links()) { |
if ($this->nav_text_links()) { |
| if ($this->nav_graphic_links()) { |
if ($this->nav_graphic_links()) { |
| echo '<br>'; |
echo '<br>'; |
| } |
} |
| if ($this->view_enabled()) |
$printed_out = false; |
| echo '<a class="pme_a_t" href="'.htmlspecialchars($this->page_name.$qviewStr).'">V</a> '; |
if ($this->view_enabled()) { |
| if ($this->change_enabled()) |
$printed_out = true; |
| echo '<a class="pme_a_t" href="'.htmlspecialchars($this->page_name.$qchangeStr).'">C</a> '; |
echo '<a class="pme_a_t" href="' |
| if ($this->copy_enabled()) |
.htmlspecialchars($this->page_name.$qviewStr).'">V</a> '; |
| echo '<a class="pme_a_t" href="'.htmlspecialchars($this->page_name.$qcopyStr).'">P</a> '; |
} |
| if ($this->delete_enabled()) |
if ($this->change_enabled()) { |
| echo '<a class="pme_a_t" href="'.htmlspecialchars($this->page_name.$qdeleteStr).'">D</a>'; |
$printed_out && print(' '); |
| |
$printed_out = true; |
| |
echo '<a class="pme_a_t" href="' |
| |
.htmlspecialchars($this->page_name.$qchangeStr).'">C</a> '; |
| |
} |
| |
if ($this->copy_enabled()) { |
| |
$printed_out && print(' '); |
| |
$printed_out = true; |
| |
echo '<a class="pme_a_t" href="' |
| |
.htmlspecialchars($this->page_name.$qcopyStr).'">P</a> '; |
| |
} |
| |
if ($this->delete_enabled()) { |
| |
$printed_out && print(' '); |
| |
$printed_out = true; |
| |
echo '<a class="pme_a_t" href="' |
| |
.htmlspecialchars($this->page_name.$qdeleteStr).'">D</a>'; |
| |
} |
| } |
} |
| if (! $this->nav_buttons() || $sys_cols > 1) { |
if (! $this->nav_buttons() || $sys_cols > 1) { |
| echo '</td>'."\n"; |
echo '</td>'."\n"; |
| } |
} |
| if ($this->nav_buttons()) { |
if ($this->nav_buttons()) { |
| echo '<td NOWRAP align=center>'; |
echo '<td nowrap 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'; |
| $first = false; |
$first = false; |
| } |
} |
| echo ' />'; |
echo '></td>'."\n"; |
| echo '</td>'."\n"; |
|
| } |
} |
| } elseif ($this->filter_enabled()) { |
} elseif ($this->filter_enabled()) { |
| echo '<td colspan='.$sys_cols.'> </td>'."\n"; |
echo '<td colspan='.$sys_cols.'> </td>'."\n"; |
|
|
| if ($colattrs != '') |
if ($colattrs != '') |
| $colattrs = ' '.$colattrs; |
$colattrs = ' '.$colattrs; |
| if ($this->fdd[$fd]['nowrap']) |
if ($this->fdd[$fd]['nowrap']) |
| $colattrs .= ' NOWRAP'; |
$colattrs .= ' nowrap'; |
| if (isset($this->fdd[$fd]['width'])) { |
if (isset($this->fdd[$fd]['width'])) { |
| $colattrs .= ' width="'.$this->fdd[$fd]['width'].'"'; |
$colattrs .= ' width="'.$this->fdd[$fd]['width'].'"'; |
| } |
} |
|
|
| // ); |
// ); |
| //echo $row[$k]; |
//echo $row[$k]; |
| // it's a normal field |
// it's a normal field |
| |
$shortdisp = $row["qf$k"]; |
| |
if ($this->fdd[$k]['strip_tags']) { |
| |
$shortdisp = strip_tags($shortdisp); |
| |
} |
| if (isset($this->fdd[$k]['trimlen']) |
if (isset($this->fdd[$k]['trimlen']) |
| && strlen($row["qf$k"]) > $this->fdd[$k]['trimlen']) { |
&& strlen($shortdisp) > $this->fdd[$k]['trimlen']) { |
| $shortdisp = ereg_replace("[\r\n\t ]+", ' ', $row["qf$k"]); |
$shortdisp = ereg_replace("[\r\n\t ]+", ' ', $shortdisp); |
| $shortdisp = substr($shortdisp,0,$this->fdd[$k]['trimlen']-3).'...'; |
$shortdisp = substr($shortdisp,0,$this->fdd[$k]['trimlen']-3).'...'; |
| } else { |
|
| $shortdisp = $row["qf$k"]; |
|
| } |
} |
| echo nl2br($this->htmlDisplay($this->fdd[$k], $shortdisp)); |
echo nl2br($this->htmlDisplay($this->fdd[$k], $shortdisp)); |
| } else { |
} else { |
|
|
| !isset($shortdisp) && $shortdisp = ''; |
!isset($shortdisp) && $shortdisp = ''; |
| echo $shortdisp; |
echo $shortdisp; |
| } else { |
} else { |
| |
$shortdisp = $row["qf$k"]; |
| |
if ($this->fdd[$k]['strip_tags']) { |
| |
$shortdisp = strip_tags($shortdisp); |
| |
} |
| if (isset($this->fdd[$k]['trimlen']) |
if (isset($this->fdd[$k]['trimlen']) |
| && strlen($row["qf$k"]) > $this->fdd[$k]['trimlen']) { |
&& strlen($shortdisp) > $this->fdd[$k]['trimlen']) { |
| $shortdisp = ereg_replace("[\r\n\t ]+",' ',$row["qf$k"]); |
$shortdisp = ereg_replace("[\r\n\t ]+",' ',$shortdisp); |
| $shortdisp = substr($shortdisp,0,$this->fdd[$k]['trimlen']-3).'...'; |
$shortdisp = substr($shortdisp,0,$this->fdd[$k]['trimlen']-3).'...'; |
| } else { |
|
| $shortdisp = $row["qf$k"]; |
|
| } |
} |
| echo nl2br($this->htmlDisplay($this->fdd[$k], $shortdisp)); |
echo nl2br($this->htmlDisplay($this->fdd[$k], $shortdisp)); |
| } |
} |
| Line 2634 echo '<h5>'.mysql_affected_rows ().' '.$ |
|
| Line 2691 echo '<h5>'.mysql_affected_rows ().' '.$ |
|
| /* |
/* |
| * Instance class variables |
* Instance class variables |
| */ |
*/ |
| $this->hn = $opts['hn']; |
$this->hn = $opts['hn']; |
| $this->hn = $opts['hn']; |
$this->hn = $opts['hn']; |
| $this->un = $opts['un']; |
$this->un = $opts['un']; |
| $this->pw = $opts['pw']; |
$this->pw = $opts['pw']; |
| $this->db = $opts['db']; |
$this->db = $opts['db']; |
| $this->tb = $opts['tb']; |
$this->tb = $opts['tb']; |
| $this->key = $opts['key']; |
$this->key = $opts['key']; |
| $this->key_type = $opts['key_type']; |
$this->key_type = $opts['key_type']; |
| $this->inc = $opts['inc']; |
$this->inc = $opts['inc']; |
| $this->options = $opts['options']; |
$this->options = $opts['options']; |
| $this->fdd = $opts['fdd']; |
$this->fdd = $opts['fdd']; |
| $this->multiple = intval($opts['multiple']); |
$this->multiple = intval($opts['multiple']); |
| $this->multiple <= 0 && $this->multiple = 2; |
$this->multiple <= 0 && $this->multiple = 2; |
| $this->display = $opts['display']; |
$this->display = $opts['display']; |
| if ($opts['language']) { |
$this->filters = $opts['filters']; |
| $this->labels = $this->make_language_labels($opts['language']); |
$this->triggers = $opts['triggers']; |
| } else { |
$this->logtable = $opts['logtable']; |
| $this->labels = $this->make_language_labels($HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE']); |
|
| } |
|
| $this->filters = $opts['filters']; |
|
| $this->default_sort_columns = $opts['default_sort_columns']; |
|
| $this->triggers = $opts['triggers']; |
|
| $this->logtable = $opts['logtable']; |
|
| |
|
| $this->page_name = $this->tb; |
$this->page_name = $this->tb; |
| $opts['page_name'] && $this->page_name = $opts['page_name']; |
$opts['page_name'] && $this->page_name = $opts['page_name']; |
| |
$this->default_sort_columns = $opts['default_sort_columns']; |
| |
|
| // alternate row background colors |
// alternate row background colors |
| /* What's this?! |
/* What's this?! |
| Line 2690 echo '<h5>'.mysql_affected_rows ().' '.$ |
|
| Line 2741 echo '<h5>'.mysql_affected_rows ().' '.$ |
|
| $this->navigation .= 'D'; // down position is default |
$this->navigation .= 'D'; // down position is default |
| } |
} |
| |
|
| |
// language labels (must go after navigation) |
| |
$this->labels = $this->make_language_labels($opts['language'] |
| |
? $opts['language'] : $HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE']); |
| |
|
| // CGI variables |
// CGI variables |
| $this->cgi['append'] = $opts['cgi']['append']; |
$this->cgi['append'] = $opts['cgi']['append']; |
| $this->cgi['overwrite'] = $opts['cgi']['overwrite']; |
$this->cgi['overwrite'] = $opts['cgi']['overwrite']; |
| Line 2729 echo '<h5>'.mysql_affected_rows ().' '.$ |
|
| Line 2784 echo '<h5>'.mysql_affected_rows ().' '.$ |
|
| if (isset($this->sw)) { |
if (isset($this->sw)) { |
| $this->sw == $this->labels['Search'] && $this->fl = 1; |
$this->sw == $this->labels['Search'] && $this->fl = 1; |
| $this->sw == $this->labels['Hide'] && $this->fl = 0; |
$this->sw == $this->labels['Hide'] && $this->fl = 0; |
| |
$this->sw == $this->labels['Clear'] && $this->fl = 0; |
| } |
} |
| |
|
| /* |
/* |
| Line 2799 echo '<h5>'.mysql_affected_rows ().' '.$ |
|
| Line 2855 echo '<h5>'.mysql_affected_rows ().' '.$ |
|
| $this->key_num = array_search($this->key, $this->fds); |
$this->key_num = array_search($this->key, $this->fds); |
| |
|
| /* |
/* |
| |
* Clear action |
| |
*/ |
| |
if ($this->sw == $this->labels['Clear']) { |
| |
for ($k = 0; $k < $this->num_fds; $k++) { |
| |
$this->cgi['overwrite']["qf$k"] = ''; |
| |
$this->cgi['overwrite']["qf$k".'_comp'] = ''; |
| |
} |
| |
} |
| |
|
| |
/* |
| * Constants |
* Constants |
| */ |
*/ |
| |
|