$db=mysql_connect ("192.168.63.192", "bectero", "Ananhuhu") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("bectero");
mysql_query('SET character_set_results=utf8');
mysql_query('SET collation_connection=utf8_unicode_ci');
mysql_query('SET NAMES utf8');
?>
function dteNow() {
$dteToday = date("Y-m-d H:i:s");
//$dteToday = date("Y-m-d H:i:s",mktime (date("H")+14, date("i"), date("s"), date("m"), date("d"), date("Y")));
$dteNow = $dteToday;
return $dteNow;
}
function TodayDate(){
$dteToday = getdate();
$strToDay = $dteToday["mon"]."/".$dteToday["mday"]."/".$dteToday["year"];
$TodayDate = $strToDay;
return $TodayDate;
}
function RLDateFormat($str_date , $strFormat, $int_lang){
//Display on Document
if ($str_date != ""){
$arr_zero = array("0","0","");
$dte=strpos($str_date," ");
if ($dte != 0) {
$dte=substr($str_date, 0,$dte);
$time=strrpos($str_date," ");
$time=substr($str_date, $time);
list($year, $month, $day) = explode("-", $dte);
list($hour, $minutes, $seconds) = explode(":", $time);
}else{
$dte=$str_date;
list($year, $month, $day) = explode("-", $dte);
}
$int_year_date = $year;
if ($int_lang == 1){
$arr_month = array("Jan","Feb","Mar", "Apr" , "May" , "Jun" , "Jul" , "Aug" , "Sep", "Oct" , "Nov","Dec");
$arr_fullmonth = array("January","February","March", "April" , "May" , "June" , "July" , "August" , "September", "October" , "November","December");
}else{
$arr_month = array("..","..","..", ".." , ".." , ".." , ".." , ".." , "..", ".." , "..","..") ;
$arr_fullmonth = array("Ҥ","Ҿѹ","չҤ", "¹" , "Ҥ" , "Զع¹" , "áҤ" , "ԧҤ" , "ѹ¹", "Ҥ" , "Ȩԡ¹","ѹҤ");
$int_year_date = $int_year_date + 543;
}
switch ($strFormat){
case "md,yyyy" :
$strDateFormat = $arr_month[$month - 1]." ". $day.", ".$int_year_date;
break;
case "d/m/yy" :
$strDateFormat = $day."/".$arr_month[$month - 1]."/".substr($int_year_date,-2);
break;
case "d/m/yyyy" :
$strDateFormat = $day."/".$month."/".$year;
break;
case "d/m/y" :
$strDateFormat = $arr_zero[strlen(strval($day))].$day."/".$arr_zero[strlen(strval($month))].$month."/".substr($int_year_date,-2);
break;
case "d.m.y" :
$strDateFormat = $arr_zero[strlen(strval($day))].$day.".".$arr_zero[strlen(strval($month))].$month.".".substr($int_year_date,-2);
break;
case "dmyy" :
$strDateFormat = $day." ".$arr_month[$month-1]." ".substr($int_year_date,-2);
break;
case "dmyyyy" :
$strDateFormat = $day." ".$arr_month[$month-1]." ".$int_year_date;
break;
case "dm" :
$strDateFormat = $arr_zero[strlen(strval($day))].$day.".".$arr_zero[strlen(strval($month))].$month;
break;
case "d" :
$strDateFormat = $arr_zero[strlen(strval($day))].$day;
break;
case "yyyy" :
$strDateFormat = $year;
break;
case "dmmyyyy(h:m)" :
$strDateFormat = $day." ".$arr_fullmonth[$month - 1]." ".$int_year_date." (" . $hour. ":" . $arr_zero[strlen(strval($minute))].$minute. ")";
break;
case "d/m/y-hh:mm" :
$strDateFormat = $arr_zero[strlen(strval($day))].$day."/".$arr_zero[strlen(strval($month))].$month."/".substr($int_year_date,-2)." - ".$hour.":".$arr_zero[strlen(strval($minute))].$minute;
break;
case "d/m/y-hh:mmAM" :
//If hour(str_date) >
$intHour = $hour;
if (($intHour >= 0) && ($intHour < 12)) {
$strAMPM = "AM";
}else{
$intHour = $intHour - 12;
$strAMPM = "PM";
}
$strDateFormat = $arr_zero[strlen(strval($day))].$day."/".$arr_zero[strlen(strval($month))].$month."/".substr($int_year_date,-2)." - ".$arr_zero[strlen(strval($intHour))].$intHour& ":".$arr_zero[strlen(strval($minute))].$minute." ".$strAMPM;
break;
case "dmmyy" :
$strDateFormat = $day." ".$arr_fullmonth[$month - 1]." ".substr($int_year_date,-2);
break;
case "dmmyyyy" :
$strDateFormat = $day." ".$arr_fullmonth[$month - 1]." ".$int_year_date;
break;
case "d/mm/yyyy" :
$strDateFormat = $day."/".$arr_month[$month-1]."/".$int_year_date;
break;
default :
$strDateFormat = $arr_zero[strlen(strval($day))].$day."/".$arr_month[$month-1]."/".substr($int_year_date,-2);
}
}else{
$strDateFormat = "- ";
}
$RLDateFormat = $strDateFormat;
return $RLDateFormat;
}
function StrToDateSerial($dte_date){
if (trim($dte_date) == "" ){
$dte_temp = "";
}else{
$dte_temp = $dte_date;
$arr_date_part = split("-", $dte_temp);
$dte_temp = date("Y-m-d", mktime(0, 0, 0, intval(trim($arr_date_part[1])) ,intval(trim($arr_date_part[0])), intval(trim($arr_date_part[2]))) );
}
$StrToDateSerial = $dte_temp;
return $StrToDateSerial;
}
function StrToDateSerial_3($dte_date){
if (trim($dte_date) == "" ){
$dte_temp = "";
}else{
$dte_temp = $dte_date;
$arr_date_part = split("/", $dte_temp);
$dte_temp = date("Y-m-d", mktime(0, 0, 0, intval(trim($arr_date_part[1])) ,intval(trim($arr_date_part[0])), intval(trim($arr_date_part[2]))) );
}
$StrToDateSerial = $dte_temp;
return $StrToDateSerial;
}
function DateFormat($str_date , $int_lang){
//Display on Document
if ($str_date != "") {
$dte=strpos($str_date," ");
if ($dte != 0) {
$dte=substr($str_date, 0,$dte);
$time=strrpos($str_date," ");
$time=substr($str_date, $time);
list($year, $month, $day) = explode("-", $dte);
list($hour, $minutes, $seconds) = explode(":", $time);
}else{
$dte=$str_date;
list($year, $month, $day) = explode("-", $dte);
}
if ($int_lang == 1) {
$arr_month = array("Jan","Feb","Mar", "Apr" , "May" , "Jun" , "Jul" , "Aug" , "Sep", "Oct" , "Nov","Dec");
}else{
$arr_month = array("..","..","..", ".." , ".." , ".." , ".." , ".." , "..", ".." , "..","..") ;
}
$arr_zero = array("0","");
$int_year_date = $year;
if ($int_lang == 1) {
$int_year_date = $int_year_date;
$DateFormat = $arr_zero[strlen(strval($day))].$day."/".$arr_month[$month-1]."/".substr($int_year_date,-2);
}else{
$int_year_date = $int_year_date + 543;
$DateFormat = $arr_zero[strlen(strval($day))].$day." ".$arr_month[$month-1]." ".substr($int_year_date,-2);
}
}else{
$DateFormat = "-";
}
return $DateFormat;
}
function DateValueFormat($str_date){
$dte=strpos($str_date," ");
if ($dte != 0) {
$dte=substr($str_date, 0,$dte);
$time=strrpos($str_date," ");
$time=substr($str_date, $time);
list($year, $month, $day) = explode("-", $dte);
list($hour, $minutes, $seconds) = explode(":", $time);
}else{
$dte=$str_date;
list($year, $month, $day) = explode("-", $dte);
}
$arr_zero = array("0","");
$DateValueFormat = $day."-".$month."-". $year;
return $DateValueFormat;
}
function DateValueFormat_3($str_date){
$dte=strpos($str_date," ");
if ($dte != 0) {
$dte=substr($str_date, 0,$dte);
$time=strrpos($str_date," ");
$time=substr($str_date, $time);
list($year, $month, $day) = explode("-", $dte);
list($hour, $minutes, $seconds) = explode(":", $time);
}else{
$dte=$str_date;
list($year, $month, $day) = explode("-", $dte);
}
$arr_zero = array("0","");
$DateValueFormat3 = $day."/".$month."/". $year;
return $DateValueFormat3;
}
function getDayOfMonth( $int_month, $int_year ){
$DOMonth = array( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 );
$LDOMonth = array( 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
if ( ($int_year % 4) == 0 ) {
if ( ($int_year % 100 == 0) && ($int_year % 400 != 0) ){
$getDayOfMonth = $DOMonth[$int_month-1];
}
$getDayOfMonth = $LDOMonth[$int_month-1];
}else{
$getDayOfMonth = $DOMonth[$int_month-1];
}
return $getDayOfMonth;
}
function getDateTime($intDay, $intMonth, $intYear, $intHour, $intMinute, $strPeriod){
$strDateTime = $intMonth."/".$intDay."/".$intYear." ".$intHour.":".$intMinute.":00 ".$strPeriod;
$getDateTime = $strDateTime;
return $getDateTime;
}
?>
function genPageNumber($strUrl, $intPage, $intTotalPage, $intTotalRow, $bitSelectAll , $intPagePerOnce){
$strPage = "";
$intPage = intval($intPage);
//------- Set << mark ------
if ($bitSelectAll==true) {
$strPage = "Showing All [Total ".$intTotalRow."]";
echo $strPage;
}else{
//--- Page per Once ---
$intTotalRange = floor(intval( $intTotalPage / $intPagePerOnce ));
if (($intTotalPage % $intPagePerOnce) > 0) { $intTotalRange = $intTotalRange + 1;}
$intCurrentRange = floor(intval( $intPage / $intPagePerOnce ));
if (($intPage % $intPagePerOnce) > 0) { $intCurrentRange = $intCurrentRange + 1;}
if ($intCurrentRange <= 0) { $intCurrentRange = 1;}
$intStartPage = (( $intCurrentRange - 1 ) * $intPagePerOnce ) + 1;
$intEndPage = $intStartPage + $intPagePerOnce - 1;
//--- [Next Page Number] ---
$intNextFromPage = $intEndPage + 1;
$intNextToPage = $intNextFromPage + $intPagePerOnce - 1;
if ($intNextToPage > $intTotalPage) { $intNextToPage = $intTotalPage;}
//--- [Previous Page Number] ---
$intPrevFromPage =$intStartPage - $intPagePerOnce;
$intPrevToPage = $intPrevFromPage + $intPagePerOnce - 1;
$intParamPosition = strpos($strUrl, "?");
if ($intParamPosition > 0) {
$strParamSymbol = "&";
}else{
$strParamSymbol = "?";
}
if ($intCurrentRange > 1 ) {
$strPageNumber = "<< ". $intPrevFromPage."-".$intPrevToPage." | ";
}
for ($iPage = $intStartPage; $iPage<=$intEndPage; $iPage++){
if ($intTotalPage >= $iPage) {
$strPageLink = "".$iPage." ";
$strPageNumber = $strPageNumber.$strPageLink." | ";
}
}
if ( $intTotalRange > 1 ) {
if ($intCurrentRange < $intTotalRange) {
//------- Set >> mark ------
if ($intNextFromPage < $intNextToPage) {
$strToPage = $intNextFromPage."-".$intNextToPage;
}else{
$strToPage = $intNextFromPage;
}
$strPageNumber = $strPageNumber."".$strToPage." >> ";
}
}
if ($intTotalPage > 1) {
//--- show page number ---
$strPageNumber = $strPageNumber." [Show All ] ";
}else{
$strPageNumber = "";
}
$strPage = "Page ".$intPage." of ".$intTotalPage." [Total ".$intTotalRow."] ".$strPageNumber;
}
$genPageNumber = $strPage;
return $genPageNumber;
}
function genPageNumber2($strUrl, $intPage, $intTotalPage, $intTotalRow, $bitSelectAll , $intPagePerOnce){
$strPage = "";
$intPage = intval($intPage);
//------- Set << mark ------
if ($bitSelectAll==true) {
$strPage = "Showing All [Total ".$intTotalRow."]";
echo $strPage;
}else{
//--- Page per Once ---
$intTotalRange = floor(intval( $intTotalPage / $intPagePerOnce ));
if (($intTotalPage % $intPagePerOnce) > 0) { $intTotalRange = $intTotalRange + 1;}
$intCurrentRange = floor(intval( $intPage / $intPagePerOnce ));
if (($intPage % $intPagePerOnce) > 0) { $intCurrentRange = $intCurrentRange + 1;}
if ($intCurrentRange <= 0) { $intCurrentRange = 1;}
$intStartPage = (( $intCurrentRange - 1 ) * $intPagePerOnce ) + 1;
$intEndPage = $intStartPage + $intPagePerOnce - 1;
//--- [Next Page Number] ---
$intNextFromPage = $intEndPage + 1;
$intNextToPage = $intNextFromPage + $intPagePerOnce - 1;
if ($intNextToPage > $intTotalPage) { $intNextToPage = $intTotalPage;}
//--- [Previous Page Number] ---
$intPrevFromPage =$intStartPage - $intPagePerOnce;
$intPrevToPage = $intPrevFromPage + $intPagePerOnce - 1;
$intParamPosition = strpos($strUrl, "?");
if ($intParamPosition > 0) {
$strParamSymbol = "&";
}else{
$strParamSymbol = "?";
}
if ($intCurrentRange > 1 ) {
$strPageNumber = "<< ". $intPrevFromPage."-".$intPrevToPage." | ";
}
for ($iPage = $intStartPage; $iPage<=$intEndPage; $iPage++){
if ($intTotalPage >= $iPage) {
$strPageLink = "".$iPage." ";
$strPageNumber = $strPageNumber.$strPageLink." | ";
}
}
if ( $intTotalRange > 1 ) {
if ($intCurrentRange < $intTotalRange) {
//------- Set >> mark ------
if ($intNextFromPage < $intNextToPage) {
$strToPage = $intNextFromPage."-".$intNextToPage;
}else{
$strToPage = $intNextFromPage;
}
$strPageNumber = $strPageNumber."".$strToPage." >> ";
}
}
if ($intTotalPage > 1) {
//--- show page number ---
$strPageNumber = $strPageNumber." [Show All ] ";
}else{
$strPageNumber = "";
}
$strPage = "Page ".$intPage." of ".$intTotalPage." [Total ".$intTotalRow."] ".$strPageNumber;
}
$genPageNumber = $strPage;
return $genPageNumber;
}
function genPageNumberAjax($strUrl, $intPage, $intTotalPage, $intTotalRow, $bitSelectAll , $intPagePerOnce, $strFunction){
$strPage = "";
$intPage = intval($intPage);
//------- Set << mark ------
if ($bitSelectAll==true) {
$strPage = "Show All [".$intTotalRow." Records]";
echo $strPage;
}else{
//--- Page per Once ---
$intTotalRange = floor(intval( $intTotalPage / $intPagePerOnce ));
if (($intTotalPage % $intPagePerOnce) > 0) { $intTotalRange = $intTotalRange + 1;}
$intCurrentRange = floor(intval( $intPage / $intPagePerOnce ));
if (($intPage % $intPagePerOnce) > 0) { $intCurrentRange = $intCurrentRange + 1;}
if ($intCurrentRange <= 0) { $intCurrentRange = 1;}
$intStartPage = (( $intCurrentRange - 1 ) * $intPagePerOnce ) + 1;
$intEndPage = $intStartPage + $intPagePerOnce - 1;
//--- [Next Page Number] ---
$intNextFromPage = $intEndPage + 1;
$intNextToPage = $intNextFromPage + $intPagePerOnce - 1;
if ($intNextToPage > $intTotalPage) { $intNextToPage = $intTotalPage;}
//--- [Previous Page Number] ---
$intPrevFromPage =$intStartPage - $intPagePerOnce;
$intPrevToPage = $intPrevFromPage + $intPagePerOnce - 1;
$intParamPosition = strpos($strUrl, "?");
if ($intParamPosition > 0) {
$strParamSymbol = "&";
}else{
$strParamSymbol = "?";
}
if ($intCurrentRange > 1 ) {
$strPageNumber = "<< ". $intPrevFromPage."-".$intPrevToPage." | ";
}
for ($iPage = $intStartPage; $iPage<=$intEndPage; $iPage++){
if ($intTotalPage >= $iPage) {
$strPageLink = "".$iPage." ";
$strPageNumber = $strPageNumber.$strPageLink." | ";
}
}
if ( $intTotalRange > 1 ) {
if ($intCurrentRange < $intTotalRange) {
//------- Set >> mark ------
if ($intNextFromPage < $intNextToPage) {
$strToPage = $intNextFromPage."-".$intNextToPage;
}else{
$strToPage = $intNextFromPage;
}
$strPageNumber = $strPageNumber."".$strToPage." >> ";
}
}
if ($intTotalPage > 1) {
//--- show page number ---
$strPageNumber = $strPageNumber." [Show All ] ";
}else{
$strPageNumber = "";
}
$strPage = "Page ".$intPage." of ".$intTotalPage." [Total ".$intTotalRow."] ".$strPageNumber;
}
//End If
$genPageNumberAjax = $strPage;
return $genPageNumberAjax;
}
function genPageNumberBox($strUrl, $intPage, $intTotalPage, $intTotalRow, $bitSelectAll){
$strPage = "";
$strHidden = "";
$intPage = intval($intPage);
//------- Set << mark ------
if ($bitSelectAll==true) {
$strPage = "
Showing All [Total ".($intTotalRow+1)."]
";
}else{
$intStartPage = 1;
$intEndPage = $intTotalPage;
$intParamPosition = strpos($strUrl, "?");
if ($intParamPosition > 0) {
$strParamSymbol = "&";
//-----Generate hidden input -----
$strTemp = substr(strUrl, intParamPosition + 1);
$strTemp = split("&", $strTemp);
for ($i=0;$i";
}
}else{
$strParamSymbol = "?";
}
$strPageNumber = "Page ";
$strPageNumber .= " ";
if ($intPage == $intStartPage) {
$strPageNumber .= " ";
}else{
$strPageNumber .= " ";
}
$strPageNumber .= " ";
$strPageNumber .= "".$intPage." of ".$intTotalPage." ";
$strPageNumber .= " ";
if ($intPage == $intEndPage) {
$strPageNumber .= " ";
}else{
$strPageNumber .= " ";
}
$strPageNumber .= " ";
if ($intTotalPage == 1) {
$strPageNumber .= "[ Show All ] ";
}else{
$strPageNumber .= "[ Show All ] ";
}
$strPageNumber .= " ";
?>
if ($intTotalPage == 1) {
$strPage = "";
}else{
$strPage = "";
}
}
$genPageNumberBox = $strPage;
return $genPageNumberBox;
}
?>
Green Day Live In Bangkok - Share Your Green Day Experience ลุ้นบัตรฟรี 10 ใบ
ไม่มีใครอยู่ตัวคนเดียว
เราต่างเชื่อมโยงถึงกันผ่านความสนใจ ความคิด ตัวตนและแรงบันดาลใจของกันและกัน
ความบันเทิงเชื่อมโยงถึงกัน มันจุดประกายความต้องการในตัวเรา
ความต้องการของพวกเราเชื่อมโยงเราถึงกัน
เราสร้างสรรค์ความบันเทิง เราสนับสนุนการเชื่อมโยง
ทุกการเดินทางเริ่มจากก้าวเล็กๆเพียงก้าวเดียว
ท้าทายตัวเองให้เติบโต ในขณะที่คุณออกผจญภัยในการทางเดินของชีวิต
ใช้ความปรารถนาเป็นเข็มทิศนำทาง และใช้ความฝันเป็นแผนที่ชีวิต
แล้วหัวใจจะนำทางคุณไปเอง
ความท้าทายกลายเป็นเพียงอุปสรรคเล็กน้อยที่เราจะผ่านไปได้
เมื่อคุณมีแรงบันดาลเป็นผู้ช่วยนำทาง
ผลักดันตัวเอง
คุณอาจจะรู้สึกปลอดภัยถ้าเลือกทำในสิ่งที่เรียบง่าย
แต่บางครั้งความสุขที่คุณใฝ่หาอาจหาพบได้ในที่ๆเสี่ยงอันตรายที่สุดก็ได้
ในแต่ละวัน ลองทำในสิ่งที่คุณไม่กล้าทำดู
$strSql="select * from tbl_webboard_main where Site_Id=2 order by DTE_CREATE_DATE DESC";
$result = mysql_query($strSql);
$num=mysql_num_rows($result);
$i = 0;
if($num>0){
$row = mysql_fetch_array($result);
$intTotalRow = $num;
$PageSize = $intMaxRow;
if ($intPage != "all") {
$sql_limit = ( $intPage == 1) ? 0 : ($intPage - 1) * $PageSize ;
$sql_limit = " LIMIT " . $sql_limit . ", " . $PageSize . " ";
}
if ($intPage == "all") {
$intPage = 1;
$intMaxRow = $num;
$bitSelectAll = true;
}else{
$bitSelectAll = false;
}
$intTotalPage = ceil($num/$PageSize);
$c = 0;
$rec = 0;
$i = (( $intPage - 1 ) * $intMaxRow )+1;
$strSql.= $sql_limit;
$result=mysql_query($strSql);
while($row = mysql_fetch_array($result)) {
?>
echo RLDateFormat($row['DTE_CREATE_DATE'] , "d.m.y", 1)?> [IP: ]
...เพิ่มเติม
}
?>
if (($num > $intMaxRow) || ($bitSelectAll == true)){
?>
if($intTotalPage == ""){
$intTotalPage = 1;
}
$strUrl = "index.php";
$strPage = genPageNumber($strUrl, $intPage, $intTotalPage, $intTotalRow, $bitSelectAll , $intPagePerOnce);
echo $strPage;
?>
}
}
mysql_free_result($result);
?>
Content on this page requires a newer version of Adobe Flash Player.
Disclaimer: All information and content contained on these Web pages are based on the latest information available at the time of publication. BECTERO.COM reserves the right to change the content on this Web Site at any time without notice and shall not be responsible for any incorrectness, incompleteness, inappropriateness or typographical errors.
Copyright © 2008, www.bectero.com, All rights reserved.