ÿØÿà JFIF ` ` ÿþxØ
| Server IP : 109.234.164.53 / Your IP : 216.73.216.110 Web Server : Apache System : Linux cervelle.o2switch.net 4.18.0-553.32.1.lve.el8.x86_64 #1 SMP Thu Dec 19 13:14:03 UTC 2024 x86_64 User : computer3 ( 1098) PHP Version : 7.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/computer3/litsolide.com/ODLDDD_2/cp-admin/ |
Upload File : |
<?php
include_once('includes/header.php');
$id_volet ="19";
include('includes/volet.php');
/****************************/
if(isset($_POST['stat_doc']))
{ $stat_doc= $_POST['stat_doc']; }
if ($stat_doc == '1'){ $stat_doc_affiche = 'statut : ' . $comm_1; }
if ($stat_doc == '2'){ $stat_doc_affiche = 'statut : ' . $comm_2; }
if(isset($_POST['mois_doc']))
{ $mois_doc= $_POST['mois_doc']; }
if(isset($_POST['an_doc']))
{ $an_doc= $_POST['an_doc']; }
if ($mois_doc=="01") { $mois_affiche ="Janvier"; }
if ($mois_doc=="02") { $mois_affiche ="Février"; }
if ($mois_doc=="03") { $mois_affiche ="Mars"; }
if ($mois_doc=="04") { $mois_affiche ="Avril"; }
if ($mois_doc=="05") { $mois_affiche ="Mai"; }
if ($mois_doc=="06") { $mois_affiche ="Juin"; }
if ($mois_doc=="07") { $mois_affiche ="Juillet"; }
if ($mois_doc=="08") { $mois_affiche ="Aout"; }
if ($mois_doc=="09") { $mois_affiche ="Septembre"; }
if ($mois_doc=="10") { $mois_affiche ="Octobre"; }
if ($mois_doc=="11") { $mois_affiche ="Novembre"; }
if ($mois_doc=="12") { $mois_affiche ="Décembre"; }
// mois / an
if ((empty($jj_doc)) AND (!empty($mois_doc))){
$tittt = " pour le mois : " . $mois_affiche . ' ' . $an_doc;
$req = ''. $an_doc . '-' . $mois_doc ;
$req_date = "date_status LIKE '%$req%' AND status ='$stat_doc'";
}
// an
if ((empty($jj_doc)) AND (empty($mois_doc))){
$tittt = " pour l'année : " . $an_doc;
$req = ''. $an_doc ;
$req_date = "date_status LIKE '%$req%' AND status ='$stat_doc'";
}
if ((empty($mois_doc)) AND (empty($an_doc))) {
echo '<script>';
echo 'window.location = "./index.php"';
echo '</script>';
}
?>
<div class="container">
<div class="row">
<div class="span12">
<div class="page-header">
<h1>Récapitulatif Z <?php echo$tittt ?></h1>
<div class="pull-right" style="margin-top: -35px;">
<a target="_blank" href="../FPDF/cloture_mois.php?stat_doc=<?php echo$stat_doc ?>&mois_doc=<?php echo$mois_doc ?>&an_doc=<?php echo$an_doc ?> " class="btn btn-success" style="width:120px">Documents</a>
<a href="z.php" class="btn btn-primary" style="width:120px"><i class="icon-arrow-left"></i> Retour</a>
</div>
</h1>
</div>
</div>
</div>
<?php
$total_ca = 0;
$total_tva1 = 0;
$total_tva2 = 0;
$total_tva3 = 0;
$total_ecop = 0;
$total_cb = 0;
$total_chq = 0;
$total_vir = 0;
$total_pay = 0;
$requete = $bdd->query("SELECT o.*, a.firstname, a.lastname, os.status, os.date_status, o.payment AS paym FROM orders o
INNER JOIN address a
ON a.id = o.invoice_address
RIGHT JOIN order_status os
ON os.id_order = o.id
WHERE os.date_status = (SELECT MAX(date_status) FROM order_status
WHERE $req_date AND id_order = o.id)
ORDER BY id DESC ");
if ($row = $requete->fetch()) {
do {
$total_ca = $total_ca + $row['total'];
$total_tva1 = $total_tva1 + $row['tva_1'];
$total_tva2 = $total_tva2 + $row['tva_2'];
$total_tva3 = $total_tva3 + $row['tva_3'];
$total_ecop = $total_ecop + $row['total_ecoprix'];
if ($row['paym'] =='cb') { $total_cb = $total_cb + $row['total']; }
if ($row['paym']=='Paypal') { $total_pay = $total_pay + $row['total']; }
if ($row['paym']=='Cheque') { $total_chq = $total_chq + $row['total']; }
if ($row['paym']=='Virement') { $total_vir = $total_vir + $row['total']; }
}while ($row = $requete->fetch());
} else {
}
$total_ca_affiche = stripcslashes(number_format($total_ca, 2, ',', ' '))." €";
$total_tva1_affiche = stripcslashes(number_format($total_tva1, 2, ',', ' '))." €" ;
$total_tva2_affiche = stripcslashes(number_format($total_tva2, 2, ',', ' '))." €" ;
$total_tva3_affiche = stripcslashes(number_format($total_tva3, 2, ',', ' '))." €";
$total_ecop_affiche = stripcslashes(number_format($total_ecop, 2, ',', ' '))." €";
$total_cb_affiche = stripcslashes(number_format($total_cb, 2, ',', ' '))." €";
$total_chq_affiche = stripcslashes(number_format($total_chq, 2, ',', ' '))." €";
$total_vir_affiche = stripcslashes(number_format($total_vir, 2, ',', ' '))." €";
$total_pay_affiche = stripcslashes(number_format($total_pay, 2, ',', ' '))." €";
?>
<div style="text-align:left;font-size:12pt">
<b> Total de vos opérations avec le <?php echo$stat_doc_affiche ?></b></div>
<br /><br />
<table style="width:100%;border:1px solid #ccc" height="66">
<tr>
<td align="center" width="20%" style="background-color: #FFF8F0" height="30"><b>CA TTC</b></td>
<td align="center" width="20%" style="background-color: #FFF8F0" height="30"><b>TVA <?php echo$T_1_text ?></b></td>
<td align="center" width="20%" style="background-color: #FFF8F0" height="30"><b>TVA <?php echo$T_2_text ?></b></td>
<td align="center" width="20%" style="background-color: #FFF8F0" height="30"><b>TVA <?php echo$T_3_text ?></b></td>
<td align="center" width="20%" style="background-color: #FFF8F0" height="30"><b>ECO-PARTICIPATION</b></td>
</tr>
<tr>
<td align="center" width="20%" style="background-color: #F9F9F9"><b>
<font size="4"></font><font size="4" color="#FF0000"><?php echo$total_ca_affiche ?></font></b></td>
<td align="center" width="20%" style="background-color: #F9F9F9"><b>
<font size="4"><?php echo$total_tva1_affiche ?></font></b></td>
<td align="center" width="20%" style="background-color: #F9F9F9"><b>
<font size="4"><?php echo$total_tva2_affiche ?></font></b></td>
<td align="center" width="20%" style="background-color: #F9F9F9"><b>
<font size="4"><?php echo$total_tva3_affiche ?></font></b></td>
<td align="center" width="20%" style="background-color: #F9F9F9"><b>
<font size="4"><?php echo$total_ecop_affiche ?></font></b></td>
</tr>
</table>
<br />
<table style="width:100%;border:1px solid #ccc" height="66">
<tr>
<td align="center" width="20%" style="background-color: #FFF8F0" height="30"><b>CB</b></td>
<td align="center" width="20%" style="background-color: #FFF8F0" height="30"><b>Chèques</b></td>
<td align="center" width="20%" style="background-color: #FFF8F0" height="30"><b>Virements</b></td>
<td align="center" width="20%" style="background-color: #FFF8F0" height="30"><b>Paypal</b></td>
</tr>
<tr>
<td align="center" width="20%" style="background-color: #F9F9F9"><b>
<font size="4"><?php echo$total_cb_affiche ?></font></b></td>
<td align="center" width="20%" style="background-color: #F9F9F9"><b>
<font size="4"><?php echo$total_chq_affiche ?></font></b></td>
<td align="center" width="20%" style="background-color: #F9F9F9"><b>
<font size="4"><?php echo$total_vir_affiche ?></font></b></td>
<td align="center" width="20%" style="background-color: #F9F9F9"><b>
<font size="4"><?php echo$total_pay_affiche ?></font></b></td>
</tr>
</table>
<br />
<div style="text-align:left;font-size:12pt">
<b> Détail des opérations</b></div>
<br /><br />
<div align="center">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th class="span1 center">N.Ordre</th>
<th class="span1 center">N.Cde</th>
<th class="span2 center">Nom</th>
<th class="span2 center">Date</th>
<th class="span1 center">Etat</th>
<th class="span1 center">Total</th>
<th class="span1 center">Facture</th>
</tr>
</thead>
<tbody>
<?php
$requete = $bdd->query("SELECT o.*, a.firstname, a.lastname, os.status, os.date_status FROM orders o
INNER JOIN address a
ON a.id = o.invoice_address
RIGHT JOIN order_status os
ON os.id_order = o.id
WHERE os.date_status = (SELECT MAX(date_status) FROM order_status
WHERE $req_date AND id_order = o.id)
ORDER BY id DESC ");
if ($row = $requete->fetch()) {
do {
?>
<tr>
<td class="center">
<b><?php echo stripcslashes($row['id']) ?></b>
</td>
<td class="span1 font12 center">
<b><?php echo stripcslashes($row['id_order']) ?></b>
</td>
<td class="center">
<b><?php echo stripcslashes($row['firstname']) ?> <?php echo stripcslashes($row['lastname']) ?></b>
</td>
<td class="center">
<b>Date commande <br />
<?php
setlocale (LC_TIME, 'fr_FR.utf8','fra');
echo utf8_encode(strftime("%A %d-%m-%Y", strtotime($row['date_insere'])));
?>
</b>
</td>
<td class="center">
<b>
<?php
switch ($row['status']) {
case '1':
echo$comm_1;
break;
case '2':
echo$comm_2;
break;
case '3':
echo$comm_3;
break;
default:
echo$comm_4;
break;
}
?>
<br />
<?php
setlocale (LC_TIME, 'fr_FR.utf8','fra');
echo utf8_encode(strftime("%A %d-%m-%Y", strtotime($row['date_status'])));
?>
</b>
</td>
</td>
<td class="center">
<b><?php echo stripcslashes(number_format($row['total'], 2, ',', ' '))."€" ?> <br /><font color="#CC3300" size="2"><?php echo $row['txt_discount']; ?></font></b>
</td>
<td class="center">
<?php if ($gesto > 0) { ?>
<a href="../order_form.php?id=<?php echo $row['id_order']; ?>" target="_blank" >
<img src="assets/img/details.png" title="Voir la facture">
</a>
<?php } ?>
</td>
</tr>
<?php
}while ($row = $requete->fetch());
} else {
echo 'Aucune commande à afficher !!!';
}
?>
</tbody>
</table>
<br /><br />
</div>
<?php
include_once('includes/footer.php');
?>