Skip to content

Commit 52f9fad

Browse files
author
François Jacquet
committed
Responsive DailyMenus
1 parent 53ba038 commit 52f9fad

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

modules/Food_Service/DailyMenus.php

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,32 +65,32 @@
6565

6666
$skip = date("w",$time);
6767

68-
echo '<!-- MEDIA TOP 1in --><P><span class="center">';
69-
echo '<TABLE style="border: solid 2px; background-color: #fff;" class="cellpadding-3">'."\n";
68+
echo '<!-- MEDIA TOP 1in --><P class="center">';
69+
echo '<TABLE style="background-color: #fff;" class="cellpadding-3 width-100p">'."\n";
7070
if($_REQUEST['_ROSARIO_PDF'])
7171
if(is_file('assets/dailymenu'.UserSchool().'.jpg'))
7272
{
73-
echo '<TR class="center"><TD colspan="7"><img src="assets/dailymenu'.UserSchool().'.jpg"></TD></TR>'."\n";
73+
echo '<TR class="center"><TD colspan="3"><img src="assets/dailymenu'.UserSchool().'.jpg" /></TD></TR>'."\n";
7474
}
7575
else
76-
echo '<TR class="center"><TD colspan="7"><span style="color:black" class="sizep2"><b>'.GetSchool(UserSchool()).'</b></span></TD></TR>'."\n";
76+
echo '<TR class="center"><TD colspan="3"><span style="color:black" class="sizep2"><b>'.GetSchool(UserSchool()).'</b></span></TD></TR>'."\n";
7777
//modif Francois: display locale with strftime()
78-
echo '<TR class="center"><TD colspan="2">'.$menus_RET[$_REQUEST['menu_id']][1]['TITLE'].'</TD><TD colspan="3"><span style="color:black" class="sizep2"><b>'.ProperDate(date('Y.m.d',mktime(0,0,0,$_REQUEST['month'],1,$_REQUEST['year']))).'</b></span></TD><TD colspan="2">'.$menus_RET[$_REQUEST['menu_id']][1]['TITLE'].'</TD></TR>'."\n";
79-
echo '<TR style="text-align:center; background-color:#808080">'."\n";
80-
echo '<TD style="width:100px;"><span style="color:white"><b>'._('Sunday').'</b></span></TD><TD style="width:100px;"><span style="color:white"><b>'._('Monday').'</b></span></TD><TD style="width:100px;"><span style="color:white"><b>'._("Tuesday").'</b></span></TD><TD style="width:100px;"><span style="color:white"><b>'._("Wednesday").'</b></span></TD><TD style="width:100px;"><span style="color:white"><b>'._("Thursday").'</b></span></TD><TD style="width:100px;"><span style="color:white"><b>'._("Friday").'</b></span></TD><TD style="width:100px;"><span style="color:white"><b>'._("Saturday").'</b></span></TD>'."\n";
81-
echo '</TR>';
78+
echo '<TR class="center"><TD>'.$menus_RET[$_REQUEST['menu_id']][1]['TITLE'].'</TD><TD><span style="color:black" class="sizep2"><b>'.ProperDate(date('Y.m.d',mktime(0,0,0,$_REQUEST['month'],1,$_REQUEST['year']))).'</b></span></TD><TD>'.$menus_RET[$_REQUEST['menu_id']][1]['TITLE'].'</TD></TR></TABLE>'."\n";
79+
echo '<TABLE style="border: solid 2px; background-color: #fff;" class="cellpadding-3" id="calendar"><THEAD><TR style="text-align:center; background-color:#808080; color:white;">'."\n";
80+
echo '<TH>'.mb_substr(_('Sunday'),0,3).'<span>'.mb_substr(_('Sunday'),3).'</span>'.'</TH><TH>'.mb_substr(_('Monday'),0,3).'<span>'.mb_substr(_('Monday'),3).'</span>'.'</TH><TH>'.mb_substr(_('Tuesday'),0,3).'<span>'.mb_substr(_('Tuesday'),3).'</span>'.'</TH><TH>'.mb_substr(_('Wednesday'),0,3).'<span>'.mb_substr(_('Wednesday'),3).'</span>'.'</TH><TH>'.mb_substr(_('Thursday'),0,3).'<span>'.mb_substr(_('Thursday'),3).'</span>'.'</TH><TH>'.mb_substr(_('Friday'),0,3).'<span>'.mb_substr(_('Friday'),3).'</span>'.'</TH><TH>'.mb_substr(_('Saturday'),0,3).'<span>'.mb_substr(_('Saturday'),3).'</span>'.'</TH>'."\n";
81+
echo '</TR></THEAD><TBODY>';
8282

8383
if($skip)
84-
echo '<TR style="height:100px;"><TD style="background-color:#C0C0C0;" colspan="'.$skip.'">&nbsp;</TD>'."\n";
84+
echo '<TR><TD style="background-color:#C0C0C0;" colspan="'.$skip.'">&nbsp;</TD>'."\n";
8585

8686
for($i = 1; $i <= $last; $i++)
8787
{
8888
if($skip%7==0)
89-
echo '<TR style="height:0px;">';
89+
echo '<TR>';
9090
$day_time = mktime(0,0,0,$_REQUEST['month'],$i,$_REQUEST['year']);
9191
$date = mb_strtoupper(date('d-M-y',$day_time));
9292

93-
echo '<TD style="width:100px;" class="valign-top"><b>'.$i.'</b>';
93+
echo '<TD class="valign-top" style="height:100%; '.(count($events_RET[$date]) ? 'background-color:#ffaaaa;' : '').'"><TABLE class="calendar-day'.(count($events_RET[$date]) ? ' hover"><TR><TD><b>'.$i.'</b>' : '"><TR><TD>'.$i);
9494

9595
if(count($events_RET[$date]))
9696
{
@@ -101,7 +101,7 @@
101101
echo '<BR />'.htmlspecialchars($event['DESCRIPTION'],ENT_QUOTES);
102102
}
103103
}
104-
echo '</TD>';
104+
echo '</TD></TR></TABLE></TD>';
105105

106106
$skip++;
107107

@@ -111,8 +111,7 @@
111111
if($skip%7!=0)
112112
echo '<TD style="background-color:#C0C0C0;" colspan="'.(7-$skip%7).'">&nbsp;</TD></TR>';
113113

114-
echo '</TABLE>';
115-
echo '</span></P>';
114+
echo '</TBODY></TABLE></P>';
116115
}
117116
else
118117
{

0 commit comments

Comments
 (0)