=1){?> ข่าวสารและกิจกรรม

=TO_DAYS(NOW()) ) OR (TO_DAYS(".$mod_tb_root."_sdate)<=TO_DAYS(NOW()) AND ". $mod_tb_root."_edate='0000-00-00 00:00:00' ) OR (TO_DAYS(".$mod_tb_root."_sdate)<=TO_DAYS(NOW()) AND TO_DAYS(".$mod_tb_root."_edate)>=TO_DAYS(NOW()) )) AND ".$mod_tb_root."_masterkey='".$masterkey."' "; $sql_pin.=" AND ".$mod_tb_root."_status !='Disable' AND ".$mod_tb_root."_statuspin !='No' AND ".$mod_tb_root."_subject !=''"; $sql_pin.=" ORDER BY ".$mod_tb_root."_order DESC "; $query_pin=mysql_query($sql_pin); $TotalRecordPin=mysql_num_rows($query_pin); //print_pre($sql_pin); $valCheckPin = $TotalRecordPin%2; */ $valEvenOdd="odd"; ## Default Value ############################################ // if($valCheckPin==0){ $SystemModule_defaultPageSize =8; // }else{ // $SystemModule_defaultPageSize =6; // } $SystemModule_defaultPageShow = 1; $SystemModule_MaxPage = 5; # Check to set default value ######################### if($PageSize=="") { $PageSize = $SystemModule_defaultPageSize; } $PageSize; if($PageShow=="") { $PageShow = $SystemModule_defaultPageShow; } $sql_cms ="SELECT ".$mod_tb_root."_id, ".$mod_tb_root."_subject , ".$mod_tb_root."_masterkey , ".$mod_tb_root."_title , ".$mod_tb_root."_credate, ".$mod_tb_root."_pic , ".$mod_tb_root."_view , ".$mod_tb_root."_groupProoject , ".$mod_tb_root."_subjecten, ".$mod_tb_root."_titleen, ".$mod_tb_root."_statuspin as pin FROM ".$mod_tb_root." WHERE ((".$mod_tb_root."_sdate='0000-00-00 00:00:00' AND ". $mod_tb_root."_edate='0000-00-00 00:00:00') OR (".$mod_tb_root."_sdate='0000-00-00 00:00:00' AND TO_DAYS(".$mod_tb_root."_edate)>=TO_DAYS(NOW()) ) OR (TO_DAYS(".$mod_tb_root."_sdate)<=TO_DAYS(NOW()) AND ". $mod_tb_root."_edate='0000-00-00 00:00:00' ) OR (TO_DAYS(".$mod_tb_root."_sdate)<=TO_DAYS(NOW()) AND TO_DAYS(".$mod_tb_root."_edate)>=TO_DAYS(NOW()) )) AND ".$mod_tb_root."_masterkey='".$masterkey."' AND ".$mod_tb_root."_subject !=''"; $sql_cms.=" AND ".$mod_tb_root."_status !='Disable'"; if($g>=1){ $sql_cms.=" AND ".$mod_tb_root."_groupProoject ='".$g."'"; } if($gg>=1){ $sql_cms.=" AND ".$mod_tb_root."_sgid ='".$gg."'"; } if($mm != ''){ // $dates = date_create($dates); $sql_cms.=" AND Month(".$mod_tb_root."_credate) = $mm"; } if($yy != ''){ // $dates = date_create($dates); $sql_cms.=" AND Year(".$mod_tb_root."_credate) = $yy"; } $query_cms=mysql_query($sql_cms); $TotalRecordCount=mysql_num_rows($query_cms); # Find max page size ######################### if($TotalRecordCount>$PageSize) { $NoOfPage= ceil($TotalRecordCount/$PageSize); } else { $NoOfPage=1; } # Recover page show into range ######################### if($PageShow>$NoOfPage) { $PageShow=$NoOfPage; } # Select only paging range ######################### $RecordStart = ($PageShow-1)*$PageSize; $sql_cms.=" ORDER BY ".$mod_tb_root."_order DESC LIMIT $RecordStart,$PageSize"; // print_pre($sql_cms); $query_cms=mysql_query($sql_cms); $count_row_cms=mysql_num_rows($query_cms); if($count_row_cms>=1){ ?> 1) { ?>
  • หน้าแรก
  • หน้าแรก
  • $NoOfPage) { $maxpage=$NoOfPage; } if($maxpage<$txtMaxCountPage) { $maxpage=$txtMaxCountPage; } if($maxpage-$minpage<=$txtMaxCheckPageA) { $minpage=$maxpage-$txtMaxCheckPageB; } if($NoOfPage<$txtMaxCountPage) { $maxpage=$NoOfPage; } for($i=$minpage;$i<=$maxpage;$i++) { if($i==$PageShow){ ?>
  • หน้าสุดท้าย
  • หน้าสุดท้าย
=1){ $indexCount=0; $arrData = array(); while($row_cms=mysql_fetch_array($query_cms)){ $arrData[] = $row_cms; } $arrNewData = array(); $arrData_UnPin = array(); foreach ($arrData as $key => $data) { if($data['pin'] == 'Yes'){ $arrNewData[] = $data; }else{ $arrData_UnPin[] = $data; } } foreach ($arrData_UnPin as $key => $newData) { $arrNewData[] = $newData; } // print_pre($arrNewData); foreach ($arrNewData as $key => $value) { $txt_cms_id=$value[0]; $txt_cms_subject=rechangeQuot($value[1]); $txt_cms_key=$value[2]; $txt_cms_detail=rechangeQuot($value[3]); $txt_cms_deate=txtFormatDateDot($value[4]); $txt_cms_pic='upload/'.$txt_cms_key.'/pictures/'.$value[5]; $txt_cms_picRoot=$core_path_root.'/upload/'.$txt_cms_key.'/pictures/'.$value[5]; if(!is_file($txt_cms_pic)){ $txt_cms_pic="images-en/nopic/noNews.jpg"; }else{ $txt_cms_pic=$txt_cms_pic; } $txt_cms_view=number_format($value[6]); $txt_cms_gid=$value[7]; $indexCount++; $valLinkNew="detail.php?".encodeURL("c=$txt_cms_id"); if($valEvenOdd=="odd"){ $valEvenOdd="even"; }else{ $valEvenOdd="odd"; } // print_pre($valEvenOdd); ?>

1) { ?>

  • หน้าแรก
  • หน้าแรก
  • $NoOfPage) { $maxpage=$NoOfPage; } if($maxpage<$txtMaxCountPage) { $maxpage=$txtMaxCountPage; } if($maxpage-$minpage<=$txtMaxCheckPageA) { $minpage=$maxpage-$txtMaxCheckPageB; } if($NoOfPage<$txtMaxCountPage) { $maxpage=$NoOfPage; } for($i=$minpage;$i<=$maxpage;$i++) { if($i==$PageShow){ ?>
  • 2000
  • 2000
  • หน้าสุดท้าย
  • หน้าสุดท้าย