PageRenderTime 28ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 1ms

/nurse_info_1.php

http://swifttide.googlecode.com/
PHP | 189 lines | 162 code | 14 blank | 13 comment | 11 complexity | c59791a754035df6703c30a57b2e4200 MD5 | raw file
  1. <?php
  2. //*
  3. // nurse_info_1.php
  4. // Health Section
  5. // Form to search for student
  6. //*
  7. //Check if Nurse is logged in
  8. session_start();
  9. if(!session_is_registered('UserId') || $_SESSION['UserType'] != "N" && $_SESSION['UserType'] != "A")
  10. {
  11. header ("Location: index.php?action=notauth");
  12. exit;
  13. }
  14. $tfname=$_SESSION['tfname'];
  15. $tlname=$_SESSION['tlname'];
  16. //Include global functions
  17. include_once "common.php";
  18. //Initiate database functions
  19. include_once "ez_sql.php";
  20. // Include configuration
  21. include_once "configuration.php";
  22. //Gather all information for drop-downs from basic tables
  23. $sSQL="SELECT * FROM school_names ORDER BY school_names_desc";
  24. $schools = $db->get_results($sSQL);
  25. $sSQL="SELECT * FROM ethnicity ORDER BY ethnicity_desc";
  26. $ethnicities = $db->get_results($sSQL);
  27. $sSQL="SELECT * FROM grades ORDER BY grades_desc";
  28. $grades = $db->get_results($sSQL);
  29. ?>
  30. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  31. <html xmlns="http://www.w3.org/1999/xhtml">
  32. <head>
  33. <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  34. <title><?php echo _BROWSER_TITLE?></title>
  35. <style type="text/css" media="all">@import "student-health.css";</style>
  36. <SCRIPT language="JavaScript">
  37. /* Javascript function to check if field is empty */
  38. function submitform(fldName, frmNumb)
  39. {
  40. var f = document.forms[frmNumb];
  41. var t = f.elements[fldName];
  42. if (t.value!="")
  43. return true;
  44. else
  45. alert("You have to enter a value !");
  46. return false;
  47. }
  48. </script>
  49. <link rel="icon" href="favicon.ico" type="image/x-icon"><link rel="shortcut icon" href="favicon.ico" type="image/x-icon"><script type="text/javascript" language="JavaScript" src="sms.js"></script>
  50. </head>
  51. <body><img src="images/<?php echo _LOGO?>" border="0">
  52. <div id="Header">
  53. <table width="100%">
  54. <tr>
  55. <td width="50%" align="left"><font size="2">&nbsp;&nbsp;<?php echo date(_DATE_FORMAT); ?></font></td>
  56. <td width="50%"><?php echo _WELCOME?>, <?php echo $tfname. " " .$tlname; ?></td>
  57. </tr>
  58. </table>
  59. </div>
  60. <div id="Content">
  61. <h1><?php echo _NURSE_INFO_1_TITLE?></h1>
  62. <br>
  63. <h2><?php echo _NURSE_INFO_1_SEARCH_DB?></h2>
  64. <br>
  65. <table border="0" cellpadding="1" cellspacing="1" width="100%">
  66. <tr>
  67. <td width="100%" height="45">
  68. <table border="1" cellpadding="0" cellspacing="0" width="100%">
  69. <tr class="trform">
  70. <td width="50%">&nbsp;<?php echo _NURSE_INFO_1_BY_INTERNAL?></td>
  71. <td width="50%">&nbsp;<?php echo _NURSE_INFO_1_BY_LAST?></td>
  72. </tr>
  73. <tr>
  74. <form name="srchid" method="POST"
  75. action="nurse_info_2.php" onsubmit="return submitform('internalid', 0);">
  76. <td width="50%" class="tdinput">
  77. <input type="text" onChange="capitalizeMe(this)" name="internalid" size="22"><input type="submit" value="<?php echo _NURSE_INFO_1_SEARCH?>" name="submit" class="frmbut">
  78. <input type="hidden" name="action" value="srchid">
  79. </td>
  80. </form>
  81. <form name="srchlname" method="POST"
  82. action="nurse_info_2.php" onsubmit="return submitform('slname', 1);">
  83. <td width="50%" class="tdinput">
  84. <input type="text" onChange="capitalizeMe(this)" name="slname" size="25"><input type="submit" value="<?php echo _NURSE_INFO_1_SEARCH?>" name="submit" class="frmbut">
  85. <input type="hidden" name="action" value="srchlname">
  86. </td>
  87. </form>
  88. </tr>
  89. </table>
  90. </td>
  91. </tr>
  92. <tr>
  93. <td width="100%" height="21">
  94. <table border="1" cellpadding="0" cellspacing="0" width="100%">
  95. <tr class="trform">
  96. <td width="100%" colspan="4">&nbsp;<?php echo _NURSE_INFO_1_OR_BY?></td>
  97. </tr>
  98. <tr>
  99. <form name="srchall" method="POST"
  100. action="nurse_info_2.php">
  101. <td width="100%" class="tdinput" colspan="4">
  102. <select name="grade">
  103. <option value="" selected=selected><?php echo _NURSE_INFO_1_BY_GRADE?></option>
  104. <?php
  105. //Display grades from table
  106. foreach($grades as $grade){
  107. ?>
  108. <option value="<?php echo $grade->grades_id; ?>"><?php echo $grade->grades_desc; ?></option>
  109. <?php
  110. };
  111. ?>
  112. </select>
  113. <select size="1" name="gender">
  114. <option value="" selected=selected><?php echo _NURSE_INFO_1_BY_GENDER?></option>
  115. <option value="male">Male</option>
  116. <option value="female">Female</option>
  117. </select>
  118. <select size="1" name="ethnicity">
  119. <option value="" selected=selected><?php echo _NURSE_INFO_1_BY_ETHNICITY?></option>
  120. <?php
  121. //Display Ethnicities from table
  122. foreach($ethnicities as $ethnicity){
  123. ?>
  124. <option value="<?php echo $ethnicity->ethnicity_id; ?>"><?php echo $ethnicity->ethnicity_desc; ?></option>
  125. <?php
  126. };
  127. ?>
  128. </select>
  129. </td>
  130. </tr>
  131. <tr class="trform">
  132. <td width="25%" class="tdinput">
  133. &nbsp;<?php echo _NURSE_INFO_1_ACTIVE?>: <input type="radio" value="1" name="active" checked=checked> <?php echo _YES?> <input type="radio" value="" name="active"> <?php echo _NO?></td>
  134. <td width="25%" class="tdinput">
  135. &nbsp;<?php echo _NURSE_INFO_1_HOMED?>: <input type="radio" value="1" name="homed"> <?php echo _YES?> <input type="radio" value="" name="homed" checked=checked> <?php echo _NO?></td>
  136. <td width="25%" class="tdinput">
  137. &nbsp;<?php echo _NURSE_INFO_1_SPED?>: <input type="radio" value="1" name="sped"> <?php echo _YES?> <input type="radio" value="" name="sped" checked=checked> <?php echo _NO?></td>
  138. <td width="25%" class="tdinput" align="center">
  139. <input type="submit" value="<?php echo _NURSE_INFO_1_SEARCH?>" name="submit" class="frmbut">
  140. <input type="hidden" name="action" value="srchall"></td>
  141. </form>
  142. </tr>
  143. </table>
  144. </td>
  145. </tr>
  146. <tr>
  147. <td width="100%">
  148. <table border="1" cellpadding="0" cellspacing="0" width="100%">
  149. <tr class="trform">
  150. <td width="100%" colspan="4">&nbsp;<?php echo _NURSE_INFO_1_SEARCH_LAST?></td>
  151. </tr>
  152. <tr>
  153. <td width="100%" align="center">
  154. <?php
  155. for($letters = 'A'; $letters != 'AA'; $letters++)
  156. {
  157. echo "<a
  158. href='nurse_info_2.php?action=letter&letter=$letters'
  159. class='aform'>$letters</a> &nbsp;";
  160. }
  161. ?>
  162. </td>
  163. </tr>
  164. </table>
  165. </td>
  166. </tr>
  167. </table>
  168. </div>
  169. <?php if($_SESSION['UserType'] == "A") {
  170. include "admin_menu.inc.php";
  171. } else {
  172. include "health_menu.inc.php";
  173. }; ?>
  174. </body>
  175. </html>