<?php session_start(); ?> <?php include "include/config.php";?> <? if($_SESSION['id_admin'] == "") { echo "<script> alert('โปรดล็อคอิน')</script>"; print "<meta http-equiv=refresh content=0;URL=login.php>"; exit(); } $strSQL = "SELECT * FROM admin WHERE id_admin = '".$_SESSION['id_admin']."' "; $objQuery = mysql_query($strSQL); $objResult = mysql_fetch_array($objQuery); ?> <!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> <style type="text/css"> <!-- .style1 { color: #FF0000; font-size: 9px; } --> </style> </head> <body> <table width="1000" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="2"><?php include "head.php"; ?></td> </tr> <tr> <td colspan="2"><?php include "menutop.php"; ?></td> </tr> <tr> <td width="200" height="152" valign="top"><?php include "menu_admin.php"; ?></td> <td width="800" valign="top"><table width="800" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="Pictures/800_admin_report.jpg" width="800" height="76" /></td> </tr> <tr> <td background="Pictures/bg800_body.jpg"><table width="800" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="16"> </td> <td width="777"><table width="770" height="289" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="780" align="center" valign="top" background="pic_admin/bodybg.jpg"><form name="frmSearch" method="get" action="<?=$_SERVER['SCRIPT_NAME'];?>"> <table width="770" border="0" cellpadding="0" cellspacing="0"> <tr> <th height="50"><p> ค้นหา <select name="type_field"> <option>-- กรุณาเลือกข้อมูล --</option> <option value="data_adviser">อาจารย์นิเทศ</option> <option value="data_organization">หน่วยงาน</option> <!-- ชื่อฟิวด์ --> </select> <input name="txtKeyword" type="text" id="txtKeyword" value="<?=$_GET["txtKeyword"];?>" size="30" /> <input type="submit" value="ค้นหา" /> </p></th> </tr> </table> </div> </form> <div align="right"> <? if($_GET["txtKeyword"] != "") { include ("include/config.php"); // Search By Name or Email $strSearch = $_GET["txtKeyword"]; $strFiled=$_GET["type_field"]; $strSQL = "SELECT * FROM data WHERE ".$strFiled." LIKE '%".$strSearch."%'"; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $Num_Rows = mysql_num_rows($objQuery); $Per_Page = 10; // Per Page $Page = $_GET["Page"]; if(!$_GET["Page"]) { $Page=1; } $Prev_Page = $Page-1; $Next_Page = $Page+1; $Page_Start = (($Per_Page*$Page)-$Per_Page); if($Num_Rows<=$Per_Page) { $Num_Pages =1; } else if(($Num_Rows % $Per_Page)==0) { $Num_Pages =($Num_Rows/$Per_Page) ; } else { $Num_Pages =($Num_Rows/$Per_Page)+1; $Num_Pages = (int)$Num_Pages; } $strSQL .=" order by data_id ASC LIMIT $Page_Start , $Per_Page"; $objQuery = mysql_query($strSQL); ?> <table width="20" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <?php if ($Num_Rows>=1) echo "<a href ='admin_page_report_word.php?type_field={$strFiled}&txtKeyword={$strSearch}'><img src='icon/msword.png' width='50' height='50' title='พิมพ์ไฟล์ MS-WORD'/></a>"; ?></a></td> </tr> </table> </div> <table width="756" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#999999"> <tr> <td width="87" height="25" bgcolor="#33CCFF" ><div align="center">รหัสนักศึกษา</div></td> <td width="208" bgcolor="#33CCFF" ><div align="center">ชื่อ-นามสกุล</div></td> <td width="286" align="center" bgcolor="#33CCFF" class="style10"><div align="center">หน่วยงาน</div></td> <td width="162" align="center" bgcolor="#33CCFF" class="line_menu_top_back style10"><div align="center">อาจารย์นิเทศ</div></td> </tr> <? while($objResult = mysql_fetch_array($objQuery)) { ?> <tr> <td height="20" bgcolor="#FFFFFF" > <?=$objResult["data_num"];?> </td> <td bgcolor="#FFFFFF"> <?=$objResult["data_name"];?> </td> <td align="center" bgcolor="#FFFFFF" > <div align="left"> <?=$objResult["data_organization"];?> </div></td> <td align="center" bgcolor="#FFFFFF"> <?=$objResult["data_adviser"];?> </td> </tr> <? } ?> </table> <div align="center"><span class="line_menu_top_back style10 ">จำนวน</span> <span class="style7"> <?= $Num_Rows;?> </span><span class="style10"> <span class="line_menu_top_back style10">Record</span> :</span><span class="style7"> <?=$Num_Pages;?> </span><span class="style10"> <span class="line_menu_top_back style10 "> หน้า</span> :</span><span class="style7"> <? if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page&txtKeyword=$_GET[txtKeyword]'><< Back</a> "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i&txtKeyword=$_GET[txtKeyword]'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page&type_field=$_GET[type_field]&txtKeyword=$_GET[txtKeyword]'>Next>></a> "; } @mysql_close($mysql_connect); } ?> </span> </div> <div align="left"></div></td> </tr> </table></td> <td width="10"> </td> </tr> </table></td> </tr> <tr> <td><img src="Pictures/bg800_body_up.jpg" width="799" height="38" /></td> </tr> </table> </td> </tr> <tr> <td colspan="2"><?php include "up.php"; ?></td> </tr> </table> </body> </html>
<? header("Content-type: application/vnd.ms-word"); header("Content-Disposition: attachment; filename=พิมพ์รายงานข้อมูลการจอง รายเดือน.doc"); ?> <!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> <body> <? if(trim($strFiled) == "") die("<script> alert('กรุณาเลือกคำค้นหา'); /////// ติดตรงนี้อะครับ ไม่ผ่านตรงนี้ history.back(); </script>"); if($strSearch != "") { include ("include/config.php"); $strSQL = "SELECT * FROM data WHERE ".$strField." LIKE '%".$strSearch."%'"; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $Num_Rows = mysql_num_rows($objQuery); $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $Num_Rows = mysql_num_rows($objQuery); ?> <table width="702" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="4"><div align="center"><font size="+1"><strong><font color="#000000">รายงาน</font></strong></font><font size="+1" color="#000000"><strong>การการจองห้องประชุมประจำเดือน : </strong></font></div></td> </tr> <tr> <td colspan="4"><div align="center"><strong><font color="#000000" size="+1">คณะวิทยาการจัดการ มหาวิทยาราชภัฏจันทรเกษม</font></strong></div></td> </tr> <tr> <td width="262"> </td> <td width="134"> </td> <td width="134"> </td> <td width="172"> </td> </tr> <tr> <td colspan="2"><p><strong><font size="4">ที่อยู่ :</font></strong> 39/1 คณะวิทยาการจัดการมหาวิทยาลัยราชภัฏจันทรเกษม </p> <p align="left"> ถนนรัชดาภิเษก แขวงจันทรเกษม เขตจตุจักร กทม.</p> <p align="left"><strong><font size="4">โทรศัพท์</font></strong> 02939-0900 </p></td> <td colspan="2" valign="top"><table width="99%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="24%"> </td> <td width="76%"><font size="3">วันที่พิมพ์รายงาน :</font><font size="2"> <? $th=mktime(gmdate("H")+7,gmdate("i"),gmdate("s"),gmdate("m"),gmdate("d"),gmdate("Y")); $format="d/m/Y H:i:s a"; $str=date($format,$th); echo "$str "; ?> </font></td> </tr> </table></td> </tr> <tr> <td><p> </p> </td> <td> </td> <td colspan="2"> </td> </tr> <tr> <td colspan="4"><table width="91%" height="46" border="1" cellpadding="0" cellspacing="0"> <tr> <td width="12%"><div align="center">รหัสการจอง</div></td> <td width="23%"><div align="center">หัวข้อประชุม</div></td> <td width="22%"><div align="center">ห้องประชุม</div></td> <td><div align="center">อาจารย์นิเทศ</div> </td> <td width="17%"><div align="center">ผู้จอง</div></td> </tr> <? while($objResult = mysql_fetch_array($objQuery)) { ?> <tr> <td><div align="center"><?=$objResult["data_num"];?></div></td> <td><div align="left"> <?=$objResult["data_name"];?> </div></td> <td><div align="left"> <?=$objResult["data_organization"];?> </div></td> <td><div align="center"> <?=$objResult["data_adviser"];?> </div> <div align="center"></div></td> <td><div align="center"> <?=$objResult["name"];?> </div></td> </tr> <?php } ?> </table></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td colspan="4"> </td> </tr> </table> <? if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page&txtKeyword=$_GET[txtKeyword]'><< Back</a> "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i&txtKeyword=$_GET[txtKeyword]'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page&type_field=$_GET[type_field]&txtKeyword=$_GET[txtKeyword]'>Next>></a> "; } @mysql_close($mysql_connect); } ?> </body> </html>
if(trim($strFiled) == "") /// ลองเปลี่ยน จาก$strFiled เป็น $_GET["type_field"] ดูครับ die("<script> alert('กรุณาเลือกคำค้นหา'); history.back(); </script>"); /////// ติดตรงนี้อะครับ ไม่ผ่านตรงนี้
<? if(trim($_GET["type_field"]) == "") die("<script> alert('กรุณาเลือกคำค้นหา'); history.back(); </script>"); if(trim($_GET["txtKeyword"]) == "") die("<script> alert('กรุณาเลือกคำค้นหา'); history.back(); </script>"); { include ("include/config.php"); $strSearch=$_GET["txtKeyword"]; $strField=$_GET["type_field"]; $strSQL = "SELECT * FROM data WHERE ".$strField." LIKE '%".$strSearch."%'"; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $Num_Rows = mysql_num_rows($objQuery); $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $Num_Rows = mysql_num_rows($objQuery); ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง