Fix stampa calendario

This commit is contained in:
Luca 2018-05-08 16:57:55 +02:00
parent 78e4816238
commit 02429812b7
1 changed files with 12 additions and 16 deletions

View File

@ -2,7 +2,7 @@
include_once __DIR__.'/../../core.php';
$height = '130';
$height = '80';
if (isset( $_SESSION['period']['month'] )){
@ -117,13 +117,7 @@ for ($i=0; $i<33;$i++){
function showMonth($month, $year){
global $rs;
global $height;
function showMonth($month, $year, &$rs, &$height){
$date = mktime(12, 0, 0, $month, 1, $year);
$daysInMonth = date("t", $date);
@ -181,8 +175,8 @@ function showMonth($month, $year){
$weekdays = array( 'Monday' => 'Lunedi\'', 'Tuesday' => 'Martedi\'', 'Wednesday' => 'Mercoledi\'','Thursday' => 'Giovedi\'','Friday' => 'Venerdi\'','Saturday' => 'Sabato','Sunday' => 'Domenica');
$weekday = $weekdays[$weekday];
$header[$rows] .= "<th>".tr($weekday.' '.(sprintf("%02d", $day)).'/'.$current_month, [], ['upper' => true])."</th>\n";
$row[$rows] .= "<td><b> - </b></td>\n";
$header[$rows] .= "<th>".tr($weekday.' '.(sprintf("%02d", $day)).'/'.(sprintf("%02d", $current_month)), [], ['upper' => true])."</th>\n";
$row[$rows] .= "<td style=\"background:lightgray;\" ><b> </b></td>\n";
}
@ -213,8 +207,10 @@ function showMonth($month, $year){
$header[$rows] .= "<th>" . tr($weekday.' '.(sprintf("%02d", $day)).'/'.$month, [], ['upper' => true]) ."</th>\n";
if (empty($rs[$day]['cliente'])){
$rs[$day]['cliente'] = ' - ';
$rs[$day]['cliente'] = ' ';
}
$row[$rows] .= "<td style='height:".$height."px' >". "<b>".$rs[$day]['cliente']."</b></td>\n";
}
@ -250,9 +246,9 @@ for($i = 1; ($day + $offset) <= ($rows * 7); $i++){
$weekday = $weekdays[$weekday];
$header[$rows] .= "<th> ".tr($weekday.' '.(sprintf("%02d", $i)).'/'.$current_month, [], ['upper' => true])." </th>\n";
$header[$rows] .= "<th> ".tr($weekday.' '.(sprintf("%02d", $i)).'/'.(sprintf("%02d", $current_month)), [], ['upper' => true])." </th>\n";
//$row[$rows] .= "<td> ".($offset+$day)."<br>".($rows * 7)." </td>\n";
$row[$rows] .= "<td><b> - </b> </td>\n";
$row[$rows] .= "<td style=\"background:lightgray;\" ><b> </b> </td>\n";
$day++;
@ -302,4 +298,4 @@ echo "
], ['upper' => true])."</h3>";
showMonth($month,$year);
showMonth($month,$year,$rs, $height);