<?php 
error_reporting(0);
include("common.php"); 
?>

     
        <!-- START: Main Content-->
        <main>
            <div class="container-fluid">
                <!-- START: Breadcrumbs-->
                <div class="row ">
                    <div class="col-12  align-self-center">
                        <div class="sub-header mt-3 py-3 px-3 align-self-center d-sm-flex w-100 rounded">
                            <div class="w-sm-100 mr-auto"><h4 class="mb-0">Customer Management</h4></div>

                            <ol class="breadcrumb bg-transparent align-self-center m-0 p-0">
                                <li class="breadcrumb-item">Home</li>
                              
                                <li class="breadcrumb-item active"><a href="#">Customer Management</a></li>
                            </ol>
                        </div>
                    </div>
                </div>
                <!-- END: Breadcrumbs-->

                <!-- START: Card Data-->
                <div class="row">
                    <div class="col-12 mt-3">
                        <div class="card">
                            <div class="card-header  justify-content-between align-items-center">                               
                                <h4 class="card-title">Customer List</h4> 
                            </div>
                            <div class="card-body">
                                <div class="table-responsive">
                                    <table id="example" class="display table dataTable table-striped table-bordered" >
                                        <thead>
                                            <tr>
											 <th>#</th>
											 
											 <th>Branch</th>
											  <th>Emp Name</th>
											 <th>Customer Name</th>
											  <th>Vehicle Number</th>
                                       <th>Vehicle Type</th> 											  
											<th>Driver Phone </th>
											<th>Phone </th>
                                             
											  <th>Route from</th> 
											    <th>Route to</th> 
											   <th>Urea Required</th> 
											<th>Company Name</th> 
											   <th>Owner Name</th> 
											   <th>Phone</th> 
											    <th></th>
                                            </tr>
                                        </thead>
                                        <tbody>
										<?php
										error_reporting(0);
										$b = $_SESSION['branch'];
										include("config.php");
									 $query="select * from customer where branch='$b' order by id desc";
    if(!($result=mysql_query($query))){echo mysql_error($query); exit;}
    while($customer=mysql_fetch_assoc($result)){
		$count ++;
		
	?>
                                            <tr>
										
						<td><?php echo $count;?></td>
						   <td><font color="blue"><b>
						   <?php if($customer[branch]=='B1'){?> GNA <?php } ?>
							<?php if($customer[branch]=='B2'){?> RSM <?php } ?>
							<?php if($customer[branch]=='B3'){?> JHU <?php } ?>
							<?php if($customer[branch]=='B4'){?> GNAP <?php } ?>
							<?php if($customer[branch]=='B5'){?> JHUP <?php } ?>
						   </b></font>
						   </td>
						 <td><?php echo ucwords($customer[empname]);?></td>
                                                <td><?php echo strtoupper($customer[customer_name]);?></td>
												  <td><?php echo strtoupper($customer[vehicle_number]);?></td>
												    <td><?php echo strtoupper($customer[vehicletyp]);?></td>
											 <td><?php echo strtoupper($customer[customer_mobile]);?></td>
											  <td> <?php echo strtoupper($customer[mobile2]);?></td>
                                            
												   <td><?php echo strtoupper($customer[routefrom]);?></td>
												    <td><?php echo strtoupper($customer[routeto]);?></td>
												    <td><?php echo strtoupper($customer[urea]);?></td>
                                              <td><?php echo strtoupper($customer[companyname]);?></td>
												    <td><?php echo strtoupper($customer[owner]);?></td>
													 <td><?php echo strtoupper($customer[ownermobile]);?></td>
        <td> 
												 <a href="edit-customerlist.php?id=<?php echo $customer[id];?>&b=<?php echo $customer[branch];?>"><i class="fa fa-edit"></i></a>
												 &nbsp; &nbsp; &nbsp;
												 <a class="btn3" title="delete" href="del-customerlist.php?flag=del&id=<?php echo $customer[id];?>"onclick="if(confirm('Do You Want To Delete This ?')){return true;}else{return false;}">
                <i class="fa fa-trash icon-white"></i>
                 
            </a>
                 </td>                               
                                                
                                             
                                            </tr>
	<?php } ?>
                                          
                                           
                                        </tbody>
                            
                                    </table>
                                </div>
                            </div>
                        </div> 

                    </div>                  
                </div>
                <!-- END: Card DATA-->
            </div>
        </main>
        <!-- END: Content-->

      
        <!-- START: Back to top-->
        <a href="#" class="scrollup text-center"> 
            <i class="icon-arrow-up"></i>
        </a>
        <!-- END: Back to top-->

        <!-- START: Template JS-->
        <script src="dist/vendors/jquery/jquery-3.3.1.min.js"></script>
        <script src="dist/vendors/jquery-ui/jquery-ui.min.js"></script>
        <script src="dist/vendors/moment/moment.js"></script>
       <!--  <script src="dist/vendors/bootstrap/js/bootstrap.bundle.min.js"></script> -->  
        <script src="dist/vendors/slimscroll/jquery.slimscroll.min.js"></script>
        <script src="dist/vendors/flag-select/js/jquery.flagstrap.min.js"></script> 
        <!-- END: Template JS-->
        
        <!-- START: APP JS-->
        <script src="dist/js/app.js"></script>
        <!-- END: APP JS-->

        <!-- START: Page Vendor JS-->
        <script src="dist/vendors/datatable/js/jquery.dataTables.min.js"></script> 
        <script src="dist/vendors/datatable/js/dataTables.bootstrap4.min.js"></script>
        <script src="dist/vendors/datatable/jszip/jszip.min.js"></script>
        <script src="dist/vendors/datatable/pdfmake/pdfmake.min.js"></script>
        <script src="dist/vendors/datatable/pdfmake/vfs_fonts.js"></script>
        <script src="dist/vendors/datatable/buttons/js/dataTables.buttons.min.js"></script>
        <script src="dist/vendors/datatable/buttons/js/buttons.bootstrap4.min.js"></script>
        <script src="dist/vendors/datatable/buttons/js/buttons.colVis.min.js"></script>
        <script src="dist/vendors/datatable/buttons/js/buttons.flash.min.js"></script>
        <script src="dist/vendors/datatable/buttons/js/buttons.html5.min.js"></script>
        <script src="dist/vendors/datatable/buttons/js/buttons.print.min.js"></script>
        <!-- END: Page Vendor JS-->

        <!-- START: Page Script JS-->        
        <script src="dist/js/datatable.script.js"></script>
		
        <!-- END: Page Script JS-->
    </body>
   
</html>
