Viewing file: v_addCourseOpenFor.php (5.23 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<script language="javascript">
function chkSelect(){
var flag = true;
var obj;
jQuery(":checkbox[name^='order']").each(function(index){
if(jQuery(this).attr("checked") == true)
{
var index_name = jQuery(this).attr("name");
index_name = index_name.substr(index_name.length-2,1);
if(jQuery(":text[name='cofSeats\["+index_name+"\]']").val() == '')
{
if(flag ==1)
obj = jQuery(":text[name='cofSeats\["+index_name+"\]']");
flag= false;
}
}
});
if(!flag)
{
alert("กรุณากรอกจำนวนที่นั่งที่เปิดรับ !");
obj.focus();
}
return flag;
}
</script>
<?php
$row_co = isset($qu_co) ? $qu_co->row() : NULL;
?>
<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")."preregis/cof_insert", array("name" => "myform", "id" => "myform"));?>
<table width="100%" align="center" cellpadding="0" cellspacing="1" border="0">
<tr>
<td align="center"><span class="h" style="color:<?php echo $font_color_err;?>">บันทึกหลักสูตร</span></td>
</tr>
<tr>
<td><br /></td>
</tr>
<tr>
<td><table class="szone">
<tr bgcolor="<?php echo $tr_color_even;?>">
<td class="coltd_szone"><span><b>รายวิชา</b></span></td>
<td><span><?php echo getval('crsCode', $row_co).' '.getval('crsName', $row_co);?></span>
<input type="hidden" name="coId" value="<?php echo $coId;?>" /></td>
<td class="coltd_szone"><span><b>กลุ่ม</b></span></td>
<td><span><?php echo getval('coSection', $row_co);?></span></td>
</tr>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td class="coltd_szone"><span><b>หน่วยกิต</b></span></td>
<td><span><?php echo getval('crsUnit', $row_co);?></span></td>
<td class="coltd_szone"><span><b>ภาค/ปีการศึกษา</b></span></td>
<td><span><?php echo getval('coTmId', $row_co).'/'.getval('coAcY', $row_co);?></span>
<input type="hidden" name="tmId" value="<?php echo getval('coTmId', $row_co);?>" />
<input type="hidden" name="acY" value="<?php echo getval('coAcY', $row_co);?>" /></td>
</tr>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td class="coltd_szone"><span><b>อาจารย์ผู้สอน</b></span></td>
<td colspan="3"><span><?php echo $prsNames;?></span></td>
</tr>
</table></td>
</tr>
<tr>
<td><br /></td>
</tr>
<tr>
<td><table class="headCol">
<tr>
<th class="seqCol"><span>เลือก</span></th>
<th><span>ชื่อหลักสูตร</span></th>
<th class="domCol"><span>จำนวนที่นั่งที่เปิดรับ</span></th>
<th class="stdCodeCol"><span>จัดกลุ่ม (คน)</span></th>
</tr>
<?php
$num_rows = count($rs);
if ($num_rows) {
foreach ($rs as $key => $val) {
$row_cur = isset($rs[$key]['qu_cur']) ? $rs[$key]['qu_cur']->row() : NULL;
$row_cof = isset($rs[$key]['qu_cof']) ? $rs[$key]['qu_cof']->row() : NULL;
$res = $rs[$key]['qu_cof']->num_rows();
echo "<tr onmouseover=\"bgColor='".$tr_color_even."'\" onmouseout=\"bgColor='".$this->config->item("rg_mouseout")."'\">";
?>
<td align="center"><input type="checkbox" name="order[<?php echo $key;?>]" value="Y" <?php echo ($res) ? 'checked' : '';?> /></td>
<td class="indent"><span><?php echo explodeSquare(getval('curName', $row_cur));?></span>
<input type="hidden" name="curId[<?php echo $key;?>]" value="<?php echo getval('curId', $row_cur);?>"></td>
<td align="center"><input type="text" name="cofSeats[<?php echo $key;?>]" value="<?php echo ($res) ? getval('cofSeats', $row_cof) : '';?>" size="2" maxlength="3" class="required-int" /><span class="error"></span></td>
<td align="center"><span><b>
<?php
if ($res) {
?>
<span class="hand" onClick="sendPost('hidform', {'cosCoId':<?php echo $coId;?>,'curId':<?php echo getval('curId', $row_cur);?>}, '<?php echo site_url($this->config->item('rg_folder').'popup/cos_input');?>', {})"><?php echo $rs[$key]['cntStd'];?></span>
<?php
} else {
echo '-';
}
?>
</b></span></td>
</tr>
<?php
} // end foreach
} else {
?>
<tr>
<td align="center" colspan="4"><span style="color:<?php echo $font_color_err;?>">** ไม่ปรากฏรายชื่อหลักสูตร **</span></td>
</tr>
<?php
}
?>
</table></td>
</tr>
<tr>
<td><br /></td>
</tr>
<tr>
<td align="center">
<input type="submit" name="edit" value="บันทึก" onClick="return chkSelect()" <?php echo ($num_rows) ? '' : 'disabled';?> />
<input type="reset" name="clear" value="เคลียร์ข้อมูล" />
<input type="hidden" name="method" value="add" />
<input type="hidden" name="cnt" value="<?php echo $num_rows;?>" /></td>
</tr>
</table><?php echo form_close();?></div>
<br></td>
</tr>
</table>
|