|
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 ] |
|---|
<?php
include_once 'code/init.php';
// echo "$agence" ;
// exit() ;
// session_start();
// echo "<pre>" ;
// print_r($_POST) ;
// echo "</pre>" ;
$date_arr = explode("-",$_POST["dateD"]);
$dateD = $date_arr[0]."".$date_arr[1]."".$date_arr[2];
// echo "==> $dateD <br/>" ;
$date_arr = explode("-",$_POST["dateF"]);
$dateF = $date_arr[0]."".$date_arr[1]."".$date_arr[2];
// echo "==> $dateF <br/>" ;
$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'];
}
// print_r($customerList) ;
$q= dbi_query("SELECT * FROM produits") ;
?>
<!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">
<!-- Content Header (Page header) -->
<!-- Modal -->
<section class="content-header">
<h1>
Commande
<small></small>
</h1>
</section>
<!-- Main content -->
<script language="Javascript">
function GetIdBureau()
{
var idbursel="";
idbureausel = document.bureau_form.client_bureau.value ;
if( idbureausel > 0 || idbureausel=="INDEFINI" )
window.location = "Statistiques_stock.php?idbureausel="+idbureausel;
else
window.location = "Statistiques_stock.php";
}
</script>
<?
if($_GET['idbureausel'] && !empty($_GET['idbureausel']) )
{
if($_GET['idbureausel']==21)
{
echo "yassin <br/>" ;
$_SESSION["local"] = "TOULON";
}
else
{
$_SESSION["local"] = "PARIS";
}
echo "<pre>" ;
print_r($_GET) ;
echo "</pre>" ;
// exit() ;
if($_GET['idbureausel']>0)
{
$idbureausel=$_GET['idbureausel'];
$tabbursel=dbi_fetch_row((dbi_query('select * from Lieu_de_stockage where Lieu_de_stockage_ID='.$_GET['idbureausel']))) ;
$id_bureau=$tabbursel['Lieu_de_stockage_ID'];
$nom_bureau=$tabbursel['lieu_de_stockage_nom'];
$where1=" where Lieu_de_stockage_ID != $id_bureau ";
$where2=" AND client_bureau = $id_bureau ";
}
elseif($_GET['idbureausel']=="INDEFINI")
{
$id_bureau=$_GET['idbureausel'];
$where2=" AND client_bureau='0' ";
$selected='selected="selected"';
}
}
// $where1=" AND ID_Bureau != $id_bureau ";
?>
<section class="content">
<div class="row">
<!-- left column -->
<div class="row">
<div class="col-md-12">
<div class="box" >
<br/><br/>
<!-- /.box-header -->
<form method="POST" action="">
<div class="col-md-3">
<div class="form-group">
<label for="Date">Date debut </label>
<input type="date" class="form-control" id="date" placeholder="Enter title" name="dateD" required>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="Date">Date fin </label>
<input type="date" class="form-control" id="date" placeholder="Enter title" name="dateF" required>
</div>
</div>
<div class="col-md-2">
<label for="Date">Fournisseurs </label>
<select class="form-control select2" style="width: 100%;" id="client_bureau" name="fournnisseur" onchange="GetIdBureau()";>
<?php if(isset($id_bureau) && isset($nom_bureau)) { ?>
<option selected="selected" value="<?=$id_bureau ?>"><?=$nom_bureau?></option>
<?php } ?>
<?php
$Reqbureau=dbi_query("select * from fournisseur $where1 ") or die(mysql_error());
while($listbureau=dbi_fetch_row($Reqbureau)){ ?>
<option value="<?php echo $listbureau['Fournisseur_ID'] ?>"><?php echo $listbureau['Fournisseur_Nom'] ?></option>
<?php } ?>
</select>
</div>
<div class="col-md-2">
<label for="Date">zone de stockage </label>
<select class="form-control select2" style="width: 100%;" id="client_bureau" name="client_bureau" onchange="GetIdBureau()";>
<?php if(isset($id_bureau) && isset($nom_bureau)) { ?>
<option selected="selected" value="<?=$id_bureau ?>"><?=$nom_bureau?></option>
<?php } ?>
<?php
$Reqbureau=dbi_query("select * from Lieu_de_stockage $where1 ") or die(mysql_error());
while($listbureau=dbi_fetch_row($Reqbureau)){ ?>
<option value="<?php echo $listbureau['lieu_de_stockage_nom'] ?>"><?php echo $listbureau['lieu_de_stockage_nom'] ?></option>
<?php } ?>
</select>
</div>
<div class="col-md-2">
<h3 class="box-title">
<input class="btn btn-primary" type="submit" >
</h3>
</div>
</form>
<br/><br/><br/><br/>
<div class="box-body">
<div></div>
<table id="tables" class="table table-bordered table-striped" >
<thead>
<tr>
<th>Produit </th>
<th>Quantité </th>
</tr>
</thead>
<tbody>
<?php
// echo "====".$_SESSION["local"]."<br/>" ;
while($row = dbi_fetch_row($q))
{
$whero = "and local = '".$_POST["client_bureau"]."' and date between $dateD and $dateF " ;
if(!empty($_POST))
{
list($qttR) = dbi_fetch_row(dbi_query( "SELECT SUM(p.quantity) FROM check_out c, check_out_produit p , produits pr where c.id = p.check_out_id and p.product_Id = pr.Produit_ID $whero and Fournisseur_ID = ".$_POST['fournnisseur']." and product_Id = ".$row['Produit_ID'])) ;
}
// list($qttL) = dbi_fetch_row(dbi_query( "SELECT SUM(p.quantity) FROM check_out c, check_out_produit p where c.id = p.check_out_id $whero and product_Id = ".$row['Produit_ID'])) ;
// $etat = $qttR - $qttL
if($qttR >0)
{
?>
<tr>
<td><?php echo $row['Produit_Designation']; ?></td>
<td><?php echo $qttR; ?></td>
<?
}
}
?>
</tfoot>
</table>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
</div>
<!-- /.row -->
</div>
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<footer class="main-footer">
.
</footer>
</div>
<!-- ./wrapper -->
<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>"+customer+"</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>
