Viewing file: v_rptRis301.php (4.16 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<table border="0" align="center" cellpadding="0" cellspacing="0" style="width:100%;"> <? $cfgClgLogo = (! isset($cfgClgLogo)? "" : $cfgClgLogo); $cfgClgName = (! isset($cfgClgName)? "" : $cfgClgName); $cfgSiteName = (! isset($cfgSiteName)? "" : $cfgSiteName); ?> <style type="text/css"> .tb_1{ border-collapse:collapse; } .tb_1 td,.tb_1 th{ border:1px solid #CCCCCC; } </style> <table width="95%" align="center"> <?php header('Content-type: application/xls'); header('Content-Disposition: attachment; filename="testing.xls"'); ?> <tr> <td width="50"><img src="<?=base_url().$this->config->item('rg_upload_picture').$cfgClgLogo;?>" width="111" height="95" align="absmiddle" border="0"></td> <td width="500"><font size="2"><b><?=$cfgClgName;?><br><?=$cfgSiteName;?></b></font></td> <td width="200" align="right" valign="top"><font size="2"><b>RIS301</b></font></td> </tr> <tr valign="top"> <td align="center" colspan="3"><hr color="#000000" noshade><br></td> </tr> <tr> <td align="center" colspan="3"><font size="3"><b>รายได้จากค่าใช้จ่ายในการศึกษาที่คาดว่าจะได้รับ</b></font></td> </tr> <tr> <td align="center" colspan="3"><font size="3" ><b>ประจำปีการศึกษา</b> <?php echo $acadYear;?> <b>ภาคการศึกษา</b> <?php echo $semester;?></font></td> </tr> <tr> <td height="22"></td> </tr> <tr> <td colspan="3"> <table width="100%" border="1" cellspacing="0" cellpadding="2" bordercolor="#000000" style="border-collapse: collapse" align="center"> <col style="width:5%;"> <col style="width:10%;"> <col style="width:4%;"> <col style="width:4%;"> <thead> <tr> <th>ที่</th> <th>หลักสูตร</th> <th>รุ่นที่</th> <th>จำนวนคน</th> <?php $num_col= 0; if(isset($tb_head) && $tb_head->num_rows()) { $num_col = $tb_head->num_rows(); foreach($tb_head->result() as $row) { ?> <th><?php echo $row->feeName;?></th> <?php } } ?> <th>ค่าหน่วยกิตภาคทฤษฎี</th> <th>ค่าหน่วยกิตภาคทดลอง/ปฏิบัติ</th> <th>รวม</th> </tr> </thead> <tbody> <?php $sum_lb =0; $sum_lc =0; $sum_total = 0; $col_val = array(); for($k =0;$k <= $num_col;$k++) { $col_val[$k] = 0; } $num = count($rs_sg); for($i=0;$i<$num;$i++) { ?> <tr> <td style="text-align:center;"><?php echo $i+1;?></td> <td><?php echo $rs_sg[$i]['curName'];?></td> <td style="text-align:right;"><?php echo $rs_sg[$i]['genNo'];?></td> <td style="text-align:right;"><?php echo $rs_sg[$i]['numStd'];?></td> <?php $j = 0; foreach($rs_sg[$i]['extra'] as $index => $value) { $col_val[$j++] += $value; ?> <td style="text-align:right;"><?php echo number_format($value,2);?></td> <?php } $sum_lb += $rs_sg[$i]['tmpLbCreditFee']; $sum_lc += $rs_sg[$i]['tmpLcCreditFee']; $sum_total += $rs_sg[$i]['total']; ?> <td style="text-align:right;"><?php echo number_format($rs_sg[$i]['tmpLbCreditFee'],2);?></td> <td style="text-align:right;"><?php echo number_format($rs_sg[$i]['tmpLcCreditFee'],2);?></td> <td style="text-align:right;"><?php echo number_format($rs_sg[$i]['total'],2);?></td> </tr> <?php }
?> </tbody> <tfoot> <tr> <td colspan="3" style="text-align:center;font-weight:bold;">รวม</td> <td style="text-align:right;"><?php echo $sum_std;?></td> <?php for($i=0;$i<$num_col;$i++) { ?> <td style="text-align:right;"><?php echo number_format($col_val[$i],2);?></td> <?php } ?> <td style="text-align:right;"><?php echo number_format($sum_lb,2);?></td> <td style="text-align:right;"><?php echo number_format($sum_lc,2);?></td> <td style="text-align:right;"><?php echo number_format($sum_total,2);?></td> </tr> </tfoot> </table> </td> </tr> </table>
|