|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /var/www/html/pathumthani_eoffice/application/information/ |
Upload File : |
<?
session_start();
if(empty($session_username)){
header("location:../control");
}
include("../../config/config.inc.php");
include("../../libary/function.php");
//.include("../../common/function.php");
################ HARD FIX
#$_SESSION[session_staffid] = 49 ;
$user=$_SESSION[session_staffid];
################
#if ($jump != ""){$jump=$jump;}else{$jump=date("d") ."/". date("m") ."/". date("Y") ; $jump = $jump; }
if ($jump == ""){$jump=date("d") ."/". date("m") ."/". date("Y") ; }
$s_m = array("","ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค.");
/*
function jump_daythai($cal_format){
$smonth = array("","ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค.");
$arr_day = explode("/",$cal_format) ;
$mm = (int)$arr_day[1] ;
$thyy = (int)$arr_day[2] + 543 ;
$daythai = (int)$arr_day[0] ." ". $smonth[$mm] ." ". $thyy ;
return $daythai ;
} ################# function jump_daythai($cal_format){
*/
?>
<HTML>
<HEAD><TITLE>ค้นหาข้อมูลข่าวประชาสัมพันธ์</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=windows-874">
<LINK href="../../common/style.css" rel="stylesheet" type="text/css">
<LINK href="../../common/tab_style.css" rel="stylesheet" type="text/css" />
<SCRIPT language="javascript" src="../../common/popcalendar.js"></SCRIPT>
<SCRIPT language="javascript" src="../../common/xmlhttp.js"></SCRIPT>
<SCRIPT type="text/javascript" src="../../common/tabber.js"></SCRIPT>
<style>
body{
font-family:Tahoma, sans-serif, Arial;
font-size: 12px;
margin: 0 0;
padding:0 0;
}
.normal_blue {
font-size: 12px;
color:#006699;
}
.mwarn{
color:#cc3300;
font-size:12px;
text-decoration:none;
}
</style>
</HEAD>
<BODY>
<?
include "header.php";
include "menu_bar.php";
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#EEEEEE" style="height:455px;">
<tr>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="19%" align="center" valign="top">
<?
$csql = " SELECT * FROM meeting_reserve ";
?></td>
<td colspan="3" valign="top"><form name="form1" method="post" action="?">
<br>
<br>
<table width="600" border="0">
<tr>
<td width="104" align="right">วันที่เริ่มต้นค้นหา : </td>
<td width="486">
<?
if ($pdate != ""){
$arr_d = explode("/",$pdate);
if($arr_d[2] < 2500){
$pdate = $arr_d[0]."/".$arr_d[1]."/".($arr_d[2]+543);
}else{ $pdate = $pdate;}
$jump_th = $pdate;
}else {
$arr_d = explode("/",$jump);
if($arr_d[2] < 2500){
$jump = $arr_d[0]."/".$arr_d[1]."/".($arr_d[2]+543);
}else{ $jump = $jump;}
$jump_th = $jump;
} ################ END if ($pdate != ""){
?>
<INPUT name="pdate" type="text" class="input" id="pdate" value="<?=$jump_th?>" maxlength="10" readonly>
<SCRIPT language='javascript'> if (!document.layers) { document.write("<input type=button onclick='popUpCalendar(this, form1.pdate, \"dd/mm/yyyy\")' value=' เลือกวัน ' class='input'>") }</SCRIPT> </td>
</tr>
<tr>
<td width="104" align="right">วันที่สิ้นสุดค้นหา : </td>
<td width="486">
<?
if ($pdate != ""){
$jump_th = $pdate;
}else {
$jump_th = $jump;
} ################ END if ($pdate != ""){
?>
<INPUT name="pdate2" type="text" class="input" id="pdate2" value="<?=$pdate2?>" maxlength="10" readonly>
<SCRIPT language='javascript'> if (!document.layers) { document.write("<input type=button onclick='popUpCalendar(this, form1.pdate2, \"dd/mm/yyyy\")' value=' เลือกวัน ' class='input'>") }</SCRIPT> </td>
</tr>
<tr>
<td align="right">หัวข้อข่าว : </td>
<td><input name="frm_topic" type="text" id="frm_topic" value="<?=$frm_topic?>" size="70"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input name="gosearch" type="submit" id="gosearch" value="ค้นหา">
<label>
<input type="button" name="Submit2" value="กลับหน้าหลัก" onClick="window.location='information.php?page=1&type=1'">
</label></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td colspan="5" width="100%" valign="top" align="center"><?
###################### 14/03/2009 ==> 2009-03-23
if ($gosearch != ""){
$meeting_topic = trim($frm_topic) ;
if($meeting_topic==""){
$pdate=explode("/",$pdate);
$pdate[2]-=543;
$date_pdate = implode("-",array_reverse($pdate)).' 00:00:00';
if($pdate2!=""){
$pdate2=explode("/",$pdate2);
$pdate2[2]-=543;
$date_pdate2 = implode("-",array_reverse($pdate2)).' 23:59:59';
$end="and stamp<='$date_pdate2'";
}
$where="where type='1' and stamp>='$date_pdate' $end";
}else{
$where="where type='1' and topic like'%$meeting_topic%'";
}
/*if($session_apppermit[2][10]!="on"){
$where.=" and author='$user_name'";
}*/
$sql="select count(topic) from news $where";
$query=mysql_query($sql);
list($num_sr)=mysql_fetch_row($query);
if($pdate != ""){ $txt_pd ="วันที่เริ่มต้นค้นหา : <i> ".intval($arr_s[0])." ".$s_m[intval($arr_s[1])]." ".$arr_s[2]."</i>"; }
if($pdate2 != ""){ $txt_pd2 = "วันที่สิ้นสุดค้นหา : <i>".intval($arr_e[0])." ".$s_m[intval($arr_e[1])]." ".$arr_e[2]."</i>";}
if($frm_topic != ""){ $txt_topic = "หัวข้อ : <i> $frm_topic</i>";}
if($num_sr < 1){ // ในกรณีค้นหาไม่เจอ // s_m
echo "<br>
<table width=\"96%\" border=\"0\" cellpadding=\"0\" cellspacing=\"2\" bgcolor=\"#E6E6E6\" align=\"center\" style=\"border:1px solid #5595CC;\">
<tr>
<td height=\"20\">
<ul><br />
<img src=\"../../images/alert.gif\" width=\"16\" height=\"16\" align=\"absmiddle\" /> <strong>ผลการค้นหา</strong> - $txt_pd $txt_pd2 $txt_topic - ไม่ตรงกับบุคลากรใด ๆ<br /><br />
ข้อแนะนำ :<br />
- ขอให้แน่ใจว่าสะกดทุกคำอย่างถูกต้อง<br />
- ลดเงื่อนไขการค้นหาลง<br /><br />
</ul>
</td>
</tr>
</table>
";
} else{
?> <br>
<form action="information.php" name="post" method="post">
<table width="85%" border="0" cellspacing="0" cellpadding="0" style="margin:0 auto;border-collapse:collapse;">
<thead>
<tr bgcolor="#466a8e" class="normal_blue" style="color:#FFFFFF">
<th width="8%" style="border:#999999 solid 1px;border-collapse:collapse;">ลำดับ</th>
<th width="8%" style="border:#999999 solid 1px;border-collapse:collapse;"><input type="checkbox" name="checkall" onClick="checkUncheckAll(this);" style="border:0px;"></th>
<th align="left" width="54%" style="border:#999999 solid 1px;border-collapse:collapse;"> เรื่อง</th>
<th width="15%" align="left" style="border:#999999 solid 1px;border-collapse:collapse;"> ประเภทของข่าว</th>
<th width="15%" style="border:#999999 solid 1px;border-collapse:collapse;">แก้ไขรูป / เรื่อง</th>
</tr>
</thead>
<?
$sql="select *from news $where order by id desc";
$result=mysql_query($sql);
while($rs = mysql_fetch_assoc($result)){
$i = $i + 1;
$bgcolor = ($bgcolor == "#f8f8f8") ? "#ffffff" : "#f8f8f8";
$edit = "<a href=\"information.php?action=edit&id=".$rs[id]."&page=$page$kwd\" style=\"text-decoration:none\"><img src=\"../../images/edit.png\" border=\"0\" height=\"13\" width=\"12\" align=\"absmiddle\" alt=\"แก้ไขข้อมูลข่าว\"></a>";
$del = "<a href=\"information.php?action=del&id=".$rs[id]."&page=$page$kwd\" style=\"text-decoration:none\" onClick=\"return confirm('ท่านต้องการที่จะลบข้อมูล ".trimtxt($rs[topic], 65)." ใช่หรือไม่ ?')\"><img src=\"../../images/del.png\" height=\"13\" width=\"11\" border=\"0\" align=\"absmiddle\" alt=\"ลบข้อมูลข่าว\">";
$img = "<a href=\"news_pic.php?id=".$rs[id]."&page=$page\" style=\"text-decoration:none\"><img src=\"../../images/cam.gif\" border=\"0\" alt=\"แก้ไขข้อมูลภาพข่าว\"></a>";
$attach = chkattach($rs[attach]);
$xsql = mysql_query("select detail as type from `news_type` where id = '$rs[type]'")or die("Query line " . __LINE__ . " error<hr>".mysql_error());
$xrs = mysql_fetch_assoc($xsql);
if(($user_name == $rs['author']) or ( $_SESSION['session_apppermit'][$app_id][$permit10] == "on") ){ // ตรวจสอบสิทธิการลบ
$dis_ch = "";
}else{
$dis_ch = "disabled='disabled'";
}// end ตรวจสอบสิทธิการลบ
?>
<tr class="normal" bgcolor="<?=$bgcolor?>" onmouseover='mOvr(this,"dbf2ae");' onmouseout='mOut(this,"<?=$bgcolor?>");'>
<td align="center" style="border:#999999 solid 1px;border-collapse:collapse;"><?=$i."."?></td>
<td align="center" style="border:#999999 solid 1px;border-collapse:collapse;"><input type="checkbox" name="chk[]" value="<?=$rs[id]?>" style="border:0px;" <?=$dis_ch?></td>
<td class="normal_blue" style="border:#999999 solid 1px;border-collapse:collapse;" onClick="window.location.replace('information.php?action=view&id=<?=$rs[id]?>&page=<?=$page?>')"> <?=$attach.trimtxt($rs[topic], 60)?></td>
<td style="border:#999999 solid 1px;border-collapse:collapse;"> <?=trimtxt($xrs[type], 15)?></td>
<td align="center" style="border:#999999 solid 1px;border-collapse:collapse;">
<?php
if(($user_name == $rs['author']) or ( $_SESSION['session_apppermit'][$app_id][$permit10] == "on") ){
echo $img,' ',$edit,' ',$del;
}
?>
</td>
</tr>
<?
}
mysql_free_result($result);
?>
<tr align="right" bgcolor="#eeeeee" >
<td height="35" colspan="5" valign="bottom"><input type="hidden" name="action" value="delete"><span class="mwarn">ลบข้อมูลที่เลือก</span> <input type="submit" class="input" name="submit" value="Delete" style="width:100px; background-color:#ffffff;" onClick="return confirm('ท่านต้องการที่จะลบกลุ่มข้อมูลที่เลือก ใช่หรือไม่ ?')"> </td>
</tr>
</table>
</form>
<?
} ############ END while ($rs = mysql_fetch_assoc($result)){
} ############ END if ($gosearch != ""){
?>
</table>
<br></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php include("footer.php");?></td>
</tr>
</table>