|
|
 |
if ($usertype=='admin') { ?>
} ?>ข่าวประชาสัมพันธ์ |
 |
 |
|
$no=0;
$show_c=1;
$date=date("Y-m-d");
if ($usertype=='admin') {
$sql="select * from tb_content where ref_cat=4 ORDER BY `id_content` DESC";
}else{
$sql = "SELECT * FROM `tb_content` WHERE show_date <= '$date' and end_date >= '$date' and `ref_cat` = 4 AND `show` = 1 ORDER BY `id_content` DESC ";
}
$result=mysql_db_query($dbname,$sql);
$num=mysql_num_rows($result);
if($num>0) { ?>
while ($r=mysql_fetch_array($result)) {
$id_content=$r[id_content];
$name_content=$r[name_content];
$content=$r[content];
$ref_cat=$r[ref_cat];
$create_date=$r[create_date];
$show_date=$r[show_date];
$end_date=$r[end_date];
$show=$r[show];
$status=$r[status];
$no++;
?>
|
echo"$name_content " ; if ($status == 1){ echo " ";} ?>
echo " ( $create_date )";}?>
|
if ($usertype=='admin') { ?>
} ?>
}
?>
|
 |
if ($usertype=='admin') { ?>
} ?>กิจกรรม |
 |
 |
|
$no=0;
$show_c=1;
$date=date("Y-m-d");
if ($usertype=='admin') {
$sql="select * from tb_content where ref_cat=5 ORDER BY `id_content` DESC";
}else{
$sql = "SELECT * FROM `tb_content` WHERE show_date <= '$date' and end_date >= '$date' and `ref_cat` = 5 AND `show` = 1 ORDER BY `id_content` DESC ";
}
$result=mysql_db_query($dbname,$sql);
$num=mysql_num_rows($result);
if($num>0) { ?>
while ($r=mysql_fetch_array($result)) {
$id_content=$r[id_content];
$name_content=$r[name_content];
$content=$r[content];
$ref_cat=$r[ref_cat];
$create_date=$r[create_date];
$show_date=$r[show_date];
$end_date=$r[end_date];
$show=$r[show];
$status=$r[status];
$no++;
?>
|
echo"$name_content " ; if ($status == 1){ echo " ";} ?>
echo " ( $create_date )";}?>
|
if ($usertype=='admin') { ?>
} ?>
}
?>
|
|