Closed syazwinashahrani closed 3 years ago
View purchase for admin
code to implement on view purchase:
`
$sql="SELECT * FROM `purchase` WHERE purchase_id='" . $_GET['purchase_id'] . "'"; $result = $conn-> query($sql); if($result-> num_rows >0){ while ($row = $result -> fetch_assoc()){ ?> <h4>No receipt: #<?php echo $row['purchase_id']; ?></h4> <h5>TICKET - ITINERARY</h5><br> <table width="100%" style="border: collapse;"> <tr style="background-color:#D6EAF8;"> <th style="text-align:center">From</th> <th style="text-align:center">To</th> <th style="text-align:center">Category</th> </tr> <tr> <td style="text-transform:capitalize;text-align:center"><?php echo $row['origin']; ?></td> <td style="text-transform:capitalize;text-align:center"><?php echo $row['destination']; ?></td> <td style="text-transform:capitalize;text-align:center"><?php echo $row['category']; ?></td> </tr> </table> <br><br> <h5>Passenger details</h5> <br> <table width="100%" border="0"> <tr> <td width="10%">Name</td> <td>:</td> <td style="text-transform:capitalize"><?php echo $row['f_name']; ?> <?php echo $row['l_name']; ?></td> </tr> <tr> <td>IC Number</td> <td>:</td> <td style="text-transform:capitalize"><?php echo $row['icnum']; ?></td> </tr> <tr> <td>Email</td> <td>:</td> <td><?php echo $row['email']; ?></td> </tr> <tr> <td>Date purchase</td> <td>:</td> <td><?php echo $row['Date']; ?></td> </tr> </table> <br> <?php }} ?> </form>`
View purchase for admin