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/TEST/../MCPRO/vendor/../

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/logmcpe/www/TEST/../MCPRO/vendor/../Compta.php
<html>
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>AdminLTE 2 | Data Tables</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.7 -->
  <link rel="stylesheet" href="../../bower_components/bootstrap/dist/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="../../bower_components/font-awesome/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="../../bower_components/Ionicons/css/ionicons.min.css">
  <!-- DataTables -->
  <link rel="stylesheet" href="../../bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="../../dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="../../dist/css/skins/_all-skins.min.css">


  <link rel="stylesheet"
        href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body class="hold-transition skin-blue sidebar-mini">























<?php
// exit() ;
include_once 'code/init.php';
// print_header ('', '', $BodyX );
// echo " + ".$_SESSION['admin']."+";
$agence=$_SESSION['agence'];
// for ($l = 'A' ; strlen($l) == 1 ; $l++)
	// echo "<a href=\"a.php?col=-2&val=$l\">$l</a> " ;
	// echo "<a href=\"a.php\">Voir la liste complète</a> " ;	
	
	
	// echo "<pre>" ; 
	// print_r($_GET) ; 
	// echo "<pre>" ; 
	
	// exit() ; 

	
	
	
		$soldeaa = 0 ; 
	$qaa = dbi_query("SELECT * FROM client where client_id  in (SELECT client_id FROM `client_suivi` where `suivi_id` = 25 ) and client_actif = '0' and agence_id = $agence ORDER BY client_bureau ,client_nom  ") ;
 
		while($c = dbi_fetch_row($qaa)) {
		
		list($nom_agence) = dbi_fetch_row( dbi_query("SELECT nom_agence FROM  bureau where  id_bureau  = ".$c['client_bureau'])) ; 
	// if($c['client_prospect']== '1'){

		 $client_id =  $c['client_id'] ; 
		$qq = 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($qq) ;
		$soldeaa= $solde + $soldeaa ;
		
	}
?>



<table style="width:95%;text-align:center;margin : 0 auto; "  height="50px" >
<tr>

<td class="tdl" style="width:50%;" ><input name="solde" class="inputblue" value=" SOLDE <?=number_format($soldeaa, 2, ', ', ' ')?>     &euro; "/><br/><br/></td>

</tr>
<tr>
</table>


<form action="" method="get" style="margin-top:10px">

<?php

if($_GET['client_actif']=='on' || $_GET['client_actif']=='off' ) $_SESSION['client_actif']=$_GET['client_actif'];
	$where1="";
	$where2="";
	$selected="";
if($_GET['idbureausel'] && !empty($_GET['idbureausel']) )
{
   if($_GET['idbureausel']>0)
	{
		$idbureausel=$_GET['idbureausel'];
		$tabbursel=dbi_fetch_row((dbi_query('select * from bureau where id_bureau='.$_GET['idbureausel'].' and agence_id='.$agence.''))) ;
		$id_bureau=$tabbursel['id_bureau'];
		$nom_bureau=$tabbursel['nom_agence'];
		$where1=" AND ID_Bureau != $id_bureau ";
		$where2=" AND client_bureau = $id_bureau ";
    }
	elseif($_GET['idbureausel']=="INDEFINI")
	{
	$id_bureau=$_GET['idbureausel'];
	$where2=" AND client_bureau='0' ";
	$selected='selected="selected"';
	}
}
?>

</form>


<script language="Javascript">
   function GetIdBureau()
   {
		var idbursel="";
  	  idbureausel = document.bureau_form.client_bureau.value ;
	if( idbureausel > 0 || idbureausel=="INDEFINI" )
	  window.location = "prospPP.php?idbureausel="+idbureausel;
	  	else
	window.location = "prospPP.php";
   }
</script>

<form action="" method="get" style="margin-top:10px">

<?php
// Zones :
// for ($i = 1 ; $i <= 12 ; $i++)
	// printf('<input type="checkbox" name="zone[]" value="%1$X"%2$s> %1$d ', $i, !empty($_GET['zone']) && in_array(strtoupper(dechex($i)), $_GET['zone']) ? ' checked' : '') ;

// Lister les intervenants actifs ou non actifs.	
if($_GET['client_actif']=='on' || $_GET['client_actif']=='off' ) $_SESSION['client_actif']=$_GET['client_actif'];
	$where1="";
	$where2="";
	$selected="";
if($_GET['idbureausel'] && !empty($_GET['idbureausel']) )
{
   if($_GET['idbureausel']>0)
	{
		$idbureausel=$_GET['idbureausel'];
		$tabbursel=dbi_fetch_row((dbi_query('select * from bureau where id_bureau='.$_GET['idbureausel'].' and agence_id='.$agence.''))) ;
		$id_bureau=$tabbursel['id_bureau'];
		$nom_bureau=$tabbursel['nom_agence'];
		$where1=" AND ID_Bureau != $id_bureau ";
		$where2=" AND client_bureau = $id_bureau ";
    }
	elseif($_GET['idbureausel']=="INDEFINI")
	{
	$id_bureau=$_GET['idbureausel'];
	$where2=" AND client_bureau='0' ";
	$selected='selected="selected"';
	}
}
?>

	<!--<br><input type="radio" Onclick="submit()" value="on" name="client_actif" <?//=($_SESSION['client_actif'] == 'on' || !isset($_SESSION['client_actif']))  ? 'checked' : ''?> >Clients actifs
	<input type="radio" Onclick="submit()" value="off" name="client_actif" <?//=$_SEION['client_actif'] == 'off' ? 'checked' : ''  ?>>Tous -->

	
	

	
	</form>

	
<?
if (empty($_GET['val']) || !isset($_GET['col']))
{
	$_GET['col'] = -1 ;
	$_GET['val'] = '' ;
}
error_reporting(E_ALL|E_STRICT) ;
$cols = array('client_nom', 'client_cp', 'client_ville', -1 => '', -2 => 'client_nom') ;
$soundex = array (1, 0, 1, -1 => 2, -2 => 3) ;
$tel = array('client_teldom', 'client_teldom', 'client_telport1', 'client_telpro') ;
$s = '$s' ;
$queries = array("(SELECT *, 1 AS exact, IF(client_genre='SERENA',1,0) as serena, IF(client_genre='FORMATION',1,0) as formation FROM ".TABLE_CLIENT." WHERE %s = '%s' AND client_genre NOT LIKE 'FORMATION' $where2 AND agence_id=$agence%3\$s ".( isset($_SESSION['client_actif'])&&$_SESSION['client_actif']=='off' ? "AND client_actif='1" : " AND client_actif='0' AND   client_prospect ='1' ").") UNION (SELECT *, 0 AS exact, IF(client_genre='SERENA',1,0) as serena, IF(client_genre='FORMATION',1,0) as formation FROM ".TABLE_CLIENT." WHERE %1\$s LIKE '%%%2$\s%%' AND %1\$s != '%2\$s' AND client_genre NOT LIKE 'FORMATION' $where2 AND agence_id=$agence%3\$s ".( isset($_SESSION['client_actif'])&&$_SESSION['client_actif']=='off' ? "AND client_actif='1'" : " AND client_actif='0' AND   client_prospect ='1' ").")", "(SELECT *, 1 AS exact, IF(client_genre='SERENA',1,0) as serena, IF(client_genre='FORMATION',1,0) as formation FROM ".TABLE_CLIENT." WHERE %s = '%s' AND client_genre NOT LIKE 'FORMATION' $where2 AND agence_id=$agence%3\$s ".( isset($_SESSION['client_actif'])&&$_SESSION['client_actif']=='off' ? "AND client_actif='1'" : " AND client_actif='0' AND   client_prospect ='1'").") UNION (SELECT *, 0 AS exact, IF(client_genre='SERENA',1,0) as serena, IF(client_genre='FORMATION',1,0) as formation FROM ".TABLE_CLIENT." WHERE (%1\$s LIKE '%%%2\$s%%' OR soundex(%1\$s) = soundex('%2\$s')) AND %1\$s  != '%2\$s' AND client_genre NOT LIKE 'FORMATION' AND agence_id=$agence%3\$s ".( isset($_SESSION['client_actif'])&&$_SESSION['client_actif']=='off' ? "AND client_actif='1'" : " AND client_actif='0' AND   client_prospect ='1' ")." )", "SELECT *, 1 AS exact, IF(client_genre='SERENA',1,0) as serena, IF(client_genre='FORMATION',1,0) as formation FROM ".TABLE_CLIENT." WHERE client_prospect ='1' AND agence_id=$agence%3\$s AND client_genre NOT LIKE 'FORMATION' $where2 ".( isset($_SESSION['client_actif'])&&$_SESSION['client_actif']=='off' ? "AND client_actif='1'" : " AND client_actif='0' AND   client_prospect ='1' "), "SELECT *, 1 AS exact, IF(client_genre='SERENA',1,0) as serena, IF(client_genre='FORMATION',1,0) as formation FROM ".TABLE_CLIENT." WHERE %1\$s LIKE '%2\$s%%' AND client_genre NOT LIKE 'FORMATION' AND agence_id=$agence%3\$s $where2".( isset($_SESSION['client_actif'])&&$_SESSION['client_actif']=='off' ? "AND client_actif='1'" : " AND client_actif='0' AND   
µ§ ='1' ")." ") ;
$tri="client_id, client_nom, client_adr1, exact";
$ordre='desc';
if(!empty($_GET['tri']) && !empty($_GET['ordre']))
{
$tri='client_'.$_GET['tri'].' '.$_GET['ordre'];
	if($_GET['ordre']=='asc')
		$ordre='desc';
	else
		$ordre='asc';
}
else
{
$tri=" client_nom asc ";
}


// echo "<pre>" ; 

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



$q = dbi_query("SELECT * FROM client where client_id  in (SELECT client_id FROM `client_suivi` where `suivi_id` = 25 and client_suivi_clos = '0') and client_actif = '0' and agence_id = $agence ORDER BY client_bureau ,client_nom  ") ;
 
 
 
 
 // $q = dbi_query(" select * from client where client_actif =  '0'
// AND client_prospect =  '1'
// ORDER BY client_prospect ASC  ") ;
 
  $nombre=0;
 ?>
<div class="box-body">
              <table id="example1" class="table table-bordered table-striped">
                <thead>
                <tr>
  <th >Nom</th>
  <th >Adresse</th>
<th >Solde</th>
 <th >Suivi</th>
   
  
  </tr>
</thead>
    <tbody>
<?
	$compteur=0;
	$previous=1;
	$serena=0;
	$prospect=0;
	while($c = dbi_fetch_row($q)) {
		
		list($nom_agence) = dbi_fetch_row( dbi_query("SELECT nom_agence FROM  bureau where  id_bureau  = ".$c['client_bureau'])) ; 
	// if($c['client_prospect']== '1'){

		 $client_id =  $c['client_id'] ; 
		$qq = 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($qq) ;
		$next=$c['exact'];
		if (!($compteur % 2)) $style='td_listing0';
		else $style='td_listing1';
		
		
		
		
		$datedujour = date("Y-m-d" );
		$suiv = dbi_query("SELECT * FROM `client_suivi`,`suivi` , suivi_biais WHERE client_id = $client_id and client_suivi.suivi_id = `suivi`.suivi_id and (client_suivi.suivi_biais_id = suivi_biais.suivi_biais_id or client_suivi.suivi_biais_id='0' ) and suivi.suivi_id = 25 and client_suivi.client_suivi_clos = '0'   ORDER BY suivi_date DESC") ;

// and 	suivi_date >NOW()
$s = dbi_fetch_row($suiv) ;
//$suivv = $suivfitch['annotation'] ;



$action = '';
if ($s['suivi_biais_id']=='4') 
$action = '<img src="images/icones/warning.gif" alt="Message repondeur" border="0" align="absmiddle">&nbsp;'.$s['suivi_biais_intitule'].' effectu&eacute;';
else if ($s['suivi_programme']=='1') 
$action = '<img src="images/icones/programme.gif" alt="Action programme" border="0" align="absmiddle">&nbsp;Pr&eacute;voir un '.strtolower($s['suivi_biais_intitule']);
else $action = $s['suivi_biais_intitule'].'';
if ($s['suivi_biais_id']=='6') 
$action = '<img src="images/controles-16.png" alt="Contr&ocirc;le au domicile du client" border="0" align="absmiddle">&nbsp;Pr&eacute;voir une '.strtolower($s['suivi_biais_intitule']);

		
	// $action = '<b>'.$action.' le '.mysql_datefr($s['suivi_date'],'-','Djma');	
if($s['suivi_date'])
$action = '<b>'.$action.' le '.mysql_datefr($s['suivi_date'],'-','Djma');
else
$action = "";
		
		?>

<TR>
  <TD><A href="top.php?link=client&amp;page=suivi_gestion&suivi=historique&amp;id=<?=$c['client_id']?>" target="ident"><?=strtoupper($c['client_nom']).' '.ucwords(strtolower($c['client_pnom']))?></A></TD>
  <TD><?=$nom_agence." ". $client_id?></TD>
  <TD><?=$solde?></TD>
   <TD><?=$action ?></TD>
</TR>
<?


} ?>



    </tbody>
</table>


</div>
<br/>
<?php
// $nombre=mysql_num_rows($q);

?>



	<script src="bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- DataTables -->
<script src="bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
<script src="bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
<!-- SlimScroll -->
<script src="bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="bower_components/fastclick/lib/fastclick.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 -->
<script>
  $(function () {
    $('#example1').DataTable()
    $('#example2').DataTable({
      'paging'      : true,
      'lengthChange': false,
      'searching'   : false,
      'ordering'    : true,
      'info'        : true,
      'autoWidth'   : false
    })
  })
</script>
</body>
</html>


AnonSec - 2021