PageRenderTime 49ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

/programs/admin/tables/index.php

https://github.com/damanlovett/SEAHO
PHP | 313 lines | 275 code | 18 blank | 20 comment | 31 complexity | 8e7c0bdc0617f9664695b6770a904c21 MD5 | raw file
  1. <?php
  2. // technocurve arc 3 php bv block1/3 start
  3. $color1 = "#FFFFFF";
  4. $color2 = "#DEDEDE";
  5. $color = $color1;
  6. // technocurve arc 3 php bv block1/3 end
  7. ?><?php require_once('../../../Connections/Programming.php'); ?>
  8. <?php
  9. if (!function_exists("GetSQLValueString")) {
  10. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  11. {
  12. $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  13. $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  14. switch ($theType) {
  15. case "text":
  16. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  17. break;
  18. case "long":
  19. case "int":
  20. $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  21. break;
  22. case "double":
  23. $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
  24. break;
  25. case "date":
  26. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  27. break;
  28. case "defined":
  29. $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  30. break;
  31. }
  32. return $theValue;
  33. }
  34. }
  35. ?>
  36. <?php require_once('../../includefiles/init.php'); ?>
  37. <?php
  38. $table = $_REQUEST['table'];
  39. if ((isset($_GET['recordID'])) && ($_GET['recordID'] != "") && (isset($_GET['delete']))) {
  40. $deleteSQL = sprintf("UPDATE $table SET `deleted`= 1 WHERE id=%s",
  41. GetSQLValueString($_GET['recordID'], "int"));
  42. mysql_select_db($database_Programming, $Programming);
  43. $Result1 = mysql_query($deleteSQL, $Programming) or die(mysql_error());
  44. }
  45. ?>
  46. <?php
  47. mysql_select_db($database_Programming, $Programming);
  48. $query_rsAudience = "SELECT audience.id, audience.audience FROM audience WHERE audience.deleted =0 ORDER BY audience.audience";
  49. $rsAudience = mysql_query($query_rsAudience, $Programming) or die(mysql_error());
  50. $row_rsAudience = mysql_fetch_assoc($rsAudience);
  51. $totalRows_rsAudience = mysql_num_rows($rsAudience);
  52. mysql_select_db($database_Programming, $Programming);
  53. $query_rsSessionType = "SELECT session_type.id, session_type.session_type FROM session_type WHERE session_type.deleted =0 ORDER BY session_type.session_type";
  54. $rsSessionType = mysql_query($query_rsSessionType, $Programming) or die(mysql_error());
  55. $row_rsSessionType = mysql_fetch_assoc($rsSessionType);
  56. $totalRows_rsSessionType = mysql_num_rows($rsSessionType);
  57. mysql_select_db($database_Programming, $Programming);
  58. $query_rsTopicArea = "SELECT topic_area.id, topic_area FROM topic_area WHERE topic_area.deleted =0 ORDER BY topic_area";
  59. $rsTopicArea = mysql_query($query_rsTopicArea, $Programming) or die(mysql_error());
  60. $row_rsTopicArea = mysql_fetch_assoc($rsTopicArea);
  61. $totalRows_rsTopicArea = mysql_num_rows($rsTopicArea);
  62. mysql_select_db($database_Programming, $Programming);
  63. $query_rsExperience = "SELECT experience_level.id, experience_level.experience_level, experience_level.deleted FROM experience_level WHERE experience_level.deleted !=1";
  64. $rsExperience = mysql_query($query_rsExperience, $Programming) or die(mysql_error());
  65. $row_rsExperience = mysql_fetch_assoc($rsExperience);
  66. $totalRows_rsExperience = mysql_num_rows($rsExperience);
  67. if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "create_user")) {
  68. NewMemberEmail($_POST['firstname'],$_POST['email'],$_POST['password']);
  69. }
  70. ?>
  71. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  72. <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/mainTemplate.dwt.php" codeOutsideHTMLIsLocked="false" -->
  73. <head>
  74. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  75. <!-- InstanceBeginEditable name="doctitle" -->
  76. <title>Table Manager</title>
  77. <script language="JavaScript" type="text/javascript" src="../../includefiles/make-popup.js"></script>
  78. <script src="../../../SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
  79. <!-- InstanceEndEditable --><!-- InstanceBeginEditable name="head" -->
  80. <script type="text/JavaScript">
  81. <!--
  82. function MM_goToURL() { //v3.0
  83. var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  84. for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
  85. }
  86. //-->
  87. </script>
  88. <link href="../../../SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
  89. <!-- InstanceEndEditable --><!-- InstanceParam name="Page Title" type="text" value="MembersPageTitle" -->
  90. <link href="../../styles/mainStyle.css" rel="stylesheet" type="text/css" />
  91. <link href="../../styles/navLeft.css" rel="stylesheet" type="text/css" />
  92. <link href="../../styles/table.css" rel="stylesheet" type="text/css" />
  93. </head>
  94. <body>
  95. <div id="header"><?php require_once('../../includefiles/userInfo.php'); ?></div>
  96. <div id="sidebar"><?php require_once('../../includefiles/navPage.php'); ?></div>
  97. <div id="mainContent">
  98. <div id="mainText">
  99. <h2><!-- InstanceBeginEditable name="PageTite" -->
  100. <img src="../../images/LCCMPHtables.jpg" alt="Admin User" width="65" height="51" />Table Manager <!-- InstanceEndEditable --></h2>
  101. <!-- InstanceBeginEditable name="SectionTitle" --><!-- InstanceEndEditable --><!-- InstanceBeginEditable name="PageInformation" -->
  102. <div id="pageInformation">
  103. <ul>
  104. <li>Topic Area: <strong><?php echo $totalRows_rsTopicArea ?></strong> </li>
  105. <li>Session Type: <strong><?php echo $totalRows_rsSessionType ?></strong> </li>
  106. <li>Audience: <strong><?php echo $totalRows_rsAudience ?></strong> </li>
  107. </ul>
  108. </div>
  109. <!-- InstanceEndEditable --><!-- InstanceBeginEditable name="PageText" -->
  110. <p>&nbsp;</p>
  111. <div id="TabbedPanels1" class="TabbedPanels">
  112. <ul class="TabbedPanelsTabGroup">
  113. <li class="TabbedPanelsTab" tabindex="0">Topic Area </li>
  114. <li class="TabbedPanelsTab" tabindex="0">Session Type</li>
  115. <li class="TabbedPanelsTab" tabindex="0">Audience</li>
  116. <li class="TabbedPanelsTab" tabindex="0">Experience Level</li>
  117. </ul>
  118. <div class="TabbedPanelsContentGroup">
  119. <div class="TabbedPanelsContent">
  120. <br />
  121. <table width="450" border="0" cellpadding="5" cellspacing="0" class="tableborder">
  122. <tr>
  123. <td colspan="3" class="tableTop"><a name="topic" id="topic"></a><strong>TOPIC AREA TABLE</strong><label>
  124. <input name="Submit1" type="submit" id="Submit1" onclick="makePopup('insert.php?table=topic_area&label=Topic Area', 400, 400, 'scroll')" value="Add new" />
  125. <input name="Submit2" type="submit" onclick="MM_goToURL('parent','index.php');return document.MM_returnValue" value="Refresh List" />
  126. </label>
  127. </td>
  128. </tr>
  129. <tr>
  130. <th>Item</th>
  131. <th>&nbsp;</th>
  132. <th>&nbsp;</th>
  133. </tr>
  134. <?php do { ?>
  135. <tr <?php
  136. // technocurve arc 3 php bv block2/3 start
  137. echo " style=\"background-color:$color\"";
  138. // technocurve arc 3 php bv block2/3 end
  139. ?> class="tableRowColor">
  140. <td nowrap="nowrap"><?php echo $row_rsTopicArea['topic_area']; ?></td>
  141. <td>&nbsp;</td>
  142. <td><div align="right"><a href="index.php?recordID=<?php echo $row_rsTopicArea['id']; ?>&amp;delete=yes&amp;table=topic_area"><img src="../../images/imgAdminDelete.gif" alt="Delete" width="14" height="14" border="0" /></a></div></td>
  143. </tr>
  144. <?php
  145. // technocurve arc 3 php bv block3/3 start
  146. if ($color == $color1) {
  147. $color = $color2;
  148. } else {
  149. $color = $color1;
  150. }
  151. // technocurve arc 3 php bv block3/3 end
  152. ?>
  153. <?php } while ($row_rsTopicArea = mysql_fetch_assoc($rsTopicArea)); ?>
  154. <tr>
  155. <td colspan="3" nowrap="nowrap" class="tableBottom">&nbsp;</td>
  156. </tr>
  157. </table></div>
  158. <div class="TabbedPanelsContent">
  159. <br />
  160. <table width="450" border="0" cellpadding="5" cellspacing="0" class="tableborder">
  161. <tr>
  162. <td colspan="3" class="tableTop"><a name="session" id="session"></a><strong>SESSION TYPE TABLE</strong>
  163. <input name="Submit3" type="submit" onclick="makePopup('insert.php?table=session_type&amp;label=Session Type', 400, 400, 'scroll')" value="Add new" />
  164. <input name="Submit4" type="submit" id="Submit4" onclick="MM_goToURL('parent','index.php');return document.MM_returnValue" value="Refresh List" />
  165. </td>
  166. </tr>
  167. <tr>
  168. <th>Item</th>
  169. <th>&nbsp;</th>
  170. <th>&nbsp;</th>
  171. </tr>
  172. <?php do { ?>
  173. <tr <?php
  174. // technocurve arc 3 php bv block2/3 start
  175. echo " style=\"background-color:$color\"";
  176. // technocurve arc 3 php bv block2/3 end
  177. ?> class="tableRowColor">
  178. <td nowrap="nowrap"><?php echo $row_rsSessionType['session_type']; ?></td>
  179. <td>&nbsp;</td>
  180. <td><div align="right"><a href="index.php?recordID=<?php echo $row_rsSessionType['id']; ?>&amp;delete=yes&amp;table=session_type"><img src="../../images/imgAdminDelete.gif" alt="Delete" width="14" height="14" border="0" /></a></div></td>
  181. </tr>
  182. <?php
  183. // technocurve arc 3 php bv block3/3 start
  184. if ($color == $color1) {
  185. $color = $color2;
  186. } else {
  187. $color = $color1;
  188. }
  189. // technocurve arc 3 php bv block3/3 end
  190. ?>
  191. <?php } while ($row_rsSessionType = mysql_fetch_assoc($rsSessionType)); ?>
  192. <tr>
  193. <td colspan="3" nowrap="nowrap" class="tableBottom">&nbsp;</td>
  194. </tr>
  195. </table></div>
  196. <div class="TabbedPanelsContent"> <br />
  197. <table width="450" border="0" cellpadding="5" cellspacing="0" class="tableborder">
  198. <tr>
  199. <td colspan="3" class="tableTop"><a name="audience" id="audience"></a><strong>AUDIENCE TABLE</strong>
  200. <input name="Submit5" type="submit" id="Submit5" onclick="makePopup('insert.php?table=audience&amp;label=Audience', 400, 200, 'scroll')" value="Add new" />
  201. <input name="Submit6" type="submit" id="Submit6" onclick="MM_goToURL('parent','index.php');return document.MM_returnValue" value="Refresh List" />
  202. </td>
  203. </tr>
  204. <tr>
  205. <th>Item</th>
  206. <th>&nbsp;</th>
  207. <th>&nbsp;</th>
  208. </tr>
  209. <?php do { ?>
  210. <tr <?php
  211. // technocurve arc 3 php bv block2/3 start
  212. echo " style=\"background-color:$color\"";
  213. // technocurve arc 3 php bv block2/3 end
  214. ?> class="tableRowColor">
  215. <td nowrap="nowrap"><?php echo $row_rsAudience['audience']; ?></td>
  216. <td>&nbsp;</td>
  217. <td><div align="right"><a href="index.php?recordID=<?php echo $row_rsAudience['id']; ?>&amp;delete=yes&amp;table=audience"><img src="../../images/imgAdminDelete.gif" alt="Delete" width="14" height="14" border="0" /></a></div></td>
  218. </tr>
  219. <?php
  220. // technocurve arc 3 php bv block3/3 start
  221. if ($color == $color1) {
  222. $color = $color2;
  223. } else {
  224. $color = $color1;
  225. }
  226. // technocurve arc 3 php bv block3/3 end
  227. ?>
  228. <?php } while ($row_rsAudience = mysql_fetch_assoc($rsAudience)); ?>
  229. <tr>
  230. <td colspan="3" nowrap="nowrap" class="tableBottom">&nbsp;</td>
  231. </tr>
  232. </table>
  233. </div>
  234. <div class="TabbedPanelsContent">
  235. <table width="450" border="0" cellpadding="5" cellspacing="0" class="tableborder">
  236. <tr>
  237. <td colspan="3" class="tableTop"><a name="audience" id="audience2"></a><strong>Experience Level</strong>
  238. <input name="Submit7" type="submit" id="Submit3" onclick="makePopup('insert.php?table=experience_level&amp;label=experience_level', 400, 200, 'scroll')" value="Add new" />
  239. <input name="Submit7" type="submit" id="Submit3" onclick="MM_goToURL('parent','index.php');return document.MM_returnValue" value="Refresh List" />
  240. </td>
  241. </tr>
  242. <tr>
  243. <th>Item</th>
  244. <th>&nbsp;</th>
  245. <th>&nbsp;</th>
  246. </tr>
  247. <?php do { ?>
  248. <tr <?php
  249. // technocurve arc 3 php bv block2/3 start
  250. echo " style=\"background-color:$color\"";
  251. // technocurve arc 3 php bv block2/3 end
  252. ?> class="tableRowColor">
  253. <td nowrap="nowrap"><?php echo $row_rsExperience['experience_level']; ?></td>
  254. <td>&nbsp;</td>
  255. <td><div align="right"><a href="index.php?recordID=<?php echo $row_rsExperience['id']; ?>&amp;delete=yes&amp;table=experience_level"><img src="../../images/imgAdminDelete.gif" alt="Delete" width="14" height="14" border="0" /></a></div></td>
  256. </tr>
  257. <?php
  258. // technocurve arc 3 php bv block3/3 start
  259. if ($color == $color1) {
  260. $color = $color2;
  261. } else {
  262. $color = $color1;
  263. }
  264. // technocurve arc 3 php bv block3/3 end
  265. ?>
  266. <?php } while ($row_rsExperience = mysql_fetch_assoc($rsExperience)); ?>
  267. <tr>
  268. <td colspan="3" nowrap="nowrap" class="tableBottom">&nbsp;</td>
  269. </tr>
  270. </table>
  271. </div>
  272. </div>
  273. </div>
  274. <br />
  275. <br />
  276. <br />
  277. <br />
  278. <p class="cleartable">&nbsp;</p>
  279. <script type="text/javascript">
  280. <!--
  281. var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
  282. //-->
  283. </script>
  284. <!-- InstanceEndEditable --></div>
  285. </div>
  286. <div id="footer"><?php require_once('../../includefiles/footer.php'); ?>
  287. </div>
  288. </body><!-- InstanceEnd -->
  289. </html>
  290. <?php
  291. mysql_free_result($rsAudience);
  292. mysql_free_result($rsSessionType);
  293. mysql_free_result($rsTopicArea);
  294. mysql_free_result($rsExperience);
  295. ?>