| version 1.11, 2002/09/29 03:36:53 |
version 1.12, 2002/09/29 17:11:30 |
|
|
| echo ' <tr>'."\n"; |
echo ' <tr>'."\n"; |
| |
|
| /* |
/* |
| * we need an initial column if we have filters, |
* System (navigation, selection) columns counting |
| * or Changes or Deletes enabled |
|
| */ |
*/ |
| if ($this->filter_enabled () or $select_recs) { |
$sys_cols = 0; |
| |
$sys_cols += intval($this->filter_enabled() || $select_recs); |
| |
if ($sys_cols > 0) { |
| |
$sys_cols += intval($this->nav_buttons() |
| |
&& ($this->nav_text_links() || $this->nav_graphic_links())); |
| |
} |
| |
|
| |
/* |
| |
* We need an initial column(s) (sys columns) |
| |
* if we have filters, Changes or Deletes enabled |
| |
*/ |
| |
if ($sys_cols) { |
| |
echo '<th colspan='.$sys_cols.' align="center">'; |
| if ($this->filter_enabled ()) { |
if ($this->filter_enabled ()) { |
| if ($this->fl) { |
echo '<input type="submit" name="sw" value="' |
| echo '<th align="center"><input type="submit" name="sw" value="'.$this->labels['Hide'].'"></th>'."\n"; |
.($this->fl ? $this->labels['Hide'] : $this->labels['Search']).'">'; |
| } else { |
|
| echo '<th align="center"><input type="submit" name="sw" value="'.$this->labels['Search'].'"></th>'."\n"; |
|
| } |
|
| } else { |
} else { |
| echo '<th align="center"> </th>'."\n"; |
echo ' '; |
| } |
} |
| |
echo '</th>'."\n"; |
| } |
} |
| |
|
| for ($k = 0; $k < $this->num_fds; $k++) { |
for ($k = 0; $k < $this->num_fds; $k++) { |
|
|
| } |
} |
| if ($this->fdd[$fd]['sort']) { |
if ($this->fdd[$fd]['sort']) { |
| // clicking on the current sort field reverses the sort order |
// clicking on the current sort field reverses the sort order |
| echo ' <th'.$w.'><a href="'.$this->page_name.'?fm=0&fl='.$this->fl.'&sfn='; |
echo '<th'.$w.'><a href="'.$this->page_name.'?fm=0&fl='.$this->fl.'&sfn='; |
| if ($this->sfn == $k) { |
if ($this->sfn == $k) { |
| // reverse the sort order sign |
// reverse the sort order sign |
| echo ($this->sort_asc?'-':''); |
echo ($this->sort_asc?'-':''); |
| } |
} |
| echo $k.$this->qfn.'">'.$fdn.'</a></th>'."\n"; |
echo $k.$this->qfn.'">'.$fdn.'</a></th>'."\n"; |
| } else { |
} else { |
| echo ' <th'.$w.'>'.$fdn.'</th>'."\n"; |
echo '<th'.$w.'>'.$fdn.'</th>'."\n"; |
| } |
} |
| } // if |
} // if |
| |
|
|
|
| } |
} |
| } // for |
} // for |
| |
|
| echo ' </tr>'."\n"; |
echo '</tr>'."\n"; |
| |
|
| |
|
| /* |
/* |
|
|
| $qparts['limit'] = $this->fm.','.$this->inc; |
$qparts['limit'] = $this->fm.','.$this->inc; |
| } |
} |
| |
|
| if ($qparts['orderby'] && $this->display_sort) { |
if ($qparts['orderby'] && $this->display['sort']) { |
| // XXX this doesn't preserve filters |
// XXX this doesn't preserve filters |
| |
echo '<tr>'; |
| if ($this->sfn != 0) { |
if ($this->sfn != 0) { |
| echo ' <tr><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.'">Clear</a>'. |
| '</td>'; |
'</td>'; |
| echo '<td colspan="'.($this->num_fields_displayed+1).'">Sorted By: '; |
echo '<td colspan="'.($this->num_fields_displayed + $sys_cols - 1).'">Sorted By: '; |
| } else { |
} else { |
| echo '<td colspan="'.($this->num_fields_displayed+2).'">Default Sort Order: '; |
echo '<td colspan="'.($this->num_fields_displayed + $sys_cols).'">Default Sort Order: '; |
| } |
} |
| echo join(', ',$sort_fields_w); |
echo join(', ',$sort_fields_w); |
| echo "</td></tr>\n"; |
echo '</td></tr>'."\n"; |
| } |
} |
| |
|
| /* |
/* |
| |
* FILTER |
| |
* |
| * 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. |
| */ |
*/ |
| |
|
| if ($this->fl) { |
if ($this->fl) { |
| echo ' <td align="center"><input type="submit" name="filter" value="' |
echo '<tr><td colspan='.$sys_cols.' align="center"><input type="submit" name="filter" value="' |
| .$this->labels['Go'].'" /></td>'."\n"; |
.$this->labels['Go'].'" /></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]; |
|
|
| |
|
| $opened = false; |
$opened = false; |
| if ( $this->displayed($k) ) { |
if ( $this->displayed($k) ) { |
| echo ' <td '.$widthStyle.'>'; |
echo '<td '.$widthStyle.'>'; |
| $opened = true; |
$opened = true; |
| } |
} |
| |
|
|
|
| */ |
*/ |
| echo '</td>'."\n"; |
echo '</td>'."\n"; |
| } else { |
} else { |
| echo ' <td> </td>'."\n"; |
echo '<td> </td>'."\n"; |
| } // if elseif else |
} // if elseif else |
| |
|
| } // end if bro1 |
} // end if bro1 |
| } // for |
} // for |
| echo ' </tr>'."\n"; |
echo '</tr>'."\n"; |
| } // if first and fl |
} // if first and fl |
| |
|
| /* |
/* |
| * display the current query |
* Display the current query |
| */ |
*/ |
| $text_query = $this->make_text_where_from_query_opts(); |
$text_query = $this->make_text_where_from_query_opts(); |
| if ($text_query != '' && $this->display_query) { |
if ($text_query != '' && $this->display['query']) { |
| echo '<tr><td align="center">'. |
echo '<tr><td colspan='.$sys_cols.' align="center">'. |
| '<a class="pme_a_t" href="'.$PHP_SELF; |
'<a class="pme_a_t" href="'.$PHP_SELF; |
| 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>'. |
echo '">Clear</a>'. |
| '</td>'; |
'</td>'; |
| echo '<td colspan="'.$this->num_fds.'">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"; |
| } |
} |
|
|
| } |
} |
| |
|
| while ($row = mysql_fetch_array ($res)) { |
while ($row = mysql_fetch_array ($res)) { |
| $key_rec = $row[$this->key_num]; |
echo '<tr class="'.(($rowCount++%2)?'pme_tr_o':'pme_tr_e')."\">\n"; |
| $qviewStr = $qpviewStr .'&rec='.$key_rec; |
if ($sys_cols) { |
| $qcopyStr = $qpcopyStr .'&rec='.$key_rec; |
$key_rec = $row[$this->key_num]; |
| $qchangeStr = $qpchangeStr.'&rec='.$key_rec; |
$qviewStr = $qpviewStr .'&rec='.$key_rec; |
| $qdeleteStr = $qpdeleteStr.'&rec='.$key_rec; |
$qcopyStr = $qpcopyStr .'&rec='.$key_rec; |
| echo ' <tr class="'.(($rowCount++%2)?'pme_tr_o':'pme_tr_e')."\">\n"; |
$qchangeStr = $qpchangeStr.'&rec='.$key_rec; |
| echo ' <td NOWRAP align=center>'; |
$qdeleteStr = $qpdeleteStr.'&rec='.$key_rec; |
| if ($select_recs) { |
if ($select_recs) { |
| if ($this->nav_buttons()) { |
if (! $this->nav_buttons() || $sys_cols > 1) { |
| echo '<input type="radio" name="rec" value="'.$row[$this->key_num].'"'; |
echo '<td NOWRAP align=center>'; |
| if ($first) { |
|
| echo ' checked'; |
|
| $first = false; |
|
| } |
|
| echo ' />'; |
|
| } |
|
| if ($this->nav_graphic_links()) { |
|
| if ($this->view_enabled()) { |
|
| echo '<a class="pme_a_t" href="'; |
|
| echo htmlspecialchars($this->page_name.$qviewStr); |
|
| echo '"><img src="'.$this->url['images'].'pme-view.png"'; |
|
| echo ' height=15 width=16 border=none alt="'.htmlspecialchars($this->labels['View']).'"></a> '; |
|
| } |
|
| if ($this->change_enabled()) { |
|
| echo '<a class="pme_a_t" href="'; |
|
| echo htmlspecialchars($this->page_name.$qchangeStr); |
|
| echo '"><img src="'.$this->url['images'].'pme-change.png"'; |
|
| echo ' height=15 width=16 border=none alt="'.htmlspecialchars($this->labels['Change']).'"></a> '; |
|
| } |
|
| if ($this->copy_enabled()) { |
|
| echo '<a class="pme_a_t" href="'; |
|
| echo htmlspecialchars($this->page_name.$qcopyStr); |
|
| echo '"><img src="'.$this->url['images'].'pme-copy.png"'; |
|
| echo ' height=15 width=16 border=none alt="'.htmlspecialchars($this->labels['Copy']).'"></a> '; |
|
| } |
|
| if ($this->delete_enabled()) { |
|
| echo '<a class="pme_a_t" href="'; |
|
| echo htmlspecialchars($this->page_name.$qdeleteStr); |
|
| echo '"><img src="'.$this->url['images'].'pme-delete.png"'; |
|
| echo ' height=15 width=16 border=none alt="'.htmlspecialchars($this->labels['Delete']).'"></a> '; |
|
| } |
} |
| } |
|
| if ($this->nav_text_links()) { |
|
| if ($this->nav_graphic_links()) { |
if ($this->nav_graphic_links()) { |
| echo '<br>'; |
if ($this->view_enabled()) { |
| |
echo '<a class="pme_a_t" href="'; |
| |
echo htmlspecialchars($this->page_name.$qviewStr); |
| |
echo '"><img src="'.$this->url['images'].'pme-view.png"'; |
| |
echo ' height=15 width=16 border=none alt="'.htmlspecialchars($this->labels['View']).'"></a> '; |
| |
} |
| |
if ($this->change_enabled()) { |
| |
echo '<a class="pme_a_t" href="'; |
| |
echo htmlspecialchars($this->page_name.$qchangeStr); |
| |
echo '"><img src="'.$this->url['images'].'pme-change.png"'; |
| |
echo ' height=15 width=16 border=none alt="'.htmlspecialchars($this->labels['Change']).'"></a> '; |
| |
} |
| |
if ($this->copy_enabled()) { |
| |
echo '<a class="pme_a_t" href="'; |
| |
echo htmlspecialchars($this->page_name.$qcopyStr); |
| |
echo '"><img src="'.$this->url['images'].'pme-copy.png"'; |
| |
echo ' height=15 width=16 border=none alt="'.htmlspecialchars($this->labels['Copy']).'"></a> '; |
| |
} |
| |
if ($this->delete_enabled()) { |
| |
echo '<a class="pme_a_t" href="'; |
| |
echo htmlspecialchars($this->page_name.$qdeleteStr); |
| |
echo '"><img src="'.$this->url['images'].'pme-delete.png"'; |
| |
echo ' height=15 width=16 border=none alt="'.htmlspecialchars($this->labels['Delete']).'"></a> '; |
| |
} |
| |
} |
| |
if ($this->nav_text_links()) { |
| |
if ($this->nav_graphic_links()) { |
| |
echo '<br>'; |
| |
} |
| |
if ($this->view_enabled()) |
| |
echo '<a class="pme_a_t" href="'.htmlspecialchars($this->page_name.$qviewStr).'">V</a> '; |
| |
if ($this->change_enabled()) |
| |
echo '<a class="pme_a_t" href="'.htmlspecialchars($this->page_name.$qchangeStr).'">C</a> '; |
| |
if ($this->copy_enabled()) |
| |
echo '<a class="pme_a_t" href="'.htmlspecialchars($this->page_name.$qcopyStr).'">P</a> '; |
| |
if ($this->delete_enabled()) |
| |
echo '<a class="pme_a_t" href="'.htmlspecialchars($this->page_name.$qdeleteStr).'">D</a>'; |
| |
} |
| |
if (! $this->nav_buttons() || $sys_cols > 1) { |
| |
echo '</td>'."\n"; |
| |
} |
| |
if ($this->nav_buttons()) { |
| |
echo '<td NOWRAP align=center>'; |
| |
echo '<input type="radio" name="rec" value="'.$row[$this->key_num].'"'; |
| |
if ($first) { |
| |
echo ' checked'; |
| |
$first = false; |
| |
} |
| |
echo ' />'; |
| |
echo '</td>'."\n"; |
| } |
} |
| if ($this->view_enabled()) |
} elseif ($this->filter_enabled()) { |
| echo '<a class="pme_a_t" href="'.htmlspecialchars($this->page_name.$qviewStr).'">V</a> '; |
echo '<td colspan='.$sys_cols.'> </td>'."\n"; |
| if ($this->change_enabled()) |
|
| echo '<a class="pme_a_t" href="'.htmlspecialchars($this->page_name.$qchangeStr).'">U</a> '; |
|
| if ($this->copy_enabled()) |
|
| echo '<a class="pme_a_t" href="'.htmlspecialchars($this->page_name.$qcopyStr).'">C</a> '; |
|
| if ($this->delete_enabled()) |
|
| echo '<a class="pme_a_t" href="'.htmlspecialchars($this->page_name.$qdeleteStr).'">D</a>'; |
|
| } |
} |
| } elseif ($this->filter_enabled()) { |
|
| echo ' '; |
|
| } |
} |
| echo '</td>'."\n"; |
|
| |
|
| // calculate the url query string for optional URL support |
// calculate the url query string for optional URL support |
| $urlqueryproto = 'fm='.$this->fm.'&sfn='.($this->sort_asc?'':'-').$this->sfn.'&'.'fl='.$this->fl.'&qfn='.$this->qfn; |
$urlqueryproto = 'fm='.$this->fm.'&sfn='.($this->sort_asc?'':'-') |
| |
.$this->sfn.'&'.'fl='.$this->fl.'&qfn='.$this->qfn; |
| for ($k = 0; $k < $this->num_fds; $k++) { |
for ($k = 0; $k < $this->num_fds; $k++) { |
| $fd = $this->fds[$k]; |
$fd = $this->fds[$k]; |
| if ($this->hidden($k) || $this->password($k)) { |
if ($this->hidden($k) || $this->password($k)) { |
|
|
| $urlstr = eval('return "'.$urlquery.'";'); |
$urlstr = eval('return "'.$urlquery.'";'); |
| //debug_var('urlstr',$urlstr); |
//debug_var('urlstr',$urlstr); |
| $urllink = eval('return "'.$this->fdd[$k]['URL'].'";'); |
$urllink = eval('return "'.$this->fdd[$k]['URL'].'";'); |
| |
// TODO: document this, is is undocumented |
| $urldisp = isset($this->fdd[$k]['URLdisp']) |
$urldisp = isset($this->fdd[$k]['URLdisp']) |
| ? eval('return "'.$this->fdd[$k]['URLdisp'].'";') |
? eval('return "'.$this->fdd[$k]['URLdisp'].'";') |
| : $value; |
: $value; |
| Line 2624 echo '<h5>'.mysql_affected_rows ().' '.$ |
|
| Line 2646 echo '<h5>'.mysql_affected_rows ().' '.$ |
|
| |
|
| //phpinfo(); |
//phpinfo(); |
| global $timer; |
global $timer; |
| if ($timer) { |
if ($this->display['time'] && $timer) { |
| echo $timer->end(); |
echo $timer->end(); |
| } |
} |
| } /* }}} */ |
} /* }}} */ |
| Line 2666 echo '<h5>'.mysql_affected_rows ().' '.$ |
|
| Line 2688 echo '<h5>'.mysql_affected_rows ().' '.$ |
|
| if ($this->multiple <= 0) { |
if ($this->multiple <= 0) { |
| $this->multiple = 2; |
$this->multiple = 2; |
| } |
} |
| $this->display_sort = $opts['display_sort']; |
$this->display = $opts['display']; |
| $this->display_query = $opts['display_query']; |
|
| if ($opts['language']) { |
if ($opts['language']) { |
| $this->labels = $this->make_language_labels($opts['language']); |
$this->labels = $this->make_language_labels($opts['language']); |
| } else { |
} else { |
| Line 2812 $this->months_long = array( |
|
| Line 2833 $this->months_long = array( |
|
| 'October'=>10,'November'=>11,'December'=>12); |
'October'=>10,'November'=>11,'December'=>12); |
| $this->months_long_keys = array_keys($this->months_long); |
$this->months_long_keys = array_keys($this->months_long); |
| |
|
| |
/* If you are phpMyEdit developer, set this to 1. |
| |
You can also hide some new unfinished and/or untested features under |
| |
if ($this->development) { new_feature(); } statement. |
| |
|
| |
Also note, that this is currently unused. */ |
| |
$this->development = 0; |
| |
|
| // Call to Action |
// Call to Action |
| // Moved this from the setup.php generated file to here |
// Moved this from the setup.php generated file to here |