Guest User

Untitled

a guest
Apr 24th, 2017
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.49 KB | None | 0 0
  1. //Project
  2. Index.html
  3. <html>
  4. <head>
  5. <title>CAT PROCESS, SCSE, VIT UNIVERSITY, VELLORE, TAMIL NADU, INDIA</title>
  6. </head>
  7. <frameset cols="25%,80%">
  8. <frame src ="Login.html" name="leftframe"/>
  9. <frame src= "right.html" name ="rightframe"/>
  10. </frameset>
  11. </html>
  12.  
  13. Login.html
  14. <html>
  15. <STYLE>
  16. font.nf
  17. {
  18. text-align:left;
  19. line-height:17pt;
  20. font-size: 18pt;
  21. color:magenta;
  22. }
  23. </STYLE>
  24. <body>
  25. <font color=green size=+3>
  26. Sign Up</font>
  27. <font class= nf>
  28. <form method=post action="login.php" align =center>
  29. Name: <br><input type=text name="LoginName"><br>
  30. Password: <br><input type =password name ="PassName"><br><br>
  31. <input type=submit value="Login">
  32. </font>
  33. </form>
  34. </body>
  35. </html>
  36.  
  37. Right.html
  38. <HTML>
  39. <STYLE>
  40. font.bf
  41. {
  42. text-align:center;
  43. line-height:20pt;
  44. font-size:24pt;
  45. color:green
  46. }
  47. font.mf
  48. {
  49. text-align:center;
  50. line-height:17pt;
  51. font-size: 24pt;
  52. color:blue;
  53. }
  54.  
  55. </STYLE>
  56. <BODY background ="pic2.jpg" align=center>
  57. <br><br>
  58. <font class=bf>
  59. <h1>CAT EXAM PROCESS</h1></font>
  60. <font class=mf>
  61. <h2>SCSE</H2>
  62. <H3>VIT UNIVERSITY,VELLORE</H3></font>
  63. </BODY>
  64. </HTML>
  65.  
  66. Login.php
  67.  
  68. <?php
  69. session_start();
  70. $username=$_POST['LoginName'];
  71. $pwd=$_POST['PassName'];
  72. $con=mysql_connect("localhost","root","") or die(mysql_error());
  73. $db=mysql_select_db("cat",$con) or die(mysql_error());
  74. $query="select * from admin where username = '".$username."' and password = '".md5($pwd)."'";
  75. $rs=mysql_query($query,$con) or die(mysql_error());
  76. if (mysql_num_rows($rs) == 1)
  77. {
  78. // HAS TO DISPLAY THE MENUS
  79.  
  80. echo "<font size=+1 color=black>";
  81. $_SESSION["loginname"]=$username;
  82. echo "Hi, $username<br>";
  83. echo "<a href= exam_Data_Process.php target=rightframe>CAT DATA PROCESS</a><br><br>";
  84. echo "<a href= Exam_Hall_Process.php target=rightframe>EXAM HALL PROCESS</a><br><br>";
  85. echo "<a href= CAT_Document_Process.html target=rightframe>CAT DOCUMENT PROCESS</a><br><br>";
  86. echo "<a href= Change_Password_Process.php target=rightframe>CHANGE PASSWORD</a><br><BR>";
  87. echo "<a href= Logout.php> LOGOUT</a>";
  88. }
  89. else
  90. echo "<html>Not authenticated please login again<br> <a href=login.html target=leftframe> Login</a></html>";
  91. mysql_close($con) or die(mysql_error());
  92. ?>
  93. Exam_Hall_Process.php
  94.  
  95. <?php
  96. session_start();
  97. if (isset($_SESSION['loginname']))
  98. {
  99. echo "<body background=\"pic2.jpg\">";
  100. echo "<h1 align=center color=blue size =+2> EXAM HALL PROCESS</h1>";
  101. echo "<br><hr><br>";
  102. echo "<form action=\"view_exam_hall.php\">";
  103. echo "<input type=submit value=\"VIEW EXAM HALL\" style=\"width:200px; height:50px; font-size:100%;color:green\">";
  104. echo "</form>";
  105. echo "<form action=\"add_exam_hall.php\">";
  106. echo "<input type=submit value=\"ADD EXAM HALL\" style=\"width:200px; height:50px; font-size:100%;color:green\">";
  107. echo "</form> <form action=\"modify_exam_hall.php\">";
  108. echo "<input type=submit value=\"MODIFY EXAM HALL\" style=\"width:200px; height:50px; font-size:100%;color:green\"></form>";
  109. echo "<form action=\"remove_exam_hall.php\">";
  110. echo "<input type=submit value=\"REMOVE EXAM HALL\" style=\"width:200px; height:50px; font-size:100%;color:green\"> </form></font>";
  111. echo "</BODY></HTML>";
  112. }
  113. else
  114. echo "<font size=+2> Sorry, You are not authorized user. Please <b>Login </b>properly</font>";
  115. ?>
  116.  
  117. View exam hall.php
  118. <?php
  119. session_start();
  120. if (isset($_SESSION['loginname']))
  121. {
  122. $con=mysql_connect("localhost","root","") or die(mysql_error());
  123. $db = mysql_select_db("cat",$con) or die(mysql_error());
  124. $query="select classnum,capacity from class order by classnum";
  125. $class_rec_set = mysql_query($query,$con) or die(mysql_error());
  126. echo "<body background=\"pic2.jpg\">";
  127. echo "<form action= \"exam_hall_process.php\">";
  128. echo "<input type=submit value=\"<< GO BACK\" style=\"width:200px; height:50px; font-size:100%;color:green\">";
  129. echo "</font></form></b></html>";
  130. echo "<h1 align=center><font color=blue>EXAM ROOM DETAILS</H1>";
  131. echo "<font size=+2 color=maroon>";
  132. echo "<table border=1 style =\"font-size:+25\" align=center><b><tr><th>S. No.</th><th> ROOM NUMBER</th><th> CAPACITY</th></tr>";
  133. $count=0;
  134. while($class_rec = mysql_fetch_assoc($class_rec_set))
  135. {
  136. $count++;
  137. echo "<tr align=center><td>$count</td><td>",$class_rec['classnum'],"</td><td>",$class_rec['capacity'], "</td></tr>";
  138. }
  139. echo "</table><br><br>";
  140. echo "<form action= \"exam_hall_process.php\">";
  141. echo "<input type=submit value=\"<< GO BACK\" style=\"width:200px; height:50px; font-size:100%;color:green\">";
  142. echo "</font></form></b></html>";
  143. mysql_close($con);
  144. }
  145. else
  146. echo "<font size=+2> Sorry, You are not authorized user. Please <b>Login </b>properly";
  147.  
  148. ?>
  149.  
  150. Add exam hall.php
  151. <?php
  152. session_start();
  153. if (isset($_SESSION['loginname']))
  154. {
  155. echo "<body background=\"pic2.jpg\"><font size=+2><form action=\"add_room.php\" method=post><b>";
  156. echo "Enter Room Number: <input type = text name=\"roomnum\">";
  157. echo "<br><br>Room Capacity: <input type=radio name =\"roomcapacity\" value =40 checked> 40";
  158. echo "<input type=radio name =\"roomcapacity\" value =60> 60<br><br>";
  159. echo "<input type=submit value=\"ADD ROOM\" style=\"width:200px; height:50px; font-size:100%;color:green\"></b></form></font>";
  160. }
  161. else
  162. echo "<font size=+2> Sorry, You are not authorized user. Please <b>Login </b>properly";
  163. ?>
  164. Add room.php
  165. <?php
  166. session_start();
  167. $room_num=strtoupper($_POST['roomnum']);
  168. $room_capacity=$_POST['roomcapacity'];
  169. settype($room_capacity,'integer');
  170. if (isset($_SESSION['loginname']))
  171. {
  172. echo "<body background=\"pic2.jpg\"><font size =+2>";
  173. if ($room_num <> "")
  174. {
  175. $con=mysql_connect("localhost","root","") or die(mysql_error());
  176. $db = mysql_select_db("cat",$con) or die(mysql_error());
  177. $query="insert into class (classnum,capacity,availability) values('".$room_num."',".$room_capacity. ",".$room_capacity.")";
  178. $rec_set=mysql_query($query,$con) or die(mysql_error());
  179. echo "<font size=+2 >Room Added</font>";
  180. mysql_close($con);
  181.  
  182. }
  183. else
  184. {
  185. echo "<font size=+3> Room number is empty pl check it</font>";
  186. echo "<form action= \"add_exam_hall.php\">";
  187. echo "<input type=submit value=\" CONTINUE\" style=\"width:200px; height:50px; font-size:100%;color:green\">";
  188. echo "</font></form></html>";
  189. }
  190. echo "<form action= \"exam_hall_process.php\"><font size=+2>";
  191. echo "<input type=submit value=\"<< MENU\" style=\"width:200px; height:50px; font-size:100%;color:green\">";
  192. echo "</font></form></html>";
  193.  
  194. }
  195. else
  196. echo "<font size=+2> Sorry, You are not authorized user. Please <b>Login </b>properly";
  197.  
  198. ?>
  199.  
  200. Modify exam hall.php
  201. <?php
  202. session_start();
  203. if (isset($_SESSION['loginname']))
  204. {
  205. echo "<body background=\"pic2.jpg\">";
  206. echo "<h1 align=center color=blue size =+2> EXAM HALL PROCESS</h1>";
  207. echo "<br><hr><br>";
  208. $con=mysql_connect("localhost","root","") or die(mysql_error());
  209. $db = mysql_select_db("cat",$con) or die(mysql_error());
  210. $query = "select classnum,capacity from class order by classnum";
  211. $class_rec_set=mysql_query($query) or die(mysql_error());
  212. echo "<form action=\"modify_room.php\" method =post>";
  213. echo "<font size=+2>Exam Halls: <br><select name=\"roomnum\" size=5> ";
  214. while ($class_rec = mysql_fetch_assoc($class_rec_set))
  215.  
  216. echo "<option value='".$class_rec['classnum']."'> ". $class_rec['classnum'];
  217. echo "</select>";
  218. echo "<br>Capacity: <input type=radio name=\"roomcapacity\" value =40 checked>40";
  219. echo "<input type=radio name=\"roomcapacity\" value =60 >60<br>";
  220. echo "<input type = submit value =\"UPDATE\" style=\"width:200px; height:50px; font-size:100%;color:green\"></FORM>";
  221. echo "<form action= \"exam_hall_process.php\">";
  222. echo "<input type=submit value=\"<< CANCEL\" style=\"width:200px; height:50px; font-size:100%;color:green\">";
  223. echo "</font></form></html>";
  224.  
  225. mysql_close($con);
  226. }
  227. else
  228. echo "<font size=+2> Sorry, You are not authorized user. Please <b>Login </b>properly</font>";
  229. ?>
  230. Modify room.php
  231. <?PHP
  232. session_start();
  233. echo "<body background =\"pic2.jpg\">";
  234. if (isset($_POST['roomnum']))
  235. {
  236. $room_number =$_POST['roomnum'];
  237. $room_capacity=$_POST['roomcapacity'];
  238. settype($room_capacity,'integer');
  239. if (isset($_SESSION['loginname']))
  240. {
  241. echo "<body background=\"pic2.jpg\">";
  242. echo "<h1 align=center color=blue size =+2> EXAM HALL MODIFY PROCESS</h1>";
  243. echo "<br><hr><br>";
  244. $con=mysql_connect("localhost","root","") or die(mysql_error());
  245. $db=mysql_select_db("cat",$con) or die(mysql_error());
  246. $query="update class set capacity = ".$room_capacity." where classnum = '". $room_number. "'";
  247. $update_rec_set= mysql_query($query,$con) or die(mysql_error());
  248. echo "Updated ".$room_number."'s capacity as ".$room_capacity."<br>";
  249.  
  250.  
  251. }
  252. else
  253. {
  254. die( "<font size=+2> Sorry, You are not authorized user. Please <b>Login </b>properly</font>");
  255.  
  256. }
  257. }
  258. else
  259.  
  260. {
  261. echo "</font><font size=+2> No room was selected. Pl select a room";
  262. echo "<form action= \"modify_exam_hall.php\">";
  263. echo "<input type=submit value=\"CONTINUE\" style=\"width:200px; height:50px; font-size:100%;color:green\">";
  264. echo "</font></form></html>";
  265. }
  266. echo "<form action= \"exam_hall_process.php\">";
  267. echo "<input type=submit value=\"<< MENU\" style=\"width:200px; height:50px; font-size:100%;color:green\">";
  268. echo "</font></form></html>";
  269.  
  270.  
  271. ?>
  272.  
  273. Remove exam hall.php
  274. <?php
  275. session_start();
  276. if (isset($_SESSION['loginname']))
  277. {
  278. echo "<body background=\"pic2.jpg\">";
  279. echo "<h1 align=center color=blue size =+2> EXAM HALL PROCESS</h1>";
  280. echo "<br><hr><br>";
  281. $con=mysql_connect("localhost","root","") or die(mysql_error());
  282. $db = mysql_select_db("cat",$con) or die(mysql_error());
  283. $query = "select classnum,capacity from class order by classnum";
  284. $class_rec_set=mysql_query($query) or die(mysql_error());
  285. echo "<form action=\"remove_room.php\" method =post>";
  286. echo "<font size=+2>Exam Halls: <br><select name=\"roomnum\" size=5> ";
  287. while ($class_rec = mysql_fetch_assoc($class_rec_set))
  288.  
  289. echo "<option value='".$class_rec['classnum']."'> ". $class_rec['classnum'];
  290. echo "</select><br>";
  291. echo "<input type = submit value =\"REMOVE\" style=\"width:200px; height:50px; font-size:100%;color:green\"></FORM>";
  292. echo "<form action= \"exam_hall_process.php\">";
  293. echo "<input type=submit value=\"<< CANCEL\" style=\"width:200px; height:50px; font-size:100%;color:green\">";
  294. echo "</font></form></html>";
  295.  
  296. mysql_close($con);
  297. }
  298. else
  299. echo "<font size=+2> Sorry, You are not authorized user. Please <b>Login </b>properly</font>";
  300. ?>
  301.  
  302. Remove room.php
  303. <?PHP
  304. session_start();
  305. echo "<body background=\"pic2.jpg\">";
  306. echo "<h1 align=center color=blue size =+2> EXAM HALL MODIFY PROCESS</h1>";
  307. echo "<br><hr><br>";
  308. if (isset($_POST['roomnum']))
  309. {
  310. $room_num=$_POST['roomnum'];
  311. if (isset($_SESSION['loginname']))
  312. {
  313. $con=mysql_connect("localhost","root","") or die(mysql_error());
  314. $db=mysql_select_db("cat",$con) or die(mysql_error());
  315. $query ="delete from class where classnum = '".$room_num."'";
  316. mysql_query($query,$con) or die(mysql_error());
  317. echo "<font size=+2> $room_num Removed from list";
  318. }
  319. else
  320. {
  321. die( "</font><font size=+2> Sorry, You are not authorized user. Please <b>Login </b>properly </font>");
  322.  
  323. }
  324.  
  325. }
  326. else
  327. {
  328. echo "</font><font size=+2> No room was selected. Pl select a room";
  329. echo "<form action= \"remove_exam_hall.php\">";
  330. echo "<input type=submit value=\"CONTINUE\" style=\"width:200px; height:50px; font-size:100%;color:green\">";
  331. echo "</font></form></html>";
  332.  
  333. }
  334.  
  335. echo "<form action= \"exam_hall_process.php\">";
  336. echo "<font size=+2><input type=submit value=\"<< MENU\" style=\"width:200px; height:50px; font-size:100%;color:green\">";
  337. echo "</font></form></html>";
  338.  
  339.  
  340. ?>
Add Comment
Please, Sign In to add comment