home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / dotproject / modules / admin / index.php < prev    next >
Encoding:
PHP Script  |  2004-01-31  |  3.2 KB  |  98 lines

  1. <?php /* $Id: index.php,v 1.22 2004/01/31 09:24:52 ajdonnison Exp $ */
  2. $AppUI->savePlace();
  3.  
  4. if (isset( $_GET['tab'] )) {
  5.     $AppUI->setState( 'UserIdxTab', $_GET['tab'] );
  6. }
  7. $tab = $AppUI->getState( 'UserIdxTab' ) !== NULL ? $AppUI->getState( 'UserIdxTab' ) : 0;
  8.  
  9.  
  10. if (isset( $_GET['stub'] )) {
  11.     $AppUI->setState( 'UserIdxStub', $_GET['stub'] );
  12.     $AppUI->setState( 'UserIdxWhere', '' );
  13. } else if (isset( $_POST['where'] )) { 
  14.     $AppUI->setState( 'UserIdxWhere', $_POST['where'] );
  15.     $AppUI->setState( 'UserIdxStub', '' );
  16. }
  17. $stub = $AppUI->getState( 'UserIdxStub' );
  18. $where = $AppUI->getState( 'UserIdxWhere' );
  19.  
  20. if (isset( $_GET['orderby'] )) {
  21.     $AppUI->setState( 'UserIdxOrderby', $_GET['orderby'] );
  22. }
  23. $orderby = $AppUI->getState( 'UserIdxOrderby' ) ? $AppUI->getState( 'UserIdxOrderby' ) : 'user_username';
  24.  
  25. // Pull First Letters
  26. $let = ":";
  27. $sql = "SELECT DISTINCT UPPER(SUBSTRING(user_username, 1, 1)) AS L FROM users";
  28. $arr = db_loadList( $sql );
  29. foreach( $arr as $L ) {
  30.     $let .= $L['L'];
  31. }
  32. $sql = "SELECT DISTINCT UPPER(SUBSTRING(user_first_name, 1, 1)) AS L FROM users";
  33. $arr = db_loadList( $sql );
  34. foreach( $arr as $L ) {
  35.     if ($L['L'])
  36.     $let .= strpos($let, $L['L']) ? '' : $L['L'];
  37. }
  38.  
  39. $sql = "SELECT DISTINCT UPPER(SUBSTRING(user_last_name, 1, 1)) AS L FROM users";
  40. $arr = db_loadList( $sql );
  41. foreach( $arr as $L ) {
  42.     if ($L['L'])
  43.     $let .= strpos($let, $L['L']) ? '' : $L['L'];
  44. }
  45.  
  46. $a2z = "\n<table cellpadding=\"2\" cellspacing=\"1\" border=\"0\">";
  47. $a2z .= "\n<tr>";
  48. $a2z .= '<td width="100%" align="right">' . $AppUI->_('Show'). ': </td>';
  49. $a2z .= '<td><a href="./index.php?m=admin&stub=0">' . $AppUI->_('All') . '</a></td>';
  50. for ($c=65; $c < 91; $c++) {
  51.     $cu = chr( $c );
  52.     $cell = strpos($let, "$cu") > 0 ?
  53.         "<a href=\"?m=admin&stub=$cu\">$cu</a>" :
  54.         "<font color=\"#999999\">$cu</font>";
  55.     $a2z .= "\n\t<td>$cell</td>";
  56. }
  57. $a2z .= "\n</tr>\n</table>";
  58.  
  59. // setup the title block
  60. $titleBlock = new CTitleBlock( 'User Management', 'helix-setup-users.png', $m, "$m.$a" );
  61.  
  62. $where = dPformSafe( $where, true );
  63.  
  64. $titleBlock->addCell(
  65.     '<input type="text" name="where" class="text" size="10" value="'.$where.'" />'
  66.     . ' <input type="submit" value="'.$AppUI->_( 'search' ).'" class="button" />',
  67.     '',
  68.     '<form action="index.php?m=admin" method="post">', '</form>'
  69. );
  70.  
  71. $titleBlock->addCell( $a2z );
  72. $titleBlock->show();
  73. ?>
  74. <script language="javascript">
  75. function delMe( x, y ) {
  76.     if (confirm( "<?php echo $AppUI->_('doDelete').' '.$AppUI->_('User');?> " + y + "?" )) {
  77.         document.frmDelete.user_id.value = x;
  78.         document.frmDelete.submit();
  79.     }
  80. }
  81. </script>
  82.  
  83. <?php
  84. $extra = '<td align="right" width="100%"><input type="button" class=button value="'.$AppUI->_('add user').'" onClick="javascript:window.location=\'./index.php?m=admin&a=addedituser\';" /></td>';
  85.  
  86. // tabbed information boxes
  87. $tabBox = new CTabBox( "?m=admin", "{$AppUI->cfg['root_dir']}/modules/admin/", $tab );
  88. $tabBox->add( 'vw_active_usr', 'Active Users' );
  89. $tabBox->add( 'vw_inactive_usr', 'Inactive Users' );
  90. $tabBox->show( $extra );
  91. ?>
  92.  
  93. <form name="frmDelete" action="./index.php?m=admin" method="post">
  94.     <input type="hidden" name="dosql" value="do_user_aed" />
  95.     <input type="hidden" name="del" value="1" />
  96.     <input type="hidden" name="user_id" value="0" />
  97. </form>
  98.