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/mcg/pages/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/logmcpe/www/mcg/pages/etat_stock.php
<?php
include 'includes/config_tmcpro.php' ;
include 'includes/stable_functions_tmcpro.php' ;



// echo "<pre>" ;
// print_r($_GET) ;
// echo "<pre>" ;

   $resu = dbi_query("SELECT * FROM client where 1")  ;
   // $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>
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <!-- Enregistrer le titre de la page --><title> LogMCPRO | </title>
												<!-- Tell the browser to be responsive to screen width -->
  <meta name="viewport" content="width=device-width, initial-scale=1">

												<!-- Font Awesome -->
  <link rel="stylesheet" href="../../plugins/fontawesome-free/css/all.min.css">
												<!-- Ionicons -->
  <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
  <link rel="stylesheet" href="../../plugins/select2/css/select2.min.css">
  <link rel="stylesheet" href="../../plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css">
												<!-- overlayScrollbars -->
  <link rel="stylesheet" href="../../dist/css/adminlte.min.css">
												<!-- Google Font: Source Sans Pro -->
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">

    <link rel="stylesheet" href="../../plugins/fontawesome-free/css/all.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
  <!-- DataTables -->
  <link rel="stylesheet" href="../../plugins/datatables-bs4/css/dataTables.bootstrap4.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="../../dist/css/adminlte.min.css">
  <!-- Google Font: Source Sans Pro -->
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">



    <link rel="stylesheet" href="../../plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
  <link rel="stylesheet" href="../../plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
  <link rel="stylesheet" href="../../plugins/datatables-buttons/css/buttons.bootstrap4.min.css">




    <style>
  .modal-header {
    padding: 15px;
    border-bottom: 1px solid #e5e5e5;
}
  .modal-header {
    background: #226faa;
    background: -webkit-gradient(linear,left top,right top,from(#226faa),color-stop(37%,#2989d8),to(#72c0d3));
    background: linear-gradient(to right,#226faa 0,#2989d8 37%,#72c0d3 100%);
    border-radius: 6px;
    color: #fff;
    padding: 18px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-color: transparent;
}




  </style>



</head>
<body class="hold-transition sidebar-mini">



<!-- Site wrapper -->
<div class="wrapper">

<!-- TOP MENU -->


<nav class="main-header navbar navbar-expand navbar-white navbar-light">
													<ul class="navbar-nav">
															<li class="nav-item">
																	<a class="nav-link" data-widget="pushmenu" href="#"><i class="fas fa-bars"></i></a>
															</li>

															 <td>
                        &nbsp  <button type="button"  class="btn btn-block btn-primary"  >Total Commande : <div id='TOTALCAHT'> <?php echo number_format( $CAHT, 2, ',', ' ').'<sup style="font-size: 20px">€ </sup>';?> </div></button>
                        </td>

															<li>
															</li>
													</ul>
												</nav>


<!-- BARRE DE NAVIGATION -->


<aside class="main-sidebar sidebar-dark-primary elevation-4">

	<!-- Brand Logo -->
	<a href="index3.html" class="brand-link">
		<img src="dist/img/logomcpro.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3"
				 style="opacity: .8">
		<span class="brand-text font-weight-light">MC PRO</span>
	</a>

	<!-- Sidebar -->
	<div class="sidebar">
		<!-- Sidebar user panel (optional) -->
		<div class="user-panel mt-3 pb-3 mb-3 d-flex">
			<div class="image">
				<img src="dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image">
			</div>
			<div class="info">
				<a href="#" class="d-block">Steeven ROBLOT</a>
			</div>
		</div>

	<?php include('menu.php'); ?>

		<!-- Sidebar Menu -->

	</div>
	<!-- /.sidebar -->
</aside>








 <!-- DEMARRAGE DE LA PAGE PRINCIPALE -->
  <div class="content-wrapper">

    <section class="content-header">
   <div class="container-fluid">
     <div class="row mb-2">
       <div class="col-sm-6">
         <h1>Etat du Stock</h1>
       </div>
       <div class="col-sm-6">
         <ol class="breadcrumb float-sm-right">
           <li class="breadcrumb-item"><a href="index.php">Accueil</a></li>
           <li class="breadcrumb-item"><a href="indexstock.php">Gestion du Stock</a></li>
           <li class="breadcrumb-item active">Etat du stock </li>
         </ol>
       </div>
     </div>
   </div><!-- /.container-fluid -->
  </section>
    <!-- Content Header (Page header) -->

													<div class="row mb-2">
																			<div  class="modal fade" id="myModal" role="dialog" class="modal fade task-modal-single in" tabindex="-1"  aria-labelledby="myLargeModalLabel" >
																			  <div class="modal-dialog modal-lg">
																				<div class="modal-content data">
																					<div id="fetch" >
																					</div>

																					</div>

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

    <!-- PAGE PRINCIPALE -->

 <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>
				<section class="content">
					<div class="row">
						<div class="col-12">
							<div class="card">

									<div class="card-body">



									      <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()";>
	            <option value="8" <?php if($_GET['idbureausel'] == 8) echo "selected"?> >   PARIS </option>
				 <option value="9" <?php if($_GET['idbureausel'] == 9) echo "selected"?> >   TOULON </option>

				</select>
				  </td>
			</tr>
</form>
</table>

</div>



										<div class="onglet_dotted">
											<div style="width:100%; float:left; vertical-align:top" class="header_ray">
												<div id="tab">
													<div class="box-body">
														  <table id="example1" class="table table-bordered table-striped">
															<thead>
															<tr>
															 <th>Produit </th>

															  <th>Qté stock</th>
                                <th>Qté mini</th>
															  <th>Qté opt</th>
															  <th>Différence</th>
															  <th>Qté Commande</th>
                                <th>Coût</th>


															</tr>
															</thead>
															<tbody>
														  <?php
														  $CAHT = 0 ;
														   while($row = dbi_fetch_row($q))
														   {
															    $cout = 0 ;

															   if( $_GET['idbureausel'] == 9)
															   {
																   $whero = "and local = 'TOULON' " ;
															   }
															   else
															   {
																	$whero = "and local = 'PARIS' " ;
															   }

															   	 if( $_GET['idbureausel'] == 9)
															   {
																   $wheroo = "and Lieu_de_stockage_ID = 21 " ;
															   }
															   else
															   {
																	$wheroo = "and Lieu_de_stockage_ID = 20 " ;
															   }

															   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']))  ;
														      list($quantite) =  dbi_fetch_row(dbi_query("SELECT quantite  FROM `stock_optimal` WHERE `Produit_ID` = ".$row['Produit_ID']."  $wheroo")) ;
														      list($quantite_minimale) =  dbi_fetch_row(dbi_query("SELECT quantite_minimale  FROM `stock_optimal` WHERE `Produit_ID` = ".$row['Produit_ID']."  $wheroo")) ;



														$etat = $qttR - $qttL ;

														$diff = $etat - $quantite ;



														$commande =  "" ;

														if( $diff < 0){

															$commande =  abs($diff)/ $row['Produit_conditionnement'] ;

															$chaine = "<span class='badge badge-pill badge-danger'> $diff</span>" ;
														}else{
															$chaine = $diff ;
														}


    //si la quantité en stock est inférieure à la quantité minimale, il faut entourer en rouge le nombre qui s’affiche dans « quantité »

	                                      // $diff_quMin_qunStok = $etat -
                                                       if( $etat < $quantite_minimale ){

														   // echo "ssssssssss <br/>" ;

															$etat = "<span class='badge badge-pill badge-danger'> $etat</span>" ;
														}


														$cout =  $row['Produit_Prix']*$row['Produit_conditionnement']* $commande ;

														$CAHT = $CAHT + $cout ;
														?>


																<tr>


															  <td><?php echo $row['Produit_Designation'] ;  ?></td>

															   <td><?php echo $etat;  ?></td>
                                                            <td><?php echo $quantite_minimale;  ?></td>

															   <td><?php echo $quantite;  ?></td>
															   <td><?php echo $chaine;  ?></td>
															   <td><?php echo ceil($commande);  ?></td>

                                                             <td><?php echo $cout." €";  ?></td>



													<?

														   }
													?>





															</tfoot>
														  </table><!-- /.table -->
													</div><!-- /.box-body -->
												</div><!-- /.tab -->
											</div><!-- /.header_ray -->
										</div><!-- /.onglet_dotted -->
								    </div><!-- /.card-body -->
							    </div><!-- /.card card-primary card-outline -->
							</div> <!-- /.col-12 -->
						</div>  <!-- /.row -->
				</section> <!-- /.section -->




	</div>
          <!-- /.card -->









  <footer class="main-footer">
    <div class="float-right d-none d-sm-block">
      <b>Version</b> 3.0.1
    </div>
    <strong>Copyright &copy; 2019 MCPRO</strong>
  </footer>
<!-- FIN DU PIED DE PAGE -->

<!-- NE PAS TOUCHER CI-DESSOUS -->
  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
    <!-- Control sidebar content goes here -->
  </aside>
  <!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->

<!-- jQuery -->
<script src="../../plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="../../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<script src="../../plugins/datatables/jquery.dataTables.js"></script>
<script src="../../plugins/datatables-bs4/js/dataTables.bootstrap4.js"></script>






<script src="../../plugins/datatables/jquery.dataTables.min.js"></script>
<script src="../../plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
<script src="../../plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
<script src="../../plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
<script src="../../plugins/datatables-buttons/js/dataTables.buttons.min.js"></script>
<script src="../../plugins/datatables-buttons/js/buttons.bootstrap4.min.js"></script>
<script src="../../plugins/jszip/jszip.min.js"></script>
<script src="../../plugins/pdfmake/pdfmake.min.js"></script>
<script src="../../plugins/pdfmake/vfs_fonts.js"></script>
<script src="../../plugins/datatables-buttons/js/buttons.html5.min.js"></script>
<script src="../../plugins/datatables-buttons/js/buttons.print.min.js"></script>
<script src="../../plugins/datatables-buttons/js/buttons.colVis.min.js"></script>
<!-- AdminLTE App -->
<script src="../../dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../../dist/js/demo.js"></script>
<script>
  $(function () {
    $("#example1").DataTable({
      "responsive": true, "lengthChange": false, "autoWidth": false, "paging": false,
      "buttons": ["copy", "csv", "excel", "pdf", "print"]
    }).buttons().container().appendTo('#example1_wrapper .col-md-6:eq(0)');
    $('#example2').DataTable({
      "paging": false,
      "lengthChange": false,
      "searching": false,
      "ordering": true,
      "info": true,
      "autoWidth": false,
      "responsive": true,
    });
  });
</script>


<script>
  $(function () {
$("#allcheck").click(function(){
    $('input:checkbox').not(this).prop('checked', this.checked);
});
	 var TOTALCA ="<?php echo number_format( $CATTC, 2, ',', ' ').'<sup> € </sup>';?>";
	$('#TOTALCA').html(TOTALCA);
	 var TOTALCAHT ="<?php echo number_format( $CAHT, 2, ',', ' ').'<sup> € </sup>';?>";
	$('#TOTALCAHT').html(TOTALCAHT);
    //Initialize Select2 Elements
    $('.select2').select2()

    //Initialize Select2 Elements
    $('.select2bs4').select2({
      theme: 'bootstrap4'
    })

    //Datemask dd/mm/yyyy
    $('#datemask').inputmask('dd/mm/yyyy', { 'placeholder': 'dd/mm/yyyy' })
    //Datemask2 mm/dd/yyyy
    $('#datemask2').inputmask('mm/dd/yyyy', { 'placeholder': 'mm/dd/yyyy' })
    //Money Euro
    $('[data-mask]').inputmask()

    //Date range picker
    $('#reservation').daterangepicker()
    //Date range picker with time picker
    $('#reservationtime').daterangepicker({
      timePicker: true,
      timePickerIncrement: 30,
      locale: {
        format: 'MM/DD/YYYY hh:mm A'
      }
    })
    //Date range as a button
    $('#daterange-btn').daterangepicker(
      {
        ranges   : {
          'Today'       : [moment(), moment()],
          'Yesterday'   : [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
          'Last 7 Days' : [moment().subtract(6, 'days'), moment()],
          'Last 30 Days': [moment().subtract(29, 'days'), moment()],
          'This Month'  : [moment().startOf('month'), moment().endOf('month')],
          'Last Month'  : [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
        },
        startDate: moment().subtract(29, 'days'),
        endDate  : moment()
      },
      function (start, end) {
        $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'))
      }
    )

    //Timepicker
    $('#timepicker').datetimepicker({
      format: 'LT'
    })

    //Bootstrap Duallistbox
    $('.duallistbox').bootstrapDualListbox()

    //Colorpicker
    $('.my-colorpicker1').colorpicker()
    //color picker with addon
    $('.my-colorpicker2').colorpicker()

    $('.my-colorpicker2').on('colorpickerChange', function(event) {
      $('.my-colorpicker2 .fa-square').css('color', event.color.toString());
    });

    $("input[data-bootstrap-switch]").each(function(){
      $(this).bootstrapSwitch('state', $(this).prop('checked'));
    });

  })
</script>



<script src="../../plugins/bs-custom-file-input/bs-custom-file-input.min.js"></script>

<script type="text/javascript">
$(document).ready(function () {
  bsCustomFileInput.init();
});
</script>

</body>
</html>

AnonSec - 2021