|
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 (0705) : /home/logmcpe/www/TEST/www/../../MCPRO/plugins/../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
include_once 'code/init.php';
print_header ( array(), '', $BodyX.'style="margin:5px 10px 5px 10px; padding:5px 10px 5px 10px; border:solid 1px #778;"' );
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>" ;
}
$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"';
}
}
?>
<script language="Javascript">
function GetIdBureau()
{
var idbursel="";
idbureausel = document.bureau_form.client_bureau.value ;
if( idbureausel > 0 || idbureausel=="INDEFINI" )
window.location = "ch.php?idbureausel="+idbureausel;
else
window.location = "ch.php";
}
</script>
<div class="onglet_dotted">
<table style="position:absolute; top:35px; right:20px;">
<form id="bureau_form" name="bureau_form" method="POST" action="a.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>
<?php
$ordre='ASC';
$client_id='';
if(isset($_GET['ordre']))
{
if($_GET['ordre']=='ASC') $ordre='DESC';
elseif($_GET['ordre']=='DESC') $ordre='ASC';
}
$somme=0;
$chant=dbi_query("SELECT * FROM chantier c, fact_chantier fc,client cl ,bureau b WHERE c.agence_id=".$agence." AND cl.client_id=c.Client_ID AND c.Chantier_ID=fc.Chantier_ID AND cl.client_bureau=b.id_bureau $where2 ORDER BY nom_agence $ordre ,client_nom ");
$chsom=dbi_query("SELECT * FROM chantier c, fact_chantier fc,client cl ,bureau b WHERE c.agence_id=".$agence." AND cl.client_id=c.Client_ID AND c.Chantier_ID=fc.Chantier_ID AND cl.client_bureau=b.id_bureau $where2 ORDER BY nom_agence $ordre ,client_nom ");;
while($s=dbi_fetch_row($chsom)){
$somme+=$s['Chantier_forfaitmensuel'];
}
$ca = "<h1>Somme HT : ".number_format($somme, 2, ",", " ")." € <span style=\"font-size:10px; font-weight:normal;\"></span></h1>";
echo $ca;
?>
<TABLE id="ver-minimalist">
<thead>
<TR>
<th>Nom</th>
<th ><A href="ch.php?tri=nom&ordre=<?=$ordre?>">Bureau</A><SPAN class="sort">↑</SPAN></th>
<th>Forfait mensuel HT</th>
<th>Designation</th>
</TR>
</thead>
<tbody>
<?php while($c=dbi_fetch_row($chant)){
// $chantierht=$listchantier['Chantier_forfaitmensuel'] /(1+($listchantier['Chantier_TVA']/100));
// $tauxtva=$listchantier['Chantier_forfaitmensuel']-$chantierht;
$tauxtva=$c['Chantier_forfaitmensuel']*($c['Chantier_TVA']/100);
// print_r($listchantier);
?>
<TR>
<?php /*if($client_id!=$c['client_id']) { ?>
<TD><?=strtoupper($c['client_nom']).' '.ucwords(strtolower($c['client_pnom']))?></TD>
<?php } else { ?>
<TD></TD>
<?php } */?>
<TD><?=strtoupper($c['client_nom']).' '.ucwords(strtolower($c['client_pnom']))?></TD>
<TD><?=$c['nom_agence']; ?></TD>
<TD><?=$c['Chantier_forfaitmensuel']; ?></TD>
<TD><?=$c['Chantier_designation']; ?></TD>
</TR>
<?php
$client_id=$c['client_id'];
// echo $client_id.' ! '.$c['client_id'].' == ';
} ?>
</tbody>
</TABLE>
</div>
</body></html>