syazwinashahrani / KTMonline.com

KTM system is a website that provide a user to purchase train ticket online
0 stars 0 forks source link

#CR9.0 #10

Closed syazwinashahrani closed 3 years ago

syazwinashahrani commented 3 years ago

View purchase for admin

rabiatul96 commented 3 years ago

code to implement on view purchase:

query($sql); if($result-> num_rows >0){ while ($row = $result -> fetch_assoc()){ ?>

No receipt: #

TICKET - ITINERARY

From To Category


Passenger details

Name :
IC Number :
Email :
Date purchase :

rabiatul96 commented 3 years ago

`

<?php include_once 'dataimport.php';

                            $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>`