<?php    include_once('../config/db.php');  include_once('../config/check.php'); 



if (filter_has_var(INPUT_POST, "delete")) 
try{
    //   $delete =        htmlspecialchars ( strtoupper($_POST['delete']));
      
    
    //   $stmt = $conn->prepare("DELETE FROM bppartner WHERE id=? and  id NOT IN (select bpartner  from  acctransaction ) ");
    //   $stmt->execute([$delete]);
    //   $deleted = $stmt->rowCount();
    //   if($deleted==0)
    //      {
    //        $Lerror='<div class="alert alert-warning alert-dismissable" style="margin-top:5px;"><i class="fa fa-key"></i><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><b> Unable to delete Other records depend on this File  </b></div>';  
    
    //       }else{ header("location:bppartnerl.php"); }
        
  } catch(Exception $e) { echo 'Message: ' .$e->getMessage();}



?>


<!DOCTYPE html>
<html>
<head>
 
<?php include_once('../inc/slink.php');   ?>  

</head>


<body <?php include_once('../inc/snav.php');  ?>>
<div class="wrapper">

  <!-- Main Header -->
    <header class="main-header">

    <!-- Logo -->
       <?php include_once('../inc/sbrand.php');   ?>

    <!-- Header Navbar -->
    <?php include_once('../inc/snavbar.php');   ?>

  </header>
 
  <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">

    <!-- sidebar: style can be found in sidebar.less -->
     <?php include_once('../inc/smenu.php');   ?>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
   

        <section class="content-header">
          <!-- <div class="col-md-12 "> -->
            <div class="col-md-3">
            <p  class="listheader"  > <i class="fa fa-file" ></i> Customers   </p>
            
            </div>
                
            <div class="col-md-3  " class="mybtn" id="mybtn"  >
            </div>  
            <div class="col-md-6 "   >
            <div class="col-md-6" id="mysearchbox">
              
              </div>   
               <a  href="customer" class="addbtn btn-primary btn-sm pull-right  " > <i class="fa fa-plus"></i> Add Customer </a>
            
             
          <!-- </div> -->
        </section>

        <!-- Main content -->
        <section class="content container-fluid">
          <div class="col-md-12">
              <div class="box  box-xs">
                <div class="box-body">
                  <table id="customer_data" width="100%" class="table display compact  table-small table-responsive ">
                    <thead >
                      <tr >

                      <th >  </th>
                      <th >  </th>
                      <th > PartnerType</th>
                      <th > Partner_Full_Name</th>
                      <!-- <th > Registration_No </th> -->
                      <th > Currency  </th>
                      <th > Phone_Number  </th>
                      <th > Email_Address  </th>
                      <th > TIN_Number  </th>
                      <th > VAT/ZRB_No  </th>
                      <th > Address  </th>
                      <!-- <th > Partner_Location </th> -->
                      <th > Country</th>
                      </tr>
                    </thead>

                      
                  </table>
                </div>
              </div>
          </div>
        </section>
      <!-- END Main content -->

  
  
</div>
  <!-- /.content-wrapper -->
  
  <!-- Main Footer -->
  <footer class="main-footer">
    <?php  include_once('../inc/sfooter.php'); ?>
  </footer>
  
</div>
                         
<!-- ./wrapper -->

<!-- REQUIRED JS SCRIPTS -->
<?php  include_once('../inc/slinkjs.php') ?>


</body>
</html>

<!-- dynamic rows start here -->
<!-- DYANAMIC ROWS LISTING HERE --->


<script  >

 


$('#customer_data').DataTable( {
 
  
    "scrollX": true,
    "language": {
                   searchPlaceholder: "Search here",
                   search: "" },
    "dom": '<"top"f>rt<"bottom"ilp><"clear">',
    ajax: {
        url: '../filter/partner/customer.php'
    }
} );

codeListTable = $("#customer_data").DataTable();
        new $.fn.dataTable.Buttons( codeListTable, {
            buttons: [
          
                {
                extend:    'excel',
                text:      '<i class="fa fa-files-o"></i> Excel',
                titleAttr: 'Excel',
                className: 'btn btn-default btn-sm',
                exportOptions: {
                    columns: ':visible'
                }
                },
                {
                extend:    'pdf',
                text:      '<i class="fa fa-file-pdf-o"></i> PDF',
                titleAttr: 'PDF',
                className: 'btn btn-default btn-sm',
                exportOptions: {
                    columns: ':visible'
                }
                },               
                {
                extend:    'print',
                text:      '<i class="fa fa-print"></i> Print',
                titleAttr: 'Print',
                className: 'btn btn-default btn-sm',
                exportOptions: {
                    columns: ':visible'
                }
                },  
            ]
        } );
        codeListTable.buttons().container().appendTo('#mybtn');    
        $(".dataTables_filter").detach().appendTo("#mysearchbox");
        $(".dataTables_length").detach().appendTo("#mylength");
</script>



