|
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/mcg/pages/feuillesroute/../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
include 'includes/config_tmcpro.php' ;
include 'includes/stable_functions_tmcpro.php' ;
$where1="";
$where2="";
$selected="";
if($_GET['id'] && !empty($_GET['id']) )
{
if($_GET['id']>0)
{
$id=$_GET['id'];
$tabbursel=dbi_fetch_row((dbi_query('SELECT * FROM etablissement where etablissement_id='.$_GET['id']))) ;
$etablissement_id=$tabbursel['etablissement_id'];
$etablissement_nom=$tabbursel['etablissement_nom'];
$where1=" where etablissement_id != $etablissement_id ";
$where2=" AND etablissement_id = $etablissement_id ";
}
elseif($_GET['id']=="INDEFINI")
{
$where2=" ";
$etablissement_id=$_GET['id'];
$selected='selected="selected"';
}
}
$debut_de_ce_mois = sprintf("%04d%02d%02d", date('Y'), date('m'), 1);
$fin_de_ce_mois = sprintf("%04d%02d%02d", date('Y'), date('m'), date('t'));
// $salarie_contrat_date_debut= dateMCPROint($_POST['debu']) ;
// $salarie_contrat_date_debut= dateMCPROint($_POST['debu']) ;
if(!empty($_POST))
{
$from = dateMCPROint($_POST['debut']) ;
$to = dateMCPROint($_POST['fin']) ;
}
else
{
$from = $debut_de_ce_mois ;
$to = $fin_de_ce_mois ;
}
$debP = $datedebut = $from;
$finP = $datefin = $to;
$TotN = 0 ;
$TotS = 0 ;
// echo "==> $from ==> $to <br/>" ;
// $chant=dbi_query("SELECT * FROM chantier c, fact_chantier fc,client cl WHERE c.agence_id=".$agence." AND cl.client_id=c.client_id AND c.Chantier_ID=fc.Chantier_ID AND Chantier_recur='0' AND Chantier_fin between $from and $to $where2 ORDER BY client_nom ");
?>
<!DOCTYPE html>
<html>
<head>
<?php include('header.php'); ?>
</head>
<body class="hold-transition sidebar-mini">
<!-- Site wrapper -->
<div class="wrapper">
<!-- TOP MENU -->
<nav class="main-header navbar navbar-expand navbar-white navbar-light">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#"><i class="fas fa-bars"></i></a>
</li>
</ul>
</nav>
<!-- BARRE DE NAVIGATION -->
<?php include('menu.php'); ?>
<!-- DEMARRAGE DE LA PAGE PRINCIPALE -->
<div class="content-wrapper">
<!-- PAGE PRINCIPALE -->
<section class="content">
<div class="row">
<div class="col-12">
<div class="card card-primary card-outline">
<div class="card-header">
<div class="row">
<div class="col-sm-11">
<h3 class="card-title"> <i class="nav-icon fas fa-id-card"></i> Chantier </h3>
</div>
</div>
</div>
<div class="card-body">
<table style="position:absolute; top:50px; right:24px;">
<form id="bureau_form" name="bureau_form" method="POST" action="chs.php">
<tr>
<td align="left" valign="top" class="td_listing0">
<select class="form-control" id="client_bureau" name="client_bureau" onchange="GetIdBureau()";>
<option selected="selected" value=""> Tous les Etablissements </option>
<?php if(isset($etablissement_id) && isset($etablissement_nom)) { ?>
<option selected="selected" value="<?=$etablissement_id ?>"><?=$etablissement_nom?></option>
<?php } ?>
<?php
$etab=dbi_query("SELECT * FROM `etablissement` $where1") or die(mysql_error());
while($et=dbi_fetch_row($etab)){ ?>
<option value="<?php echo $et['etablissement_id']?>"><?php echo $et['etablissement_nom'] ?></option>
<?php } ?>
<option <?=$selected ?> value="INDEFINI">INDEFINI</option>
</select>
</td>
</tr>
</form>
</table>
<br/>
<div class="onglet_dotted">
<div style="width:100%; float:left; vertical-align:top" class="header_ray">
<br/><br/>
<?php
// $chant=dbi_query("SELECT * FROM chantier c,client cl WHERE cl.client_id=c.client_id AND Chantier_recur='0' AND Chantier_debut between $from and $to $where2 ORDER BY client_nom ");
$chant=dbi_query("SELECT * FROM chantier c,client cl WHERE cl.client_id=c.client_id AND (Chantier_fin=0 OR Chantier_fin IS NULL) $where2 ");
$chsom=dbi_query("SELECT * FROM chantier c,client cl WHERE cl.client_id=c.client_id AND (Chantier_fin=0 OR Chantier_fin IS NULL) $where2 ");;
while($s=dbi_fetch_row($chsom)){
$somme+=$s['chantier_forfaitmensuel'];
}
$ca = "<h1>CA : ".number_format($somme, 2, ",", " ")." € <span style=\"font-size:10px; font-weight:normal;\">( chantiers réguliers )</span></h1>";
echo $ca;
?>
<div id="tab">
<div class="box-body">
<table id="example1" class="table table-bordered table-striped">
<thead>
<TR>
<th align="center">Nom du client</th>
<th align="center">Etablissement</th>
<th align="center">FORFAIT HT</th>
<th align="center">DESIGNATION</th>
<th align="center">TVA</th>
</TR>
</thead>
<tbody>
<?php while($c=dbi_fetch_row($chant)){
$tauxtva=$c['chantier_forfaitmensuel']*($c['Chantier_TVA']/100);
list($etablissement_nom) =dbi_fetch_row(dbi_query('select etablissement_nom from etablissement where etablissement_id ='.$c['etablissement_id'])) ;
?>
<TR>
<?php if($client_id!=$c['client_id']) { ?>
<TD><?=strtoupper($c['client_nom']).' '.ucwords(strtolower($c['client_pnom']))?></TD>
<?php } else { ?>
<TD></TD>
<?php }
$TotS+=$c['chantier_forfaitmensuel'];
?>
<TD align="center"><?=$etablissement_nom ?></TD>
<TD align="center"><?=number_format($c['chantier_forfaitmensuel'], 2, ",", " ").' €'; ?></TD>
<TD><?=stripslashes($c['chantier_designation']); ?></TD>
<TD><?=number_format($c['Chantier_TVA'], 2, ",", " ") ;?></TD>
</TR>
<?php
// echo $client_id.' ! '.$c['client_id'].' == ';
} ?>
</tbody>
</table><!-- /.table -->
</div><!-- /.box-body -->
</div><!-- /.tab -->
<?php
$debut_de_ce_mois = sprintf("%04d%02d%02d", date('Y'), date('m'), 1);
// $chant=dbi_query("SELECT * FROM chantier c, fact_chantier fc,client cl WHERE c.agence_id=".$agence." AND cl.client_id=c.client_id AND Chantier_fin >= $debut_de_ce_mois AND c.Chantier_ID=fc.Chantier_ID $where2 $where3 $ordre ,client_nom ");
// $chsom=dbi_query("SELECT * FROM chantier c, fact_chantier fc,client cl WHERE c.agence_id=".$agence." AND cl.client_id=c.client_id AND Chantier_fin >= $debut_de_ce_mois AND c.Chantier_ID=fc.Chantier_ID $where2 $where3 $ordre ,client_nom ");;
$somme = 0 ;
$chant=dbi_query("SELECT * FROM chantier c,client cl WHERE cl.client_id=c.client_id AND Chantier_fin >= $debut_de_ce_mois $where2 ");
$chsom=dbi_query("SELECT * FROM chantier c,client cl WHERE cl.client_id=c.client_id AND Chantier_fin >= $debut_de_ce_mois $where2 ");;
while($s=dbi_fetch_row($chsom)){
$somme+=$s['chantier_forfaitmensuel'];
}
$ca = "<h1>CA : ".number_format($somme, 2, ",", " ")." € <span style=\"font-size:10px; font-weight:normal;\">( chantiers ponctuels )</span></h1>";
echo $ca;
?>
<div id="tab">
<div class="box-body">
<table id="example1" class="table table-bordered table-striped">
<thead>
<TR>
<th align="center">Nom du client</th>
<th align="center">Etablissement</th>
<th align="center">FORFAIT HT</th>
<th align="center">DESIGNATION</th>
<th align="center">TVA</th>
</TR>
</thead>
<tbody>
<?php while($c=dbi_fetch_row($chant)){
$tauxtva=$c['chantier_forfaitmensuel']*($c['Chantier_TVA']/100);
list($etablissement_nom) =dbi_fetch_row(dbi_query('select etablissement_nom from etablissement where etablissement_id ='.$c['etablissement_id'])) ;
?>
<TR>
<?php if($client_id!=$c['client_id']) { ?>
<TD><?=strtoupper($c['client_nom']).' '.ucwords(strtolower($c['client_pnom']))?></TD>
<?php } else { ?>
<TD></TD>
<?php }
$TotS+=$c['chantier_forfaitmensuel'];
?>
<TD align="center"><?=$etablissement_nom ?></TD>
<TD align="center"><?=number_format($c['chantier_forfaitmensuel'], 2, ",", " ").' €'; ?></TD>
<TD><?=stripslashes($c['chantier_designation']); ?></TD>
<TD><?=number_format($c['Chantier_TVA'], 2, ",", " ") ;?></TD>
</TR>
<?php
// echo $client_id.' ! '.$c['client_id'].' == ';
} ?>
</tbody>
</table><!-- /.table -->
</div><!-- /.box-body -->
</div><!-- /.tab -->
</div><!-- /.header_ray -->
</div><!-- /.onglet_dotted -->
</div><!-- /.card-body -->
</div><!-- /.card card-primary card-outline -->
</div> <!-- /.col-12 -->
</div> <!-- /.row -->
</section> <!-- /.section -->
</div>
<?php include('footerr.php'); ?>
<script language="Javascript">
function GetIdBureau()
{
var id="";
id = document.bureau_form.client_bureau.value ;
if( id > 0 || id=="INDEFINI" )
window.location = "chs.php?id="+id;
else
window.location = "chs.php";
}
</script>
</body>
</html>
