PageRenderTime 26ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/programs/admin/users/logins.php

https://github.com/damanlovett/SEAHO
PHP | 213 lines | 195 code | 11 blank | 7 comment | 27 complexity | 4ab645ddb15032e24268fbed67347747 MD5 | raw file
  1. <?php
  2. // technocurve arc 3 php mv block1/3 start
  3. $mocolor1 = "#FFFFFF";
  4. $mocolor2 = "#DEDEDE";
  5. $mocolor3 = "#F2F2F2";
  6. $mocolor = $mocolor1;
  7. // technocurve arc 3 php mv block1/3 end
  8. ?><?php require_once('../../../Connections/Programming.php'); ?>
  9. <?php
  10. if (!function_exists("GetSQLValueString")) {
  11. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  12. {
  13. $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  14. $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  15. switch ($theType) {
  16. case "text":
  17. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  18. break;
  19. case "long":
  20. case "int":
  21. $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  22. break;
  23. case "double":
  24. $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
  25. break;
  26. case "date":
  27. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  28. break;
  29. case "defined":
  30. $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  31. break;
  32. }
  33. return $theValue;
  34. }
  35. }
  36. ?>
  37. <?php require_once('../../includefiles/init.php'); ?>
  38. <?php
  39. $editFormAction = $_SERVER['PHP_SELF'];
  40. if (isset($_SERVER['QUERY_STRING'])) {
  41. $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
  42. }
  43. if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "create_user")) {
  44. $insertSQL = sprintf("INSERT INTO users (userID, first_name, last_name, email, password, `access`) VALUES (%s, %s, %s, %s, %s, %s)",
  45. GetSQLValueString($_POST['userID'], "text"),
  46. GetSQLValueString($_POST['firstname'], "text"),
  47. GetSQLValueString($_POST['lastname'], "text"),
  48. GetSQLValueString($_POST['email'], "text"),
  49. GetSQLValueString($_POST['password'], "text"),
  50. GetSQLValueString($_POST['access'], "int"));
  51. mysql_select_db($database_Programming, $Programming);
  52. $Result1 = mysql_query($insertSQL, $Programming) or die(mysql_error());
  53. }
  54. $maxRows_rsUserInfo = 100;
  55. $pageNum_rsUserInfo = 0;
  56. if (isset($_GET['pageNum_rsUserInfo'])) {
  57. $pageNum_rsUserInfo = $_GET['pageNum_rsUserInfo'];
  58. }
  59. $startRow_rsUserInfo = $pageNum_rsUserInfo * $maxRows_rsUserInfo;
  60. mysql_select_db($database_Programming, $Programming);
  61. $query_rsUserInfo = "SELECT loginrecord.id, loginrecord.username, DATE_FORMAT(loginrecord.Timelog,'%m/%d/%Y %r') AS Timelog, users.userID, users.first_name, users.last_name FROM loginrecord, users WHERE loginrecord.username = users.userID AND users.userID !='198a829b-b93c-a24b-2dd0-461d394346a4' GROUP BY loginrecord.id ORDER BY loginrecord.Timelog DESC";
  62. $query_limit_rsUserInfo = sprintf("%s LIMIT %d, %d", $query_rsUserInfo, $startRow_rsUserInfo, $maxRows_rsUserInfo);
  63. $rsUserInfo = mysql_query($query_limit_rsUserInfo, $Programming) or die(mysql_error());
  64. $row_rsUserInfo = mysql_fetch_assoc($rsUserInfo);
  65. if (isset($_GET['totalRows_rsUserInfo'])) {
  66. $totalRows_rsUserInfo = $_GET['totalRows_rsUserInfo'];
  67. } else {
  68. $all_rsUserInfo = mysql_query($query_rsUserInfo);
  69. $totalRows_rsUserInfo = mysql_num_rows($all_rsUserInfo);
  70. }
  71. $totalPages_rsUserInfo = ceil($totalRows_rsUserInfo/$maxRows_rsUserInfo)-1;
  72. if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "create_user")) {
  73. NewMemberEmail($_POST['firstname'],$_POST['email'],$_POST['password']);
  74. }
  75. ?>
  76. <?php $lastTFM_nest = "";?>
  77. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  78. <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/mainTemplate.dwt.php" codeOutsideHTMLIsLocked="false" -->
  79. <head>
  80. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  81. <!-- InstanceBeginEditable name="doctitle" -->
  82. <title>Login Information</title>
  83. <!-- InstanceEndEditable --><!-- InstanceBeginEditable name="head" -->
  84. <script type="text/JavaScript">
  85. <!--
  86. function MM_openBrWindow(theURL,winName,features) { //v2.0
  87. window.open(theURL,winName,features);
  88. }
  89. //-->
  90. </script>
  91. <style type="text/css">
  92. <!--
  93. .style1 {
  94. color: #990000;
  95. font-size: 12px;
  96. }
  97. -->
  98. </style><!-- InstanceEndEditable --><!-- InstanceParam name="Page Title" type="text" value="MembersPageTitle" -->
  99. <link href="../../styles/mainStyle.css" rel="stylesheet" type="text/css" />
  100. <link href="../../styles/navLeft.css" rel="stylesheet" type="text/css" />
  101. <link href="../../styles/table.css" rel="stylesheet" type="text/css" />
  102. </head>
  103. <body>
  104. <div id="header"><?php require_once('../../includefiles/userInfo.php'); ?></div>
  105. <div id="sidebar"><?php require_once('../../includefiles/navPage.php'); ?></div>
  106. <div id="mainContent">
  107. <div id="mainText">
  108. <h2><!-- InstanceBeginEditable name="PageTite" -->
  109. <img src="../../images/LCCMPHadminUser.jpg" alt="Admin User" width="65" height="51" />User Login Information <!-- InstanceEndEditable --></h2>
  110. <!-- InstanceBeginEditable name="SectionTitle" --><!-- InstanceEndEditable --><!-- InstanceBeginEditable name="PageInformation" -->
  111. <div id="pageInformation"><br />
  112. <form id="create_user" name="create_user" method="POST" action="<?php echo $editFormAction; ?>">
  113. <table border="0" cellpadding="5" cellspacing="0">
  114. <tr>
  115. <td><strong>
  116. <label for="label">First Name</label>
  117. </strong></td>
  118. <td><input name="firstname" type="text" id="firstname" size="35" /></td>
  119. <td>&nbsp;</td>
  120. <td><strong>
  121. <label for="label2">Last Name</label>
  122. </strong></td>
  123. <td><input name="lastname" type="text" id="label" size="35" /></td>
  124. </tr>
  125. <tr>
  126. <td><strong>
  127. <label for="label2">Email</label>
  128. </strong></td>
  129. <td><input name="email" type="text" id="label2" size="35" /></td>
  130. <td>&nbsp;</td>
  131. <td><strong>
  132. <label for="select">Access</label>
  133. </strong></td>
  134. <td><select name="access" id="access">
  135. <option value="2">Administrator</option>
  136. <option value="3" selected="selected">Reviewer</option>
  137. </select></td>
  138. </tr>
  139. <tr>
  140. <td colspan="2"><input type="submit" name="Submit2" value="Create Account" /></td>
  141. <td>&nbsp;</td>
  142. <td><input name="userID" type="hidden" id="userID" value="<?php echo create_guid();?>" />
  143. <input name="password" type="hidden" id="password" value="<?php echo createPassword();?>" /></td>
  144. <td>&nbsp;</td>
  145. </tr>
  146. </table>
  147. <input type="hidden" name="MM_insert" value="create_user">
  148. </form>
  149. <?php if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "create_user")) {?>
  150. <span class="style1">Account for <?php echo $_POST['firstname']." ( ".$_POST['email']." )";?> has been created, and a password email has been sent. </span>
  151. <?php }?>
  152. </div>
  153. <!-- InstanceEndEditable --><!-- InstanceBeginEditable name="PageText" -->
  154. <p>&nbsp;</p>
  155. <table width="500" border="0" cellpadding="5" cellspacing="0" class="tableborder">
  156. <tr>
  157. <td colspan="3" class="tableTop">Last 100 Logins </td>
  158. </tr>
  159. <tr>
  160. <th>Name</th>
  161. <th>&nbsp;</th>
  162. <th>Last Login </th>
  163. </tr>
  164. <?php do { ?>
  165. <tr <?php
  166. // technocurve arc 3 php mv block2/3 start
  167. echo " style=\"background-color:$mocolor\" onMouseOver=\"this.style.backgroundColor='$mocolor3'\" onMouseOut=\"this.style.backgroundColor='$mocolor'\"";
  168. // technocurve arc 3 php mv block2/3 end
  169. ?> class="tableRowColor">
  170. <td nowrap="nowrap"><a href="#" onclick="MM_openBrWindow('details.php?recordID=<?php echo $row_rsUserInfo['username']; ?>','logindetails','scrollbars=yes,width=240,height=275')">
  171. <?php $TFM_nest = $row_rsUserInfo['first_name'];
  172. if ($lastTFM_nest != $TFM_nest) {
  173. $lastTFM_nest = $TFM_nest; ?>
  174. </a><a href="#" onclick="MM_openBrWindow('details.php?recordID=<?php echo $row_rsUserInfo['username']; ?>','logindetails','scrollbars=yes,width=240,height=275')"><?php echo strtoupper($row_rsUserInfo['last_name']); ?>, </a><a href="#" onclick="MM_openBrWindow('details.php?recordID=<?php echo $row_rsUserInfo['username']; ?>','logindetails','scrollbars=yes,width=240,height=275')"><?php echo strtoupper($row_rsUserInfo['first_name']); ?><?php } //End of Basic-UltraDev Simulated Nested Repeat?>
  175. </a></td>
  176. <td>&nbsp;</td>
  177. <td><?php echo $row_rsUserInfo['Timelog']; ?> <div align="center"></div></td>
  178. </tr>
  179. <?php
  180. // technocurve arc 3 php mv block3/3 start
  181. if ($mocolor == $mocolor1) {
  182. $mocolor = $mocolor2;
  183. } else {
  184. $mocolor = $mocolor1;
  185. }
  186. // technocurve arc 3 php mv block3/3 end
  187. ?>
  188. <?php } while ($row_rsUserInfo = mysql_fetch_assoc($rsUserInfo)); ?>
  189. <tr>
  190. <td colspan="3" nowrap="nowrap" class="tableBottom">&nbsp;</td>
  191. </tr>
  192. </table>
  193. <p>&nbsp;</p>
  194. <!-- InstanceEndEditable --></div>
  195. </div>
  196. <div id="footer"><?php require_once('../../includefiles/footer.php'); ?>
  197. </div>
  198. </body><!-- InstanceEnd -->
  199. </html>
  200. <?php
  201. mysql_free_result($rsUserInfo);
  202. ?>