<div class="col-md-12 p-3 mt-2">
   <!--<h3 class="text-center">User Booking Detail</h3>-->
    <!-- Div1 and Div2 to show or hide -->
    <div id="div1">
        
        <?php 
        
        if(!empty($result)){
         
         ?>
         
         <div class="bg-white p-3 py-4 rounded-3 mt-3"> 
            <h3 class="text-center mb-4">User Booking Detail</h3>
                <div class="row mx-0">
                    <div class="col-md-3">
                        <?//php if(empty($result['driver_profile_pic'])){ ?>
                        
                        <img src="https://asatvindia.in/cab/uploads/images/DriverProfile/1718455563786503387.webp" class="w-100 rounded-3 shadow">
                        
                        <?//php } else {?>
                        
                         <!--<img src="<?//php echo base_url().$result[0]['image_photo'] ?>" class="w-100 rounded-3 shadow">-->
                        
                        <?//php } ?>
                        
                    </div>
                    <div class="col-md-9">
                        <div class="row">
                            <div class="col-md-4">
                                
                                <div class="d-flex gap-2 mb-2 border py-1 px-2 rounded-2">
                                    <div class="fw-bold">User ID :</div>
                                    <div><?=$result['0']['user_id']?></div>
                                </div>
                                <div class="d-flex gap-2 mb-2 border py-1 px-2 rounded-2">
                                    <div class="fw-bold">User Name :</div>
                                    <div><?=$result['0']['f_name']?></div>
                                </div>
                                <div class="d-flex gap-2 mb-2 border py-1 px-2 rounded-2">
                                    <div class="fw-bold">Mobile No :</div>
                                    <div><?=$result['0']['mobile_no']?></div>
                                </div>
                                
                                
                                <div class="d-flex gap-2 mb-2 border py-1 px-2 rounded-2">
                                    <div class="fw-bold">User EmailId :</div>
                                    <div><?=$result['0']['email_id']?></div>
                                </div>
                               
                                
                                <?php
                                if($result['0']['status']==1)
                                {
                                   $st='Active'; 
                                }
                                else
                                {
                                     $st='In Active'; 
                                }
                                
                                ?>
                                
                                
                                
                            </div>
                            
                            
                            <div class="col-md-4">
                                
                                 <div class="d-flex gap-2 mb-2 border py-1 px-2 rounded-2">
                                    <div class="fw-bold">Wallet Amount :</div>
                                    <div><?=$result['0']['wallet_amount']?></div>
                                </div>
                                <div class="d-flex gap-2 mb-2 border py-1 px-2 rounded-2">
                                    <div class="fw-bold">Status :</div>
                                    <div><?=isset($st)?$st:'NA';?></div>
                                </div>
                            </div>
                        </div>
                        
                        <h4 class="fw-bold mt-3">Booking Details :</h4>
                        
                        <table class="table table-bordered mt-3">
                            <thead>
                              <tr>
                                <th>SL.No</th>
                                <th>Booking Id</th>
                                <th>Order Id</th>
                                <th>Driver Id</th>
                                <th>Driver Name</th>
                                <th>Bokking type</th>
                                <th>Pickup address</th>
                                <th>Drop address</th>
                                <th>Vehicle Number</th>
                                <th>Total_distance(in km)</th>
                                <!--<th>Per km fare(in Rs)</th>-->
                                <!--<th>Wait time limit(in Min)</th>-->
                                <!--<th>Default wait charge(Per Min)</th>-->
                                <!--<th>Total waiting time(in Min)</th>-->
                                <!--<th>Total wait charge(Rs)</th>-->
                                <!--<th>Conv charge(Rs)</th>-->
                                <th>Total Fare(Rs)</th>
                                <th>Paymenttype</th>
                                 <th>Collect Cash</th>
                                 <th>Status</th>
                                <th>Is cancle</th>
                                <th>cancle_date</th>
                                <!--<th>ip</th>-->
                                <!--<th>Added by web</th>-->
                                <th>Booking Date</th>
                                
                              </tr>
                            </thead>
                            
                            
                            
                            <tbody>
                                <?php if (!empty($result)) {
                                    $i = 1; 
                                    foreach ($result as $sing) { ?>
                                        
                                        <tr>
                                            <td><?= $i; ?></td>
                                            <td><?=isset($sing['book_id'])?$sing['book_id']:'NA';?></td>
                                             <td><?=isset($sing['order_id'])?$sing['order_id']:'NA';?></td>
                                             
                                             <td><?=isset($sing['driver_id'])?$sing['driver_id']:'NA';?></td>
                                             <td><?=isset($sing['driver_name'])?$sing['driver_name']:'NA';?></td>
                                             
                                               <td><?=isset($sing['booking_type'])?$sing['booking_type']:'NA';?></td>
                                              
                                              <td><?=isset($sing['pickup_address'])?$sing['pickup_address']:'NA';?></td>
                                             <td><?=isset($sing['drop_address'])?$sing['drop_address']:'NA';?></td>
                                             <td><?=isset($sing['number'])?$sing['number']:'NA';?></td>
                                             
                                              <td><?=isset($sing['user_journey_distance'])?$sing['user_journey_distance']:'NA';?></td>
                                              
                                             <!-- <td><?//=isset($sing['per_km_fare'])?$sing['per_km_fare']:'NA';?></td>-->
                                             <!--<td><?//=isset($sing['wait_time_limit'])?$sing['wait_time_limit']:'NA';?></td>-->
                                             
                                             <!-- <td><?//=isset($sing['default_wait_charge'])?$sing['default_wait_charge']:'NA';?></td>-->
                                              
                                             <!-- <td><?//=isset($sing['total_waiting_time'])?$sing['total_waiting_time']:'NA';?></td>-->
                                             <!--<td><?//=isset($sing['total_wait_charge'])?$sing['total_wait_charge']:'NA';?></td>-->
                                             
                                              
                                              
                                             <!-- <td><?//=isset($sing['conv_charge'])?$sing['conv_charge']:'NA';?></td>-->
                                             
                                              <td><?=isset($sing['grand_total'])?$sing['grand_total']:'NA';?></td>
                                             <td><?=isset($sing['paymenttype'])?$sing['paymenttype']:'NA';?></td>
                                             
                                             
                                             
                                             <?php 
                                             
                                                 $collect_cash='';
                                                $collect_total_cash=0;
                                                if($sing['ride_status']==2)
                                                {
                                                    if($sing['post_paymenttype'] == 'COD')
                                                    {   
                                                       $collect_total_cash=round($sing['total_fare']+$sing['total_wait_charge'],2);
                                                       
                                        //               $collect_cash='<a href="javascript:void(0);" class="delete" data-toggle="tooltip" title="Collect cash" onclick="collectcash('.$r->id.')" aria-hidden="true" style="color:green;font-size:27px">
                                    				// 		 <i class="fa fa-check-square" aria-hidden="true"></i></a>';     
                                                    }
                                                    
                                                    
                                                    else if($sing['post_paymenttype'] == 'COD' && $sing['post_paymenttype'] != 'COD')
                                                    {
                                                        $collect_total_cash=round($sing['total_wait_charge'],2);
                                                    }
                                                }
                                                
                                                if($sing['ride_status']==0){
                      
                                                   $stas = '<span class="text-warning">Pending</span>';
                                              }else if($sing['ride_status']==1){
                                                  $stas = '<span class="text-info">start</span>';
                                              }else if($sing['ride_status']== 2){
                                                   $stas = '<span class="text-success">Completed</span>';
                                              }else if($sing['ride_status']==3){
                                                   $stas = '<span class="text-danger">Cancel</span>';
                                              }
                                               
                                                
                                             
                                             
                                                if($sing['is_cancle']==0)
                                                {
                                                   $can='Not cancelled'; 
                                                }
                                                else
                                                {
                                                     $can='Cancelled'; 
                                                }
                                                if($sing['ip'])
                                                {
                                                    $ip=$sing['ip'];
                                                }
                                                else
                                                {
                                                   $ip='NA'; 
                                                }
                                                if($sing['added_by_web'])
                                                {
                                                    $web=$sing['added_by_web'];
                                                }
                                                else
                                                {
                                                   $web='NA'; 
                                                }
                                                
                                                ?>
                                                
                                                <td><?=isset($collect_total_cash)?$collect_total_cash:0;?></td>
                                                <td><?=isset($stas)?$stas:'NA';?></td>
                                             
                                              <td><?=isset($can)?$can:'NA';?></td>
                                              
                                              <td><?=isset($sing['cancle_date'])?$sing['cancle_date']:'NA';?></td>
                                            <!--<td><?//=isset($ip)?$ip:'NA';?></td>-->
                                            
                                            <!--<td><?//=isset($web)?$web:'NA';?></td>-->
                                              
                                              <td><?=isset($sing['entry_date'])?$sing['entry_date']:'NA';?></td>
                                             
                                              
                                            
                                            
                                        </tr>
                                <?php 
                                        $i++; 
                                    } 
                                } ?>
                            </tbody>

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

    
</div>   
         
         <?php } else { ?>
         
         <div class="bg-white p-3 py-4 rounded-3 mt-3">
             
             <p style="color:red;">No Record Found</p>
             
         </div>
         
         <?php } ?>
        
        
       
    </div>
    
  
    
    
    
    
    

    
   </div>
</div>