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

/www/profile.php

https://bitbucket.org/thomascherian91/online-hostel-manager
PHP | 172 lines | 161 code | 11 blank | 0 comment | 11 complexity | b63089fcfda3d0544e23d642e3aabfc4 MD5 | raw file
  1. <?php
  2. session_start();
  3. if($_SESSION['status']!='admin')
  4. {
  5. $_SESSION['status']='';
  6. header('location: login.php?typ=5');
  7. }
  8. ?>
  9. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  10. <html xmlns="http://www.w3.org/1999/xhtml">
  11. <head>
  12. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  13. <title>Inmate list</title>
  14. <link rel="stylesheet" type="text/css" href="home.css" >
  15. </head>
  16. <?php include("adminPart1.php");?>
  17. <body>
  18. <?php
  19. $id=$_GET['id'];
  20. $aid=$_GET['id'];
  21. $sid=$_GET['id'];
  22. $gid=$_GET['id'];
  23. $inmate=$_GET['inmate'];
  24. if($inmate=='student')
  25. {
  26. $query="SELECT * FROM student WHERE uid='$id'";
  27. $result=mysql_query($query);
  28. ?>
  29. <table class="form"><tr>
  30. <?php
  31. echo "<table border='1'>";
  32. while($row=mysql_fetch_array($result))
  33. {
  34. ?>
  35. <td align="center" colspan=2><img name='studentpic' src='dispImageStudent.php?num=<?php echo $id; ?>' width='171' height='170' alt='' /></td></tr>
  36. <?php
  37. echo "<tr><td><div align='left'>Id</div></td><td><div align='left'>";
  38. echo $row['uid'];
  39. echo "</div></td></tr><tr><td><div align='left'>Name</div></td><td><div align='left'>";
  40. echo $row['name'];
  41. echo "</div></td></tr><tr><td><div align='left'>Current address</div></td><td><div align='left'>";
  42. echo $row['curr_address'];
  43. echo "</div></td></tr><tr><td><div align='left'>permanent address</div></td><td><div align='left'>";
  44. echo $row['per_address'];
  45. echo "</div></td></tr><tr><td><div align='left'>Course</div></td><td><div align='left'>";
  46. echo $row['course_of_study'];
  47. echo "</div></td></tr><tr><td><div align='left'>Branch</div></td><td><div align='left'>";
  48. echo $row['branch'];
  49. echo "</div></td></tr><tr><td><div align='left'>Blood Group</div></td><td><div align='left'>";
  50. echo $row['blood_group'];
  51. echo "</div></td></tr><tr><td><div align='left'>Email id</div></td><td><div align='left'>";
  52. echo $row['emailid'];
  53. echo "</div></td></tr><tr><td><div align='left'>Parents contact number</div></td><td><div align='left'>";
  54. echo $row['parent_cont_num'];
  55. echo "</div></td></tr><tr><td><div align='left'>Student contact number</div></td><td><div align='left'>";
  56. echo $row['stud_cont_num'];
  57. }
  58. echo "</table>";
  59. }
  60. if($inmate=='admin')
  61. {
  62. $sqlquery=mysql_query("SELECT * FROM admin WHERE aid = '$aid';");
  63. $row = mysql_fetch_array($sqlquery);
  64. if (mysql_affected_rows() == 1)
  65. {
  66. ?>
  67. <table width="221" border="1">
  68. <tr><td align="center" colspan=2><img name='studentpic' src='dispImageAdmin.php?num=<?php echo $aid; ?>' width='171' height='170' alt='' /></td></tr>
  69. <tr>
  70. <td width="119"><div align="left">Admin id</div></td>
  71. <td width="86" align="left" ><div align="left"><?php echo $row['aid']?></div></td>
  72. </tr>
  73. <tr>
  74. <td><div align="left">Name</div></td>
  75. <td align="left" ><div align="left"><?php echo $row['name']?></div></td>
  76. </tr>
  77. <tr>
  78. <td><div align="left">Designation</div></td>
  79. <td align="left" ><div align="left"><?php echo $row['designation']?></div></td>
  80. </tr>
  81. <tr>
  82. <td><div align="left">Contact number</div></td>
  83. <td align="left" ><div align="left"><?php echo $row['cntact_no']?></div></td>
  84. </tr>
  85. </table>
  86. <?php
  87. }
  88. }
  89. ?>
  90. <?php
  91. if($inmate=='staff')
  92. {
  93. $sqlquery=mysql_query("SELECT * FROM staff WHERE id = '$sid';");
  94. $row = mysql_fetch_array($sqlquery);
  95. if (mysql_affected_rows() == 1)
  96. {
  97. ?>
  98. <table width="221" border="1">
  99. <tr><td align="center" colspan=2><img name='studentpic' src='dispImageStaff.php?num=<?php echo $aid; ?>' width='171' height='170' alt='' /></td></tr>
  100. <tr>
  101. <td width="119"><div align="left">Staff id</div></td>
  102. <td width="86" align="left" ><div align="left"><?php echo $row['id']?></div></td>
  103. </tr>
  104. <tr>
  105. <td><div align="left">Name</div></td>
  106. <td align="left"><div align="left"><?php echo $row['name']?></div></td>
  107. </tr>
  108. <tr>
  109. <td><div align="left">Address</div></td>
  110. <td align="left" ><div align="left"><?php echo $row['address']?></div></td>
  111. </tr>
  112. <tr>
  113. <td><div align="left">Contact number</div></td>
  114. <td align="left" ><div align="left"><?php echo $row['cont_num']?></div></td>
  115. </tr>
  116. </table>
  117. <?php
  118. }
  119. }
  120. ?>
  121. <?php
  122. if($inmate=='guest')
  123. {
  124. $sqlquery=mysql_query("SELECT * FROM guest WHERE id = '$gid';");
  125. $row = mysql_fetch_array($sqlquery);
  126. if (mysql_affected_rows() == 1)
  127. {
  128. ?>
  129. <table width="221" border="1">
  130. <tr>
  131. <td width="119"><div align="left">Guest id</div></td>
  132. <td width="86" align="left" ><div align="left"><?php echo $row['id']?></div></td>
  133. </tr>
  134. <tr>
  135. <td><div align="left">Name</div></td>
  136. <td align="left" ><div align="left"><?php echo $row['name']?></div></td>
  137. </tr>
  138. <tr>
  139. <td><div align="left">Address</div></td>
  140. <td align="left"><div align="left"><?php echo $row['room_num']?></div></td>
  141. </tr>
  142. <tr>
  143. <td><div align="left">Address</div></td>
  144. <td align="left" ><div align="left"><?php echo $row['address']?></div></td>
  145. </tr>
  146. <tr>
  147. <td><div align="left">Address</div></td>
  148. <td align="left" ><div align="left"><?php echo $row['purpose_of_stay']?></div></td>
  149. </tr>
  150. <tr>
  151. <td><div align="left">Contact number</div></td>
  152. <td align="left"><div align="left"><?php echo $row['cont_num']?></div></td>
  153. </tr>
  154. </table>
  155. <?php
  156. }
  157. }
  158. include("adminPart2.php");
  159. ?>
  160. </body>
  161. </html>