暫無描述

viewQuestionnaireExperience.php 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <!---
  2. Developer: Coralys Cubero Rivera
  3. Fall 2018
  4. This script allows the user to see the specific information of a questionnaire associated to an experience.
  5. Updated by: Víctor A. Hernández
  6. Summer 2019
  7. --->
  8. <?php
  9. require_once 'processes/config.php';
  10. require_once 'processes/dbh.inc.php';
  11. if(isset($_GET['view'])) {
  12. $query = "SELECT * FROM `questionnair` WHERE `id`='".$_GET['view']."';";
  13. $result = mysqli_query($connection, $query);
  14. if(!$result) die("Error: ".mysqli_error($connection));
  15. $row = mysqli_fetch_array($result);
  16. }
  17. include_once 'header.php';
  18. ?>
  19. <div class='container'>
  20. <br>
  21. <h2>QUESTIONNAIRE <?php echo $row[0]; ?></h2>
  22. <br>
  23. <p> <font size='4'> <b> Title: </b> <?php echo $row[1]; ?> </font> </p>
  24. <p> <font size='4'> <b> Description: </b> <?php echo $row[2]; ?> </font>
  25. <a class='btn btn-info' style='float: right;' href='editQuestionnaire.php?edit=<?php echo $row[0]; ?>'> Edit Questionnaire </a>
  26. </p>
  27. <table class='table table-hover' id='tableEvaluations'>
  28. <?php
  29. $result = mysqli_query($connection, "SELECT `id`, `premise` FROM `question` WHERE `id` IN (SELECT `id_question` FROM `questionnair_question` WHERE `id_questionnair`='".$row[0]."');");
  30. echo "
  31. <thead>
  32. <tr>
  33. <th> ID </th>
  34. <th> Questions </th>
  35. </tr>
  36. </thead>
  37. <tbody>";
  38. while($row = mysqli_fetch_array($result)) {
  39. echo " <tr>";
  40. echo "<td> <p> ".$row['id']."</p> </td>";
  41. echo "<td> <p> ".$row['premise']." </p> </td>";
  42. echo "</tr>";
  43. }
  44. echo "</tbody>"
  45. ?>
  46. </table>
  47. <br><br>
  48. </div>
  49. <?php include_once 'footer.html'; ?>
  50. <?php
  51. /*
  52. <!-- POPUP FOR EDIT EXPERIENCE -->
  53. <form class='form-horizontal' action='processes/updateExperience.php' method='POST'>
  54. <div class='modal fade' id='Edit_<?php echo $row['id']; ?>' tabindex='-1' role='dialog' aria-labelledby='EditLabel_<?php echo $row['id']; ?>' aria-hidden='true'>
  55. <div class='modal-dialog' role='document'>
  56. <div class='modal-content'>
  57. <div class='modal-header'>
  58. <h3 class='modal-title' id='EditLabel_<?php echo $row['id']; ?>'>Experience Basic Info</h3>
  59. </div>
  60. <div class='modal-body'>
  61. <!-- ID -->
  62. <input type='hidden' name='id' value='<?php echo $row['id']; ?>'>
  63. <!-- NEW TITLE -->
  64. <div class='form-group form-horizontal'>
  65. <label class='col-sm-offset-1 col-sm-2 control-label'>Title:</label>
  66. <div class='col-sm-8'>
  67. <input class='form-control' type='text' name='newTitle' value='<?php echo $row['title']; ?>'>
  68. </div>
  69. </div>
  70. <!-- NEW DESCRIPTION -->
  71. <div class='form-group form-horizontal'>
  72. <label class='col-sm-offset-1 col-sm-2 control-label'>Description:</label>
  73. <div class='col-sm-8'>
  74. <input class='form-control' type='text' name='newDescription' value='<?php echo $row['description']; ?>'>
  75. </div>
  76. </div>
  77. <!-- NEW TYPE -->
  78. <div class='form-group form-horizontal'>
  79. <label class='col-sm-offset-1 col-sm-2 control-label'>Type:</label>
  80. <div class='col-sm-8'>
  81. <input class='form-control' type='text' name='newType' value='<?php echo $row['type']; ?>'>
  82. </div>
  83. </div>
  84. <!-- NEW DURATION -->
  85. <div class='form-group form-horizontal'>
  86. <label class='col-sm-offset-1 col-sm-2 control-label'>Duration:</label>
  87. <div class='col-sm-8'>
  88. <input class='form-control' type='text' name='newDuration' value='<?php echo $row['duration_weeks']; ?>'>
  89. </div>
  90. </div>
  91. <!-- NEW START -->
  92. <div class='form-group form-horizontal'>
  93. <label class='col-sm-offset-1 col-sm-2 control-label'>Start Date:</label>
  94. <div class='col-sm-8'>
  95. <input class='form-control' type='text' name='newStart' value='<?php echo $row['start_date']; ?>'>
  96. </div>
  97. </div>
  98. <!-- NEW END -->
  99. <div class='form-group form-horizontal'>
  100. <label class='col-sm-offset-1 col-sm-2 control-label'>End Date:</label>
  101. <div class='col-sm-8'>
  102. <input class='form-control' type='text' name='newEnd' value='<?php echo $row['end_date']; ?>'>
  103. </div>
  104. </div>
  105. </div><!--modal-body-->
  106. <!-- SUBMIT OR CANCEL -->
  107. <div class='modal-footer'>
  108. <button type='button' class='btn btn-default' data-dismiss='modal'>Close</button>
  109. <button type='submit' class='btn btn-primary' name='updateExperience'>Save Changes</button>
  110. </div><!--modal-footer-->
  111. </div><!--modal-content-->
  112. </div><!--modal-dialog-->
  113. </div><!--modal-->
  114. </form>
  115. */
  116. ?>