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/MCPRO/../MC/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/logmcpe/www/MCPRO/../MC/tab.php
<?php
include_once 'code/init.php';

// echo "bonjour  $agence <br/>" ; 

print_header ();
// exit() ; 
$qq= dbi_query("SELECT client_id  FROM  client where agence_id = $agence and client_actif = '0' order by client_nom ") ; 


		$du = sprintf("%04d%02d%02d", $_POST['duyear'], $_POST['dumonth'], $_POST['duday']) ;
		$au = sprintf("%04d%02d%02d", $_POST['auyear'], $_POST['aumonth'], $_POST['auday']) ;
		
		// echo "===> $du <br/>" ;
		// echo "===> $au <br/>" ;
		if(!empty($_POST))
		{

	  ?>
	  
<table BORDER="1px">
	 <tr>
			 
			  <th>nom de client </th>
			 <th>somme  paiement</th>
			 <th> somme facture  </th>
			 <th> somme avoir  </th>
			 <th> sm avoir + sm factur </th>
			 <th> diff </th>

	 </tr>	

      <?
	  $som_f_a = 0 ;
	  while($a=dbi_fetch_row($qq))
{

$cId = $a['client_id'] ; 
	list($smfacture) = dbi_fetch_row(dbi_query("SELECT SUM(f.total) FROM ".TABLE_PAIEMENT." p INNER JOIN ".TABLE_FACT." f ON f.fact_id = p.fact_id WHERE p.client_id='$cId' AND p.agence_id=$agence and p.date >= '$du' and p.date <= '$au'")) ;
	list($smmpaiment) = dbi_fetch_row(dbi_query("SELECT SUM(p.montant) FROM ".TABLE_PAIEMENT." p  WHERE p.client_id='$cId' AND p.agence_id=$agence and p.date >= '$du' and p.date <= '$au'")) ;
	list($nomc , $pnomc) = dbi_fetch_row(dbi_query("SELECT client_nom ,client_pnom  FROM  `client`  WHERE  client_id =$cId")) ;
  
  list($sommeAvoir)= dbi_fetch_row(dbi_query("select sum(a.montant) from avoir a , ".TABLE_FACT." f where f.fact_id= a.fact_id AND f.client_id='$cId' AND a.agence_id=$agence and a.date >= '$du' and a.date <= '$au' ")) ; 
 $som_f_a = $smfacture + $sommeAvoir ;
 
 $diff=  $som_f_a - $smmpaiment ; 
 ?>
  <tr>
  <?
 if($diff == 0)
 {
?>
 <td> <?=$nomc." ".$pnomc ?>  </td>
  <td> <?=$smmpaiment ?>  </td>
  <td> <?=$smfacture ?>  </td>
  <td> <?=$sommeAvoir ?>  </td>
  <td> <?=$som_f_a ?>  </td>
   <td  > <?=$diff ?>  </td>
   <?
  }
  else
  {
  ?>
   <td bgcolor="#A5DF010"> <?=$nomc." ".$pnomc ?>  </td>
  <td bgcolor="#A5DF010" > <?=$smmpaiment ?>  </td>
  <td bgcolor="#A5DF010" > <?=$smfacture ?>  </td>
  <td bgcolor="#A5DF010" > <?=$sommeAvoir ?>  </td>
  <td bgcolor="#A5DF010" > <?=$som_f_a ?>  </td>
   <td bgcolor="#A5DF010" > <?=$diff ?>  </td>
   <?
  }
  ?>
 </tr>
 <?
 $som_f_a = 0 ;
}

	  ?>

	 
</table>
<?




}
?>
      
          <form action="" method="post">
            <input type="hidden" name="type" value="attestation" />
            <table width="400">
            <tr>
              Du :
              <?php print_date_selection('du', $att_du)?>
            </tr>
            <tr>
              Au : 
              <?php print_date_selection('au', $att_au)?>
            </tr>
 
           
            <tr>
              <input type="submit" value="Cr&eacute;er" class="bigbutton" onClick="this.form.submit();">
          </form>
		
      </tr>
    </table>

</body>
</html>

AnonSec - 2021