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/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/logmcpe/www/mcg/importet_FA_Avance_imm.php
<?php
	// require __DIR__ . '/vendor_sms_recu/autoload.php';
	// include 'includes_sms_recu/ovhhh.php';

include 'includes/config_tmcpro.php' ;
	include 'includes/stable_functions_tmcpro.php' ;
// use \Ovh\Api;
// exit() ;


// if(!empty($_POST))
// {
	// echo "<pre>" ;
	// print_r($_POST) ;
	// echo "<pre>" ;
	// $du= date2int_DSI($_POST['du']) ;

	// echo "==>".$du."<br/>" ;

	// $au= date2int_DSI($_POST['au']) ;

	// echo "==>".$du."<br/>" ;
	// echo "==>".$au."<br/>" ;

	// exit();
// }

function calculateTotalHours($data) {
    $totalHours = 0;
    foreach ($data as $item) {
		
        if (isset($item['nbH']) && is_numeric($item['nbH']) && ($item['des']!= "TOTAL")) {
            $totalHours += $item['nbH'];
        }
    }
    return $totalHours;
}

?>


<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>MCPRO</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">
  <!-- daterange picker -->
  <link rel="stylesheet" href="../plugins/daterangepicker/daterangepicker.css">
  <!-- iCheck for checkboxes and radio inputs -->
  <link rel="stylesheet" href="../plugins/icheck-bootstrap/icheck-bootstrap.min.css">
  <!-- Bootstrap Color Picker -->
  <link rel="stylesheet" href="../plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css">
  <!-- Tempusdominus Bbootstrap 4 -->
  <link rel="stylesheet" href="../plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css">
  <!-- Select2 -->
  <link rel="stylesheet" href="../plugins/select2/css/select2.min.css">
  <link rel="stylesheet" href="../plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css">
  <!-- Bootstrap4 Duallistbox -->
  <link rel="stylesheet" href="../plugins/bootstrap4-duallistbox/bootstrap-duallistbox.min.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">

    <!-- DataTables -->
  <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">
  <!-- Theme style -->
      <style>
.myCollapse {
    display: none;
}
.myCollapse.in {
    display: block;
}
  .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;
}

.modal-header .close {
    margin-top: -3px;
    font-size: 24px;
    font-weight: 400;
    color: #fff;
    opacity: .9;
    width: 28px;
    height: 28px;
    padding-bottom: 0;
    padding-left: 1px;
}
button.close {
    padding: 0;
    cursor: pointer;
    background: 0 0;
    border: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}



  </style>

</head>

<body class="hold-transition sidebar-mini">
												<!-- Site wrapper -->
<div class="wrapper">


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


		 </ul>

 <!-- liens TOP MENU DROITE -->


	<ul class="navbar-nav ml-auto">
		<li class="nav-item">
<a href="login.php?dec=1" class="nav-link">

<i class="nav-icon fas fa-power-off"></i>


</a>
</li><!-- Placer ici l'élément à positionner à droite du TOP MENU -->
	</ul>

	</nav>

<!-- BARRE DE NAVIGATION -->

 <!-- Couleur et caracteristiques de la barre de navigation-->
<?php include('menu.php'); ?>



 <!-- Ne pas toucher au dessus / fin de la BARRE DE NAVIGATION-->

 <!-- DEMARRAGE DE LA PAGE PRINCIPALE -->

    <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>
</div>


  <div class="content-wrapper">

  <!-- TITRE DE LA PAGE PRINCIPALE A PLACE ENTRE LES BALISES H1 & ARBORESCENCE SUR LA DROITE-->
    <section class="content-header">
      <div class="container-fluid">

		        <div class="row mb-2">




        </div><!-- /.row -->
      </div><!-- /.container-fluid -->
    </section>




    <section class="content">
      <div class="row">
        <div class="col-12">
         <div class="card card-info">
            <div class="card-header">
							<div class="row">
								<div class="col-sm-11"></div>
								<h3 class="card-title">  EXPORT DES FACTURES AVANCE IMMEDIATE </h3>


            </div>
            </div>
            <!-- /.card-header example1 -->
            <div class="card-body">


			   <form action="" method="POST">

   <?php

   				if(!empty($_POST))
{
	// echo "<pre>" ;
	// print_r($_POST) ;
	// echo "<pre>" ;
	$du= date2int_DSI($_POST['du']) ;

	// echo "==>".$du."<br/>" ;

	$au= date2int_DSI($_POST['au']) ;

	// echo "==>".$du."<br/>" ;
	// echo "==>".$au."<br/>" ;

	// exit();
}
else{
	$du= date('Ym').'01' ;
	$au= date('Ym').'31';
	// echo "==>".$du."<br/>" ;
	// echo "==>".$au."<br/>" ;
}











   ?>
 <div class="form-row">






  </div> <!-- ///////Permet de passer à la ligne suivante -->

 <!-- ///////Ligne société & Catégorie -->

<!-- ///////Ligne -->

  <div class="form-row">
    <div class="form-group col-md-4">
      <label></label>
	  <div class="input-group">
	  Du &nbsp; &nbsp;
                    <div class="input-group-prepend">
                      <span class="input-group-text"><i class="far fa-calendar-alt"></i></span>
                    </div>
                    <input type="date" class="form-control" data-inputmask-alias="datetime" data-inputmask-inputformat="dd/mm/yyyy" data-mask name="du" <?php  echo "value=".int2date_autre_format($du) ;?> placeholder="jj/mm/aaaa">
                  </div>

   </div>



     <?php//  $chantier_fin =    int2date_autre_format($red['chantier_fin'])  ;  ?>
  <div class="form-group col-md-4">
      <label></label>
	  <div class="input-group">
	  Au &nbsp; &nbsp;
                    <div class="input-group-prepend">
                      <span class="input-group-text"><i class="far fa-calendar-alt"></i></span>
                    </div>
                    <input type="date" class="form-control" data-inputmask-alias="datetime" data-inputmask-inputformat="dd/mm/yyyy" data-mask name="au" <?php  echo "value=".int2date_autre_format($au) ;?> placeholder="jj/mm/aaaa" >
                  </div>
	 </div>

	  <div class="form-group col-md-4">
      <label></label>
	  <div class="input-group">

                 <button type="submit" name="Enregistrer"  class="btn btn-primary">Afficher</button> </div>
	 </div>
	 </div>







</form>






               <table id="example1" class="table table-bordered table-striped">
                <thead>
                <tr>
				   <th>  Client  </th>
				   <th>  Email </th>
				   <th>  Date de la facture </th>
				   <th>N°Facture</th>
				   <th> Total TTC  </th>
				   <th> Total HT  </th>
				    <th> Acompte  </th>
				    <th> Date début prestation  </th>
					<th> Date Fin prestation  </th>
					<th> Date acompte </th>
					
					<th> Nature activité </th>
					<th> Unité  </th>
					<th>Quantité </th>
					<th> Prix unitaire TTC </th>
					<th> Prix unitaire HT</th>
					
					
		

                </tr>
                </thead>
                <tbody>
				<?php
		// $a =  dbi_query("SELECT client_nom , client_numexport, rt.date, rt.montant , reglement_desc,num_fact FROM reglement r , reglementt rt, client c , paiement p , facture f where rt.client_id = c.client_id and rt.reglement_id = r.reglement_id and rt.reg_id = p.reg_id AND p.fact_id = f.fact_id AND rt.date between $du AND $au") ;
		$a =  dbi_query(" SELECT c.client_nom,  c.client_facture_mail, f.date_debut, f.date_fin,f.data , f.num_fact , f.date_fact , f.total   ,  c.client_numexport , f.client_id FROM   facture f  , client c where  f.client_id = c.client_id and c.reglement_id = 8 and f.date_fact  between $du AND $au ") ;


			       while( $res=dbi_fetch_row($a))
				   {

                 
			   $mois =  substr($res['date_fact'], 4, 2);


			   switch ($mois) {
							case "01":
								$chaine_mois = "FACTURE DEC";
								break;
							case "02":
								$chaine_mois =  "FACTURE JAN";
								break;
							case "03":
								$chaine_mois =  "FACTURE FEV";
								break;
							case "04":
								$chaine_mois =  "FACTURE MAR";
								break;
							case "05":
								$chaine_mois =  "FACTURE AVR";
								break;
							case "06":
								$chaine_mois =  "FACTURE MAI";
								break;
							case "07":
								$chaine_mois =  "FACTURE JUI";
								break;
							case "08":
								$chaine_mois =  "FACTURE JUL";
								break;
							case "09":
								$chaine_mois =  "FACTURE AOU";
								break;
							case "10":
								$chaine_mois =  "FACTURE SEP";
								break;
							case "11":
								$chaine_mois =  "FACTURE OCT";
								break;
							case "12":
								$chaine_mois =  "FACTURE NOV";
								break;


						}
						$data = utf8_decode($res['data']);
                        list($data, $factures, $acompte, $attdata, $option) = unserialize($data) ;
						
						// echo "==>".$res['num_fact']."<br/>" ; 
						// echo "<pre>" ; 
						// print_r($data) ; 
						// echo "</pre>" ; 
						
					   $nbh	= calculateTotalHours($data) ;
					   // echo "==> $c <br/>" ;
						// list($chantier_TVA)=dbi_fetch_row(dbi_query("SELECT chantier_TVA  FROM `chantier` WHERE `client_id` = ".$res['client_id'])) ;
						 $chantier_TVA = 10 ;  
						$t_tva =  100/(100+ $chantier_TVA) ;

						$mnt_HT = $res['total'] * $t_tva ;

					    // echo "==>".$mnt_HT."===".$res['total']."<br/>" ;
						// echo "==>".round($mnt_HT ,2)."<br/>" ;
						$mnt_HT =   round($mnt_HT ,2) ;

						$TVAA =  $res['total'] -  $mnt_HT  ;

				?>
				<tr>
				<td> <?=$res['client_nom']?></td>
				<td> <?=$res['client_facture_mail']?></td>
				<td> <?=int2date($res['date_fact'])?></td>
				<td> <?="FA-".$res['num_fact']?></td>
			
				<td> <?=$res['total']?></td>
				<td> <?=$mnt_HT?></td>
				<td> <??></td>
			    <td> <?=int2date($res['date_debut'])?></td>
                <td> <?=int2date($res['date_fin'])?></td>
				<td> Ménage- repassage</td>
				<td> HEURE</td>
				<td> <?=$nbh?></td>
				<td> <?=$res['total']/$nbh?></td>
				<td> <?=round($mnt_HT/$nbh , 2)?></td>
				 
				 
		
		

				</tr>



                <?}?>











                </tbody>

              </table>
            </div>
            <!-- /.card-body -->
          </div>
          <!-- /.card -->
        </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->
    </section>
    <!-- /.content -->
  </div>
  <!-- NE PAS TOUCHER AU DESSUS DESSOUS -->




<!-- DEBUT DU PIED DE PAGE -->

  <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 -->

<script src="../plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Select2 -->
<script src="../plugins/select2/js/select2.full.min.js"></script>
<!-- Bootstrap4 Duallistbox -->
<script src="../plugins/bootstrap4-duallistbox/jquery.bootstrap-duallistbox.js"></script>
<!-- InputMask -->
<script src="../plugins/moment/moment.min.js"></script>
<script src="../plugins/inputmask/min/jquery.inputmask.bundle.min.js"></script>
<!-- date-range-picker -->
<script src="../plugins/daterangepicker/daterangepicker.js"></script>
<!-- bootstrap color picker -->
<script src="../plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js"></script>
<!-- Tempusdominus Bootstrap 4 -->
<script src="../plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
<!-- Bootstrap Switch -->
<script src="../plugins/bootstrap-switch/js/bootstrap-switch.min.js"></script>
<!-- AdminLTE App -->
<script src="../../dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../../dist/js/demo.js"></script>
<!-- Page script -->
<!-- DataTables  & Plugins -->
<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>
<!-- Page specific script -->
<script>
  $(function () {
    $("#example1").DataTable({
      "responsive": true, "lengthChange": false, "autoWidth": false,
	    "paging":   false,
	   "ordering": false,
      "buttons": ["excel", "pdf"]
    }).buttons().container().appendTo('#example1_wrapper .col-md-6:eq(0)');
    $('#example2').DataTable({
      "paging": true,
      "lengthChange": false,
      "searching": false,
      "ordering": true,
      "info": true,
      "autoWidth": false,
      "responsive": true,
    });
  });
</script>

<script>
  $(function () {
    //Initialize Select2 Elements
    $('.select2').select2()

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







</body>
</html>

AnonSec - 2021