PageRenderTime 52ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/take_test_sql.php

https://bitbucket.org/krishna2793/aces
PHP | 150 lines | 123 code | 19 blank | 8 comment | 4 complexity | 1b7a07e4a55373fc77b7cf43924bfd25 MD5 | raw file
  1. <?php
  2. require_once ('Auth_stu.php');
  3. session_start();
  4. $auth = new Auth_stu();
  5. if (!isset($_SESSION['user_id']))
  6. {
  7. die('nogrjig');
  8. //Not logged in, send to login page.
  9. //header( 'Location: login.php' );
  10. }
  11. else
  12. {
  13. //Check we have the right user
  14. $logged_in = $auth->checkSession();
  15. if(empty($logged_in)){
  16. //Bad session, ask to login
  17. $auth->logout();
  18. header( 'Location: login.php' );
  19. }
  20. else
  21. {
  22. //User is logged in, show the page
  23. ?>
  24. <!DOCTYPE html>
  25. <html>
  26. <head>
  27. <title>ACES : HOME</title>
  28. <!-- Include the bootstrap stylesheets -->
  29. <link rel="stylesheet" href="bootstrapnew.css"
  30. </head>
  31. <body>
  32. <!-- Navbar
  33. ================================================== -->
  34. <div class="navbar navbar-fixed-top">
  35. <div class="navbar-inner">
  36. <div class="container">
  37. <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
  38. <span class="icon-bar"></span>
  39. <span class="icon-bar"></span>
  40. <span class="icon-bar"></span>
  41. </a>
  42. <a class="brand" href="C:\Users\sowmya\Desktop\demo\boot.html">AMRITA</a>
  43. <div class="nav-collapse" id="main-menu">
  44. <ul class="nav" id="main-menu-left">
  45. <li><a onclick="pageTracker._link(this.href); return false;" href="http://news.bootswatch.com">News</a></li>
  46. <li><a id="swatch-link" href="gallery.html">Gallery</a></li>
  47. </ul>
  48. <ul class="nav pull-right" id="main-menu-right">
  49. <Li> <form class="navbar-search pull-left">
  50. <input type="text" class="search-query span2" placeholder="Search">
  51. </form></Li>
  52. <li><a rel="tooltip" href="http://www.amrita.edu/">Login <i class="icon-share-alt"></i></a></li>
  53. </ul>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <div class="container">
  59. <div class="container">
  60. <p> </p>
  61. <h1 style="font-size:46px" align="center" >&nbsp;</h1>
  62. <h1 style="font-size:46px" align="center" >&nbsp;</h1>
  63. <h1 style="font-size:46px" align="center" >ACES</h1>
  64. <h4 align="center"> Automated Code Evaluation System</h4>
  65. <p>........................................................................................................................................................................................................................................</p>
  66. <h6 align="left">AMRITA SCHOOL OF ENGINEERING</h6>
  67. <h6 align="left" >COIMBATORE <small></h6>
  68. <!-- Forms
  69. ================================================== -->
  70. <section id="forms">
  71. <div class="page-header">
  72. <h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Code Submission Response</h1>
  73. </div>
  74. <div class="row">
  75. <div class="span10 offset1">
  76. <form class="form-horizontal well" method="post" action="test_RULES_SQL.php">
  77. <fieldset>
  78. <div class="control-group">
  79. <label class="control-label" for="textarea">Available Tests</label>
  80. <div class="controls">
  81. <p>
  82. <?php session_start();
  83. $con = mysql_connect('localhost','root','mysql');
  84. if (!$con)
  85. {
  86. die('Could not connect: ' . mysql_error());
  87. }
  88. mysql_select_db("aces", $con) or die('db con faild');
  89. $_SESSION['i']=0;
  90. //the list that i print here must be convrted to check box or radio button or links
  91. $query = mysql_query("select * from test_pool_sql where test_id not in (select test_id from user_gradebook_Query where stu_id=$_SESSION[user_id]");
  92. //$j = 1;
  93. while($info = mysql_fetch_array($query))
  94. {
  95. echo '<br>'.'('.$info['test_id'].')'.$info['test_name'].'----';
  96. //$j++;
  97. }
  98. ?>
  99. </p>
  100. </div>
  101. </div>
  102. <div class="control-group">
  103. <label class="control-label" for="input01">Choose your test :</label>
  104. <div class="controls">
  105. <input type="text" class="input-xlarge" id="i01" name="test_id">
  106. </div>
  107. </div>
  108. <div class="form-actions">
  109. <button type="submit" class="btn btn-primary">Go</button>
  110. <button type="reset" class="btn">Cancel</button>
  111. </div>
  112. </fieldset>
  113. </form>
  114. </div>
  115. </div>
  116. </section>
  117. <!-- Footer
  118. ================================================== -->
  119. <hr>
  120. <footer id="footer">
  121. <p class="pull-right"><a href="boot.html">Back to top</a></p>
  122. <div class="links"></div>
  123. Made by <a href="http://www.amrita.edu">Amrita</a>. Contact him <a href="mailto:amrita.edu">hello@admin_asec</a>.<br/>
  124. Based on <a target="_blank" href="http://twitter.github.com/bootstrap/">Bootstrap</a>. Icons from <a target="_blank" href="http://glyphicons.com/">Glyphicons</a>. Web fonts from <a target="_blank" href="http://www.google.com/webfonts">Google</a>.</p>
  125. </footer>
  126. </body>
  127. </html>
  128. <?php
  129. }
  130. }
  131. ?>