Viewing file:      v_report003.php (3.98 KB)      -rwxr-xr-x Select action/file-type:    (+) |   (+) |   (+) | Code (+) | Session (+) |   (+) | SDB (+) |   (+) |   (+) |   (+) |   (+) |   (+) |
 
<?php
 ini_set("memory_limit", "128M");
 header('Content-type: application/xls');
 header('Content-Disposition: attachment; filename="testing.xls"');
 
 $row_cfg = (isset($qu_cfg) && $qu_cfg!=NULL) ? $qu_cfg->row() : NULL;
 $row_pa = (isset($qu_pa) && $qu_pa!=NULL) ? $qu_pa->row() : NULL;
 ?>
 <table width="100%">
     <tr>
         <td><img src="<?php echo base_url().$this->config->item('ea_cfglogo');?>" width="111" height="95" align="absmiddle" border="0"></td>
         <td><font size="3"><b><?php echo setValue('cfgName',$row_cfg)."<br />".$this->config->item('ea_system');?></b></font></td>
         <td align="right" valign="top"><font size="3"><b>EAIS003</b></font></td>
     </tr>
     <tr valign="top">
         <td align="center" colspan="3"><hr color="#000000" noshade><br></td>
     </tr>
     <tr>
         <td colspan="3" align="center"><font size="3"><b>รายงานที่อยู่ศิษย์เก่า แยกตามหลักสูตร</b></font></td>
     </tr>
     <tr>
         <td colspan="3" align="center"><font size="3"><b>หลักสูตร </b><?php echo setValue('programalumniName',$row_pa)=="" ? "-" : setValue('programalumniName',$row_pa);?> <b>ปีการศึกษาที่จบ </b><?php echo ($graduateY==0) ? "-" : $graduateY;?></font></td>
     </tr>
     <tr>
         <td colspan="3"><br /></td>
     </tr>
     <tr>
         <td colspan="3"><table class="excelCol" border="1">
             <tr>
                 <th class="seqCol">ลำดับที่</th>
                 <th class="stdCodeCol">รหัสนักศึกษา</th>
                 <th>ชื่อ - สกุลศิษย์เก่า</th>
                 <th>ชื่อรางวัล ภาษาไทย</th>
                 <th>หน่วยงานที่ให้รางวัล</th>
                 <th>วันที่ได้รับรางวัล</th>
                 <th>ประเภทรางวัล</th>
                 <th>ระดับการได้รับรางวัล</th>
             </tr>
 <?php
     $i = 0;
     if(isset($rs_am) && $rs_am->num_rows()) {
         foreach($rs_am->result() as $row_am) {
             echo "<tr onmouseover=\"bgColor='".$this->config->item('tr_c_even')."'\" onmouseout=\"bgColor='".$this->config->item("rg_mouseout")."'\">";
 
             $con_rs_ha = array('ha.alumniId'        => $row_am->alumniId,
                                'ha.typeAwardId'        => $typeAward,
                                'ha.levelAwardId'    => $levelAward);
             $rs_ha = $ha->qryHaJoinTaLaAmPf($con_rs_ha);
             if($rs_ha->num_rows) {
                 $line = 0;
                 foreach($rs_ha->result() as $row_ha) {
                     if($line==0) {
 ?>
                 <td align="center"><?php echo $i+1;?></td>
                 <td align="center"><?php echo $row_am->studentCode;?></td>
                 <td align="center"><?php echo $row_am->prefixName.$row_am->studentName.' '.$row_am->studentSurname;?></td>
 <?php
                     } else {
 ?>
                 <td colspan="3"></td>
 <?php
                     }
 ?>
                 <td class="indent"><?php echo $row_ha->awardNameT." [".$row_ha->awardNameE."]";?></td>
                 <td class="indent"><?php echo $row_ha->awardCompany;?></td>
                 <td class="indent"><?php echo abbreDate2($row_ha->receiveDate);?></td>
                 <td class="indent"><?php echo $row_ha->typeAwardNameT;?></td>
                 <td class="indent"><?php echo $row_ha->levelAwardNameT;?></td>
             </tr>
 <?php
                     $line++;
                 }
             } else {
 ?>
                 <td align="center"><?php echo $i+1;?></td>
                 <td align="center"><?php echo $row_am->studentCode;?></td>
                 <td align="center"><?php echo $row_am->prefixName.$row_am->studentName.' '.$row_am->studentSurname;?></td>
                 <td>-</td>
                 <td>-</td>
                 <td>-</td>
                 <td>-</td>
                 <td>-</td>
             </tr>
 <?php
             }
 
             $i++;
         }
     } else {
 ?>
             <tr>
                 <td colspan="8" align="center">** ไม่ปรากฏรายการในฐานข้อมูล **</td>
             </tr>
 <?php
     }
 ?>
         </table></td>
     </tr>
     <tr valign="bottom">
         <td align="center" colspan="3" height="88"><hr color="#000000" noshade></td>
     </tr>
     <tr valign="top">
         <td colspan="2"><font size="2">วันที่พิมพ์ : <?php echo date('d-m-y h:m');?></font></td>
         <td align="right"><font size="2">หน้า 1/1</font></td>
     </tr>
 </table>
  |