1
user_reservation.phpInsert-Status in der Datenbank
<thead>
<tr>
<th scope="col">Number of Guest</th>
<th scope="col">Type of Service</th>
<th scope="col">Date</th>
<th scope="col">Time</th>
<th scope="col">Status</th>
<th scope="col">Edit</th>
</tr>
</thead>
<tbody>
<?php
include 'include/db_config.php';
$result = $dbs->prepare("SELECT * FROM service_info WHERE id = :id");
$result->bindParam(':id', $_SESSION['id']);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
?>
<tr class="record">
<td><?php echo $row['no_guest']; ?></td>
<td><?php echo $row['type_service']; ?></td>
<td><?php echo $row['datepicker']; ?></td>
<td><?php echo $row['t_time']; ?></td>
<td><?php echo $service['status']; ?></td>
<td><a href="editform.php?id=<?php echo $row['id']; ?>"> edit </a></td>
</tr>
<?php
}
?>
</tbody>
</table>
<b>STATUS</b><br>
<?php
include 'include/db_config.php';
$result = $dbs->prepare("SELECT * FROM service_info WHERE id = :id");
$result->bindParam(':id', $_SESSION['id']);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
?>
<!--<td><?php //echo $row['datepicker']; ?></td>-->
<?php
$today = date("Y-m-d H:i:s");
$startdate = $row['datepicker'];
$offset = strtotime("+2 day");
$enddate = date($startdate, $offset);
$today_date = new DateTime($today);
$expiry_date = new DateTime($enddate);
$status = ($expiry_date < $today_date) ? 'Expired' : 'Active' ;
$result = $dbs->prepare("UPDATE Customers SET status = :status WHERE id = :id");
$result->bindParam(':id', $_SESSION['id']);
$result->bindParam(':status', $status);
$result->execute();
?>
<?php
}
?>
Das ist mein ganzer Code auf user_reservation. Alles, was ich auf meiner Admin-Reservierung wollte, war, was in meiner Status-Datenbank zu holen. aber wie man sehen kann ich kann immer noch die Statusdaten in der Datenbank
Lassen Sie mich dieses Sir zuerst versuchen. – Ginxx0009
Ich bearbeitete einige;), wenn Sie einen Fehler erhalten, fügen Sie es hier pls :) –
übrigens Sir sie sind in verschiedenen form.php – Ginxx0009