Viewing file:      v_rptRis110Excel.php (5.71 KB)      -rwxr-xr-x Select action/file-type:    (+) |   (+) |   (+) | Code (+) | Session (+) |   (+) | SDB (+) |   (+) |   (+) |   (+) |   (+) |   (+) |
 
<?php
 header('Content-type: application/xls');
 header('Content-Disposition: attachment; filename="Ris110.xls"');
 ?>
 <meta http-equiv="Content-Type" content="text/html; charset=tis-620">
 <table width="100%" align="center" border="0" cellpadding="0" cellspacing="1">
     <tr>
         <td width="50"><img src="<?php echo base_url().$this->config->item('rg_upload_picture').$cfgClgLogo;?>" width="111" height="95" align="absmiddle" border="0"></td>
         <td width="450"><b><?php echo $cfgClgName;?><br><?php echo $cfgSiteName;?></b></td>
         <td width="200" align="right" valign="top"><b>RIS110</b></td>
     </tr>
     <tr valign="top">
         <td align="center" colspan="3"><hr color="#000000" noshade><br></td>
     </tr>
     <tr>
         <td colspan="3" height="22" align="center"><b>ใบลงคะแนนสำหรับนักศึกษาจำแนกตามหลักสูตร</b></td>
     </tr>
 <?
     $pgNames = "";
     $levelNames = "";
     $tmpLevel = "";
     if(is_null($qu_co->row()->coCurId)) {
         $con_cof = array('cofCoId'    => $qu_co->row()->coId);
         $rs_cof = $cof->qryCofJoinCurLev($con_cof);
 
         if($rs_cof->num_rows()) {
             foreach($rs_cof->result() as $row_cof) {
                 $pgNames.= $row_cof->curName.", ";
 
                 if($tmpLevel=="" || ($tmpLevel!=$row_cof->levelId)) {
                     $levelNames.= $row_cof->levelName.", ";
                 }
 
                 $tmpLevel = $row_cof->levelId;
             }
 
             $pgNames = substr($pgNames, 0, -2);
             $levelNames = substr($levelNames, 0, -2);
         }
     } else {
         $pgNames = $qu_co->row()->curName;
         $levelNames = $qu_co->row()->levelName;
     }
     if(isset($qu_co) && $qu_co->num_rows()) {
         $row = $qu_co->row();
 
         $sy->syId = $row->coSyId;
         $sy->get_by_key(TRUE);
 
 
         $tm->tmId = $row->coTmId;
         $tm->get_by_key(TRUE);
     }
 ?>
     <tr>
         <td colspan="3" height="22" align="center"><b>หลักสูตร</b> <?php echo $pgNames;?>
         <b>ระดับ</b> <?php echo $levelNames;?></td>
     </tr>
     <tr>
         <td colspan="3" height="22" align="center"><b>ชั้นปีที่</b> <?php echo (isset($sy->syCode)) ? $sy->syCode : "";?>
         <b>ภาคการศึกษาที่</b> <?php echo (isset($tm->tmCode)) ? $tm->tmCode : "";?></td>
     </tr>
     <tr>
         <td colspan="3" height="22" align="center"><b>รหัสวิชา</b> <?php echo $row->crsCode;?>
         <b>รายวิชา</b> <?php echo explodeSquare($row->crsName);?>
         <b>หน่วยกิต</b> <?php echo $row->crsUnit;?></td>
     </tr>
     <tr>
         <td colspan="3" height="22"></td>
     </tr>
     <tr>
         <td colspan="3" align="center">
         <table border="1">
             <tr>
                 <td align="center"><b>ที่</b></td>
                 <td align="center"><b>รหัสนักศึกษา</b></td>
                 <td align="center"><b>ชื่อ-สกุล</b></td>
                 <td align="center"><b>เกรด</b></td>
             </tr>
 <?
 $i = 0;    
 if($rs_rd->num_rows()){
     foreach($rs_rd->result() as $row_rd){
         $i++;
 ?>
             <tr>
                 <td height="22" align="center"><?php echo $i;?></td>
                 <td align="center"><?php echo $row_rd->stdCode;?></td>
                 <td><?php echo $row_rd->prefixName.$row_rd->stdName.' '.$row_rd->stdSurname;?></td>
                 <td></td>
             </tr>
 <?    
     }
 }else{
 ?>
     <tr>
         <td colspan="4" align="center">** ไม่ปรากฏรายการในฐานข้อมูล **</td>
     </tr>
 <?
 }
 ?>
         </table></td>
     </tr>
     <tr>
         <td colspan="3">
             <table width="100%">
                 <tr>
                     <td height="22" colspan="3" align="left"><b>สรุปผลการเรียน</b></td>
                 </tr>
                 <tr>
                     <td height="22"></td>
                     <td colspan="2">1. จำนวนนักศึกษาในชั้นเรียน <?php echo $i;?> คน
                     ชาย <?php echo $co->getNumBySex($row->coId, 'M');?> คน
                     หญิง <?php echo $co->getNumBySex($row->coId, 'F');?> คน</td>
                 </tr>
                 <tr>
                     <td height="22"></td>
                     <td colspan="2">2. จำนวนนักศึกษาที่เข้าสอบ....................คน
                     ขาดสอบ....................คน</td>
                 </tr>
                 <tr>
                     <td height="22"></td>
                     <td colspan="2">3. รายละเอียดผลการเรียน</td>
                 </tr>
             </table>
         </td>
     </tr>
     
     <tr>
         <td colspan="3" height="22"></td>
     </tr>
     <tr>
         <td colspan="3"><table width="100%" border="1" cellspacing="0" cellpadding="0" align="center">
             <tr>
                 <th align="center"><font size="2"><b>เกรด</b></font></th>
                 <th align="center"><font size="2"><b>ระดับคะแนน</b></font></th>
                 <th align="center"><font size="2"><b>ช่วงคะแนน</b></font></th>
                 <th align="center"><font size="2"><b>จำนวน</b></font></th>
             </tr>
 <?php
             foreach($rs_gd->result() as $row_gd){
 ?>
             <tr>
                 <td height="22" align="center"><?php echo $row_gd->grdGrade;?></td>
                 <td align="center"><?php echo number_format($row_gd->grdPoint, 2);?></td>
                 <td> </td>
                 <td> </td>
             </tr>
 <?php
             }
 ?>
         </table></td>
     </tr>
     <tr>
         <td colspan="3" height="22"></td>
     </tr>
     <tr>
         <td height="22"></td>
         <td colspan="2" align="right">อาจารย์ผู้รับผิดชอบวิชา..................................................</td>
     </tr>
     <tr>
         <td height="22"></td>
         <td colspan="2" align="right">หัวหน้าภาควิชา/ประธานหลักสูตร..................................................</td>
     </tr>
     <tr valign="bottom">
         <td align="center" colspan="3" height="88"><hr color="#000000" noshade></td>
     </tr>
     <tr valign="top">
         <td colspan="2" >วันที่พิมพ์ : <?php echo date('d-m-y h:m');?></td>
         <td align="right">หน้า 1/1</td>            
     </tr>
     <tr>
         <td colspan="3" height="22"></td>
     </tr>            
 </table>
 
  |