|
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_tmcpro2.php' ;
include 'includes/stable_functions_tmcpro.php' ;
$annee = $year = date('Y');
$mois = $month = date('m');
$months = array(
1 => 'Janvier',
2 => 'Février',
3 => 'Mars',
4 => 'Avril',
5 => 'Mai',
6 => 'Juin',
7 => 'Juillet',
8 => 'Août',
9=> 'Septembre',
10=> 'Octobre',
11 => 'Novembre',
12 => 'Décembre'
);
if(!empty($_POST))
{
list($factures_ttc)=dbi_fetch_row(dbi_query("SELECT SUM(total) AS total FROM ".TABLE_FACT." WHERE date_debut>='".$_POST['annee'].''.$_POST['mois'].'01'."' AND date_fin<=".date('Ymt', strtotime($_POST['annee'].'-'.$_POST['mois'].'-01'))));
list($montant_avoir ,$nbh_avoir)=dbi_fetch_row(dbi_query("SELECT SUM(montant) AS montant , SUM(nbheure) AS nbh_avoir FROM ".TABLE_FACT." f , avoir a WHERE f.fact_id = a.fact_id and date_debut>='".$_POST['annee'].''.$_POST['mois'].'01'."' AND date_fin<=".date('Ymt', strtotime($_POST['annee'].'-'.$_POST['mois'].'-01'))));
$tabtva=dbi_fetch_row(dbi_query("SELECT * FROM TVA WHERE TVA_datedebut<= '".$_POST['annee'].''.$_POST['mois'].'01'."' and ( TVA_datefin>= '".$_POST['annee'].''.$_POST['mois'].'01'."' OR TVA_datefin IS NULL OR TVA_datefin=0 ) ORDER BY TVA_ID DESC "));
if($tabtva['TVA_Taux'] )
$tauxtva=($tabtva['TVA_Taux']/100)+1 ;
$tot_nbh = 0 ;
$reqh=dbi_query("SELECT client_id, data FROM ".TABLE_FACT." WHERE date_debut>='".$_POST['annee'].''.$_POST['mois'].'01'."' AND date_fin<=".date('Ymt', strtotime($_POST['annee'].'-'.$_POST['mois'].'-01')));
while( $datafact=dbi_fetch_row($reqh) ) {
if (!in_array($datafact['client_id'],$clients)) $clients[]=$datafact['client_id'];
list($data) = unserialize($datafact['data']);
foreach($data as $d)
$tot_nbh += $d['nbH'];
}
// echo " $factures_ttc <br/>" ;
// echo " $montant_avoir <br/>" ;
// echo "===>".$_POST['debutyear']."---".$_POST['debutmonth']."-----".$_POST['debutday']."<br/>" ;
// echo "===>".$_POST['finyear']."---".$_POST['finmonth']."-----".$_POST['finday']."<br/>" ;
}
$_POST['tab'] = 1 ;
// $_POST['debutmonth'] = 03 ;
// $_POST['debutyear'] = 2024 ;
// $_POST['finmonth'] = 03 ;
// $_POST['finyear'] = 2024 ;
// $_POST['debutday'] = 01 ;
// $_POST['finday'] = 30 ;
// echo "===>".$_POST['debutyear']."---".$_POST['debutmonth']."-----".$_POST['debutday']."<br/>" ;
// echo "===>".$_POST['finyear']."---".$_POST['finmonth']."-----".$_POST['finday']."<br/>" ;
// $_POST['tab'] = 1 ;
// print_r($_POST) ;
include_once 'function-news.php';
global $graphx, $x;
global $absix;
?>
<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>
<li>
<?php
// echo '<a href="#myModal2" id="custId" data-toggle="modal" data-id="'.$c['Fournisseur_ID'].'"><h3><button type="button" class="btn btn-primary" ><i class="fas fa-plus"></i> Ajouter Fichier</button></h3></a>';
?>
</li>
</ul>
</nav>
<!-- BARRE DE NAVIGATION -->
<?php include('menu.php'); ?>
<!-- DEMARRAGE DE LA PAGE PRINCIPALE -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<!-- PAGE PRINCIPALE -->
<section class="content">
<?php
if(isset($_GET["msg"])){
?>
<div class="alert alert-<?php echo $_GET["color"]; ?> alert-dismissible col-12" role="alert">
<strong><?php echo $_GET["color"].': '; ?></strong><?php echo $_GET["msg"]; ?>.
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
?>
<div class="row">
<div class="col-12">
<div class="card card-info">
<div class="card-header">
<div class="row">
<div class="col-sm-11"><h3 class="card-title"> <i class="nav-icon fas fa-registered"></i> Statistique / CA</h3> </div>
<div class="col-sm-1"></div>
</div>
</div>
<!-- /.card-header -->
<div class="card-body">
<div class="onglet_dotted">
<div style="width:100%; float:left; vertical-align:top" class="header_ray">
<form role="form" method='POST' action=''>
<!-- /.card-header -->
<div class="card-body" >
<div class="row">
<div class="col-sm-3">
<div class="form-group">
<label>Année</label>
<select name='annee' id='annee' class="form-control">
<?php
$earliest_year = 2018;
foreach (range($year+3, $earliest_year) as $x) {
print '<option value="'.$x.'"'.($x == $annee ? ' selected="selected"' : '').'>'.$x.'</option>';
}
?>
</select>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<label>Mois</label>
<select name='mois' id='mois' class="form-control">
<?php
foreach ($months as $key => $value) {
$key = sprintf("%02d",$key );
print '<option value="'.$key.'"'.($key == $mois ? ' selected="selected"' : '').'>'.$value.'</option>';
}
?>
</select>
</div>
</div>
<!--
<div class="col-sm-3">
<div class="form-group">
<label>Du :</label>
<input type="date" class="form-control" data-inputmask-alias="datetime" data-inputmask-inputformat="dd/mm/yyyy" data-mask name="from" placeholder="jj/mm/aaaa" >
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<label>Au : </label>
<input type="date" class="form-control" data-inputmask-alias="datetime" data-inputmask-inputformat="dd/mm/yyyy" data-mask name="to" placeholder="jj/mm/aaaa" >
</div>
</div>
-->
<div class="col-sm-3">
<div class="form-group"><label><br/></label>
<button type="submit" class="btn btn-block bg-gradient-primary">Valider</button>
</div>
</div>
</div>
</div>
</form>
<?
// print_r($clients) ;
$bbb1 = 0 ;
$r1 = dbi_query("SELECT client_id FROM `client` WHERE etablissement_id = 1 ") ;
while($b1=dbi_fetch_row($r1))
{
$bureau1[]=$b1['client_id'] ;
}
$nbr1 = count($bureau1) ;
for($i=0 ;$i<$nbr1 ; $i++ )
{
if (in_array($bureau1[$i], $clients)) {
$bbb1++ ;
}
}
// $bbb1=$bbb1 +1 ;
echo "Nombre de clients bureau BOULOGNE BILLANCOURT : <strong> $bbb1 </strong> <br/>" ;
$bbb2 = 0 ;
// $r1 = dbi_query("SELECT client_id FROM `client` WHERE etablissement_id = 2 ") ;
$r2 = dbi_query("SELECT client_id FROM `client` WHERE etablissement_id = 2 ") ;
while($b2=dbi_fetch_row($r2))
{
$bureau5[]=$b2['client_id'] ;
}
$nbr1 = count($bureau5) ;
for($i=0 ;$i<$nbr1 ; $i++ )
{
if (in_array($bureau5[$i], $clients)) {
$bbb2++ ;
}
}
echo "Nombre de clients bureau Marseille : <strong> $bbb2 </strong> <br/>" ;
$bbb3 = 0 ;
// $r1 = dbi_query("SELECT client_id FROM `client` WHERE `client_bureau` = 1 ") ;
$r3 = dbi_query("SELECT client_id FROM `client` WHERE etablissement_id = 3 ") ;
while($b3=dbi_fetch_row($r3))
{
// echo "--->".$b1['client_id']."<br/>" ;
$bureau6[]=$b3['client_id'] ;
}
$nbr1 = count($bureau6) ;
for($i=0 ;$i<$nbr1 ; $i++ )
{
if (in_array($bureau6[$i], $clients)) {
$bbb3++ ;
}
}
echo "Nombre de clients bureau Six Fours les Plages: <strong>$bbb3</strong> <br/>" ;
$CA = $factures_ttc - $montant_avoir ;
$CA_HT=$CA/$tauxtva;
$montant_avoir_affich = $montant_avoir." €" ;
if($montant_avoir == ""){
$montant_avoir_affich = "--" ;
}
?>
<table id="example1" class="table table-hover">
<tr>
<th>Description</th>
<th>Montant</th>
</tr>
<tr>
<td>Factures TTC :</td>
<td><?php echo $factures_ttc; ?> €</td>
</tr>
<tr>
<td>Avoirs TTC :</td>
<td><?php echo $montant_avoir_affich; ?> €</td>
</tr>
<tr>
<td>CA TTC :</td>
<td><?php echo $CA; ?> €</td>
</tr>
<tr>
<td>CA HT :</td>
<td><?php echo $CA_HT; ?> €</td>
</tr>
<tr>
<td>Nombre d'Heures :</td>
<td><?php echo $tot_nbh - $nbh_avoir; ?></td>
</tr>
<tr>
<td> Nombre de clients : </td>
<td><?php echo count($clients);; ?></td>
</tr>
</table>
<?
// echo "Factures TTC : <strong> ".$factures_ttc." € </strong><br/>" ;
// echo "Avoirs TTC : <strong>".$montant_avoir." € </strong> <br/>" ;
// $CA = $factures_ttc + $montant_avoir ;
// echo "CA TTC : <strong> ".$CA." € </strong> <br/>" ;
// $CA_HT=$CA/$tauxtva;
// echo "CA HT : <strong> ".$CA_HT." € </strong><br/>" ;
// echo "Nombre d'Heures : <strong> ".$tot_nbh." </strong> <br/>" ;
?>
</table>
</div></div>
</div></div>
</div>
</section>
</div></div>
<!-- page script -->
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
<!-- /.content -->
</div>
<footer class="main-footer">
<div class="float-right d-none d-sm-block">
<b>Version</b> 3.0.1
</div>
<strong>Copyright © 2019 MCPRO</strong>
</footer>
<!-- FIN DU PIED DE PAGE -->
<!-- NE PAS TOUCHER CI-DESSOUS -->
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here -->
</aside>
<!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->
<!-- jQuery -->
<script src="../../plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="../../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- DataTables -->
<script src="../../plugins/datatables/jquery.dataTables.js"></script>
<script src="../../plugins/datatables-bs4/js/dataTables.bootstrap4.js"></script>
<!-- AdminLTE App -->
<script src="../../dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../../dist/js/demo.js"></script>
<script>
$(function () {
$("#example1").DataTable();
$('#example2').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": true,
"info": true,
"autoWidth": false,
});
});
</script>
<script src="../../plugins/bs-custom-file-input/bs-custom-file-input.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
bsCustomFileInput.init();
});
</script>
</body>
</html>
