|
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/agenda/agenda_backup20091110/ |
Upload File : |
<?php
include("../../config/config.inc.php");
include("function/function.php");
$smonth = array("","ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค.");
function check_data($id, $type = "type"){
$sql = "SELECT * FROM tbl_config_meeting WHERE type_set='$id' and colump ='$type'";
$result = @mysql_query($sql);
$num1 = @mysql_num_rows($result);
return $num1;
}
$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 ;
}
}
$cons="";
if($owner_id!=""){
$cons=" where org_owner='$owner_id' ";
$paramet_page="&owner_id=$owner_id";
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
?>
<!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="../../common/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>
</head>
<body>
<?php
$page=$_GET['page'];
if(empty($page)){
$page=1;
}
$sql="select count(*) from tbl_subject $cons";
$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&page=$pre_page".$paramet_page."'";
$next = "self.location='".$PHP_SELF."?type=1&page=$next_page".$paramet_page."'";
$prevTen = "self.location='".$PHP_SELF."?type=1&page=1".$paramet_page."'";
$nextTen = "self.location='".$PHP_SELF."?type=1&page=$total_page".$paramet_page."'";
?>
<br />
<table width="98%" border="0" align="center" cellpadding="1" id="page" cellspacing="0">
<tr>
<td width="59%" align="right"><? if($View==''&&$all_row>0){?>
<? if($page==1){?>
<img src="../../images/page_div_icon/xFirst.gif" />
<? }else{?>
<img src="../../images/page_div_icon/First.gif" align="absmiddle" border="0" width="10" height="12" onclick="<?=$prevTen;?>" onmouseover="style.cursor='hand';"/>
<? }?>
<? if($page==1){?>
<img src="../../images/page_div_icon/xPrevious.gif" />
<? }else{?>
<img src="../../images/page_div_icon/Previous.gif" align="absmiddle" border="0" width="7" height="12" onclick="<?=$prev;?>" onmouseover="style.cursor='hand';"/>
<? }?>
<?php
$board_link_num = $per_page;
$ii = 1;
if ( $board_link_num > $total_page ){
$loop_page = $total_page;
} else {
$bx = $board_link_num / 2;
$pp = $page - $bx;
$pn = $page + $bx;
$loop_page = $pn;
$ii = $pp;
if ( $total_page <= $loop_page ) {
$loop_page = $total_page;
$ii = $loop_page - ($board_link_num -1);
}
if ( $ii < 1 ) {
$ii = 1;
$loop_page = $ii + ($board_link_num -1);
}
}
for($i=$ii;$i<=$loop_page;$i++){
if ( $i==$page || !$page ) {
$txt = "<font color=\"E80000\"><b>$i</b></font>";
} else {
$txt = $i;
}
?>
<a href="<?=$PHP_SELF;?>?type=1&page=<?=$i;?>">
<?=$txt;?>
</a>
<?
} # for
?>
<? if($page==$loop_page){?>
<img src="../../images/page_div_icon/xNext.gif" />
<? }else{?>
<img src="../../images/page_div_icon/Next.gif" align="absmiddle" border="0" width="7" height="12" onclick="<?=$next;?>" onmouseover="style.cursor='hand';"/>
<? }?>
<? if($page==$loop_page){?>
<img src="../../images/page_div_icon/xLast.gif" />
<? }else{?>
<img src="../../images/page_div_icon/Last.gif" align="absmiddle" border="0" width="10" height="12" onclick="<?=$nextTen;?>" onmouseover="style.cursor='hand';"/>
<? } }#End View=?></td>
<? if($View==""){$Klink="?View=All"; $CSh="ข้อมูลทั้งหมด"; $Klink2="?View=";}else{$Klink="?View=";$CSh="ข้อมูล 10 รายการล่าสุด";$Klink2="?View=All";}?>
<td width="41%" align="right" valign="middle"> ทั้งหมด <b> <font color="#CC0000">
<?=number_format($all_row);?>
</font> </b> รายการ
<? if($View !='All'){?>
แบ่งเป็น <b><font color="#0033CC">
<?=number_format($total_page);?>
</font></b> หน้า
<? }
?></td>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td bgcolor="#000000">
<table width="100%" border="0" cellpadding="3" cellspacing="1">
<tr>
<? if(check_data("2","c1") > 0 or (check_data("1") > 0)){?>
<td width="5%" rowspan="2" align="center" bgcolor="#E7E7E7"><span class="index2"><strong>ลำดับ</strong></span></td>
<? }?>
<? if(check_data("2","c2") > 0 or (check_data("1") > 0)){?>
<td width="14%" rowspan="2" align="center" bgcolor="#E7E7E7"><span class="index2"><strong>ชื่อเรื่อง</strong></span></td>
<? } ?>
<? if(check_data("2","c8") > 0 or (check_data("1") > 0)){?>
<td width="16%" rowspan="2" align="center" bgcolor="#E7E7E7"><span class="index2"><strong>เลขที่หนังสือ</strong></span></td>
<? } ?>
<? if(check_data("2","c3") > 0 or (check_data("1") > 0)){?>
<td width="17%" rowspan="2" align="center" bgcolor="#E7E7E7"><span class="index2"><strong>รายละเอียด</strong></span></td>
<? } ?>
<? if(check_data("2","c4") > 0 or (check_data("1") > 0)){?>
<td width="12%" rowspan="2" align="center" bgcolor="#E7E7E7"><span class="index2"><strong>ลงวันที่</strong></span></td>
<? } ?>
<? if(check_data("2","c5") > 0 or (check_data("1") > 0)){?>
<td width="12%" colspan="3" align="center" bgcolor="#E7E7E7">เอกสารประกอบการประชุม</td>
<? } ?>
<? if(check_data("2","c7") > 0 or (check_data("1") > 0)){?>
<? } ?>
<? if(check_data("2","c6") > 0 or (check_data("1") > 0)){?>
<? } ?>
</tr>
<tr>
<td align="center" bgcolor="#E7E7E7"><strong>รายงานการประชุม</strong></td>
<td align="center" bgcolor="#E7E7E7"><strong>วาระการประชุม</strong></td>
<td align="center" bgcolor="#E7E7E7"><strong>เอกสารประกอบการประชุม</strong></td>
</tr>
<?
$begin=($page-1)*$per_page;
$sql = "select * from `tbl_subject` $cons ORDER BY id_sub DESC limit $begin,$per_page";
$i =$begin;
$result = mysql_query($sql)or die("Query line " . __LINE__ . " error<hr>".mysql_error());
while($rs_s = mysql_fetch_assoc($result)){
$i = $i + 1;
$bgcolor = ($bgcolor == "#f8f8f8") ? "#ffffff" : "#f8f8f8";
if($i <= 3){ $i_new = "<img src='../../images_sys/new1.gif' border='0'>";}else{ $i_new = "";}
?>
<tr bgcolor="<?=$bgcolor?>">
<? if(check_data("2","c1") > 0 or (check_data("1") > 0)){?>
<td align="center"><?=$i?></td>
<? } ?>
<? if(check_data("2","c2") > 0 or (check_data("1") > 0)){?>
<td align="left"><?=$rs_s[subject]?></td>
<? } ?>
<? if(check_data("2","c8") > 0 or (check_data("1") > 0)){?>
<td align="left"><?=$rs_s[noorder]?></td>
<? } ?>
<? if(check_data("2","c3") > 0 or (check_data("1") > 0)){?>
<td align="left"><?=$rs_s[detail]?></td>
<? } ?>
<? if(check_data("2","c4") > 0 or (check_data("1") > 0)){?>
<td align="center"><?
$arr_t = explode("-",$rs_s[date_create]);
if($arr_t[0] != "0000"){
echo intval($arr_t[2]) ." ".$smonth[intval($arr_t[1])]." ". $arr_t[0];
}
?></td>
<? }
if(check_data("2","c5") > 0 or (check_data("1") > 0)){
$strSQL_attach = "SELECT * FROM tbl_attach_file WHERE id_attach_file='".$rs_s[id_sub]."' AND status_file='Y' ORDER by run_id asc";
$Result_attach = mysql_query($strSQL_attach);
while($Rs_a = mysql_fetch_object($Result_attach)){
$comment=($Rs_a->comment =="")?$Rs_a->attach_file :$Rs_a->comment ;
$f[$Rs_a->id_type]="<a href='attach_file/$Rs_a->attach_file' target='_blank'><img src='images/attach.gif' border='0' alt='คลิกเพื่อแสดงไฟล์แนบ'>$comment </a>";
}
?>
<td align="left"><?=($f[3])?$f[3]:" "?></td>
<td align="left"><?=($f[15])?$f[15]:" "?></td>
<td align="left"><?=($f[16])?$f[16]:" "?></td>
<? unset($f); } ?>
<? if(check_data("2","c7") > 0 or (check_data("1") > 0)){?>
<? }?>
<? if(check_data("2","c6") > 0 or (check_data("1") > 0)){?>
<? } ?>
</tr>
<?
} // end while
?>
</table>
</td>
</tr>
</table>
</body>
</html>