Advertisement
adrianpascua

Untitled

May 24th, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4. require_once 'config.php';
  5.  
  6. if (@$_SESSION['username']) {
  7. $query = "SELECT * FROM `crew_info` WHERE `id` = ?";
  8. $stmt = mysqli_prepare($conn, $query);
  9. mysqli_stmt_bind_param($stmt, 's', $_GET['id']);
  10. mysqli_stmt_execute($stmt);
  11. mysqli_stmt_bind_result($stmt, $col1, $col2, $col3, $col4, $col5, $col6, $col7, $col8, $col9, $col10, $col11, $col12, $col213, $col14, $col15, $col16, $col17, $col18, $col19);
  12.  
  13. if(isset($_POST['submit'])) {
  14. include 'config.php';
  15. $query_update = "UPDATE `crew_info` SET `crew_status` = 'NEW' WHERE `id` = ?";
  16. $stmt2 = mysqli_prepare($conn, $query_update);
  17. mysqli_stmt_bind_param($stmt2, 's', $_GET['id']);
  18. mysqli_stmt_execute($stmt2);
  19.  
  20. /*if (mysqli_stmt_affected_rows($stmt2)) {
  21. echo "Crew update accepted";
  22. } else {
  23. echo 'Error';
  24. }*/
  25.  
  26. }
  27. echo '<!DOCTYPE html>
  28. <html>
  29. <head>
  30. <title>Review Crew</title>
  31. </head>
  32. <body>
  33. <form action="review.php" method="POST">
  34.  
  35. <table border="2" align="center" width="600" cellspacing="3" cellpadding="4">
  36. <tr>
  37. <th>First Name</th>
  38. <th>Middle Name</th>
  39. <th>Last Name</th>
  40. <th>Date Added</th>
  41. <th>Status</th>
  42. </tr>
  43. <tr>';
  44. while($record = mysqli_stmt_fetch($stmt)) {
  45. echo '<tr>';
  46. echo "<th>".sprintf("%s", $col2)."</th>";
  47. echo "<th>".sprintf("%s", $col3)."</th>";
  48. echo "<th>".sprintf("%s", $col4)."</th>";
  49. echo "<th>".sprintf("%s", $col18)."</th>";
  50. echo "<th>".sprintf("%s", $col19)."</th>";
  51. echo '</tr>';
  52. }
  53. echo '</table>';
  54. echo '<br><center><input type="submit" name="submit" value="Submit"></center>
  55. </form>
  56. </body>
  57. </html>';
  58.  
  59. }
  60. else {
  61. header('Location: /practice1/index.php');
  62. }
  63.  
  64. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement