| version 1.10, 2002/09/25 18:06:20 |
version 1.11, 2002/09/29 03:36:53 |
|
|
| var $fds; // sql field names |
var $fds; // sql field names |
| var $num_fds; // number of fields |
var $num_fds; // number of fields |
| |
|
| var $logtable; // name of optional logtable |
var $logtable; // name of optional logtable |
| |
var $navigation; // navigation style |
| |
|
| function myquery($qry, $line = 0) /* {{{ */ |
function myquery($qry, $line = 0) /* {{{ */ |
| { |
{ |
|
|
| function col_is_set($k) { return $this->fdd[$k]['type'] == 'set'; } |
function col_is_set($k) { return $this->fdd[$k]['type'] == 'set'; } |
| |
|
| /* |
/* |
| |
* functions for indicating whether navigation style is enabled |
| |
*/ |
| |
|
| |
function nav_buttons() { return stristr($this->navigation, 'B'); } |
| |
function nav_text_links() { return stristr($this->navigation, 'T'); } |
| |
function nav_graphic_links() { return stristr($this->navigation, 'G'); } |
| |
function nav_up() { return stristr($this->navigation, 'U'); } |
| |
function nav_down() { return stristr($this->navigation, 'D'); } |
| |
|
| |
/* |
| * functions for indicating whether operations are enabled |
* functions for indicating whether operations are enabled |
| */ |
*/ |
| |
|
|
|
| echo '<input type="submit" name="operation" value="'.$this->labels['Add'].'"> '; |
echo '<input type="submit" name="operation" value="'.$this->labels['Add'].'"> '; |
| } |
} |
| |
|
| if ($this->actionStyle == 'button') { |
if ($this->nav_buttons()) { |
| if ($this->view_enabled()) { |
if ($this->view_enabled()) { |
| echo '<input'; |
echo '<input'; |
| if (! $total_recs) { echo ' disabled'; } |
if (! $total_recs) { echo ' disabled'; } |
|
|
| $row = mysql_fetch_row($res); |
$row = mysql_fetch_row($res); |
| $total_recs = $row[0]; |
$total_recs = $row[0]; |
| |
|
| $this->display_list_table_buttons($total_recs); |
if ($this->nav_up()) { |
| echo '<hr>'."\n"; |
$this->display_list_table_buttons($total_recs); |
| |
echo '<hr>'."\n"; |
| |
} |
| |
|
| // if the filter input boxes are not displayed, we need to preserve the filter |
// if the filter input boxes are not displayed, we need to preserve the filter |
| if (!$this->fl) { |
if (!$this->fl) { |
|
|
| $first = true; |
$first = true; |
| $rowCount = 0; |
$rowCount = 0; |
| |
|
| if ($this->actionStyle == 'link' || $this->actionStyle == 'graphic') { |
if ($this->nav_text_links() || $this->nav_graphic_links()) { |
| // gather query & GET options to preserve for Update/Delete links |
// gather query & GET options to preserve for Update/Delete links |
| $qstrparts = array(); |
$qstrparts = array(); |
| if (count($this->qo) > 0) { |
if (count($this->qo) > 0) { |
|
|
| echo ' <tr class="'.(($rowCount++%2)?'pme_tr_o':'pme_tr_e')."\">\n"; |
echo ' <tr class="'.(($rowCount++%2)?'pme_tr_o':'pme_tr_e')."\">\n"; |
| echo ' <td NOWRAP align=center>'; |
echo ' <td NOWRAP align=center>'; |
| if ($select_recs) { |
if ($select_recs) { |
| if ($this->actionStyle == 'button') { |
if ($this->nav_buttons()) { |
| echo '<input type="radio" name="rec" value="'.$row[$this->key_num].'"'; |
echo '<input type="radio" name="rec" value="'.$row[$this->key_num].'"'; |
| if ($first) { |
if ($first) { |
| echo ' checked'; |
echo ' checked'; |
| $first = false; |
$first = false; |
| } |
} |
| echo ' />'; |
echo ' />'; |
| } elseif ($this->actionStyle == 'graphic') { |
} |
| |
if ($this->nav_graphic_links()) { |
| if ($this->view_enabled()) { |
if ($this->view_enabled()) { |
| 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-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> '; |
| } |
} |
| } else { |
} |
| |
if ($this->nav_text_links()) { |
| |
if ($this->nav_graphic_links()) { |
| |
echo '<br>'; |
| |
} |
| if ($this->view_enabled()) |
if ($this->view_enabled()) |
| echo '<a class="pme_a_t" href="'.htmlspecialchars($this->page_name.$qviewStr).'">V</a> '; |
echo '<a class="pme_a_t" href="'.htmlspecialchars($this->page_name.$qviewStr).'">V</a> '; |
| if ($this->change_enabled()) |
if ($this->change_enabled()) |
|
|
| echo ' </table>'."\n"; // end of table rows listing |
echo ' </table>'."\n"; // end of table rows listing |
| |
|
| |
|
| //display buttons at bottom of page - sparky |
if ($this->nav_down()) { |
| echo '<hr>'."\n"; |
//display buttons at bottom of page - sparky |
| $this->display_list_table_buttons($total_recs); |
echo '<hr>'."\n"; |
| |
$this->display_list_table_buttons($total_recs); |
| |
} |
| |
|
| echo '</form>'."\n"; |
echo '</form>'."\n"; |
| //phpinfo(); |
//phpinfo(); |
|
|
| { |
{ |
| $this->create_javascripts(); |
$this->create_javascripts(); |
| |
|
| //sparky |
if ($this->nav_up()) { |
| //display buttons at top of page - sparky |
//display buttons at top of page - sparky |
| $this->display_record_buttons (); |
$this->display_record_buttons (); |
| echo " <hr />\n"; |
echo " <hr />\n"; |
| |
} |
| |
|
| echo '<table width="100%" border="1" cellpadding="1" cellspacing="0" summary="'.$this->tb.'">'."\n"; |
echo '<table width="100%" border="1" cellpadding="1" cellspacing="0" summary="'.$this->tb.'">'."\n"; |
| echo ' <input type="hidden" name="rec" value="'.($this->copy_operation()?'':$this->rec).'" />'."\n"; |
echo ' <input type="hidden" name="rec" value="'.($this->copy_operation()?'':$this->rec).'" />'."\n"; |
|
|
| |
|
| echo '</table>'."\n"; |
echo '</table>'."\n"; |
| |
|
| //display buttons at bottom of page - sparky |
if ($this->nav_down()) { |
| echo " <hr />\n"; |
//display buttons at bottom of page - sparky |
| $this->display_record_buttons (); |
echo " <hr />\n"; |
| |
$this->display_record_buttons (); |
| |
} |
| |
|
| echo '</form>'."\n"; |
echo '</form>'."\n"; |
| |
|
| Line 2677 echo '<h5>'.mysql_affected_rows ().' '.$ |
|
| Line 2700 echo '<h5>'.mysql_affected_rows ().' '.$ |
|
| $this->notify = $opts['notify']; |
$this->notify = $opts['notify']; |
| } |
} |
| |
|
| // whether to display 'Add', 'Update', 'Delete' buttons or to put |
// navigation |
| // hyperlinks next to the rows |
$this->navigation = $opts['navigation']; |
| $this->actionStyle = 'button'; |
if (! $this->nav_buttons() && ! $this->nav_text_links() && ! $this->nav_graphic_links()) { |
| if (isset($opts['actionStyle']) && $opts['actionStyle'] == 'link') { |
$this->navigation .= 'B'; // buttons are default |
| $this->actionStyle = 'link'; |
} |
| } elseif (isset($opts['actionStyle']) && $opts['actionStyle'] == 'graphic') { |
if (! $this->nav_up() && ! $this->nav_down()) { |
| $this->actionStyle = 'graphic'; |
$this->navigation .= 'D'; // down position is default |
| } |
} |
| |
|
| /* |
/* |
| * Find the URL to post forms |
* Find the URL to post forms |
| */ |
*/ |