Kod napisany w php:
<?php $dayOffset = dayNoOfFirstDayOfMonth($date_start); for ($p = 0; $p < $usercount; $p++) { for ($i = 0; $i < $daysCount; $i++) { $employee[$p][$i]['index2'] = $i; $dayWeek = dayWeek($date_start_tmp); //$dayOffset + 1 + date('d', $date_start_tmp) $employee[$p][$i]['name'] = dayNameAbr($dayWeek); $employee[$p][$i]['style'] = 'work'; $employee[$p][$i]['readOnly'] = (($periodBegining > $date_start_tmp)?'disabled="disabled"':''); if (get_vacation_type($userID[$p], $dateStart) == '1') { $employee[$p][$i]['style'] = 'vacationFL'; } if (get_vacation_type($userID[$p], $dateStart) == '2') { $employee[$p][$i]['style'] = 'vacationTR'; } if ($dayWeek % 7 == 0 || $dayWeek % 7 == 6) { $employee[$p][$i]['style'] = 'weekDay'; } { $employee[$p][$i]['style'] = 'publicHoliday'; } { $employee[$p][$i]['style'] = 'today'; } $user_color[][] = $employee[$p][$i]['style']; } } //echo "<pre>"; //print_r($employee); //print_r($usercount); //echo $daysCount; //echo "</pre>"; $smarty->assign ('user_color',$user_color); ?>
i plik w tpl:
<table class="timesheet" border="0" cellpadding="2" cellspacing="2"> <tr> {foreach from=$calendar key=id item=i} {/foreach} </tr> <tr> {foreach from=$calendar key=id item=i} {/foreach} </tr> {section name=p loop=$userID} <tr> <td align="right"> <div id="userIDCombo{$smarty.section.userID}"> <hidden name="userID{$smarty.section.userID}" > </select> </div> </td> <div id="userNAMECombo{$smarty.section.userNAME}"> <text name="userNAME{$smarty.section.userNAME}" > </select> </div> </td> {foreach from=$employee key=p item= i} <td class="$user_color[p][i]" title="{$i.holidayName}"> <input type="hidden" id="wh_{$i.number}_{$userID[p]}" name="wh_{$i.number}_{$userID[p]}" value=""> <input {$i.readOnly} class="smallInput" type="" id="wh_{$i.number}_{$userID[p]}" name="wh_{$i.number}_{$userID[p]}" value="" maxlength="4" onchange="valueArr[{math equation="x - 1" x=$userID[p]}][{$i.index2}] = (this.value != '')?this.value:0.0; countRow{$userID[p]}();" ondblclick="manageComment('wh_{$i.number}_{$userID[p]}', 'wh_{$i.number}_{$userID[p]}');" oncontextmenu="return false;" onkeypress="return enter(this);" onkeydown="return enter(this);" title="{$i.holidayName}" /> </td> {/foreach} </tr> {/section} </table>
Bede bardzo wdzieczna za pomoc w rozwiazaniu :/ bo mecze sie nad tym juz ktorys dzien