Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- require_once 'config.php';
- if (@$_SESSION['username']) {
- $query = "SELECT * FROM `crew_info` WHERE `id` = ?";
- $stmt = mysqli_prepare($conn, $query);
- mysqli_stmt_bind_param($stmt, 's', $_GET['id']);
- mysqli_stmt_execute($stmt);
- mysqli_stmt_bind_result($stmt, $col1, $col2, $col3, $col4, $col5, $col6, $col7, $col8, $col9, $col10, $col11, $col12, $col213, $col14, $col15, $col16, $col17, $col18, $col19);
- if(isset($_POST['submit'])) {
- include 'config.php';
- $query_update = "UPDATE `crew_info` SET `crew_status` = 'NEW' WHERE `id` = ?";
- $stmt2 = mysqli_prepare($conn, $query_update);
- mysqli_stmt_bind_param($stmt2, 's', $_GET['id']);
- mysqli_stmt_execute($stmt2);
- /*if (mysqli_stmt_affected_rows($stmt2)) {
- echo "Crew update accepted";
- } else {
- echo 'Error';
- }*/
- }
- echo '<!DOCTYPE html>
- <html>
- <head>
- <title>Review Crew</title>
- </head>
- <body>
- <form action="review.php" method="POST">
- <table border="2" align="center" width="600" cellspacing="3" cellpadding="4">
- <tr>
- <th>First Name</th>
- <th>Middle Name</th>
- <th>Last Name</th>
- <th>Date Added</th>
- <th>Status</th>
- </tr>
- <tr>';
- while($record = mysqli_stmt_fetch($stmt)) {
- echo '<tr>';
- echo "<th>".sprintf("%s", $col2)."</th>";
- echo "<th>".sprintf("%s", $col3)."</th>";
- echo "<th>".sprintf("%s", $col4)."</th>";
- echo "<th>".sprintf("%s", $col18)."</th>";
- echo "<th>".sprintf("%s", $col19)."</th>";
- echo '</tr>';
- }
- echo '</table>';
- echo '<br><center><input type="submit" name="submit" value="Submit"></center>
- </form>
- </body>
- </html>';
- }
- else {
- header('Location: /practice1/index.php');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement