|
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/ |
Upload File : |
<?
include("../../config/config.inc.php");
//=========================================
// Select attach files where status id_attach_file = $sub_id
// @author Kridsada Satakarn
// @date 2009/06/20
// @return a array of list attach files where status id_attach_file = $sub_id
//=========================================
function selectAttachFiles($sub_id, $id_type)
{
$add_cond = "";
if($id_type >= 0)
{
$add_cond = " AND id_type = ". $id_type;
}
$arr = array();
$sql = "SELECT
tbl_attach_file.attach_file,
tbl_attach_file.run_id,
tbl_attach_file.comment
FROM
tbl_attach_file
WHERE
tbl_attach_file.id_attach_file = '$sub_id' $add_cond order by run_id ASC";
$query = mysql_query($sql);
while($rs = mysql_fetch_assoc($query))
{
$arr[$rs[run_id]]['file'] = $rs[attach_file];
$arr[$rs[run_id]]['comment'] =( $rs[comment]=="")?$rs[attach_file]:$rs[comment];
}
return $arr;
}
function showListFile($id, $id_type)
{
$listFiles = selectAttachFiles($id, $id_type);
$path = "attach_file/agenda/";
$str_show = "";
if(count($listFiles) > 0)
{
foreach($listFiles as $key => $value)
{
$str_show .= " <a href=\"download.php?path=$path$value[file]&filename=$value[file]\" target='fdownload' >".$value['comment']."</a><BR>";
}
}else
{
$str_show = " ";
}
return $str_show;
}
?>
<!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>
<style type="text/css">
.page {
font : 9px tahoma;
font-weight : bold;
color : #0280D5;
padding : 1px 3px 1px 3px;
}
.pagelink {
font : 9px tahoma;
font-weight : bold;
color : #000000;
text-decoration : underline;
padding : 1px 3px 1px 3px;
}
.go {
BORDER: #59990e 1px solid;
PADDING-RIGHT: 0.38em;
PADDING-LEFT: 0.38em;
FONT-WEIGHT: bold;
FONT-SIZE: 105%;
BACKGROUND: url(../hr3/hr_report/images/hdr_bg.png) #6eab26 repeat-x 0px -90px;
FLOAT: left;
PADDING-BOTTOM: 0px;
COLOR: #fff;
MARGIN-RIGHT: 0.38em;
PADDING-TOP: 0px;
HEIGHT: 1.77em
}
#bf .go {
FLOAT: none
}
.go:hover {
BORDER: #3f8e00 1px solid;
BACKGROUND: url(../hr3/hr_report/images/hdr_bg.png) #63a218 repeat-x 0px -170px;
}
.q {
BORDER-RIGHT: #5595CC 1px solid;
PADDING-RIGHT: 0.7em;
BORDER-TOP: #5595CC 1px solid;
PADDING-LEFT: 0.7em;
FONT-WEIGHT: normal; FONT-SIZE: 105%;
FLOAT: left;
PADDING-BOTTOM: 0px;
MARGIN: 0px 0.38em 0px 0px;
BORDER-LEFT: #5595CC 1px solid;
WIDTH: 300px;
PADDING-TOP: 0.29em;
BORDER-BOTTOM: #5595CC 1px solid;
HEIGHT: 1.39em
}
.tabberlive .tabbertab {
background-color:#FFFFFF;
height:200px;
}
</style>
<style type="text/css">
<!--
.header1 { font-family:"MS Sans Serif", Tahoma, Arial;
font-size:1em;
font-weight:bold;
color: #FFFFFF;
}
.main { font-family:"MS Sans Serif", Tahoma, Arial;
font-size:0.8em;
color:#FF0000;
font-weight:bold;
}
.normal { font-family:"MS Sans Serif", Tahoma, Arial;
font-size:0.8em;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.style1 {color: #FF0000}
-->
</style>
</head>
<?
if($_GET)
{
$id = $_GET[idsub];
$id_type = $_GET[id_type];
}
?>
<body bgcolor="#F4F4F4">
<table align="center" border="0" style="filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#144C85', EndColorStr='#ffffff');" width="100%" cellpadding="0" cellspacing="2" class="normal" height="100%">
<tr>
<th bgcolor="#B0C6E6">
ä¿ÅìṺ
</th>
</tr>
<tr >
<td align="left" bgcolor="#F4F4F4">
<? echo showListFile($id, $id_type)?>
</td>
</tr>
</table>
<iframe id="fdownload" name="fdownload" width="0" height="0" scrolling="no" frameborder="0"></iframe>
</body>
</html>