File "booking.php"

Full Path: /home/sasslijg/public_html/admin/global_assets/images/booking.php
File size: 13.22 KB
MIME-type: text/x-php
Charset: utf-8

<?php
include("header.php");


$query = "SELECT * from booking";
$bookings = db::getRecords($query);


?>
<section id="breadcrumb-alignment">
    <div class="row">
        <div class="col-sm-12">
            <div class="card">
                <div class="card-body">
                    <div class="d-flex justify-content-between breadcrumb-wrapper">
                        <nav aria-label="breadcrumb ">
                            <ol class="breadcrumb mt-2">
                                <li class="breadcrumb-item"><a href="javascript:void(0)"><i class='bx bx-home-alt mx-1'></i>Dashboard</a></li>
                                <li class="breadcrumb-item"><a href="javascript:void(0)"> Bookings</a></li>
                            </ol>
                        </nav>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<!-- Breadcrumb Alignment Ends -->
<div class="card">
    <div class="card-body">
        <!-- Row grouping -->
        <section id="row-grouping-datatable">
            <div class="row">
                <div class="col-12">
                    <div class="card">
                        <div class="card-title">
                            <h2 class="mb-0 text-center h1 text-primary uppercase">Bookings</h2>
                        </div>
                        <hr>
                        <div class="card-datatable table-responsive">
                            <table id="example" class="table table-bordered" style="width:100%">
                                <thead>
                                    <tr class="text-center">
                                        <th>Id</th>
                                        <th>Name</th>
                                        <th>Phone</th>
                                        <th>Email</th>
                                        <th>Product Name</th>
                                        <th>Product Price</th>
                                        <th>Actions</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php
                                    $counter=0;
                                    if($bookings!=NULL){
                                        foreach($bookings as $booking){

                                            $counter++;
                                            $p_id=$booking['product_id'];
                                            $query = "SELECT * from rental where id='$p_id'";
                                            $product = db::getRecord($query);


                                    ?>
                                    <tr >
                                        <td class="text-center" >  <?php echo $counter; ?></td>
                                        <td class="text-center" >  <?php echo  $booking['name']; ?></td>
                                        <td class="text-center" >  <?php echo  $booking['phone']; ?></td>
                                        <td class="text-center" >  <?php echo  $booking['email']; ?></td>
                                        <td class="text-center" >  <?php echo  $product['c_name']; ?></td>
                                        <td class="text-center" > $<?php echo  $product['price']; ?></td>

                                        <td>
                                            <div class="col-lg-6 col-12">
                                                <div class="btn-group" role="group" aria-label="Basic example">
                                                    <span>
                                                        <a type="button" class="btn text-white bg-info ml-2" title="View Detail" data-toggle="modal" data-target="#productedit<?php echo $booking['id']; ?>"><i class="fa fa-eye"></i></a>
                                                    </span>
                                                    <span  data-toggle="modal" data-target="#delete_modal<?php echo $booking['id']; ?>">
                                                        <a data-toggle="popover"  data-trigger="hover" data-original-title="Delete Booking" class="btn btn-pinterest ml-2"><i class="bx bx-trash"></i></a>
                                                    </span>
                                                </div>
                                            </div>



                                            <div class="modal fade" id="productedit<?php echo $booking['id']; ?>">
                                                <div class="modal-dialog" role="document">
                                                    <div class="modal-content" style="width:640px">
                                                        <div class="modal-header bg-info">
                                                            <h3 class="modal-title text-white">View Booking Detail</h3>
                                                            <button type="button" class="close" data-dismiss="modal"><span>&times;</span>
                                                            </button>
                                                        </div>
                                                        <div class="modal-body table-responsive" style="padding-bottom:0px;">
                                                            <div class="card-datatable table-responsive">
                                                                <table id="example" class="table table-bordered" style="width:100%">
                                                                    <thead>
                                                                        <tr class="text-center">
                                                                            <th>Name</th>
                                                                            <th>Phone</th>
                                                                            <th>Email</th>
                                                                        </tr>
                                                                    </thead>
                                                                    <tbody>

                                                                        <tr >
                                                                            <td class="text-center" >  <?php echo  $booking['name']; ?></td>
                                                                            <td class="text-center" >  <?php echo  $booking['phone']; ?></td>
                                                                            <td class="text-center" >  <?php echo  $booking['email']; ?></td>
                                                                        </tr>
                                                                    

                                                                    </tbody>
                                                                    <thead>
                                                                        <tr class="text-center">
                                                                            <th>Product</th>
                                                                            <th>Product Name</th>
                                                                            <th>Product Price</th>
                                                                        </tr>
                                                                    </thead>
                                                                    <tbody>

                                                                        <tr>
                                                                            <td class="text-center" > <img src="<?php echo "rental/images/".$product['image_name']; ?>" style="height:80px"></td>
                                                                            <td class="text-center" >  <?php echo  $product['c_name']; ?></td>
                                                                            <td class="text-center" > $<?php echo  $product['price']; ?></td>

                                                                        </tr>

                                                                    </tbody>
                                                                    <tfoot>
                                                                    </tfoot>
                                                                </table>
                                                            </div>
                                                            <div class="card mt-2">
                                                                <center>
                                                                    <h2>Address</h2>
                                                                </center>
                                                                <center>
                                                                    <p><?php echo $booking['address']; ?></p>
                                                                </center>
                                                            </div>

                                                            <hr>
                                                            <div class="card">
                                                                <center>
                                                                    <h2>Booking Note</h2>
                                                                </center>
                                                                <center>
                                                                    <p><?php echo $booking['note']; ?></p>
                                                                </center>
                                                            </div>

                                                        </div>
                                                    </div>
                                                </div>
                                            </div>


                                            <!-- Modal -->
                                            <div class="modal fade" id="delete_modal<?php echo $booking['id']; ?>" data-backdrop="false" tabindex="-1" role="dialog" aria-hidden="true">
                                                <div class="modal-dialog modal-dialog-centered ">
                                                    <div class="modal-content  bbooking-0">
                                                        <div class="modal-header bg-danger bg-darken-2 bbooking-bottom-0">
                                                            <h5 class="modal-title pt-1" style="color:white;">Delete Order</h5>

                                                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">	<span aria-hidden="true">&times;</span>
                                                            </button>
                                                        </div>
                                                        <div class="modal-body">
                                                            <form action="action.php" method="POST">
                                                                <div class="modal-body">
                                                                    <p class="text-danger" >Are You Sure to Delete This</p>
                                                                </div>
                                                                <input type="text" value="<?php echo  $booking['id']; ?>" id="delete_id" name="delete_id" hidden>
                                                                <div class="modal-footer bbooking-top-0">
                                                                    <button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>
                                                                    <button type="submit" name="booking_delete" class="btn btn-outline-danger">Delete</button>
                                                                </div>
                                                            </form>
                                                        </div>

                                                    </div>
                                                </div>
                                            </div>

                                        </td>
                                    </tr>
                                    <?php
                                        }
                                    }
                                    ?>
                                </tbody>
                                <tfoot>
                                </tfoot>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!--/ Row grouping -->
    </div>
</div>

<?php
include("footer.php");

?>