|
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/www/../../MCPRO/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<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">
<style>
body {
background-color: rgb(236,240,245);
}
.box-body {
background-color: rgb(255,255,255);
}
</style>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<!-- /.row -->
<?php
// echo "test <br/>" ;
include_once 'code/init.php';
session_start();
// echo "<pre>" ;
// print_r($_POST) ;
// echo "</pre>" ;
// ini_set('display_errors','on');
// error_reporting(E_ALL);
// echo "test IFGIA" ;
$_SESSION["check_client"] = $_POST['check_client'] ;
// echo "<pre>" ;
// print_r($_SESSION["check_client"]) ;
// echo "</pre>" ;
// $get = '' ;
if(!empty($_POST))
{
// exit() ;
header("location: suivi_edition_check.php?action=nouvelle_action_suivi&client_suivi_id=92762&suivi_id=10&client_id=7343");
}
// exit() ;
// echo "<pre>" ;
// print_r($_SESSION) ;
// echo "</pre>" ;
// print_header ();
// [client_actif]
function get_bureau_drop_down($name = '', $param = '', $value ='', $choose = 'auto')
{
global $agence ;
if(!is_array($value))
$value = array($value) ;
$ret = "<select onchange='GetIdBureau()'; name=\"$name\" $param>".((in_array('', $value) || in_array('0', $value)) && count($value) == 1 && $choose == 'auto' || $choose === true ? '<option value="" selected style="font-weight:bold"></option>' : '') ;
$q = dbi_query("SELECT * FROM bureau WHERE agence_id=".$agence." ORDER BY nom_agence") ;
while($res = dbi_fetch_row($q)) {
$ret .= sprintf('<option value="%s"%s>%s </option>', $res['id_bureau'], in_array($res['id_bureau'], $value) ? ' selected' : '', $res['nom_agence']) ;
}
return $ret."</select>" ;
}
$where2='';
if($_GET['id'] && !empty($_GET['id']) )
{
if($_GET['id']>0)
{
$id=$_GET['id'];
$tabbursel=dbi_fetch_row((dbi_query('select * from bureau where id_bureau='.$_GET['id'].' 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['id']=="INDEFINI")
{
$id_bureau=$_GET['id'];
$where2=" AND client_bureau='0' ";
$selected='selected="selected"';
}
}
$CA=0;
?>
<script language="Javascript">
function GetIdBureau()
{
var id="";
id = document.bureau_form.client_bureau.value ;
if( id > 0 || id=="INDEFINI" )
window.location = "solde.php?id="+id;
else
window.location = "solde.php";
}
</script>
<style type="text/css">
div#hdp {
border:1;
position:absolute;
top:0;
left:25px;
}
</style>
<br/>
<br/>
<br/>
<h2> Encours en Retard -20 </h2>
<div class="box">
<div class="box-body">
<form action="" method="POST">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<TH align="center" >Client</TH>
<TH align="center" >Créer </TH>
<TH align="center" >Encours</TH>
<TH align="center" >Suivi </TH>
<TH align="center" >Action de suivi </TH>
<TH align="center" >Salarié administratif </TH>
<TH align="center" >Voir Suivi </TH>
<TH align="center" >relance 1 </TH>
<TH align="center" >relance 2 </TH>
</tr><tbody>
<?php
$Client=array();
$order=' ASC ';
$query = dbi_query("SELECT f.client_id, client_pnom, client_nom, reglement_delai , f.num_fact, c.client_reglement,
f.fact_id, total,total-sum(if(p.montant is null, 0, p.montant))-sum(if(a.montant is null, 0, a.montant)) AS paye,
if(a.montant is null, 0, a.montant) avoir,
f.date_fact, f.relance, IF(client_genre='SERENA',1,0) as serena
FROM ".TABLE_FACT." f
LEFT JOIN ".TABLE_PAIEMENT." p ON f.fact_id=p.fact_id AND f.client_id=p.client_id
LEFT JOIN ".TABLE_AVOIR." a ON f.fact_id = a.fact_id
LEFT JOIN ".TABLE_CLIENT." c ON c.client_id = f.client_id
WHERE f.agence_id=$agence $where2
GROUP BY date_fact, f.fact_id, total
HAVING paye > 0.001
ORDER BY client_nom $order , client_pnom $order , f.date_fact ASC ") ;
// $today = date('Ymd', strtotime('-20 day'));
$today = date('Ymd');
$todayform = date('Y-m-d');
// echo
// echo "$today <br/>" ;
// exit() ;
while($f = dbi_fetch_row($query))
{
// echo "<pre>" ;
// print_r($f) ;
// echo "</pre>" ;
// 'Y-m-d'
// echo "==oooooooo>".int2date($f['date_fact'],'Y-m-d')."<br/>" ;
// $a = int2date($f['date_fact'],'Y-m-d') ;
// $tabloTest = explode('-', $a);
// $dateTest = $tabloTest[0].''.$tabloTest[1].''.$tabloTest[2];
// $b = strtotime(date("Y-m-d", strtotime($a)) . " +5 day");
// echo "=kk=>".$b."<br/>" ; .
$a = int2date($f['date_fact'],'Y-m-d') ;
$date_fact_plus_reglement_delai = date("Y-m-d", strtotime("$a +".$f['reglement_delai']." days"));
// echo "==>".$date_fact_plus_reglement_delai."<br/>" ;
// echo "==>".$todayform."<br/>" ;
$date1 = new DateTime($date_fact_plus_reglement_delai);
$date2 = new DateTime($todayform);
$diff = $date2->diff($date1)->format("%a");
// echo $diff."<br/>";
// exit() ;
$tabloTest = explode('-', $date_fact_plus_reglement_delai);
$date_fact_plus_reglement_delai = $tabloTest[0].''.$tabloTest[1].''.$tabloTest[2];
// echo "===>>> ".$date_fact_plus_reglement_delai."<br/>" ;
// $date_fact_plus_reglement_delai = $f['date_fact'] + $f['reglement_delai'] ;
// echo "===> $today <br/>" ;
// echo "==> ".$date_fact_plus_reglement_delai."<br/>" ;
if($date_fact_plus_reglement_delai <= $today )
{
$Client[$f['client_id']][]=$f;
}
}
// echo "<pre>" ;
// print_r($Client) ;
// echo "</pre>" ;
// exit() ;
?>
<?
$R=dbi_query("SELECT reglement_delai regday ,client_id id, concat(client_nom, ' ', client_pnom) civ, client_prospect, IF(client_genre='SERENA',1,0) as serena, IF(client_genre='FORMATION',1,0) as formation FROM ".TABLE_CLIENT." where agence_id=$agence ".( $_SESSION['client_actif']=='off' ? "" : "")." AND client_prospect ='0' $where2 ORDER BY civ");
while($cl = dbi_fetch_row($R))
{
$client_id=$cl['id'];
$a=$client_id ;
$nb=count($Client[$client_id]);
$soldaa = 0 ;
// $sommeavoir = 0 ;
for($i=0 ; $i<$nb ;$i++ )
{
// echo "=$i==>".$Client[$client_id][$i]['total']."<br/>" ;
// if(!empty($Client[$client_id][$i]['fact_id']))
// {
// list($avoir) = dbi_fetch_row(dbi_query("select montant from avoir where fact_id = ".$Client[$client_id][$i]['fact_id'])) ;
// }
// $sommeavoir = $sommeavoir + $avoir ;
$soldaa=$Client[$client_id][$i]['paye'] + $soldaa ;
// $avoir = 0 ;
}
// list($solde) = $Client[$client_id][] ;
// $soldaa = $soldaa - $sommeavoir ;
if($soldaa != 0)
{
$suiva = dbi_query("SELECT * FROM `client_suivi` WHERE client_id = $a and client_suivi_clos = '0' ") ;
$recouvrement = "" ;
$litige = "" ;
$Compta = "" ;
while($ss = dbi_fetch_row($suiva))
{
if($ss['suivi_id']== 10)
{
$recouvrement = "<i class='fa fa-fw fa-check' ></i>" ;
}
if($ss['suivi_id']== 21)
{
$litige = "<i class='fa fa-fw fa-check' ></i>" ;
}
if($ss['suivi_id']== 25)
{
$Compta = "<i class='fa fa-fw fa-check' ></i>" ;
}
}
$suiv = dbi_query("SELECT * FROM `client_suivi`,`suivi` , suivi_biais WHERE client_id = $a and client_suivi.suivi_id = `suivi`.suivi_id and suivi_parent_id != 0 and client_suivi.client_suivi_clos = '0' and ( suivi.suivi_id = 21 or suivi.suivi_id = 25 or suivi.suivi_id = 10 ) ORDER BY suivi_date DESC") ;
list($suivdate) = dbi_fetch_row (dbi_query("SELECT UNIX_TIMESTAMP(suivi_date) FROM `client_suivi`,`suivi` , suivi_biais WHERE client_id = $a and client_suivi.suivi_id = `suivi`.suivi_id and suivi_parent_id != 0 and client_suivi.client_suivi_clos = '0' and ( suivi.suivi_id = 21 or suivi.suivi_id = 25 or suivi.suivi_id = 10 ) ORDER BY suivi_date DESC")) ;
$suivRoucv = dbi_query("SELECT * FROM `client_suivi`,`suivi` , suivi_biais WHERE client_id = $a and client_suivi.suivi_id = `suivi`.suivi_id and client_suivi.client_suivi_clos = '0' and suivi.suivi_id = 10 ORDER BY suivi_date DESC") ;
$suivlitge = dbi_query("SELECT * FROM `client_suivi`,`suivi` , suivi_biais WHERE client_id = $a and client_suivi.suivi_id = `suivi`.suivi_id and client_suivi.client_suivi_clos = '0' and ( suivi.suivi_id = 21 or suivi.suivi_id = 25 or suivi.suivi_id = 10 ) ORDER BY suivi_date DESC") ;
$suivcompta = dbi_query("SELECT * FROM `client_suivi`,`suivi` , suivi_biais WHERE client_id = $a and client_suivi.suivi_id = `suivi`.suivi_id and client_suivi.client_suivi_clos = '0' and ( suivi.suivi_id = 21 or suivi.suivi_id = 25 or suivi.suivi_id = 10 ) ORDER BY suivi_date DESC") ;
$sRoucv = dbi_fetch_row($suivRoucv) ;
$slitige = dbi_fetch_row($suivlitge) ;
$scompta = dbi_fetch_row($suivcompta) ;
if($sRoucv['suivi_parent_id']== 0)
{
$rec= $sRoucv['client_suivi_id'] ;
// echo "yasss $rec <br/>" ;
}
else
{
$rec= $sRoucv['suivi_parent_id'] ;
// echo "aa $rec <br/>" ;
}
if($slitige['suivi_parent_id']== 0)
{
$litg= $slitige['client_suivi_id'] ;
}
else
{
$litg= $slitige['suivi_parent_id'] ;
}
if($scompta['suivi_parent_id']== 0)
{
$comp= $scompta['client_suivi_id'] ;
}
else
{
$comp= $scompta['suivi_parent_id'] ;
}
$s = dbi_fetch_row($suiv) ;
if(!empty($s['Admin_ID']))
{
}
// echo "<pre>" ;
// print_r($s) ;
// echo "</pre>" ;
// if( )
// {
// }
if(!empty($s['client_suivi_id']))
{
$suiva = dbi_query("SELECT suivi_biais_id FROM `client_suivi` WHERE client_id = $a and client_suivi_id = ".$s['client_suivi_id']) ;
}
$ssv = dbi_fetch_row($suiva) ;
if(!empty($ssv['suivi_biais_id']))
{
$suiva2 = dbi_query(" SELECT * FROM `suivi_biais` WHERE suivi_biais_id = ".$ssv['suivi_biais_id']) ;
}
$ssv_bia = dbi_fetch_row($suiva2) ;
$action = '';
if($s['suivi_programme']=='1')
{
// if ($ssv['suivi_biais_id']=='4' or $ssv['suivi_biais_id']=='41' ) original
if ($ssv['suivi_biais_id']=='4')
$action = ' '.$ssv_bia['suivi_biais_intitule'].' effectué';
else if ($s['suivi_programme']=='1')
$action = ' Prévoir un '.strtolower($ssv_bia['suivi_biais_intitule']);
else $action = $s['suivi_biais_intitule'].' effectué';
if ($ssv['suivi_biais_id']=='6')
$action = ' Prévoir une '.strtolower($ssv_bia['suivi_biais_intitule']);
$total+= $l['montant_devis'];
// $action = $ssv_bia['suivi_biais_intitule'] ;
if($s['suivi_date'])
$action = mysql_datefrrr($s['suivi_date'],'-','Djma').' <b>'.$action;
else
$action = "";
}
else
{
$action = '';
}
if($action != "")
{
list($n , $p) = dbi_fetch_row(dbi_query(" SELECT Admin_nom,Admin_pnom FROM `administratif` where Admin_ID = ".$s['Admin_ID'] )) ;
$salarier_admin = $n." ".$p ;
}
else
{
$salarier_admin = "" ;
}
$get = 'client_id='.$a;
if($nb==1) //afficher sauf les clients qui ont le nombre de pieces egale 1
{
// echo "===================================>".$Client[$client_id][0]['date_fact']."<br/>" ;
$date_fact_plus_reglement_delai = date("Y-m-d", strtotime($Client[$client_id][0]['date_fact']."+".$cl['regday']." days"));
// echo "EEEEEEEEEEEEE==>".$date_fact_plus_reglement_delai."<br/>" ;
// echo "333333333333==>".$todayform."<br/>" ;
$date1 = new DateTime($date_fact_plus_reglement_delai);
$date2 = new DateTime($todayform);
$diff = $date2->diff($date1)->format("%a");
// echo 'sddddddddddddddddd'.$diff."<br/>";
//----------------------------------------------------------------------------------
$query = dbi_query("SELECT f.client_id, client_pnom, client_nom, reglement_delai , f.num_fact, c.client_reglement,
f.fact_id, total,total-sum(if(p.montant is null, 0, p.montant))-sum(if(a.montant is null, 0, a.montant)) AS paye,
if(a.montant is null, 0, a.montant) avoir,
f.date_fact, f.relance, IF(client_genre='SERENA',1,0) as serena
FROM ".TABLE_FACT." f
LEFT JOIN ".TABLE_PAIEMENT." p ON f.fact_id=p.fact_id AND f.client_id=p.client_id
LEFT JOIN ".TABLE_AVOIR." a ON f.fact_id = a.fact_id
LEFT JOIN ".TABLE_CLIENT." c ON c.client_id = f.client_id
WHERE f.agence_id=$agence $where2 and f.client_id = $client_id
GROUP BY date_fact, f.fact_id, total
HAVING paye > 0.001 ") ;
$tabnumfact = array();
while($acd = dbi_fetch_row($query))
{
$tabnumfact[] =$acd['num_fact'] ;
}
$ab =count($tabnumfact); ;
// afficher juste les clients qui ont un seul facture
//----------------------------------------------------------------------------------------------
// echo " $client_id bbbbbbbbbbbbbbbbbb kkkkkkkkkk ===> $ab <br/>" ;
if($diff<=20 && $nb == 1)
{
$depasse = mktime(0,0,0,date("m"), date("d")+1, date("Y"));
$de= mktime($s['suivi_date'] );
if( $suivdate< $depasse )
{
$color= "rouge" ;
}
else
{
$color= "normale" ;
}
// echo $de."===>".$color."==".$depasse."<br/>" ;
$CA+=$soldaa;
if(!empty($solde))
$solde=number_format($solde, 2, ', ', '');
echo '<tr>';
echo "<td >".$cl['civ']."</td>";
?>
<td align='center' > <input type="checkbox" name="check_client[]" value="<?=$client_id?>"> </td>
<?
echo "<td align='center' >$soldaa</td>";
$var_nn=$ya["date_fact"];
$var_yes =$yb["max_fact"] ;
//if($dateF > $dateP)
?>
<td align='center' > <?=$recouvrement ?> </td>
<?
// $color= "rouge" ;
// echo "==aaaaa=>".$color."<br/>" ;
if($color== "rouge")
{
// echo "tttttttttttt" ;
echo "<td align='center' style='color:red' > $action</td>";
}
else
{
echo "<td align='center' > $action</td>";
}
echo "<td align='center' >$salarier_admin</td>";
?>
<td align='center'>
<A onclick="window.open('suivi_concern.php?client_id=<?=$a?>&link=client&page=suivi_gestion&suivi=historique&suiviiid=<?=$rec?>','nom_de_ma_popup','menubar=no, scrollbars=no, top=300, left=600, width=900, height=700');" target="edit" ><i class="fa fa-fw fa-plus-square"></i> </a>
</td>
<td align='center'>
<A onclick="window.open('relancesuiv_moin_20.php?client_id=<?=$a?>&link=client&page=suivi_gestion&suivi=historique&suiviiid=<?=$rec?>','nom_de_ma_popup','menubar=no, scrollbars=no, top=300, left=600, width=900, height=700');" target="edit" ><i class="fa fa-fw fa-envelope"></i> </a>
</td>
<td align='center'>
<A onclick="window.open('relancesuiv_moin_20.php?client_id=<?=$a?>&link=client&page=suivi_gestion&suivi=historique&suiviiid=<?=$rec?>','nom_de_ma_popup','menubar=no, scrollbars=no, top=300, left=600, width=900, height=700');" target="edit" ><i class="fa fa-fw fa-envelope"></i> </a>
</td>
<?
echo '</tr>';
}
}
}
}
?>
</table>
<input type="submit">
</form>
</div>
<table style="position:absolute; top:10px; right:872px;" >
<tr>
<td class="tdl" style="width:50%;" > <b> <?=number_format($CA, 2, ",", " ")?> <b/> €<br/><br/></td>
</tr>
<tr>
</table>
<!-- /.col -->
<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>
