Ignore:
Timestamp:
Nov 14, 2005 6:22:44 AM (19 years ago)
Author:
scdev
Message:

Rebuilt the services/admins.php script and templates. Fixes since v2 conversion. Lots of bugs and more to come!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/services/templates/admin_list.ihtml

    r18 r19  
    22<?php $fv->printErrorMessages(); ?>
    33<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
    4 <?php $carry_queries = array('search_query', 'filter_admin_priv'); ?>
     4<?php $carry_queries = array('search_query', 'filter_admin_user_type'); ?>
    55<?php App::printHiddenSession(false); ?>
    66<div id="commandbox">
     
    88    <br />
    99   
    10     <input type="text" class="forminputtext" size="20" name="search_query" value="<?php echo getFormData('search_query'); ?>" title="<?php echo oTxt(_("Fields searched: username, first & last name, phone, email, county.")); ?>" />
    11     <input type="submit" name="list" value="<?php echo _("Search"); ?>" class="formsubmitbutton" />
    12    
    13 <!--     <select name="filter_admin_priv"> -->
    14 <!--     <?php printSetSelectForm('admin_tbl', 'filter_admin_priv', getFormData('filter_admin_priv'), true); ?> -->
    15 <!--     </select> -->
    16 <!--     <input type="submit" name="list" value="Filter by privilege" class="formsubmitbutton"> -->
     10    <input type="text" class="forminputtext" size="20" name="search_query" value="<?php echo getFormData('search_query'); ?>" title="<?php echo oTxt(_("Fields searched: Admin id, Username, Userpass, First name, Last name, Email, User type, Login abuse exempt, Blocked, Blocked reason, Abuse warning level, Seconds online, Last login datetime, Last access datetime, Last login ip, Added by user id, Modified by user id, Added datetime, Modified datetime.")); ?>" />
     11<!--
     12    <select name="filter_<##>">
     13        <?php // printSelectForm('<##>_tbl', "CONCAT(<##>_id, '&mdash;', city, '&mdash;', title)", '<##>_id', getFormData('filter_<##>'), array('Any <##>'), 'ORDER BY <##> ASC'); ?>
     14    </select>
     15 -->
     16    <input type="submit" name="list" value="<?php echo _("Search"); ?>" />
    1717</div>
    1818
    1919<?php include 'list_info.ihtml'; ?>
    2020
    21 <table class="list" border="0" cellpadding="2" cellspacing="0">
     21<table class="list">
    2222    <tr>
    23         <th class="padleft">&nbsp;</th>
    24         <th class="padleft"><?php $so->printSortHeader('admin_id', _("ID"), 'ASC'); ?></th>
    25         <th class="padleft"><?php $so->printSortHeader('username', _("Username"), 'ASC'); ?></th>
    26         <th class="padleft"><?php $so->printSortHeader('first_name', _("First"), 'ASC'); ?>
    27             <?php $so->printSortHeader('last_name', _("Last name"), 'ASC'); ?></th>
    28         <th class="padleft"><?php $so->printSortHeader('last_access_datetime', _("Logged-in"), 'DESC'); ?></th>
    29         <th class="padleft"><?php $so->printSortHeader('seconds_online', _("Total min logged-in"), 'DESC'); ?></th>
    30         <th class="padleft"><?php $so->printSortHeader('last_login_ip', _("Last remote addr"), 'ASC'); ?></th>
    31         <th class="padleft">&nbsp;</th>
     23        <th>&nbsp;</th>
     24        <th>&nbsp;</th>
     25        <th><?php echo $so->printSortHeader('admin_tbl.admin_id', _("ID"), 'ASC'); ?></th>
     26        <th><?php echo $so->printSortHeader('admin_tbl.username', _("Username"), 'ASC'); ?></th>
     27        <th><?php echo $so->printSortHeader('admin_tbl.first_name', _("First"), 'ASC'); ?> <?php echo $so->printSortHeader('admin_tbl.last_name', _("Last name"), 'ASC'); ?></th>
     28        <th><?php echo $so->printSortHeader('admin_tbl.email', _("Email"), 'ASC'); ?></th>
     29        <th><?php echo $so->printSortHeader('admin_tbl.user_type', _("User type"), 'ASC'); ?></th>
     30        <th><?php echo $so->printSortHeader('admin_tbl.seconds_online', _("Min online"), 'ASC'); ?></th>
     31        <th><?php echo $so->printSortHeader('admin_tbl.last_login_datetime', _("Last login"), 'ASC'); ?></th>
     32        <th><?php echo $so->printSortHeader('admin_tbl.last_login_ip', _("Remote host"), 'ASC'); ?></th>
     33        <th><?php echo $so->printSortHeader('admin_tbl.added_datetime', _("Added"), 'ASC'); ?></th>
     34        <th><?php echo $so->printSortHeader('admin_tbl.added_by_user_id', _("by admin"), 'ASC'); ?></th>
     35        <th><?php echo $so->printSortHeader('admin_tbl.modified_datetime', _("Last modified"), 'ASC'); ?></th>
     36        <th>&nbsp;</th>
    3237    </tr>
    33     <?php for ($i = 0; $i <= $page->last_item - $page->first_item && $page->total_items; $i++) { ?>
     38    <?php for ($i = 0; $i <= $page->last_item - $page->first_item && $page->total_items > 0; $i++) { ?>
    3439    <tr>
    35         <td class="padleft nowrap">
    36             <a title="<?php printf(_("Edit %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo App::oHREF('/admin/admins.php?op=edit&admin_id=' . $list[$i]['admin_id']); ?>"><img src="/admin/_widgets/edit.gif" alt="Edit" width="14" height="18" border="0"></a>
    37         </td>
    38         <td class="padleft nowrap"><?php echo $list[$i]['admin_id']; ?> &nbsp;</td>
    39         <td class="padleft nowrap"><?php echo oTxt($list[$i]['username']); ?> &nbsp;</td>
    40         <td class="padleft nowrap"><a href="mailto:<?php echo oTxt($list[$i]['email']); ?>"><?php echo oTxt($list[$i]['first_name']); ?>
    41             <?php echo oTxt($list[$i]['last_name']); ?></a> &nbsp;</td>
    42         <td class="padleft nowrap"><a href="#" style="text-decoration:none;" title="<?php printf(_("Last accessed %s"), $list[$i]['last_access_datetime']) ?>"><?php echo $auth->isLoggedIn($list[$i]['admin_id']) ? '<strong>' . _("yes") . '</strong>' : _("no"); ?></a>  &nbsp;</td>
    43         <td class="padleft nowrap"><?php echo round($list[$i]['seconds_online'] / 60); ?> &nbsp;</td>
    44         <td class="padleft nowrap"><?php echo gethostbyaddr($list[$i]['last_login_ip']); ?> &nbsp;</td>
    45         <td class="padleft right nowrap">
    46             <a title="<?php printf(_("Delete %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo App::oHREF('/admin/admins.php?op=del&admin_id=' . $list[$i]['admin_id']); ?>" onClick="javascript:return confirm('<?php printf(_("Are you sure you want to delete %s? This action is permanent and cannot be undone."), oTxt($list[$i]['username'])) ?>')"><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0"></a>
    47         </td>
     40        <td class="padleft nowrap"><a title="<?php printf(_("Edit %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=edit&admin_id=' . $list[$i]['admin_id']); ?>"><img src="/admin/_widgets/edit.gif" alt="Edit" width="14" height="18" border="0"></a> &nbsp;</td>
     41        <td class="padleft nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo App::oHREF('/admin/versions.php?record_table=admin_tbl&record_key=admin_id&boomerang=true&record_val=' . $list[$i]['admin_id']); ?>"><img src="/admin/_widgets/subcategory.gif" alt="" width="18" height="14" border="0" /></a> &nbsp;</td>
     42        <td class="nowrap"><?php echo oTxt($list[$i]['admin_id'], true); ?> &nbsp;</td>
     43        <td class="nowrap"><?php echo oTxt($list[$i]['username'], true); ?> &nbsp;</td>
     44        <td class="nowrap"><?php echo oTxt($list[$i]['first_name'], true); ?> <?php echo oTxt($list[$i]['last_name'], true); ?> &nbsp;</td>
     45        <td class="nowrap"><?php echo oTxt($list[$i]['email'], true); ?> &nbsp;</td>
     46        <td class="nowrap"><?php echo oTxt($list[$i]['user_type'], true); ?> &nbsp;</td>
     47        <td class="nowrap"><?php echo round($list[$i]['seconds_online'] / 60); ?> &nbsp;</td>
     48        <td class="nowrap"><?php echo '0000-00-00 00:00:00' == $list[$i]['last_login_datetime'] ? '' : date(App::getParam('date_format'), strtotime($list[$i]['last_login_datetime'])); ?> &nbsp;</td>
     49        <td class="nowrap"><?php echo gethostbyaddr($list[$i]['last_login_ip']); ?> &nbsp;</td>
     50        <td class="nowrap"><?php echo '0000-00-00 00:00:00' == $list[$i]['added_datetime'] ? '' : date(App::getParam('date_format'), strtotime($list[$i]['added_datetime'])); ?> &nbsp;</td>
     51        <td class="nowrap"><?php echo oTxt($list[$i]['added_admin_username'], true); ?> &nbsp;</td>
     52        <td class="nowrap"><?php echo '0000-00-00 00:00:00' == $list[$i]['modified_datetime'] ? '' : date(App::getParam('date_format'), strtotime($list[$i]['modified_datetime'])); ?> &nbsp;</td>
     53        <td class="padleft nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . "?op=del&admin_id=" . $list[$i]['admin_id']); ?>" onClick="javascript:return confirm('<?php printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt($list[$i]['username'])) ?>')"><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0"></a> &nbsp;</td>
    4854    </tr>
    4955    <?php } ?>
Note: See TracChangeset for help on using the changeset viewer.