สอบถามเกี่ยวกับการซ่อน URL บน Address bar ครับ ด้านในเลยครับ
Code (PHP)
<? include "menu_admin.php"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<?php require_once('Connections/connect_teacher.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_connect_teacher, $connect_teacher);
$query_sub = "SELECT teacher_ID, teacher_name FROM teacher ORDER BY teacher_ID ASC";
$sub = mysql_query($query_sub, $connect_teacher) or die(mysql_error());
$row_sub = mysql_fetch_assoc($sub);
$totalRows_sub = mysql_num_rows($sub);
?>
<body>
<form name="form1" method="post" action="sc4_save.php">
<p>
<?
echo $type_sub = $_POST['type_sub'];
@session_start();
$_SESSION['s_type_sub'] = $type_sub;
$sql = "select * from courses where tus LIKE '%N%' ";
$query = mysql_query($sql);
$rows = mysql_num_rows($query); ?>
</p>
<p> </p>
<p></p>
<p> </p>
<table width="1222" border="0">
<tr>
<td width="290" align="right"> </td>
<td width="288">
<label for="year1"> </label></td>
<td width="301" align="right">ปีการศึกษา
<input type="text" name="year_sch" id="year_sch" value = "<? echo $_SESSION['s_year']; ?>"/>
<label for="schedule_ID2"></label></td>
<td width="209">เทอมที่
<input type="text" name="term" id="term" value = "<? echo $_SESSION['s_semester1']; ?>"/></td>
<td width="112"> </td>
</tr>
<tr align="center"><td> <input name="date_open" type="hidden" id="date_open" value="open">
รหัสวิชา :
<label for="subject_ID"></label>
<select name="subject_ID" id="subject_ID" onchange="resutName0(this.value);">
<option value="0">- เลือกรหัสวิชา -</option>
<?php
for($i=0;$i<$rows;$i++){
$data = mysql_fetch_array($query);
//$open =$data['open_teach'];
//$term =$data['semester'];
// $year_sch = $data['at_year'];
?>
<option value="<?php echo $data['subject_ID']?>" ><?php echo $data['subject_ID']?></option>
<? } ?>
</select>
<script language="JavaScript">
// select day
function resutName0(CusID0)
{
switch(CusID0)
{
<?php
$strSQL0 = "SELECT * FROM courses ORDER BY course_ID ASC";
$objQuery0 = mysql_query($strSQL0);
while($objResult0 = mysql_fetch_array($objQuery0))
{
?>
case "<?php echo $objResult0["subject_ID"];?>":
form1.subject.value = "<?php echo $objResult0["subject_ID"];?>";
break;
<?php
}
?>
default:
form1.subject.value = "";
}
}
</script>
</td>
<td><label for="teacher_ID"></label>
รหัสอาจารย์ :
<select name="teacher_ID" id="teacher_ID" onchange="resutName(this.value);">
<option value="" <?php if (!(strcmp("", $row_sub['']))) {echo "selected=\"selected\"";} ?>>-เลือกรหัสอาจารย์-</option>
<?php
do {
?>
<option value="<?php echo $row_sub['teacher_ID']?>"<?php if (!(strcmp($row_sub['teacher_name'], $row_sub['']))) {echo "selected=\"selected\"";} ?>><?php echo $row_sub['teacher_ID']?></option>
<?php
} while ($row_sub = mysql_fetch_assoc($sub));
$rows = mysql_num_rows($sub);
if($rows > 0) {
mysql_data_seek($sub, 0);
$row_sub = mysql_fetch_assoc($sub);
}
?>
</select><script language="JavaScript">
// select teacher
function resutName(CusID)
{
switch(CusID)
{
<?php
$strSQL = "SELECT * FROM teacher ORDER BY teacher_ID ASC";
$objQuery = mysql_query($strSQL);
while($objResult = mysql_fetch_array($objQuery))
{
?>
case "<?php echo $objResult["teacher_ID"];?>":
form1.teacher.value = "<?php echo $objResult["teacher_ID"];?>";
break;
<?php
}
?>
default:
form1.teacher.value = "";
}
}
</script>
</td>
<td>
<div align="center"><strong></strong>วัน:
<select name="day_ID" id="day_ID" onchange="resutName1(this.value);">
<option value="">-เลือกวัน-</option>
</select>
</div>
<script language="JavaScript">
// select day
function resutName1(CusID1)
{
switch(CusID1)
{
<?php
$strSQL1 = "SELECT * FROM day_t ORDER BY day_ID ASC";
$objQuery1 = mysql_query($strSQL1);
while($objResult1 = mysql_fetch_array($objQuery1))
{
?>
case "<?php echo $objResult1["day_ID"];?>":
form1.day1.value = "<?php echo $objResult1["day_free"];?>";
break;
<?php
}
?>
default:
form1.day1.value = "";
}
}
</script>
</td>
<td>เวลา :
<select name="time_teach" id="time_teach" onchange="resutName2(this.value);" >
<option value="">-เลือกเวลา-</option>
</select>
<script language="JavaScript">
// select time
function resutName2(CusID2)
{
switch(CusID2)
{
<?php
$strSQL1 = "SELECT * FROM time_t ORDER BY time_ID ASC";
$objQuery1 = mysql_query($strSQL1);
while($objResult1 = mysql_fetch_array($objQuery1))
{
?>
case "<?php echo $objResult1["time_ID"];?>":
form1.time1.value = "<?php echo $objResult1["time_free"];?>";
break;
<?php
}
?>
default:
form1.time1.value = "";
}
}
</script>
</td>
<td> </td>
</tr>
<tr align="center">
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr align="center">
<td>รหัสวิชาที่เลือก</td>
<td>รหัสอาจารย์ที่เลือก</td>
<td>วันที่เลือก</td>
<td>เวลาที่เลือก</td>
<td> </td>
</tr>
<tr align="center">
<td><label for="subject"></label>
<input name="subject" type="text" id="subject" readonly><div id="status"></div></td>
<td><label for="teacher"></label> <input name="teacher" type="text" id="teacher" readonly></td>
<td><label for="day1"></label> <input name="day1" type="text" id="day1" readonly></td>
<td><label for="time1"></label>
<input name="time1" type="text" id="time1" readonly><div id="status"></td>
<td><input type="submit" name="Submit" id="Submit" value="บันทึกข้อมูล"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td></td>
<td><input name="tus" type="hidden" id="tus" value="N"></td>
<td align="left"> </td>
<td> </td>
<td> </td>
</tr>
</table>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
// ส่งค่าไปทำงานอีกหน้า เพื่อเลือก list box
$("select#subject_ID").change (function()
{
$.get("sc3.php",{
subject_ID:$(this).val(),
},function(data){
$("select#teacher_ID").html(data);
});
});
});
</script><br />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
// ส่งค่าไปทำงานอีกหน้า เพื่อเลือก list box
$("select#teacher_ID").change (function()
{
$.get("sc3.php",{
teacher_ID:$(this).val(),
},function(data){
$("select#day_ID").html(data);
});
});
});
</script>
<span class="mylabel"></span><br />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
// ส่งค่าไปทำงานอีกหน้า เพื่อเลือก list box
$("select#day_ID").change (function()
{
$.get("sc3.php",{
day_ID:$(this).val(),
},function(data){
$("select#time_teach").html(data);
});
});
});
</script>
<table width="1080" border="0" align="center">
<tr>
<td colspan="10" align="right"><a href="schedule5_show.php">ดูรายละเอียดตารางสอน</a></td>
</tr>
<tr>
<td colspan="11" align="center">ตารางสอน</td>
</tr>
<tr bgcolor="#8DDCFB">
<td width="40" align="center" bgcolor="#8DDCFB">รหัส</td>
<td width="68" align="center">รหัสวิชา</td>
<td width="103" align="center">รหัสอาจารย์</td>
<td width="62" align="center">วัน</td>
<td width="93" align="center">เวลา</td>
<td width="73" align="center">สถานะ</td>
<td width="97" align="center">ปีการศึกษา</td>
<td width="84" align="center">เทอม</td>
<td width="68"><div align="center">แก้ไข</div></td>
<td width="190" align="center">จำนวนที่สมัคร</td>
<td width="101"> <div align="center">ห้อง</div> </td>
</tr>
<tr>
<?php
$sql_sc = " select *,s.room_ID as show_room,s.tus as status from schedule s,courses c where c.subject_ID = s.subject_ID group by s.schedule_ID ASC ";
$query_sc = mysql_query($sql_sc);
// $rows_sc= mysql_num_rows($query_sc);
//for($i=0;$i<$rows_sc;$i++){
while($data_sc = @mysql_fetch_array($query_sc)) {
?>
<td><div align="center"><? echo $data_sc['schedule_ID'] ?></div></td>
<td><div align="center"><? echo $data_sc['subject_ID'] ?></div></td>
<td><div align="center"><? echo $data_sc['teacher_ID'] ?></div></td>
<td><div align="center"><? echo $data_sc['day_teach'] ?></div></td>
<td><div align="center"><? echo $data_sc['time_teach'] ?></div></td>
<td><div align="center"><? echo $data_sc['date_open'] ?></div></td>
<td><div align="center"><? echo $data_sc['year_sch'] ?></div></td>
<td><div align="center"><? echo $data_sc['term'] ?></div></td>
<td align="center"><a href="sc6_edit.php?id=<?php echo $data_sc['schedule_ID'];?>">เลือก</a></td>
<td>
<div align="center"><? echo $data_sc['now'] ?></div>
</td>
<td align="center">
<?php
if($data_sc['status'] == "N"){
echo "<a href='sc_management.php?id=".$data_sc["schedule_ID"]."'>จัดการ</a>";
}else{
echo $data_sc["show_room"];
}
?>
</td>
</tr>
<? } ?>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td align="center"> </td>
<td align="center"> </td>
<td align="center"> </td>
<td align="center"> </td>
<td align="center"> </td>
<td align="center"> </td>
</tr>
</table> <a href="schedule5.show.php"></a></td>
</form>
</body>
</html>
<? include "footer.php"; ?>
ประวัติการแก้ไข 2015-07-07 21:33:04
Date :
2015-07-07 21:17:46
By :
nuraly
Load balance : Server 01