<style>
    .mouse-cursor{
        
    }
</style>  
<div class="wrapper">
            <div class="container">
                <!-- Page-Title -->
                <div class="row">
                    <div class="col-sm-12">
                        <h4 class="page-title">Advance Booking</h4>                       
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="panel panel-default">
                            <div class="panel-body">
                                
                               
                                <div class="row">
                                    <div class="col-md-6" >
                                        <div class="row">
                                        <div class="pull-left">
                                            <h3 class="logo invoice-logo"><?php if(isset($business)){ echo "<img src='".base_url().'assets/images/business/'.$business[0]['business_logo']."' alt='".$business[0]['business_name']."' class='img-responsive' />";} else {echo 'SalonPK';}?></h3>

                                        </div>
                                        <div class="pull-right">
                                            <h4 class="img-">Appointment #
                                                <strong id="invoicenumber"><?php echo  date("Y").'-'.date("m").'-'; if(isset($visit[0]['id_customer_visits'])){ echo sprintf("%04s",$visit[0]['id_customer_visits']);}else{echo '00001';} ?></strong>
                                            </h4>
                                            <span><strong>Booking ID: <?php if(isset($bookingid)){ echo $bookingid;}?>  </strong></span>
                                        </div>
                                    </div>
                                        <h4>Service Card</h4>
                                        <table class="table m-t-10">
                                            <tr>
                                                <td>Customer Name: </td>
                                                <td style="border-bottom: 1px solid #000;"><strong><?php if(isset($visit)){ echo $visit[0]['customer_name']; }?></strong></td>
                                                <td>For Service: </td>
                                                <td style="border-bottom: 1px solid #000;"><strong ><?php if(isset($visit)){ print_r($visit[0]['service_category']); }?></strong></td>                                                
                                            </tr>
                                            <tr>
                                                <td>Customer Contact: </td>
                                                <td style="border-bottom: 1px solid #000;"><strong><?php if(isset($visit)){ echo $visit[0]['customer_cell']; }?></strong></td>
                                                <td>Package: </td>
                                                <td style="border-bottom: 1px solid #000;"><strong ><?php if(isset($visit)){ print_r($visit[0]['service_type']); }?></strong></td>                                                
                                            </tr>                                           
                                            <tr>
                                                <td>Booking Date: </td>
                                                <td style="border-bottom: 1px solid #000;"><strong><?php if(isset($visit)){ echo $visit[0]['booking_date']; }?></strong></td>
                                                <td>Event Date: </td>
                                                <td style="border-bottom: 1px solid #000;"><strong><?php if(isset($visit)){if(null!=$visit[0]['customer_event_date']){ echo date_format(date_create($visit[0]['customer_event_date']), 'd-m-Y H:i'); }}?></strong></td>
                                            </tr>
                                            <tr>
                                                <td>Arrival Date: </td>
                                                <td ><strong><?php if(isset($visit)){ echo date_format(date_create($visit[0]['visit_service_start']),'d-m-Y'); }?></strong></td>
                                                <td>Arrival Time: </td>
                                                <td style="border-bottom: 1px solid #000;"><strong ><?php if(isset($visit)){ echo date_format(date_create($visit[0]['visit_service_start']), 'h:i A'); }?></strong></td>
                                            </tr>
                                            <tr>
                                                <td style="border-bottom: 1px solid #000;"></td>
                                                <td style="border-bottom: 1px solid #000;"></td>
                                                <td style="border-bottom: 1px solid #000;">Departure Time: </td>
                                                <td style="border-bottom: 1px solid #000;"><strong ><?php if(isset($visit)){ echo date_format(date_create($departure_time->departure_time), 'h:i A'); }?></strong></td>
                                            </tr>
                                            <tr>
                                                <td >Package Amount: </td>
                                                <td style="border-bottom: 1px solid #000;"><strong ><?php if(isset($visit)){ echo number_format($visit[0]['service_rate']); }?></strong></td>
                                                <td >Payment Mode: </td>
                                                <td style="border-bottom: 1px solid #000;"><strong ><?php if(!empty($advances)){ echo strtoupper($advances[0]['advance_mode']); }else{echo 'CASH';}?></strong></td>                                                
                                            </tr>  
                                            <tr>
                                                <td>Advance: </td>
                                                <td style="border-bottom: 1px solid #000;"><strong><?php if(!empty($advances)){ echo number_format($advances[0]['advance_amount']); }else{echo 0;}?></strong></td>
                                                <td>Remaining: </td>
                                                <td style="border-bottom: 1px solid #000;"><strong ><?php echo !empty($advances) ?  number_format($visit[0]['service_rate'] - $advances[0]['advance_amount'] - $visit[0]['discount']) : number_format($visit[0]['service_rate'] - $visit[0]['discount']); ?></strong></td>                                                
                                            </tr>
                                            <tr>
                                                <td>Discount: </td>
                                                <td style="border-bottom: 1px solid #000;"><strong><?php echo number_format($visit[0]['discount']);?></strong></td>   
                                                <td>Booking Officer: </td>
                                                <td style="border-bottom: 1px solid #000;"><strong><?php echo $this->session->userdata('username');?></strong></td>
                                                                                             
                                            </tr>
                                            <tr>
                                                <td>Cashier Name: </td>
                                                <td style="border-bottom: 1px solid #000;"><?php echo !empty($advances) ? $advances[0]['advance_user'] : '';?></td>
                                                <td>Cashier Sign: </td>
                                                <td style="border-bottom: 1px solid #000;"></td>                                                
                                            </tr>
                                        </table>
                                         <div class="row m-t-20">
                                             <div class="col-md-6 col-sm-6 col-xs-6">
                                                 <h4>TERMS & CONDITIONS</h4>
                                                 <?php echo $business[0]['payment_terms'];?>
                                             </div>
                                             <div class="col-md-6 col-xs-6 col-sm-6" style="border: 1px solid #808080;">
                                                 <table class="" >
                                                    <tr><td><h4><?php echo $business[0]['business_name'];?></h4></td>
                                                    <tr><td><?php echo $business[0]['business_address'];?></td>
                                                    <tr><td><?php echo $business[0]['business_email'];?></td>
                                                    <tr><td><?php echo $business[0]['business_phone1'];?></td>
                                                 </table>
                                             </div>
                                         </div>
                                    </div>
                                    <div class="col-md-6" >
                                        
                                    </div>
                                </div>
                                <hr>
                                
                            </div>
                            <div class="panel-footer">
                                <div class="hidden-print" style="text-align: right" >                                    
                                    <a href="javascript:window.print()" class=" btn btn-inverse waves-effect waves-light" id="btnprint"><i class="fa fa-print"></i></a>                                    
                                </div>
                            </div>
                            
                        </div>

                    </div>

                </div>
                <!-- end row -->
            </div>

               
<script>
    
 
   
    
   

</script>
