PHP -- ต้องการเลือก dropdown แล้วรีเฟส แต่ข้อมูลที่เราดึงมาแสดงด้วย ไม่แสดง
PHP -- ต้องการเลือก dropdown แล้วรีเฟส แต่ข้อมูลที่เราดึงมาแสดงด้วย ไม่แสดง
หน้าแรกเลือกที่ข้อมูลนักเรียนที่ต้องการ กดปุ่ม Score
จะส่งค่าเลขที่นักเรียนที่เลือก
แล้วจะเลือกปีกศึกษา แต่ข้อมูลรหัสนักเรียนก็หาย
growdata_student.php
<?php
session_start();
?>
<!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>
<?php
/*header('Content-Type: text/html; charset=utf-8');*/
/*mysql_connect("localhost","root","12345678");
mysql_select_db("pookpanya");*/
include ("config.php");
$strSQL = "SELECT * FROM member_teacher WHERE UserID_teacher = '".$_SESSION['UserID_admin']."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Plookpanya School -- ระบบสารสนเทศนักเรียน</title>
<!-- load stylesheets -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!--[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment */
.twoColHybLtHdr #sidebar1 { padding-top: 30px; }
.twoColHybLtHdr #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it may need to avoid several bugs */
</style>
<![endif]--></head>
<body class="twoColHybLtHdr">
<div id="container">
<div id="header">
<h1 class="style1"><!-- end #header -->
</h1>
</div>
<div id="sidebar1">
<h3 align="center" class="style9">WELCOME!!</h3>
<table width="235">
<tr>
<td width="185" height="20"><div align="center"><img src="icon/user.png" width="150" height="150" /></div></td>
</tr>
<tr>
<td width="185" height="20"><div align="left"><span class="style5"> User ID : <?php echo $objResult["UserID_teacher"];?></span></div></td>
</tr>
<tr>
<td><div align="left"><span class="style7"> Name : <?php echo $objResult["TeacherName"];?></span></div></td>
</tr>
<tr>
<td><div align="left"><span class="style7"> Status : <?php echo "คุณครู"?></span></div></td>
</tr>
</table>
<table width="222" height="41">
<tr>
<td width="214">
<p align="center"><a href="logout.php"><img src="icon/btnlogout_2.png" width="150" height="60"
onmouseover="this.src='icon/btnlogout_3.png';"
onmouseout="this.src='icon/btnlogout_2.png';"/></a>
</p>
</td>
</tr>
</table>
<br />
<table width="238">
<tr>
<td width="230">
<p> <a href="teacher_page.php"><img src="icon/btnmenu.png" width="200" height="60" onMouseOver="this.src='icon/btnmenu_1.png';"
onmouseout="this.src='icon/btnmenu.png';"/></a>
<a href="teacher_page.php"><img src="icon/btnreport.png" width="200" height="60" onmouseover="this.src='icon/btnreport_1.png';"
onmouseout="this.src='icon/btnreport.png';"/></a>
<a href="teacher_page.php"><img src="icon/btnchack.png" width="200" height="60" onmouseover="this.src='icon/btnchack_1.png';"
onmouseout="this.src='icon/btnchack.png';"/></a>
<a href="teacher_page.php"><img src="icon/btnchack_2.png" width="200" height="60" onmouseover="this.src='icon/btnchack_3.png';"
onmouseout="this.src='icon/btnchack_2.png';"/></a>
<a href="teacher_page.php"><img src="icon/btnlistname.png" width="200" height="60" onmouseover="this.src='icon/btnlistname_1.png';"
onmouseout="this.src='icon/btnlistname.png';"/></a>
<a href="teacher_page.php"><img src="icon/btnrate.png" width="200" height="60" onmouseover="this.src='icon/btnrate_1.png';"
onmouseout="this.src='icon/btnrate.png';"/></a>
<a href="teacher_page.php"><img src="icon/btngrow.png" width="200" height="60" onmouseover="this.src='icon/btngrow_1.png';"
onmouseout="this.src='icon/btngrow.png';"/></a>
<a href="teacher_page.php"><img src="icon/btnresult.png" width="200" height="60" onmouseover="this.src='icon/btnresult_1.png';"
onmouseout="this.src='icon/btnresult.png';"/></a></td>
</tr>
<tr>
<td width="230">
<p></td>
</tr>
<tr>
<td width="230">
<p></td>
</tr>
</table>
<!-- end #sidebar1 --></div>
<div id="mainContent">
<p class="style12">ข้อมูลการเจริญเติบโตของนักเรียน</p>
<hr width=90% size=3 color=#003399><br /><br />
<form name="form1" method="post" action="student_grow.php">
<table width="728" align="center">
<tr>
<td width="235" align="left"><font size="3"> ข้อมูลปีการศึกษา : </td>
<td width="127"> <select name="lmName1" OnChange="window.location='?item='+this.value;">
<option value=""> -- กรุณาเลือก --</option>
<?php
$strSQL = "SELECT * FROM year ORDER BY year_id DESC";
$objQuery = mysql_query($strSQL);
while($objResult = mysql_fetch_array($objQuery))
{
if($_GET["item"] == $objResult["year_id"])
{
$sel = "selected";
}
else
{
$sel = "";
}
?>
<option value="<?php echo $objResult["year_id"];?>" <?php echo $sel;?>>ปีการศึกษา <?php echo $objResult["year_BE"];?></option>
<?php
}
?>
</select></td>
<td width="350">
<a href="add_teacher.php"><a href="add_page.php"></a>
<!-- ปุ่มย้อนกลับ --></td>
</tr>
</table>
<br />
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="105" height="34" bgcolor="#2F97FF"><div align="center" >รหัสนักเรียน</div></td>
<td width="208" bgcolor="#97CBFF"><div align="center">ชื่อนักเรียน</div></td>
<td width="167" bgcolor="#2F97FF"><div align="center" >ชื่อเล่น</div></td>
<td width="120" bgcolor="#97CBFF"><div align="center" >ชั้นเรียน</div></td>
<td width="122" bgcolor="#FFFFFF"><div align="center" ></div></td>
</tr>
<?php
if($_GET["item"] != "")
{
$strSQL = "select member_student.UserID_student, member_student.sex_student, member_student.name_student, member_student.nickname_student, classroom_student.classroom_id, class_student.abbreviation_class, class_teacher.year_id
from member_student, class_teacher, class_student, classroom_student
where class_teacher.UserID_teacher = '".$_SESSION['UserID_admin']."' AND
class_teacher.year_id='".$_GET["item"]."' AND
member_student.year_id=class_teacher.year_id AND
member_student.Class_ID=class_teacher.Class_ID AND
member_student.classroom_id=class_teacher.classroom_id AND
member_student.classroom_id=classroom_student.classroom_id AND
member_student.Class_ID=class_student.Class_ID";
$objQuery = mysql_query($strSQL);
$item = $_GET["item"];
while ($row = mysql_fetch_array($objQuery)){
echo "<tr><td>". $row['UserID_student'] ."</td>
<td>". $row['sex_student'] ."". $row['name_student'] ."</td>
<td>". $row['nickname_student'] ."</td>
<td>". $row['abbreviation_class'] ."/". $row['classroom_id'] ."</td>
<td><a href='student_grow.php?UserID_student=$row[0]'><img src='icon/btnscore.png' width='85' height='39' /></a></td></tr>";
}
}
?>
</table>
<br>
</form>
Tag : PHP, MySQL, HTML
Date :
2019-01-26 11:27:22
By :
aummyasia
View :
829
Reply :
2
เอา tag php ครอบสิครับ เอาอื่นๆ ครอบมันจะได้เรื่องเหรอ
Date :
2019-01-26 21:51:37
By :
Chaidhanan
Load balance : Server 02