Viewing file: v_rptRis132.php (4.79 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
header('Content-type: application/xls');
header('Content-Disposition: attachment; filename="testing.xls"');
$row_cur = isset($qu_cur) ? $qu_cur->row() : NULL;
?>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<?php
if ($curId) {
?>
<tr>
<td align="center"><span class="h error"><b>โปรแกรมการศึกษาตามหลักสูตร</b></span></td>
</tr>
<tr>
<td align="center"><span class="h"><b>หลักสูตร : </b><?php echo ($typeLang == 'E') ? getval('curNameE', $row_cur) : (($typeLang=="T1") ? th2a(getval('curName', $row_cur)) : a2th(getval('curName', $row_cur)));?></font></td>
</tr>
<tr>
<td height="22"></td>
</tr>
<?php
}
if ($rs) {
foreach ($rs as $syId => $val) {
$row_sy = isset($rs[$syId]['qu_sy']) ? $rs[$syId]['qu_sy']->row() : NULL;
?>
<tr>
<td align="center"><span class="h error"><b><?php echo ($typeLang == 'E') ? getval('syNameE', $row_sy) : (($typeLang=="T1") ? th2a(getval('syName', $row_sy)) : a2th(getval('syName', $row_sy)));?></b></span></td>
</tr>
<tr>
<td><table width="100%" border="1" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="60%" rowspan="2" align="center"><font size="2"><b>รายวิชา</b></font></td>
<td width="10%" rowspan="2" align="center"><font size="2"><b>หน่วยกิต</b></font></td>
<td width="30%" colspan="3" align="center"><font size="2"><b>จำนวนชั่วโมง/สัปดาห์</b></font></td>
</tr>
<tr>
<td width="10%" align="center"><font size="2"><b>ทฤษฎี</b></font></td>
<td width="10%" align="center"><font size="2"><b>ทดลอง/ปฏิบัติ</b></font></td>
<td width="10%" align="center"><font size="2"><b>ศึกษาด้วยตนเอง</b></font></td>
</tr>
<?php
foreach ($rs[$syId] as $tmId => $val) {
if (is_int($tmId)) {
$row_tm = isset($rs[$syId][$tmId]['qu_tm']) ? $rs[$syId][$tmId]['qu_tm']->row() : NULL;
?>
<tr>
<td colspan="5"><b><?php echo ($typeLang == 'E') ? getval('tmNameE', $row_tm) : (($typeLang=="T1") ? th2a(getval('tmName', $row_tm)) : a2th(getval('tmName', $row_tm)));?></b></td>
</tr>
<?php
$sumCreditTotal = 0;
$sumPeriod1 = 0;
$sumPeriod2 = 0;
$sumPeriod3 = 0;
foreach ($rs[$syId][$tmId] as $cdId1 => $val) {
if (is_int($cdId1)) {
$row_cd = isset($rs[$syId][$tmId][$cdId1]['qu_cd']) ? $rs[$syId][$tmId][$cdId1]['qu_cd']->row() : NULL;
?>
<tr>
<td height="22" colspan="5"><span><b><?php echo ($typeLang == 'E') ? getval('cdNameE', $row_cd) : (($typeLang=="T1") ? th2a(getval('cdName', $row_cd)) : a2th(getval('cdName', $row_cd)));?></b></span></td>
</tr>
<?php
foreach ($rs[$syId][$tmId][$cdId1]['rs_sp']->result() as $row_sp) {
$sumCreditTotal += $row_sp->crsCreditTotal;
$sumPeriod1 += $row_sp->crsPeriod1;
$sumPeriod2 += $row_sp->crsPeriod2;
$sumPeriod3 += $row_sp->crsPeriod3;
?>
<tr>
<td height="22"><span><?php echo ($typeLang == 'E') ? explodeSquare($row_sp->crsCodeE.' '.$row_sp->crsNameE) : (($typeLang=="T1") ? th2a(explodeSquare($row_sp->crsCode.' '.$row_sp->crsName)) : a2th(explodeSquare($row_sp->crsCode.' '.$row_sp->crsName)));?></span></td>
<td align="center"><span><?php echo ($typeLang=="T2") ? a2th($row_sp->crsCreditTotal) : $row_sp->crsCreditTotal;?></span></td>
<td align="center"><span><?php echo ($typeLang=="T2") ? a2th($row_sp->crsPeriod1) : $row_sp->crsPeriod1;?></span></td>
<td align="center"><span><?php echo ($typeLang=="T2") ? a2th($row_sp->crsPeriod2) : $row_sp->crsPeriod2;?></span></td>
<td align="center"><span><?php echo ($typeLang=="T2") ? a2th($row_sp->crsPeriod3) : $row_sp->crsPeriod3;?></span></td>
</tr>
<?php
} // end foreach sp
} // end if
} // end foreach cdId1
?>
<tr>
<td height="22" align="right"><span><b>รวมหน่วยกิต</b></span></td>
<td align="center"><span><?php echo ($typeLang=="T2") ? a2th($sumCreditTotal) : $sumCreditTotal;?></span></td>
<td align="center"><span><?php echo ($typeLang=="T2") ? a2th($sumPeriod1) : $sumPeriod1;?></span></td>
<td align="center"><span><?php echo ($typeLang=="T2") ? a2th($sumPeriod2) : $sumPeriod2;?></span></td>
<td align="center"><span><?php echo ($typeLang=="T2") ? a2th($sumPeriod3) : $sumPeriod3;?></span></td>
</tr>
<?php
} // end if
} // end foreach tmId
?>
</table></td>
</tr>
<tr>
<td><br /></td>
</tr>
<?php
} // end foreach syId
} // end if rs
?>
</table>
|