else { $sub = ($num-1); }
$WeekMon  = mktime(0, 0, 0, date("m", $now)  , date("d", $now)-$sub, date("Y", $now));    //monday week begin calculation
$todayh = getdate($WeekMon); //monday week begin reconvert

$d = $todayh[mday];
$m = $todayh[mon];
$y = $todayh[year];
echo "$d-$m-$y"; //getdate converted day */
function get_first_day($day_number = 1, $month = false, $year = false)
{
    $month = $month === false ? strftime("%m") : $month;
    $year = $year === false ? strftime("%Y") : $year;
    $first_day = 1 + (7 + $day_number - strftime("%w", mktime(0, 0, 0, $month, 1, $year))) % 7;
    return mktime(0, 0, 0, $month, $first_day, $year);
}
$diaEnglish = strftime("%a", get_first_day($i, $_GET['mes'], $_GET['year']));
/*
Monday-Lunes.
Tuesday-Martes.
Wednesday-Mi�rcoles.
Thursday-Jueves.
Friday-Viernes.
Saturday-S�bado.
Sunday-Domingo.
*/
switch ($diaEnglish) {
    case "Sunday":
        $dias = "Dom";
        break;
    case "Monday":
        $dias = "Lun";
Ejemplo n.º 2
0
				</tr>
			</tbody>
		</table>
		<br/>
		<div id="graph_wrapper4" class="graph_wrapper"></div>
		<table id="graph_weekday" class="data" style="display:none" cellpadding="0" cellspacing="0" width="100%">
			<caption><?php 
echo _occupancy_per_week . " / " . _days;
?>
</caption>
			<thead>
				<tr>
					<td class="no_input">&nbsp;</td>
					<?php 
foreach ($label_wk as $value) {
    echo "<th>" . strftime("%A", get_first_day($value, $_SESSION['statistic_month'], $_SESSION['selectedDate_year'])) . "</th>";
}
?>
				</tr>
			</thead>
			<tbody>
				<tr>
					<th><?php 
echo _days;
?>
</th>
					<?php 
foreach ($data_wk as $value) {
    echo "<td>" . $value . "</td>";
}
?>