Updated generation of previous days in heading on home template, now looped into array then passed to smarty

Signed-off-by: Nathan Booth <nath.booth@gmail.com>
This commit is contained in:
Nathan Booth
2011-12-19 14:10:00 +00:00
parent 116140ee17
commit 1f2d8fec99
2 changed files with 6 additions and 11 deletions

View File

@@ -3,12 +3,9 @@
$services = StatusBoard_Service::all(); $services = StatusBoard_Service::all();
for ($i = 1; $i <= 6; ++$i){ for ($i = 1; $i <= 6; ++$i){
$day = 'day'.$i; $tbl_header_date[] = date("M. d", strtotime("-{$i}day"));
$date = date("M. d", strtotime("-{$i}day"));
$this->smarty->assign($day, $date);
} }
$this->smarty->assign('days', $tbl_header_date);
$this->smarty->assign('services', $services); $this->smarty->assign('services', $services);
?> ?>

View File

@@ -4,12 +4,10 @@
<tr> <tr>
<th>Service</th> <th>Service</th>
<th class="status">Current</th> <th class="status">Current</th>
<th class="status">{$day1}</th> {foreach from=$days key="ind" item="day"}
<th class="status">{$day2}</th> <th class="status">{$day}</th>
<th class="status">{$day3}</th> {/foreach}
<th class="status">{$day4}</th>
<th class="status">{$day5}</th>
<th class="status">{$day6}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>