								
                    <div class="card-body">
                        <div class="table-back employee-office-table">
                            <div class="table-responsive" id='table'>
                                <table class="table custom-table table-hover table-hover" border=1>
                                    <thead>
                                        <tr >
                                            <th class="text-center">Sr.</th>
                                            <th class="">Name of Driver</th>
                                            <th class="text-center">Completed Bookings</th>
                                            <!--<th class="text-center">Booking in Progress</th>-->
                                            <th class="text-center">Total Business (Amount AED.)</th>
                                        </tr>
                                    </thead>
                                    <tbody>
<?php 
$bookings = $total = $i = 0;
$sql = mysqli_query($connect, "select driver.driver_id as id, driver.driver_name as driver, count(rentedcars.id) as bookings, sum(rentedcars.total_amount) as total
                                from rentedcars
                                RIGHT JOIN driver on driver.driver_id = rentedcars.driver_id") or die(mysqli_error($connect));
										while($data = mysqli_fetch_assoc($sql)){
										    ?>
											<tr>
											    <td class="text-center">
                                                <?php echo ++$i?>
                                            </td>
                                            <td class="">
                                                <a href="./reports/bookingsdriver.php?driver=<?php echo $data["id"]; ?>">
                                                    <?php echo $data["driver"]?>
                                                </a>
                                                
                                            </td>
                                            <!--<td class="pl-2">-->
                                            <td class="text-center">
                                                <?php echo $data["bookings"]?>
                                            </td>
                                            <!--<td class="text-center">-->
                                                
                                            <!--</td>-->

											<td class="text-center">
                                            <?php echo $data["total"]?></td>
                                                
                                        </tr>
										<?php
										$bookings += $data["bookings"];
										$total += $data["total"];
								// 		$i++;
										
										}
										?>
                                        <tr>
                                            <!--<td class="text-right" colspan="2" style="background-color: #cccccc2e;color: black;font-size: large;">-->
                                            <td class="text-center" colspan="2" style="background-color: #cccccc2e;color: black;font-size: large;">
                                                Total:
                                            </td>
                                             <td class="text-center" style="background-color: #cccccc2e;color: black;font-size: large;">
                                                <?php echo $bookings?>
                                            </td>
                                            <!--<td class="text-center" style="background-color: #cccccc2e;color: black;font-size: large;">-->
                                                
                                            <!--</td>-->
                                            <td class="text-center" style="background-color: #cccccc2e;color: black;font-size: large;">
                                                <?php echo $total?>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>