|
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/wp-content/../../../MCPRO/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
require_once 'config.php';
$no=1;
$message = false;
$suppliers = array();
$suppliersList = array();
$products = array();
$productsList = array();
$check_in = array();
//where status ='pending'
$select = "SELECT * FROM `check_in` ";
if($res = mysqli_query($conn,$select)){
$count = mysqli_num_rows($res);
}else{
$count=0;
}
$select = "SELECT * FROM `product_command`";
$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;
}
$select = "SELECT * FROM `fournisseur`";
$resu = mysqli_query($conn,$select);
while ($sup = mysqli_fetch_array($resu)) {
$suppliersList[] = $sup;
}
if(isset($_GET['delete'])){
$del = $_GET['delete'];
$query = "DELETE FROM check_in WHERE id='$del'";
if(mysqli_query($conn,$query)){
$query = "DELETE FROM product_command WHERE check_in_id='$del'";
if(mysqli_query($conn,$query)){
header("location: Livraison_f.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">
<!-- Content Header (Page header) -->
<!-- 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">×</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 >
Fournisseur
</td>
<td id="checkOutSupplier">
Fournisseur
</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>
<table id="productTable" class="table table-bordered table-striped">
<thead>
<td>Local Stockage
</td>
<td>Note
</td>
</thead>
<tbody><tr>
<td id="productLocal"></td>
<td id="productNote"></td>
</tr></tbody>
<tr></tr>
</table>
</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>
<section class="content-header">
<h1>
Réception commande fournisseur
<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_in.php" class="btn btn-primary">Nouvelle Réception</a>
</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<div></div>
<table id="tables" class="table table-bordered table-striped" >
<thead>
<tr>
<th>Sr.no</th>
<th>Date</th>
<th>Référence</th>
<th>Fournisseur</th>
<th>Local</th>
<th>Note</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php if(!$count<=0){ while($row = mysqli_fetch_array($res)) {
$in = 0;
$check_in[] = $row;
$rowid = $row['id'];
?>
<tr>
<td><?php echo $no++; ?></td>
<td><?php echo $row['date']; ?></td>
<td><?php echo $row['reference']; ?></td>
<td>
<?php
foreach ($suppliersList as $key => $value) {
if($suppliersList[$key]["Fournisseur_ID"] == $row['supplier']){
echo $suppliersList[$key]["Fournisseur_Nom"];
}
}?>
</td>
<td><?php echo $row['local']; ?></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_in.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">
<strong>Copyright © 2019 .</strong> All rights
reserved.
</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 = "";
var data = "";
var tempId = "";
var table = $('#tables').DataTable();
var data = table.row(this).data();
var tempId = data[6].split("?edit=");
var tempId = tempId[1].split('"');
// var rowEdit = document.getElementById("rowValue");
// var rowHref = rowEdit.getAttribute('href');
// var splitHref = rowHref.split("=");
//var rowId =tempId[0];
// var rowEdit = document.getElementById("rowValue");
// var rowHref = rowEdit.getAttribute('href');
// var splitHref = rowHref.split("=");
var rowId =tempId[0];
// alert(rowId);
var te = 1;
var arr = <?php echo json_encode($check_in); ?>;
var prod = <?php echo json_encode($products); ?>;
var prodList = <?php echo json_encode($productsList); ?>;
var suplList = <?php echo json_encode($suppliersList); ?>;
var supplier = "";
for(var i=0; i < arr.length; i++){
if(rowId == arr[i][0]){
document.getElementById('exampleModalLongTitle').innerHTML = "<b>Checked IN 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>"+arr[i][7]+"</b>";
document.getElementById("productLocal").innerHTML = "<b>"+arr[i][4]+"</b>";
for(var s=0; s<suplList.length; s++){
if(suplList[s][0]==arr[i][3]){
supplier = suplList[s][1];
}
}
document.getElementById('checkOutSupplier').innerHTML = "<b>"+supplier+"</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');
});
});
</script>
</body>
</html>
