Viewing file: v_addStudyPlan.php (4.67 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php if($qu_cur->num_rows()>0) { $row = $qu_cur->row(); $curId = $row->curId; $curName = $row->curName; }
if($qu_sy->num_rows()>0) { $row = $qu_sy->row(); $syId = $row->syId; $syCode = $row->syCode; }
if($qu_tm->num_rows()>0) { $row = $qu_tm->row(); $tmId = $row->tmId; $tmCode = $row->tmCode; }
$cpub_row = ($cpub->num_rows()) ? $cpub->row() : NULL; ?> <script> // function karn function delStdPlan(value, url, id,unit){ if(confirm("คุณต้องการลบใช่หรือไม่") == true){ var strdata = "ran="+Math.random(); $.each(value,function(index,value){ strdata += "&"+index+"="+value; }); var ptotal = parseInt($("#total").text()); $.ajax({ type: "POST", url: url, data: strdata, async: false, success: function(res){ if(res.length>0){ $("#"+id).remove(); $("#total").text(ptotal-unit); } } }); } } </script> <table width="100%" class="szone"> <tr> <td colspan="2" align="center"><span class="h error">บันทึก/แก้ไขโปรแกรมการศึกษา</span><br><br></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_szone">หลักสูตร</td> <td><?php echo $curName;?> <input type="hidden" name="spCurId" id="spCurId" value="<?php echo (set_value('spCurId')=="") ? $curId : set_value('spCurId');?>" /></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_szone">ชั้นปีที่</td> <td><?php echo $syCode;?> <input type="hidden" name="spSyId" id="spSyId" value="<?php echo (set_value('spSyId')=="") ? $syId : set_value('spSyId');?>" /></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_szone">ภาคการศึกษา</td> <td><?php echo $tmCode;?> <input type="hidden" name="spTmId" id="spTmId" value="<?php echo (set_value('spTmId')=="") ? $tmId : set_value('spTmId');?>" /></td> </tr> <tr> <td colspan="2" height="22"></td> </tr> <tr> <td colspan="2"><table class="headCol"> <tr> <th lass="stdCodeCol">รหัสรายวิชา</th> <th>ชื่อรายวิชา</th> <th>หน่วยกิต</th> <th class="deleteCol">ลบ</th> </tr> <?php $sumCreditTotal = 0; $i = 0; foreach($rs_cs->result() as $row_cs) { ?> <tr bgcolor="<?php echo $tr_color_even;?>"> <td colspan="2"><b><?php echo $row_cs->cdName." (".$row_cs->csCreditTotal." หน่วยกิต)";?></b></td> <td align="right"> <?php // เปลี่ยน Controller //$lnk = anchor_popup($this->config->item("rg_folder")."curpbri/pcr_popup/$curId/$syId/$tmId/$row_cs->csCdId1", "<input type=\"button\" name=\"addOrder[$i]\" value=\"+\" />", array("width" => "500", "height" => "500")); $lnk = "<span class=\"hand\" onClick=\"sendPost('hidform5', {'curId':$curId,'syId':$syId,'tmId':$tmId,'csCdId1':$row_cs->csCdId1}, '".site_url($this->config->item("rg_folder")."curpbri/pcr_popup")."',{'width':500,'height':500,'scrollbars':1})\"><input type=\"button\" name=\"addOrder[$i]\" value=\"+\" /></span>"; echo $lnk; //echo $oU->CRUD($lnk, 'C'); ?> </td> <td></td> </tr> <?php foreach($rs_sp[$row_cs->csCdId1]->result() as $row_sp) { $sumCreditTotal += $row_sp->crsCreditTotal; ?> <tr id="<?php echo $row_sp->crsId;?>"> <td align="center"><?php echo $row_sp->crsCode;?></td> <td class="indent"><?php echo explodeSquare($row_sp->crsName);?></td> <td align="center"><?php echo $row_sp->crsUnit;?></td> <td align="center"> <?php if (getval('cpubPublic', $cpub_row) == 'Y') { $lnk = "<span><img src=\"".base_url().$this->config->item("rg_deleted")."\" width=\"16\" height=\"19\" align=\"absmiddle\" border=\"0\" /></span>"; echo $lnk; } else { $lnk = "<span class=\"hand\" onClick=\"delStdPlan({'curId':$row_sp->spCurId,'syId':$row_sp->spSyId,'tmId':$row_sp->spTmId,'spCrsId':$row_sp->spCrsId}, '".site_url($this->config->item("rg_folder")."curpbri/sp_delete")."','".$row_sp->crsId."','".$row_sp->crsCreditTotal."')\"><img src=\"".base_url().$this->config->item("rg_delete")."\" width=\"16\" height=\"19\" align=\"absmiddle\" border=\"0\" /></span>"; echo $lnk; } //echo $oU->CRUD($lnk, 'D'); ?> </td> </tr> <?php } $i++; } ?> <tr> <th colspan="2">รวมหน่วยกิต</th> <td align="center"><font size="2" id="total"><?php echo $sumCreditTotal;?></font></td> <td></td> </tr> </table></td> </tr> </table>
|