Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function fetchVLTable() {
- $stmtFetchVL = $this->con->prepare("SELECT * FROM vehicle2_login");
- $stmtFetchVL->execute();
- $cdate=date("m/d/Y");
- foreach($stmtFetchVL as $row) {
- $vl_id = $row['id'];
- echo '<tr>
- <td>'.$row['id'].'</td>
- <td>'.$row['plate'].'</td>
- <td>'.$row['status'].'</td>
- <td>'.$row['name'].'</td>';
- $datedb = $row['expiration_date'];
- if($datedb == $cdate) {
- $stmtDeleteVL = $this->con->prepare("DELETE FROM vehicle2_login WHERE expiration_date = ?");
- $stmtDeleteVL->execute(array($cdate));
- echo '<td>'.date("F j, Y g:i a",strtotime($row['time_login'])).'</td>';
- }
- elseif ($cdate != $datedb) {
- echo '<td>'.date("F j, Y g:i a",strtotime($row['time_login'])).'</td>';
- // echo "Date db != current date";
- }else {
- echo '<td>'.date("F j, Y g:i a",strtotime($row['time_login'])).'</td>';
- }
- echo'<td><a style="color:green;" href=update_vl.php?edit_vl='.$vl_id.'>Edit</a></td>
- <td><a style="color:red;" href=delete_vl.php?delete_vl='.$vl_id.'>Delete</a></td>
- </tr>';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement