MINI SHELL

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/bin/meetingroom_bk/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/pathumthani_eoffice/application/bin/meetingroom_bk/search.php
<?
//include("chk_permission.php");
session_start();
include("../../config/config.inc.php");
include("../../common/function.php");
include("var.inc.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 type=text/css>BODY {
OVERFLOW: scroll; OVERFLOW-X: hidden
}
.DEK {
POSITION: absolute; VISIBILITY: hidden; Z-INDEX: 200
}
</STYLE> 
</HEAD>
<BODY topmargin="0">

<? 			 	
$title_label = "ระบบจองห้องประชุม";
include "header.php";    
include "../../common/tag_alt.txt";   
include "menu_bar.php";  
?>
    <table width="100%" height="400" border="0" cellpadding="0" cellspacing="0" bgcolor="#EEEEEE">
      <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  ";			
include("_calendar.php"); 
?></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>&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td>&nbsp; </td>
                  <td><input name="gosearch" type="submit" id="gosearch" value="ค้นหา"> 
                    &nbsp; <label>
                    <input type="button" name="Submit2" value="กลับหน้าหลัก" onClick="window.location='main.php'">
                    </label></td>
                </tr>
              </table>
                        </form></td>
          </tr>
          <tr>
            <td colspan="4" valign="top"><?
###################### 14/03/2009   ==>   2009-03-23  
if ($gosearch != ""){ 
	//$time01 = convert2th($pdate) ;   	
	$date_pdate = convert_2mysql($pdate) ;  
	//echo $pdate."<br>".$time01;
	//$time01 = convert2th($pdate2) ;   	
	$date_pdate2 = convert_2mysql($pdate2) ;  	

	#$date_dbformat =  convertxxxxxxx($jump_th) ; 
	$meeting_topic = trim($frm_topic) ; 
	addlog("ค้นหารายการจองห้องประชุม $meeting_topic",$m_id,$logid11,"0"); // เก็บ log ในการค้นหาข้อมูลของโปรแกรมการจองห้องประชุม
	if ( $pdate2 == ""){
		$exturl = " AND daterent = '$date_pdate'  ";
	}else{
		$exturl = " AND daterent >= '$date_pdate'  AND daterent <= '$date_pdate2'  ";	
	} ########### END if ( $pdate2 != ""){
	$sql = " SELECT * FROM meeting_reserve 
	INNER JOIN meeting_room ON meeting_reserve.roomid = meeting_room.rid
	WHERE  meeting_topic LIKE '%$meeting_topic%'   $exturl ";
	//echo $sql;
	#### SELECT * FROM `meeting_reserve` WHERE `daterent` < '2009-03-23' LIMIT 0,1000
	$result = @mysql_query($sql) ; 
	$num_sr = @mysql_num_rows($result);
	$arr_s = explode("/",$pdate);
	$arr_e = explode("/",$pdate2);
	
	
		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\" />&nbsp;<strong>ผลการค้นหา</strong> - $txt_pd   &nbsp;  $txt_pd2  &nbsp;   $txt_topic - ไม่ตรงกับบุคลากรใด ๆ<br /><br />
	ข้อแนะนำ :<br />
	- ขอให้แน่ใจว่าสะกดทุกคำอย่างถูกต้อง<br />
	- ลดเงื่อนไขการค้นหาลง<br /><br />
	</ul>
	</td>
</tr>
</table>
			  ";
	} else{
?>   <br>

              <table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td>&nbsp;<strong>ผลการค้นหา - </strong>   <? echo "$txt_pd   &nbsp; $txt_pd2  &nbsp;  $txt_topic "; ?></td>
                </tr>
              </table>
              <table width="96%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF">
                <tr class="headerTB_white"  align="center"bgcolor="#466A8E" >
				  <td width="4%">ลำดับ</td>
                  <td width="20%" height="30" bgcolor="#466A8E"   >ชือห้อง</td>
                  <td width="23%">หัวข้อการประชุม</td>
                  <td width="23%">ประธานการประชุม</td>
                  <td width="15%">หน่วยงานจองห้องประชุม</td>
                  <td colspan="15%">วันที่/เวลา</td>
                </tr>
<?
$i = 1;
while ($rs = mysql_fetch_assoc($result)){ 
$nextdatemysql2=explode("-",$rs[daterent]);
$nextdatemysql2=array_reverse($nextdatemysql2);
$nextdatemysql2=implode("/",$nextdatemysql2);
list($h,$m,$s)=explode(":",$rs[time_start]);
$nonm++; 
if ($bgcolor1 == "DDDDDD"){  $bgcolor1 = "EFEFEF"  ; } else {$bgcolor1 = "DDDDDD" ;}
$sql="Select org_staffgroup.groupname FROM org_groupmember Inner Join epm_staff ON org_groupmember.staffid = epm_staff.staffid Inner Join org_staffgroup ON org_staffgroup.gid = org_groupmember.gid where  epm_staff.staffid = $rs[staff_regis]";
$my_query=mysql_query($sql);
list($groupname)=mysql_fetch_row($my_query);
?>
                <tr bgcolor="#<?=$bgcolor1?>" >
				  <td align="center"><?=$i ?></td>
                  <td height="25" align="left"><?=$rs[rname]?></td>
                  <td><?=$rs[meeting_topic]?></td>
                  <td><?=$rs[meeting_chairman]?></td>
                  <td><?=$groupname?></td>
                  <td  align="center"><? echo jump_daythai($nextdatemysql2);?></td>
                  <td  align="center"><? echo $h,':',$m . "-".substr($rs[time_end], 0, 5); ?></td>
                </tr>
				
<?
			$i++;
	} ############ END while ($rs = mysql_fetch_assoc($result)){
	} // end if($num_sr < 1){ // ในกรณีค้นหาไม่เจอ
} ############ END if ($gosearch != ""){ 
?>				
            </table>

            <br></td>
          </tr>
        </table></td>
      </tr>
</table>

 
	
 
	
	
	
	

	
<? 	
		 	include "footer.php";  
/*
    [session_status_pri] => 0
    [session_apppermit] => Array
        (
            [1] => Array
                (
                    [100] => on
                    [200] => on
                )

        )
*/
			
?>

Anon7 - 2021