|
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/../www/MCPRO/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
include_once 'code/init.php';
// echo "$agence" ;
// exit() ;
$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>
Etat du Stock
<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 = "etat_stock.php?idbureausel="+idbureausel;
else
window.location = "etat_stock.php";
}
</script>
<?
// echo "<pre>" ;
// print_r($_GET) ;
// echo "</pre>" ;
if($_GET['idbureausel'] && !empty($_GET['idbureausel']) )
{
if($_GET['idbureausel']>0)
{
$idbureausel=$_GET['idbureausel'];
$tabbursel=dbi_fetch_row((dbi_query('select * from bureau where id_bureau='.$_GET['idbureausel'].' and agence_id='.$agence.''))) ;
$id_bureau=$tabbursel['id_bureau'];
$nom_bureau=$tabbursel['nom_agence'];
$where1=" AND ID_Bureau != $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="col-md-12">
<table >
<form id="bureau_form" name="bureau_form" method="POST" action="a.php">
<tr>
<td align="left" valign="top" class="td_listing0">
<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 bureau where agence_id=$agence $where1 and id_bureau != 8 ") or die(mysql_error());
while($listbureau=dbi_fetch_row($Reqbureau)){ ?>
<option value="<?php echo $listbureau['id_bureau']?>"><?php echo $listbureau['nom_agence'] ?></option>
<?php } ?>
</select>
</td>
</tr>
</form>
</table>
</div>
<div class="col-md-12">
<div class="box" >
<!-- /.box-header -->
<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
while($row = dbi_fetch_row($q))
{
if( $_GET['idbureausel'] == 9)
{
$whero = "and local = 'TOULON' " ;
}
else
{
$whero = "and local = 'PARIS' " ;
}
list($qttR) = dbi_fetch_row(dbi_query( "SELECT SUM(p.quantity) FROM check_in c, product_command p where c.id = p.check_in_id $whero 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 ;
?>
<tr>
<td><?php echo $row['Produit_Designation']; ?></td>
<td><?php echo $etat; ?></td>
<?
}
?>
</tfoot>
</table>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
</div>
<!-- /.row -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
</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>
