Viewing file: v_showTimeTableSt.php (5.7 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_sy = (isset($qu_sy) && $qu_sy!=NULL) ? $qu_sy->row() : NULL; ?> <script language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" ></script> <script language="javascript" > $(document).ready(function(){ get_option(); timeTable(); getExam(); }); function timeTable(){ /*if(!/^[0-9][0-9]*.?[0-9]*$/.test($("#AcY option:selected").val())){ $(".mark").hide(); return false }else{*/ var url = "<?=site_url()."/".$this->config->item('rg_folder')?>"+"timetable2/timeTable"; $.ajax({ url: url, global: false, type: "POST", data: { tbtmcAcY : $("#AcY option:selected").val() , tbwdAcYWeekNo : $("#tbwdAcYWeekNo option:selected").val() , stdId : $("#stdId").val() , view : 'st', lnk : 'no', ran : Math.random() }, async:false, dataType: 'json',//"html", success: function(data) { $("#tt").html(data.timetable); $("#tbnsd").html(data.tbnsd); } }); //} } function getExam(){ var url = "<?=site_url()."/".$this->config->item('rg_folder')?>"+"timetable2/getExam"; $.ajax({ url: url, global: false, type: "POST", data: { tbtmcAcY : $("#AcY option:selected").val() , stdId : $("#stdId").val() , ran : Math.random() }, async:false, dataType: 'json',//"html", success: function(data) { $("#tbexam").html(data.tbexam); } }); } function get_option(){ var url = "<?=site_url()."/".$this->config->item('rg_folder')?>"+"timetable/get_option"; $.ajax({ url: url, global: false, type: "POST", data: { tmcAcY : $("#AcY option:selected").val() , ran : Math.random() }, dataType: 'json',//"html", async: false, success: function(json) { //alert("success"+data); if (json.error) alert(json.html); else{ /* alert(json.tt); */ //karn $('#tbwd').html(json.tbwd2); } } }); } function changeWeek(oprator){ if(oprator=="+"){ if(parseInt($("#tbwdAcYWeekNo").val())!=52){ $("#tbwdAcYWeekNo").val(parseInt($("#tbwdAcYWeekNo").val())+1); timeTable(); } }else{ $("#tbwdAcYWeekNo").val(parseInt($("#tbwdAcYWeekNo").val())-1); timeTable(); } } </script> <table width="100%"> <tr> <td> <label><div align="center"><br> <table width="100%" class="szone"> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_szone2">รหัสนักศึกษา</td> <td><?php echo setValue('stdCode',$row_std);?><input type="hidden" name="stdId" id="stdId" value="<?echo setValue('stdId',$row_std);?>"></td> <?php if(setValue('sdtPicturePath',$row_std) == '') $image = base_url().$this->config->item('rg_pictureStd').'photo.jpg'; else $image = base_url().$this->config->item('rg_pictureStd').setValue('sdtPicturePath',$row_std); ?> <td rowspan="5" align="center" valign="middel"><img src="<?php echo $image;?>" align="absmiddle" border="1" width="100" height="115"></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_szone2">ชื่อ-นามสกุลนักศึกษา</td> <td><?php echo setValue('prefixName ',$row_std).setValue('stdName',$row_std).' '.setValue('stdSurname',$row_std);?></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_szone2">หลักสูตร</td> <td><?php echo setValue('curName',$row_std);?></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_szone2">ระดับการศึกษา</td> <td><?php echo setValue('levelName',$row_std);?></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_szone2">ชั้นปีที่</td> <td><?php echo setValue('syCode',$row_sy);?></td> </tr> </table> <form name="pc" method="post"> <table width="100%"> <tr> <td><span class="h error">ตารางสอน</span> ปีการศึกษา <? $attr = 'id="AcY" onChange="get_option();timeTable();getExam();"'; echo form_dropdown('AcY',$AcY,$this->session->userdata('acY'),$attr);?></td> <td align="right"><div class="w"><a href="javascript:void(0)" onClick="changeWeek('-')">สัปดาห์ก่อน</a> <b>สัปดาห์ที่</b> <span id='tbwd' ></span> <a href="javascript:void(0)" onClick="changeWeek('+')">สัปดาห์ถัดไป</a></div></td> </tr> <tr> <td colspan="2"><hr size=1></td> </tr> </table> </form> <?php /////////////////////////////// // show schedule by room, teacher, curr /////////////////////////////// ?> <table cellpadding="0" cellspacing="0"> <tr> <td><div id="tt"></div></td> </tr> <tr> <td><table class="mark"> <tr bgcolor="#FFFFFF"> <td class="coltd_mark" ><span class="error"><b>หมายเหตุ :</b></span></td> <td><span class="error">สีเทา = ห้อง วัน เวลาเรียน ไม่ซ้ำกัน, สีชมพู = ห้อง วัน เวลาเรียน ซ้ำกัน, สีเขียว = วันที่ไม่ให้จัดการเรียนการสอน</span></td> </tr> <tr> <td></td> <td><span id="tbnsd"></span></td> </tr> </table></td> </tr> </table> <div id="tbexam"></div> </div></label> <br></td> </tr> </table>
|