<? include('ConnectDB.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>BANKUNG SCHOOL</title> <link rel="stylesheet" type="text/css" href="pro_dropdown_3/pro_dropdown_3.css" /> <script src="pro_dropdown_3/stuHover.js" type="text/javascript"></script> </head> <body> <center><img src="pro_dropdown_3/logo.jpg" width="1000" height="300" /></center> <span class="preload1"></span> <span class="preload2"></span> <ul id="nav"> <li class="top"><a href="main_manage.php" class="top_link"><span>หน้าแรกการจัดการ</span></a></li> <li class="top"><a href="student_report.php" class="top_link"><span>รายงานข้อมูลนักเรียน</span></a></li> <li class="top"><a href="employee_report.php" class="top_link"><span>รายงานข้อมูลบุคลากร</span></a></li> <li class="top"><a href="news_report.php" class="top_link"><span>รายงานข้อมลููข่าว</span></a></li> <li class="top"><a href="logout.php" id="products" class="top_link"><span>ออกจากระบบ</span></a></li> </ul> </body> </html> <!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> <form name="form1" action="student_report.php" method="get"> เลือกเทอมที่ต้องการ <td width="19%" align="left">ชนิดเอกสาร</td> <td width="81%"> <select name='typeList' id='typeList'> <option value=''>กรุณาเลือก</option> <option value='2550'>2550</option> <option value='2551'>2551</option> <option value='2552'>2552</option> <option value='2553'>2553</option> <option value='2554'>2554</option> <option value='2555'>2555</option> <option value='2556'>2556</option> </select> </td> <input type="submit" name="btnSubmit" id="btnSubmit" value="ออกรายงาน" /> </form> <? $sql1 = "SELECT * FROM users WHERE year LIKE '%$typeList%' AND status = 'F'"; ตรงนี้ครับคือต้องใส่ออกทั้ง 2 ตารางนี้ $dbquery1 = mysql_db_query($dbname, $sql1) or die("Can't Query"); $sql2 = "SELECT * FROM student where user_id = '$user_id'"; $dbquery2 = mysql_db_query($dbname, $sql2) or die("Can't Query"); ?> <table width="100%" border="1" align="center" bordercolor="#000" cellspacing="0"> <tr> <th width="20%" bgcolor="#FFFFCC">เลขประจำตัวนักเรียน</th> <th width="20%" bgcolor="#FFFFCC">ชื่อ</th> <th width="20%" bgcolor="#FFFFCC">นามสกุล</th> <th width="20%" bgcolor="#FFFFCC">ที่อยู๋</th> <th width="20%" bgcolor="#FFFFCC">เบอร์โทร</th> <th width="20%" bgcolor="#FFFFCC">ปีการศึกษา</th> <th width="20%" bgcolor="#FFFFCC">GPA</th> <th width="20%" bgcolor="#FFFFCC">ประวัติ</th> </tr> <?php $c = 0; while($result1 = mysql_fetch_array($dbquery1)) { $c++; if($c%2==0) { $bg = "#FFFFCC"; } else { $bg = "#ADD8E6"; } ?> <tr bgcolor="<?=$bg;?>"> <td><?=$result1["user_id"];?></td> <td><?=$result1["firstname"];?></td> <td><?=$result1["lastname"];?></td> <td><?=$result1["address"];?></td> <td><?=$result1["telephone"];?></td> <td><?=$result1["year"];?></td> <td><?=$result1["gpa"];?></td> <td><?=$result1["behavior"];?></td> </tr> <? } mysql_close(); ?> </table> </body> </html>
<? $sql1 = "SELECT * FROM users WHERE year LIKE '%$typeList%' AND status = 'F'"; ตรงนี้ครับคือต้องใส่ออกทั้ง 2 ตารางนี้ $dbquery1 = mysql_db_query($dbname, $sql1) or die("Can't Query"); ?> <table width="100%" border="1" align="center" bordercolor="#000" cellspacing="0"> <tr> <th width="20%" bgcolor="#FFFFCC">เลขประจำตัวนักเรียน</th> <th width="20%" bgcolor="#FFFFCC">ชื่อ</th> <th width="20%" bgcolor="#FFFFCC">นามสกุล</th> <th width="20%" bgcolor="#FFFFCC">ที่อยู๋</th> <th width="20%" bgcolor="#FFFFCC">เบอร์โทร</th> <th width="20%" bgcolor="#FFFFCC">ปีการศึกษา</th> <th width="20%" bgcolor="#FFFFCC">GPA</th> <th width="20%" bgcolor="#FFFFCC">ประวัติ</th> </tr> <?php $c = 0; while($result1 = mysql_fetch_array($dbquery1)) { #### $sql2 = "SELECT * FROM student where user_id = '$result1[user_id]'"; $dbquery2 = mysql_db_query($dbname, $sql2) or die("Can't Query"); $result2=mysql_fetch_array($dbquery2 ); #ใช้ ตัว $result2 ในการเรียกค่าของ student ออกมา #### $c++; if($c%2==0) { $bg = "#FFFFCC"; } else { $bg = "#ADD8E6"; } ?> <tr bgcolor="<?=$bg;?>"> <td><?=$result1["user_id"];?></td> <td><?=$result1["firstname"];?></td> <td><?=$result1["lastname"];?></td> <td><?=$result1["address"];?></td> <td><?=$result1["telephone"];?></td> <td><?=$result1["year"];?></td> <td><?=$result1["gpa"];?></td> <td><?=$result1["behavior"];?></td> <td><?=$result2["ชื่อฟิลค์ในตาราง student"];?></td> </tr> <? } mysql_close(); ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง