Viewing file:      v_addBackRegistAndSendGrade.php (9.54 KB)      -rwxr-xr-x Select action/file-type:    (+) |   (+) |   (+) | Code (+) | Session (+) |   (+) | SDB (+) |   (+) |   (+) |   (+) |   (+) |   (+) |
 
<?php
 $row_std = (isset($qu_std) && $qu_std!=NULL) ? $qu_std->row() : NULL;
 $row_ssm = (isset($qu_ssm) && $qu_ssm!=NULL) ? $qu_ssm->row() : NULL;
 $row_sy = (isset($qu_sy) && $qu_sy!=NULL) ? $qu_sy->row() : NULL;
 $row_tm = (isset($qu_tm) && $qu_tm!=NULL) ? $qu_tm->row() : NULL;
 ?>
 <script language="JavaScript1.2">
 function checkGrd() {
     cnt = document.getElementById('cnt').value;
 
     for(i=0; i<cnt; i++) {
         if(document.getElementById('chk'+i).checked==true) {
             if(document.getElementById('grdId'+i).value=='') {
                 alert('กรุณาเลือกเกรด !');
                 document.getElementById('grdId'+i).focus();
                 return false;
             }
         }
     }
 
     if(confirm("กรุณาตรวจสอบข้อมูลให้เรียบร้อยก่อนบันทึก !!"))
         return true;
     else
         return false;
 }
 </script>
 <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
     <tr>
         <td>
             <div align="center">
             <?php echo form_open($this->config->item("rg_folder")."grade/processBackRegistAndSendGrade", array("name" => "myform", "id" => "myform"));?>
             <table width="100%" align="center" cellpadding="0" cellspacing="1" border="0">
 <?php
             if(!is_null($row_std)) {
 ?>
                 <tr>
                     <td><table class="szone">
                         <tr bgcolor="<?php echo $tr_color_even;?>">
                             <td class="coltd_szone">รหัสนักศึกษา</td>
                             <td><font size="2"><?php echo setValue('stdCode',$row_std);?></font>
                             <input type="hidden" name="stdId" id="stdId" value="<?php echo setValue('stdId',$row_std);?>">
                             <input type="hidden" name="stdCode" id="stdCode" value="<?php echo setValue('stdCode',$row_std);?>" /></td>
                             <td class="coltd_szone">ชื่อ-นามสกุล</td>
                             <td><font size="2"><?php echo setValue('prefixName',$row_std).setValue('stdName',$row_std).' '.setValue('stdSurname',$row_std);?></font></td>
                         </tr>
                         <tr bgcolor="<?php echo $tr_color_even;?>">
                             <td class="coltd_szone">หลักสูตร</td>
                             <td colspan="3"><font size="2"><?php echo setValue('curName',$row_std);?></font>
                             <input type="hidden" name="curId" id="curId" value="<?php echo setValue('curId',$row_std);?>"></td>
                         </tr>
                         <tr bgcolor="<?php echo $tr_color_even;?>">
                             <td class="coltd_szone">ชั้นปี</td>
                             <td><font size="2" color="<?php echo $this->config->item('rg_font_color_err');?>"><b><?php echo setValue('syCode',$row_std);?></b></font></td>
                             <td class="coltd_szone">ชั้นปีที่ลงทะเบียน</td>
                             <td><font size="2" color="<?php echo $this->config->item("rg_font_color_err");?>"><b><?php echo setValue('syCode',$row_sy);?></b></font>
                             <input type="hidden" name="syId" id="syId" value="<?php echo setValue('syId',$row_sy);?>"></td>
                         </tr>
                         <tr bgcolor="<?php echo $tr_color_even;?>">
                             <td class="coltd_szone">ปีการศึกษาที่ลงทะเบียน</td>
                             <td><font size="2"><?php echo $acY;?></font>
                             <input type="hidden" name="acY" id="acY" value="<?php echo $acY;?>"></td>
                             <td class="coltd_szone">ภาคการศึกษาที่ลงทะเบียน</td>
                             <td><font size="2"><?php echo setValue('tmCode',$row_tm);?></font>
                             <input type="hidden" name="tmId" id="tmId" value="<?php echo setValue('tmId',$row_tm);?>"></td>
                         </tr>
                         <tr bgcolor="<?php echo $tr_color_even;?>">
                             <td class="coltd_szone">GPA</td>
                             <td><font size="2"><?php echo number_format(setValue('ssmGPA',$row_ssm),2);?></font></td>
                             <td class="coltd_szone">GPAX</td>
                             <td><font size="2"><?php echo number_format(setValue('ssmGPAX',$row_ssm),2);?></font></td>
                         </tr>
                         <tr>
                             <td colspan="4"><br /></td>
                         </tr>
 <?php
                         if(setValue('syCode',$row_sy) > setValue('syCode',$row_std)) {
 ?>
                         <tr>
                             <td colspan="4" align="center"><span class="h error"><b>** ต้องทำการเลื่อนชั้นปีนักศึกษาก่อน **</b></span></td>
                         </tr>
                         <tr>
                             <td colspan="4">
                             <input type="button" name="cancel" value="ย้อนกลับ" onClick="location.href = '<?php echo site_url($this->config->item('rg_folder')."grade/showBackRegistAndSendGrade");?>'"></td>
                         </tr>
 <?php
                         }
 ?>
                     </table></td>
                 </tr>
 <?php
                 if(!(setValue('syCode',$row_sy) > setValue('syCode',$row_std))) {
 ?>
                 <tr>
                     <td colspan="4"><table class="headCol">
                         <tr>
                             <th class="seqCol"><font size="2" color="<?php echo $font_color_table;?>">เลือก</font></td>
                             <th class="amtCol"><font size="2" color="<?php echo $font_color_table;?>">รหัสรายวิชา</font></td>
                             <th><font size="2" color="<?php echo $font_color_table;?>">รายวิชา</font></td>
                             <th class="amtCol"><font size="2" color="<?php echo $font_color_table;?>">หน่วยกิต</font></td>
                             <th class="amtCol"><font size="2" color="<?php echo $font_color_table;?>">กลุ่มเรียน</font></td>
                             <th class="amtCol"><font size="2" color="<?php echo $font_color_table;?>">เกรด</font></td>
                         </tr>
 <?php
                 $i = 0;
                 if(isset($arr) && count($arr)) {
                     foreach($arr as $key => $val) {
                         echo "<tr onmouseover=\"bgColor='".$tr_color_even."'\" onmouseout=\"bgColor='".$this->config->item("rg_mouseout")."'\">";
 ?>
                             <td align="center"><input type="checkbox" name="chk<?php echo $i;?>" id="chk<?php echo $i;?>" value="Y" <?php echo ($arr[$key]['rd']->num_rows()) ? 'checked' : '';?>>
                             <input type="hidden" name="coId<?php echo $i;?>" id="coId<?php echo $i;?>" value="<?php echo $arr[$key]['co']->coId;?>"></td>
                             <td class="indent"><font size="2" ><?php echo $arr[$key]['co']->crsCode;?></font></td>
                             <td class="indent"><font size="2" ><?php echo explodeSquare($arr[$key]['co']->crsName);?></font>
                             <input type="hidden" name="creditAttempt<?php echo $i;?>" id="creditAttempt<?php echo $i;?>" value="<?php echo $arr[$key]['co']->crsCreditTotal;?>">
                             <input type="hidden" name="credit1<?php echo $i;?>" id="credit1<?php echo $i;?>" value="<?php echo $arr[$key]['co']->crsCredit1;?>">
                             <input type="hidden" name="credit2<?php echo $i;?>" id="credit2<?php echo $i;?>" value="<?php echo $arr[$key]['co']->crsCredit2;?>">
                             <input type="hidden" name="cdId1<?php echo $i;?>" id="cdId1<?php echo $i;?>" value="<?php echo $arr[$key]['co']->coCdId1;?>">
                             <input type="hidden" name="cdId2<?php echo $i;?>" id="cdId2<?php echo $i;?>" value="<?php echo $arr[$key]['co']->coCdId2;?>"></td>
                             <td align="center"><font size="2"><?php echo $arr[$key]['co']->crsUnit;?></font></td>
                             <td align="center"><font size="2"><?php echo $arr[$key]['co']->coSection;?></font>
                             <input type="hidden" name="coSection<?php echo $i;?>" id="coSection<?php echo $i;?>" value="<?php echo $arr[$key]['co']->coSection;?>"></td>
                             <td align="center">
 <?php
                             $row_rd = ($arr[$key]['rd']->num_rows()) ? $arr[$key]['rd']->row() : NULL;
                             $js = "id='rdGrade".$i."'";
                             echo form_dropdown('rdGrade'.$i, $rs_grd, set_value('rdGrade'.$i,setValue('rdGrade',$row_rd), $js));
 ?>
                             <span class="error"><?php echo form_error('rdGrade'.$i);?></span></td>
 <?php
                         $i++;
                     }
                 } else {
 ?>
                         </tr>
                         <tr>
                             <td colspan="6" align="center"><font size="2" color="<?php echo $font_color_err;?>">** ไม่ปรากฏรายวิชาที่เปิดสอนในฐานข้อมูล **</font></td>
                         </tr>
 <?php
                 }
 ?>
                         <tr>
                             <th colspan="3" align="right"><font size="2" color="<?php echo $font_color_table;?>"><b>รวมหน่วยกิต</b></font></th>
                             <th align="center"><font size="2" color="<?php echo $font_color_table;?>"><?php echo number_format($creditAttempt, 0);?></font></th>
                             <th colspan="2"></th>
                         </tr>
                     </table></td>
                 </tr>
                 <tr>
                     <td colspan="4"><input type="button" name="selectAll" value="เลือกทั้งหมด" onClick="doCheckAll(this.form, true);">
                     <input type="button" name="cancelAll" value="ยกเลิกทั้งหมด" onClick="doCheckAll(this.form, false);"></td>
                 </tr>
                 <tr>
                     <td colspan="4" align="center"><br><input type="submit" name="add" value="บันทึก" <?php if($i == 0) echo 'disabled';?> />
                     <input type="reset" name="clear" value="เคลียร์ข้อมูล">
                     <input type="hidden" name="cnt" id="cnt" value="<?php echo $i;?>"></td>
                 </tr>
 <?php
                 }
             } else {
                 if(isset($std) && $std->num_rows()) {
                     $std = $std->row();
 ?>
                 <tr>
                     <td height="22" colspan="4" align="center"><br><font size="2" color="<?php echo $font_color_err;?>"><?php echo setValue('pfName',$std).setValue('stdName',$std).' '.setValue('stdSurname',$std).' '.setValue('sstName',$std);?></font></td>
                 </tr>
 <?php
                 } else {
 ?>
                 <tr>
                     <td height="22" colspan="4" align="center"><br><font size="3" color="<?php echo $font_color_err;?>"><b>** ไม่ปรากฏรหัสนักศึกษาดังกล่าวในฐานข้อมูล **<br>กรุณาตรวจสอบข้อมูลอีกครั้ง
                     <a href="<?php echo site_url($this->config->item('rg_folder')."grade/showBackRegistAndSendGrade");?>">คลิกที่นี่</a></b></font></td>
                 </tr>
 <?php
                 }
             }
 ?>
             </table><?php echo form_close();?></div>
         <br></td>
     </tr>
 </table>
 
  |