PageRenderTime 72ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/admin/stateeditors/index.php

https://github.com/damanlovett/SEAHO
PHP | 202 lines | 180 code | 18 blank | 4 comment | 21 complexity | 7d511f6253ed95791d6ccb49c5dce22d MD5 | raw file
  1. <?php require_once('../../Connections/Directory.php'); ?>
  2. <?php require_once('../includefiles/initEmails.php'); ?>
  3. <?php require_once('../includefiles/init.php'); ?>
  4. <?php require_once('../includefiles/AdminLogin.php'); ?>
  5. <?php
  6. if (!function_exists("GetSQLValueString")) {
  7. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  8. {
  9. $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  10. $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  11. switch ($theType) {
  12. case "text":
  13. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  14. break;
  15. case "long":
  16. case "int":
  17. $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  18. break;
  19. case "double":
  20. $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
  21. break;
  22. case "date":
  23. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  24. break;
  25. case "defined":
  26. $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  27. break;
  28. }
  29. return $theValue;
  30. }
  31. }
  32. mysql_select_db($database_Directory, $Directory);
  33. $query_rsEditorsOne = "SELECT * FROM state_editors WHERE `column` = 1 ORDER BY `order` ASC";
  34. $rsEditorsOne = mysql_query($query_rsEditorsOne, $Directory) or die(mysql_error());
  35. $row_rsEditorsOne = mysql_fetch_assoc($rsEditorsOne);
  36. $totalRows_rsEditorsOne = mysql_num_rows($rsEditorsOne);
  37. mysql_select_db($database_Directory, $Directory);
  38. $query_rsEditorsTwo = "SELECT * FROM state_editors WHERE `column` = 2 ORDER BY `order` ASC";
  39. $rsEditorsTwo = mysql_query($query_rsEditorsTwo, $Directory) or die(mysql_error());
  40. $row_rsEditorsTwo = mysql_fetch_assoc($rsEditorsTwo);
  41. $totalRows_rsEditorsTwo = mysql_num_rows($rsEditorsTwo);
  42. ?>
  43. <?php
  44. DeleteRecord(team_positions,position_id);
  45. // Unassign Member
  46. if(isset($_GET['recordID'])){
  47. $clear = "";
  48. $updateSQL = sprintf("UPDATE team_positions SET user_id=NULL WHERE position_id=%s AND user_id=%s",
  49. GetSQLValueString($_GET['positionID'], "text"),
  50. GetSQLValueString($_GET['recordID'], "text"));
  51. mysql_select_db($database_Directory, $Directory);
  52. $Result1 = mysql_query($updateSQL, $Directory) or die(mysql_error());
  53. }
  54. // Delete Record - set to 1
  55. DeleteRecord("team_positions","position_id");
  56. ?>
  57. <?php
  58. $currentPage = $_SERVER["PHP_SELF"];
  59. $queryString_rsActiveMembers = "";
  60. if (!empty($_SERVER['QUERY_STRING'])) {
  61. $params = explode("&", $_SERVER['QUERY_STRING']);
  62. $newParams = array();
  63. foreach ($params as $param) {
  64. if (stristr($param, "pageNum_rsActiveMembers") == false &&
  65. stristr($param, "totalRows_rsActiveMembers") == false) {
  66. array_push($newParams, $param);
  67. }
  68. }
  69. if (count($newParams) != 0) {
  70. $queryString_rsActiveMembers = "&" . htmlentities(implode("&", $newParams));
  71. }
  72. }
  73. $queryString_rsActiveMembers = sprintf("&totalRows_rsActiveMembers=%d%s", $totalRows_rsActiveMembers, $queryString_rsActiveMembers);
  74. ?>
  75. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  76. <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/adminTemplate.dwt.php" codeOutsideHTMLIsLocked="false" -->
  77. <head>
  78. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  79. <!-- InstanceBeginEditable name="doctitle" -->
  80. <title>State Editor Manager</title>
  81. <!-- InstanceEndEditable -->
  82. <link href="../styles/mainStyle.css" rel="stylesheet" type="text/css" />
  83. <link href="../styles/table.css" rel="stylesheet" type="text/css" />
  84. <link href="../styles/navLeft.css" rel="stylesheet" type="text/css" />
  85. <!-- InstanceBeginEditable name="head" -->
  86. <script src="../../SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
  87. <link href="../../SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
  88. <script type="text/JavaScript">
  89. <!--
  90. function MM_openBrWindow(theURL,winName,features) { //v2.0
  91. window.open(theURL,winName,features);
  92. }
  93. function MM_goToURL() { //v3.0
  94. var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  95. for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
  96. }
  97. //-->
  98. </script><!-- InstanceEndEditable -->
  99. </head>
  100. <body>
  101. <div id="header">
  102. <?php require_once('../includefiles/userInfo.php'); ?></div>
  103. <div id="sidebar"><?php require_once('../includefiles/navPage.php'); ?></div>
  104. <div id="mainContent">
  105. <div id="mainText">
  106. <h2><!-- InstanceBeginEditable name="PageTitle" --><span class="pageHeadUserAdmin">State Editor Manager</span> <!-- InstanceEndEditable --></h2>
  107. <!-- InstanceBeginEditable name="PageContent" --><br />
  108. <div id="TabbedPanels1" class="TabbedPanels">
  109. <ul class="TabbedPanelsTabGroup">
  110. <li class="TabbedPanelsTab" tabindex="0">State Rep Lists</li>
  111. </ul>
  112. <div class="TabbedPanelsContentGroup">
  113. <div class="TabbedPanelsContent">
  114. <p><input name="refresh" type="button" id="refresh" onclick="MM_goToURL('parent','<?php echo $_SERVER['../committeesadmin/PHP_SELF'];?>');return document.MM_returnValue" value="Refresh List" />
  115. </p>
  116. <table border="0" cellpadding="5" cellspacing="0" class="tableborder">
  117. <tr>
  118. <th width="50%" align="left" valign="top">Column #1</th>
  119. <th width="50%" align="left" valign="top">Column #2</th>
  120. </tr>
  121. <tr>
  122. <td width="50%" align="left" valign="top"><table border="0" cellpadding="5" cellspacing="0" class="tableborder">
  123. <tr class="tableTop">
  124. <td><strong>State</strong></td>
  125. <td><strong>Rep</strong></td>
  126. <td><strong>Email</strong></td>
  127. <td><strong>Order</strong></td>
  128. <td>&nbsp;</td>
  129. </tr>
  130. <?php do { ?>
  131. <tr >
  132. <td><?php echo $row_rsEditorsOne['state']; ?></td>
  133. <td><?php echo $row_rsEditorsOne['first_name']; ?>&nbsp;<?php echo $row_rsEditorsOne['last_name']; ?></td>
  134. <td><?php echo $row_rsEditorsOne['email']; ?></td>
  135. <td><div align="center"><?php echo $row_rsEditorsOne['order']; ?></div></td>
  136. <td><a href="#"><img src="../images/imgUpdate.gif" alt="Edit" width="14" height="14" border="0" onclick="MM_openBrWindow('update.php?recordID=<?php echo $row_rsEditorsOne['editor_id']; ?>','update','width=400,height=400')" /></a></td>
  137. </tr>
  138. <?php } while ($row_rsEditorsOne = mysql_fetch_assoc($rsEditorsOne)); ?>
  139. </table>
  140. <p>&nbsp;</p></td>
  141. <td width="50%" align="left" valign="top"><table border="0" cellpadding="5" cellspacing="0" class="tableborder">
  142. <tr class="tableTop">
  143. <td><strong>State</strong></td>
  144. <td><strong>Rep</strong></td>
  145. <td><strong>Email</strong></td>
  146. <td><strong>Order</strong></td>
  147. <td>&nbsp;</td>
  148. </tr>
  149. <?php do { ?>
  150. <tr >
  151. <td><?php echo $row_rsEditorsTwo['state']; ?></td>
  152. <td><?php echo $row_rsEditorsTwo['first_name']; ?>&nbsp;<?php echo $row_rsEditorsTwo['last_name']; ?></td>
  153. <td><?php echo $row_rsEditorsTwo['email']; ?></td>
  154. <td><div align="center"><?php echo $row_rsEditorsTwo['order']; ?></div></td>
  155. <td><a href="#"><img src="../images/imgUpdate.gif" alt="Edit" border="0" onclick="MM_openBrWindow('update.php?recordID=<?php echo $row_rsEditorsTwo['editor_id']; ?>','update','width=500,height=400')" /></a></td>
  156. </tr>
  157. <?php } while ($row_rsEditorsTwo = mysql_fetch_assoc($rsEditorsTwo)); ?>
  158. </table></td>
  159. </tr>
  160. </table>
  161. </div>
  162. </div>
  163. </div>
  164. <p class="cleartable">&nbsp;</p>
  165. <script type="text/javascript">
  166. <!--
  167. <?php if((isset($_GET['recordID'])) && (!isset($_GET['position_id']))) {?>
  168. var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
  169. <?php } else { ?>
  170. var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
  171. <?php }?>
  172. //-->
  173. </script>
  174. <!-- InstanceEndEditable --></div>
  175. </div>
  176. <div id="footer"><?php require_once('../includefiles/footer.php'); ?>
  177. </div>
  178. </body><!-- InstanceEnd -->
  179. </html>
  180. <?php
  181. mysql_free_result($rsEditorsOne);
  182. mysql_free_result($rsEditorsTwo);
  183. mysql_free_result($rsActiveMembers);
  184. ?>