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_news/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/pathumthani_news/report_bk.php
<?
//session_start();
include "config/config.inc.php";
include("function/function.php");
$month_arr=array('','มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน','กรกฏาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม');
$month_s=array('','ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.','ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.');
//if(!isset($session_username)){
//header("Location: login.php");
//}
?>
<html>
<head>
<title><?=$show_title?></title>
<META http-equiv=Content-Type content="text/html; charset=windows-874">
<link href="common/style.css" type="text/css" rel="stylesheet" />
<script language='javascript' src='daily_popcalendar.js'></script>
<script language='javascript' src='displayelement.js'></script>
<style type="text/css">
<!--
body {  margin: 0px  0px; padding: 0px  0px}
a:link { color: #005CA2; text-decoration: none}
a:visited { color: #005CA2; text-decoration: none}
a:active { color: #0099FF; text-decoration: underline}
a:hover { color: #0099FF; text-decoration: underline}
.style2 {color: #000000}
-->
a.inmain_link:link,a.inmain_link:visited{
	color:#2176A8;
	text-decoration:none;

}
a.inmain_link:hover{
	color:#B0F3FF;
	text-decoration:underline;
}
</style>

<SCRIPT LANGUAGE="JavaScript">
function CheckForm(){
	missinginfo = "";
	missinginfo1 = "";

	if (document.form.subject.value == "")  {missinginfo1 += "\n- กรุณากรอก เรื่องร้องเรียน "; }		
	if (document.form.subject_no_in.value == "")  {missinginfo1 += "\n- กรุณากรอก เลขที่หนังสือ "; }	
	if (document.form.date_start.value == "")  {missinginfo1 += "\n- กรุณากรอก วันเริ่มต้น "; }	
	if (document.form.date_end.value == "")  {missinginfo1 += "\n- กรุณากรอก สิ้นสุด "; }	
	
	if (missinginfo1 != "") { 	
		missinginfo += "ไม่สามารถบันทึกข้อมูลได้  เนื่องจาก \n";
		missinginfo +="_____________________________\n";
		missinginfo = missinginfo + missinginfo1  ;
		missinginfo += "\n___________________________";
		missinginfo += "\nกรุณาตรวจสอบ อีกครั้ง";
		alert(missinginfo);
		return false;
	}
}
</SCRIPT>
<script language="javascript">
function popWindow(url, w, h){

	var popup		= "Popup"; 
	if(w == "") 	w = 420;
	if(h == "") 	h = 300;
	var newwin 	= window.open(url, popup,'location=0,status=no,scrollbars=no,resizable=no,width=' + w + ',height=' + h + ',top=20');
	newwin.focus();

}
function popWindow1(url, w, h){

	var popup		= "Popup"; 
	if(w == "") 	w = 420;
	if(h == "") 	h = 300;
	var newwin 	= window.open(url, popup,'location=0,status=no,scrollbars=no,resizable=no,width=' + w + ',height=' + h + ',top=20');
	newwin.focus();

}
function popWindow2(url, w, h){

	var popup		= "Popup"; 
	if(w == "") 	w = 420;
	if(h == "") 	h = 300;
	var newwin 	= window.open(url, popup,'location=0,status=no,scrollbars=no,resizable=no,width=' + w + ',height=' + h + ',top=20');
	newwin.focus();

}

</script>
<script language="javascript">
function clearselect()
{
	document.post.salary_day.disabled=true;
	document.post.salary_month.disabled=true;
	document.post.salary_year.disabled=true;
	document.post.label_date.disabled=true;
	
	 if (document.post.salary_day.value!="")
 	{
       document.post.salary_day.value="";
	   document.post.salary_day.disabled=true;
    }
	 if (document.post.salary_month.value!="")
 	{
       document.post.salary_month.value="";
	   document.post.salary_month.disabled=true;
    }
	
	 if (document.post.salary_year.value!="")
 	{
       document.post.salary_year.value="";
	   document.post.salary_year.disabled=true;
    }
	 if (document.post.label_date.value!="")
 	{
       document.post.label_date.value="";
	   document.post.label_date.disabled=true;
    }
}
</script>
</head>
<body >
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" style="filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#FFFFFF', EndColorStr='#ffffff');">
  <tr>
    <td valign="top" background="bimg/bg1.gif" style="background-repeat: no-repeat; background-position:right bottom "><table width="100%" border="0" cellspacing="1" cellpadding="2">
	<?
if($action == "Sreport"){
	function devidepage($total, $kwd , $sqlencode ){
	$per_page		= 11;	
	$page_all 		= $total;
	global $page,$id_menu;	

	if($total >= 1){
		$table	= "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
		$table	= $table."<tr align=\"right\">";
		$table	= $table."<td width=\"70%\" align=\"left\" height=\"30\">&nbsp;";
				
		if($page_all <= $per_page){
			$min		= 1;
			$max		= $page_all;
		} elseif($page_all > $per_page && ($page - 5) >= 2 ) {			
			$min		= $page - 5;
			$max		= (($page + 5) > $page_all) ? $page_all : $page + 5;
		} else {
			$min	= 1;
			$max	= $per_page; 			
		}
	
		if($min >= 4){ 
			$table .= "<a href=\"?action=Sreport&id_menu=$id_menu&page=1&displaytype=people".$kwd."\"><u><font color=\"black\">หน้าแรก</font></u></a>&nbsp;"; 
		}
		
		for($i=$min;$i<=$max;$i++){			
			$i	= str_pad($i, 2, "0", STR_PAD_LEFT);
			if($i != $page){
				$table .= " <a href=\"?action=Sreport&id_menu=$id_menu&page=".$i."&displaytype=people". $kwd."\"><span class=\"pagelink\">".$i."</span></a> ";
			} else {
				$table .= " <span class=\"page\">".$i."</span> ";
			}	
		}
		
		if(($page + 5) <= $page_all){ 
			$table .= "&nbsp;<a href=\"?action=Sreport&id_menu=$id_menu&page=".$page_all."&displaytype=people". $kwd."\"><u><font color=\"black\">หน้าสุดท้าย</font></u></a>"; 
		}
		
		if($page_all > 1){
			$table .= "&nbsp;<a href=\"reportALL.php?action=Sreport&id_menu=$id_menu&page=".($page_all+1)."&displaytype=people". $kwd."\" target='_blank'><u><font color=\"black\">แสดงทั้งหมด</font></u></a>";
		}
#		$table .= "&nbsp;<a href=\"search_excel.php?page=$sqlencode\"><u><font color=\"black\">ส่งออกรูปแบบ MS Excel </font></u></a>";

		unset($max,$i,$min);

		$table	= $table."</td>";	
		$table	= $table."<td width=\"30%\">จำนวนทั้งหมด <b>".number_format($page_all, 0, "", ",")."</b>&nbsp;หน้า&nbsp;</td>";
		$table	= $table."</tr>";
		$table	= $table."</table>";
	}
 	return $table;
}


//--------------------------------------end function -----------------------------------------
		$page 	= (!isset($page) || $page <= 0) ? 1 : $page ; 
		$e = (!isset($e) || $e == 0) ? 10 : $e ;
		$i	= (!isset($page) || ($page == 1)) ?  0 : ($page - 1) * $e ; 

	$strSQL = "SELECT * FROM tbl_subject  WHERE id_menu='$id_menu' AND status_sub='1'";
	$Result = mysql_db_query($dbname,$strSQL);
		$all= @mysql_num_rows($Result);
		$allpage	= ceil($all / $e);
		$sumpage 	= (($i + $e) >= $all) ? $all : ($i + $e) ;
		$xpage=$allpage +1;
if($page <= $allpage){
$strSQL1 = "SELECT * FROM tbl_subject  WHERE id_menu='$id_menu' AND status_sub='1' ORDER BY date_create DESC LIMIT $i, $e";
}else if($page == $xpage){
$strSQL1 = "SELECT * FROM tbl_subject  WHERE id_menu='$id_menu' AND status_sub='1' ORDER BY date_create DESC";
}else{
$strSQL1 = "SELECT * FROM tbl_subject  WHERE id_menu='$id_menu' AND status_sub='1' ORDER BY date_create DESC LIMIT $i, $e";
}
$Result1 = mysql_db_query($dbname,$strSQL1);
$search_sql = $strSQL1 ; 
$num_row = mysql_num_rows($Result1);
$i=0;
while($Rs1= mysql_fetch_object($Result1)){
	$txtdate_create[$i] = $Rs1->date_create;
	$txtid_sub[$i] = $Rs1->id_sub;
	$txtsubject[$i] = $Rs1->subject;
	
	$i++;
}// end while $Rs1
	?>
		  <tr>
        <td colspan="3" align="left" valign="bottom">
			<? $sqlencode = urlencode($search_sql)  ; ?><?=devidepage($allpage, $keyword ,$sqlencode )?>  </td>
        </tr>	
		<tr>
        <td colspan="3" align="left" style="border-top:#0099FF dotted 1px;">&nbsp;</td>
        </tr>	

	<?
	$n=0;
	for($j=0;$j<count($txtid_sub);$j++){ // for เพื่อแสดงข้อมูล
	$n++;
	?>
      <tr>
        <td width="20" align="left" valign="top"><?=$n?></td>
        <td width="89" align="left" valign="top">
		<?
		if($txtdate_create[$j] != "0000-00-00"){
		$arr_r = explode("-",$txtdate_create[$j]);
		echo intval($arr_r[2])." ".$month_s[intval($arr_r[1])]." ".$arr_r[0];
		}
		?>
		</td>
        <td align="left" valign="top">
		<a href="report_view.php?id=<?=$txtid_sub[$j]?>" target="_blank"><?=$txtsubject[$j]?></a>
		<?
		$dd = date("d");
		$mm = date("m");
		$yy = date("Y")+543;
		$check_dd = $yy."-".$mm."-".$dd;
		$arrR = explode("-",$txtdate_create[$j]);
		 	 if($arrR[0] == $yy){
			 	if($arrR[1] == $mm){
					echo "<img src='images/new.gif' width='24' height='7' border='0' alt='ข่าวใหม่'>";
				}else{
					echo "";
				}
			 }else{
			 	echo "";
			 }
			 		 
		 
		 ?>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
          <?
		$strSQL2 = "SELECT * FROM tbl_attach_file WHERE id_attach_file='$txtid_sub[$j]' AND status_file='Y'";
		$Result2 = mysql_db_query($dbname,$strSQL2);
		while($Rs2 = mysql_fetch_object($Result2)){
		?>
          <tr>
            <td align="left" valign="top"><a href="attach_file/<?=$Rs2->attach_file?>" target="_blank"><img src="images/attach.gif" alt="คลิกเพื่อดูไฟล์แนบ" border="0" align="absmiddle"><?=$Rs2->comment?>
              </a></td>
          </tr>         
		   <?
		  }
		  ?>
		  	<?
		  $strSQL_url = "SELECT * FROM tbl_url WHERE id_sub='$txtid_sub[$j]'";
		  $Result_url = mysql_db_query($dbname,$strSQL_url);
		  while($Rs_url = mysql_fetch_object($Result_url)){
		  ?>

          <tr>
            <td align="left" valign="top"><a href="<?=$Rs_url->url?>" target="_blank"><img src="images/yast_www.png" border="0" alt="เว็บอ้างอิง" width="16" height="16"><?=$Rs_url->url_name?></a></td>
          </tr>
		  <?
		  }
		  ?>
        </table></td>
      </tr>
	 <?
	 } // end for
	 ?> 
      <tr>
        <td colspan="3" align="left" style="border-top:#0099FF dotted 1px;">
			<? $sqlencode = urlencode($search_sql)  ; ?><?=devidepage($allpage, $keyword ,$sqlencode )?>  </td>
        </tr>	
	   <?
	 }
	 ?>
    </table></td>
  </tr>
</table>
</body>
</html>

Anon7 - 2021