ob_start(); ?>
session_start();?>
error_reporting (E_ALL ^ E_NOTICE); ?>
include("../inc/incConfig.php");?>
include("../inc/incConn.php");?>
include("../inc/incFnPage.php");?>
include("../inc/incFnDate.php");?>
include("../inc/incFnText.php");?>
include("../inc/incFnCommon.php");?>
include("../inc/incFnDataBinding.php");?>
include("inc/incLang.php");?>
//--------- Receive Variables ----------------
$intPage = $_GET["page"];
$intNewsID = $_GET["ID"];
//--------- Config Variables -------------------
//$intTopNavMenu = 3;
$intMaxRow = 3;
$intNewDate = 5;
$intSection = 6;
$strThumbNewsDefault = "pic_company.png";
//$strThumbNewsDefault = "thumbDefault.jpg";
//$tmpThumbNewsDefault = "noThumb01.gif";
//$arrThumbNewsDefault = array("noThumb01.gif", "noThumb02.gif", "noThumb03.gif", "noThumb04.gif");
if (($intNewsID!="")&&(isset($intNewsID))) {
$strCond = " AND (INT_NEWS_ID = ".$intNewsID." ) ";
}
if ($intNewsID!="") {
$strSql = "SELECT * FROM tbl_news WHERE BIT_ENABLE=1 AND INT_LANG=$intWebLang ".$strCond;
$result = mysql_query($strSql);
$num = mysql_num_rows($result);
if ($num > 0) {
if($Rs = mysql_fetch_array($result)) {
$strSubject = $Rs[STR_NEWS_SUBJECT];
$strDetail = $Rs[STR_NEWS_DETAIL];
//$dteNewsDate = RLDateFormat($Rs[DTE_NEWS_DATE] , "dmyyyy", $intWebLang);
$dteNewsDate = RLDateFormat($Rs[DTE_NEWS_DATE] , "dmyyyy", 1);
$strImage = $Rs[STR_IMAGE_THUMB_FILENAME];
}
}
mysql_free_result($result);
} else {
header("Location: news.php");
}
//=== Find Previous ID ===//
$strSql = "SELECT t2.INT_NEWS_ID FROM tbl_news t1 , tbl_news t2 WHERE (t1.BIT_ENABLE=1) AND (t1.INT_LANG=$intWebLang) AND (t2.BIT_ENABLE=1) AND (t2.INT_LANG=$intWebLang) AND ((t1.DTE_NEWS_DATE > t2.DTE_NEWS_DATE) OR ((t1.DTE_NEWS_DATE = t2.DTE_NEWS_DATE) AND (t1.INT_NEWS_ID > t2.INT_NEWS_ID))) AND (t1.INT_NEWS_ID <> t2.INT_NEWS_ID) AND (t1.INT_NEWS_ID = $intNewsID) ORDER BY t2.DTE_NEWS_DATE DESC, t2.INT_NEWS_ID DESC ";
//echo $strSql;
$result = mysql_query($strSql);
$num = mysql_num_rows($result);
if ($num > 0) {
if($Rs = mysql_fetch_array($result)) {
$intPrevID = $Rs[INT_NEWS_ID];
}
} else {
$intPrevID = NULL;
}
mysql_free_result($result);
//================//
//=== Find Next ID ===//
$strSql = "SELECT t2.INT_NEWS_ID FROM tbl_news t1 , tbl_news t2 WHERE (t1.BIT_ENABLE=1) AND (t1.INT_LANG=$intWebLang) AND (t2.BIT_ENABLE=1) AND (t2.INT_LANG=$intWebLang) AND ((t1.DTE_NEWS_DATE < t2.DTE_NEWS_DATE) OR ((t1.DTE_NEWS_DATE = t2.DTE_NEWS_DATE) AND (t1.INT_NEWS_ID < t2.INT_NEWS_ID))) AND (t1.INT_NEWS_ID <> t2.INT_NEWS_ID) AND (t1.INT_NEWS_ID = $intNewsID) ORDER BY t2.DTE_NEWS_DATE ASC, t2.INT_NEWS_ID ASC ";
$result = mysql_query($strSql);
$num = mysql_num_rows($result);
if ($num > 0) {
if($Rs = mysql_fetch_array($result)) {
$intNextID = $Rs[INT_NEWS_ID];
}
} else {
$intNextID = NULL;
}
mysql_free_result($result);
//================//
?>
$intMenu = 5;
?>
Thai Kansai Paint Co., Ltd.
|
include("incNav.php");?> |
|
|
|
|
if($strImage != ""){
//echo $strImage;
$img = getimagesize("../imgUpload/".$strImage);
$Width= $img[0];
if ($Width>=640){
$intWidth = 640;
}else{
$intWidth = $Width;
}
?>
}?>
|
$strSqlFile = "select * from tbl_news_file where INT_NEWS_ID = $intNewsID";
//echo $strSqlFile;
$resultFile = mysql_query($strSqlFile);
$numFile = mysql_num_rows($resultFile);
if ($numFile > 0){
?>
Attachment Files |
while($RsFile = mysql_fetch_array($resultFile)) {
$strFilename = $RsFile[STR_FILENAME];
$strFileSubject = $RsFile[STR_FILE_SUBJECT];
$strFilePath = realpath("../download/".$strFilename);
if (file_exists($strFilePath)) {
$strFileSize = filesize($strFilePath);
$strFileSize = number_format(($strFileSize/1024), 2);
$strFileIcon = getFileIcon($strFilePath);
}
?>
 |
|
echo $strFileSubject ?>
[ echo $strFileSize ?> kb.] |
|
|
|
}
?>
|
}?> |
|
|
|
|
|
|
include("incFooter.php");?> |
|
|