AnonSec Team
Server IP : 10.128.40.6  /  Your IP : 216.73.217.20
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 (0755) :  /home/logmcpe/www/TMCPRO/pages/python/../

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/logmcpe/www/TMCPRO/pages/python/../reg.php
<?php

include 'includes/config_tmcpro.php' ;
include 'includes/stable_functions_tmcpro.php' ;
// echo "<pre>" ; 
// print_r($_GET) ; 
// echo "</pre>" ; 

if(!empty($_GET['client_id']))
{
$_SESSION["client_id"]=$_GET['client_id'];

}
 $cleint_id=$_SESSION["client_id"] ; 
$client_id = $_SESSION["client_id"] ;
$_SESSION["cleint_id"]= NULL ; 
// echo "<pre>" ; 
// prinhht_r($_POST) ; 
// echo "</pre>" ;

	

	
						 if(!empty($_POST))
			 {
				 // echo "bbb <br/>" ;
				 // exit() ;
	                       $client_statut=$_POST['cleint_satatu'] ; 
					    $id_Etablissement=$_POST['etab'] ; 
						$societe=addslashes($_POST['societe']) ; 
						$id_Categorie=addslashes($_POST['cleint_categorie']) ; 
						$client_adr1=addslashes($_POST['adr1']) ; 
						$client_adr2=addslashes($_POST['adr2']) ; 
						$client_adr3=addslashes($_POST['adr3']) ; 
						$client_cp=$_POST['cp'] ; 
						$client_ville=addslashes($_POST['ville']) ; 
						$client_tele=$_POST['tele'] ; 
						$client_fax=$_POST['fax'] ; 
					
						
						
						dbi_query( " UPDATE client
SET client_nom = '$societe', client_adr1 = '$client_adr1',
  client_adr1 = '$client_adr1',
  client_adr2 = '$client_adr2',
  client_adr3 = '$client_adr3',
  client_cp =   '$client_cp',
  client_ville = '$client_ville',
  client_statut = '$client_statut',
  etablissement_id = '$id_Etablissement',
  categorie_id  = '$id_Categorie',
  client_tele  = '$client_tele',
  client_fax  = '$client_fax'
WHERE client_id = $cleint_id ") ; 
			 }
	
	$q= dbi_fetch_row(dbi_query("SELECT * FROM client where client_id = ".$cleint_id)) ; 

	?>





<!DOCTYPE html>
<html>

<head>

  <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <!-- Enregistrer le titre de la page --><title> LogMCPRO | Client</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">
												<!-- 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">
</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>
				<li><button  href="#myModal"  id="custId" data-toggle="modal" type="button" class="btn btn-primary" > Nouveau reglement </button></h3> </li>
			</ul>
		 <!-- liens TOP MENU DROITE -->
			<ul class="navbar-nav ml-auto">
			 <!-- Placer ici l'élément à positionner à droite du TOP MENU -->
			</ul>
		</nav>  <!-- fin du TOP MENU -->
		
		<?php include('menu.php'); ?>
 
					<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>
 
 <!-- Ne pas toucher au dessus / fin de la BARRE DE NAVIGATION-->	
 <!-- 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="col-sm-6">
					<h1 class="m-0 text-dark"></h1>
				  </div><!-- /.col -->
				  <div class="col-sm-6">
					
				  </div><!-- /.col -->
				</div><!-- /.row -->
			  </div><!-- /.container-fluid -->
			</div>
			<!-- /.content-header -->





			<!-- PAGE PRINCIPALE -->
			<div class="content">
				<div class="container-fluid">
					<div class="row">
					
						<!-- DEFINITION DES COLONNES -->	
						<div class="col-lg-3">
							<!-- WIDGET AVEC LE NOM DU CLIENT -->		  
							<?php include('widget_client.php'); ?>	
							<!-- BARRE DE NAVIGATION DU CLIENT -->		  
							<?php include('menu_client.php'); ?>
						</div>
					  
					  <!-- PASSAGE A LA COLONNE DE DROITE-->
						<div class="col-lg-9">
							<?php
							$query = "SELECT f.num_fact,
							f.fact_id, total,date_debut,date_fin,
							total-if(p.paye is null, 0, p.paye)-if(a.avoir is null, 0, a.avoir) AS paye,
							if(a.avoir is null, 0, a.avoir) avoir,
							f.date_fact, if(if(p.paye is null, 0, p.paye)+if(a.avoir is null, 0, a.avoir) >= total, 'Réglé', if(if(p.paye is null, 0, p.paye)+if(a.avoir is null, 0, a.avoir) = 0, 'Pas de r&egrave;glement', 'R&egrave;glement partiel')) statut,
							f.relance
							FROM ".TABLE_FACT." f
							LEFT JOIN (select if(sum(if(montant is null, 0, montant)) is null, 0, sum(if(montant is null, 0, montant))) paye, fact_id FROM ".TABLE_PAIEMENT." where client_id = $client_id group by fact_id) p ON f.fact_id = p.fact_id
							LEFT JOIN (select if(sum(if(montant is null, 0, montant)) is null, 0, sum(if(montant is null, 0, montant))) avoir, fact_id FROM ".TABLE_AVOIR." group by fact_id) a ON f.fact_id = a.fact_id
							WHERE f.client_id=$client_id
							AND f.agence_id=$agence
							AND if(p.paye is null, 0, p.paye)+if(a.avoir is null, 0, a.avoir) %s total
							GROUP BY date_fact, f.fact_id, total
							order by num_fact DESC" ;
							$q = dbi_query(sprintf($query, '>=')) ;


							$query2 = "SELECT f.num_fact,
							f.fact_id, total,date_debut,date_fin,
							total-if(p.paye is null, 0, p.paye)-if(a.avoir is null, 0, a.avoir) AS paye,
							if(a.avoir is null, 0, a.avoir) avoir,
							f.date_fact, if(if(p.paye is null, 0, p.paye)+if(a.avoir is null, 0, a.avoir) >= total, 'Réglé', if(if(p.paye is null, 0, p.paye)+if(a.avoir is null, 0, a.avoir) = 0, 'Pas de r&egrave;glement', 'R&egrave;glement partiel')) statut,
							f.relance
							FROM ".TABLE_FACT." f
							LEFT JOIN (select if(sum(if(montant is null, 0, montant)) is null, 0, sum(if(montant is null, 0, montant))) paye, fact_id FROM ".TABLE_PAIEMENT." where client_id = $client_id group by fact_id) p ON f.fact_id = p.fact_id
							LEFT JOIN (select if(sum(if(montant is null, 0, montant)) is null, 0, sum(if(montant is null, 0, montant))) avoir, fact_id FROM ".TABLE_AVOIR." group by fact_id) a ON f.fact_id = a.fact_id
							WHERE f.client_id=$client_id
							AND f.agence_id=$agence
							AND if(p.paye is null, 0, p.paye)+if(a.avoir is null, 0, a.avoir) %s total
							GROUP BY date_fact, f.fact_id, total
							order by num_fact DESC" ;
							
							
							$q = dbi_query("SELECT sum(f.total)
							FROM (
								(select -montant total from ".TABLE_PAIEMENT." where client_id='$client_id' AND agence_id='$agence')
								union all
								(
									SELECT total-sum(if(a.montant is null, 0, a.montant)) AS total
									FROM ".TABLE_FACT." f
									LEFT JOIN ".TABLE_AVOIR." a ON f.fact_id = a.fact_id
									WHERE f.client_id='$client_id'
									AND f.agence_id='$agence'
									GROUP BY f.fact_id, f.total
								)
							) f") ;
							list($solde) = dbi_fetch_row($q) ;
							list($regl) = dbi_fetch_row(dbi_query("select date from ".TABLE_PAIEMENT." where client_id=$client_id AND agence_id=$agence order by date DESC  limit 1")) ;
							// echo " solde ===> ".number_format($solde, 2, ', ', ' ')."<br/>"; 
							// echo " DERNIER REGLEMENT ===> ".int2date($regl) ; 
							?>
					  
							<div class="row">
								<div class="col-lg-6 col-6">

								</div>
								<div class="col-lg-3 col-6">
									<div class="small-box bg-info">
										<a href="#" class="small-box-footer">SOLDE  : 
											<h3><div id='TOTALCAHT'><?php echo number_format( $solde, 2, ',', ' ').'<sup style="font-size: 20px">€ </sup>';?></div></h3>
										</a>
									</div>
								</div>
								<div class="col-lg-3 col-6">
									<div class="small-box bg-info">
										<a href="#" class="small-box-footer">DERNIER REGLEMENT  : 
											<h3><div id='TOTALCA'><?php echo int2date($regl).'<sup style="font-size: 16px"></sup>';?></div></h3>
										</a>
									</div>
								</div>
							</div>	
					 
							<div class="row">
								<div class="col-lg-12">
								  <!-- CARD DE DROITE-->
									<div class="card">
										<div class="card-header"><h5 class="m-0"><i class="nav-icon far fas fa-address-book"></i> Coordonnées</h5></div>
										<div class="card-body">
											<!-- ><section class="content"> CARD DE DROITE-->
											<?php if(isset($_GET["msg"])){ ?>
												<div class="alert alert-<?php echo $_GET["color"]; ?>  alert-dismissible col-12" role="alert">
												  <strong><?php echo $_GET["color"].': '; ?></strong><?php echo $_GET["msg"]; ?>.
												  <button type="button" class="close" data-dismiss="alert" aria-label="Close">
													<span aria-hidden="true">&times;</span>
												  </button>
												</div>
											<?php  }  
												$q = dbi_query("SELECT * FROM ".TABLE_PAIEMENT." p LEFT JOIN ".TABLE_FACT." f USING(fact_id) LEFT JOIN ".TABLE_REGLEMENT." r USING(reglement_id) where p.client_id = '$client_id' AND p.agence_id='$agence' order by num_fact DESC") ;
												if(mysqli_num_rows($q))
												{
												?><br clear="all" />

												<table class="table table-bordered" >
													<tr>
														<th style="text-align:center;"><A href="#">Numéro de Facture</A></th>
														<th style="text-align:center;"><A href="#">Date du r&egrave;glement</A></th>
														<th style="text-align:center;"><A href="#">Mode de r&egrave;glement</A></th>
														<th style="text-align:center;"><A href="#">Montant r&eacute;gl&eacute;</A></th>
														<th style="text-align:center;"><A href="#">Supprimer</A></th> 
													</tr>
												<?php
													while($f = dbi_fetch_row($q))
													{
												?>
													<tr>
														<td style="text-align:center;"><?=$f['num_fact']?></td>
														<td style="text-align:center;"><?=int2date($f['date'])?></td>
														<td style="text-align:center;"><?=utf8_encode($f['reglement_desc'])?><?=($f['reglement_desc']=='Chèque'?' N°'.$f['num_cheque']:'')?></td>
														<td style="text-align:center;"><?=number_format($f['montant'], 2, ', ', ' ')?> &euro;</td>
														<td style="text-align:center;">
														

														
														<a href="<?="?client_id=$client_id&agence_id=$agence&action=sup&paiement_id=".$f['paiement_id']?>" onclick="return confirm('Voulez-vous vraiment supprimer ce règlement ?');" class="btn btn-danger btn-sm"> </i>  Supprimer </a>  
														
														</td>
													</tr>
												<?php
													}
													echo '</table>';
												}
											?>
														
														
														
										</div>
									</div>
								</div>	
							</div>

						
						</div>
					</div>
				</div>

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

  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
    <!-- Control sidebar content goes here -->
    <div class="p-3">
      <h5>Title</h5>
      <p>Sidebar content</p>
    </div>
  </aside>
  <!-- /.control-sidebar -->
  <footer class="main-footer">
    <div class="float-right d-none d-sm-block">
      <b>Version</b> 3.0.1
    </div>
    <strong>Copyright &copy; 2014-2019 <a href="http://adminlte.io">AdminLTE.io</a>.</strong> All rights
    reserved.
  </footer>

  <!-- 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>
<!-- AdminLTE App -->
<script src="../../dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../../dist/js/demo.js"></script>
<script src="../../plugins/summernote/summernote-bs4.min.js"></script>
<script>
  $(function () {
    // Summernote
    $('.textarea').summernote()
  }) ; 
  
  
  
  $(document).ready(function(){
    $('#myModal').on('show.bs.modal', function (e) {
        var rowid = $(e.relatedTarget).data('id');
        $.ajax({
            type : 'post',
            url : 'ajaxModifierReglement.php', //Here you will fetch records 
            data :  'rowid='+ rowid, //Pass $id
            success : function(data){
            $('#fetch').html(data);//Show fetched data from database
            }
        });
     });
});

</script>

AnonSec - 2021