selectDB('imarket_main'); $category->connect_DB('*','category_sub',' order by category_main_id asc , id asc'); $categoryNumRows=$category->get_nums_rows(); $category->get_data(); $user_online=0; if(isset($_SESSION["session_customerIMM"])){ $register_customer = new cls_member(); $register_customer->selectDB('imarket_member'); $register_customer->connect_DB('*','imarketmall_customer','where email =',"'".$_SESSION["session_customerIMM"]."' AND id=".$_SESSION["session_customerIDIMM"]); $user_online=$register_customer->get_nums_rows(); if($user_online>0){ $membermenu_customer = new cls_m_category(); $membermenu_customer->selectDB('imarket_main'); $membermenu_customer->connect_DB('*','customerpage_sub',' order by category_main_id asc , id asc'); $membermenuNumRowsCustomer=$membermenu_customer->get_nums_rows(); $membermenu_customer->get_data(); } } if(isset($_SESSION["session_user"])){ $membermenu = new cls_m_category(); $membermenu->selectDB('imarket_main'); $membermenu->connect_DB('*','memberpage_sub',' order by category_main_id asc , id asc'); $membermenuNumRows=$membermenu->get_nums_rows(); $membermenu->get_data(); $memberShop = new cls_shop(); $memberShop->selectDB('imarket_main'); $memberShop->connect_DB('*','shop','where member_id =',$_SESSION["session_shop_id"]); $memberShop->get_data_from_var(); $text[11]=$memberShop->get_text_pr_from_var(); $text[12]=$memberShop->get_text_article_from_var(); $text[13]=$memberShop->get_text_contactus_from_var(); $text[14]=$memberShop->get_text_payment_from_var(); $text[15]=$memberShop->get_text_webboard_from_var(); $text[26]=$memberShop->get_text_bestsell_from_var(); $text[27]=$memberShop->get_text_recommend_from_var(); } $member_them = new cls_shop(); $member_them->selectDB('imarket_main'); $ShoppingYim = new cls_m_product(); $ShoppingYim->selectDB('imarket_member'); $ShoppingYim->connect_DB('*','all_product','WHERE cargo_main_id =1 AND promote=2','order by id desc LIMIT 12'); $ShoppingYim->get_data(); $row=$ShoppingYim->get_nums_rows(); $today=date('YmdHis',mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"))); $SuperProducttoday = date("Y-m-d H:i:s"); // current time -- NO NEED TO CHANGE $SuperProduct = new cls_m_product(); $SuperProduct->selectDB('imarket_member'); $SuperProduct->connect_DB('*',"all_product","WHERE bid_process >=2 AND time_discount > '".$today."' " ,"order by time_discount asc"); $SuperProductNumRows=$SuperProduct->get_nums_rows(); $SuperProduct->get_data(); if($SuperProductNumRows>10)$SuperProductNumRows=10; for($m=0;$m<$SuperProductNumRows;$m++){ $SuperProduct_id[$m]=$SuperProduct->get_id($m); $enddate[$m]=$SuperProduct->get_time_discount($m); $super_discount[$m][6]=$SuperProduct->get_super_discount($m); $super_discount[$m][5]=$SuperProduct->get_super_discount1($m)+$super_discount[$m][6]; $super_discount[$m][4]=$SuperProduct->get_super_discount2($m)+$super_discount[$m][5]; $super_discount[$m][3]=$SuperProduct->get_super_discount3($m)+$super_discount[$m][4]; $super_discount[$m][2]=$SuperProduct->get_super_discount4($m)+$super_discount[$m][3]; $super_discount[$m][1]=$SuperProduct->get_super_discount5($m)+$super_discount[$m][2]; $super_discount[$m][0]=$SuperProduct->get_super_discount6($m)+$super_discount[$m][1]; $Superprice[$m]=$SuperProduct->get_cargo_price($m); if($SuperProductNumRows){ $final_bit.=$SuperProduct->get_bid_process($m)."/"; $timediscount[$m]=str_split($enddate[$m]); $yy=$timediscount[$m][0]."".$timediscount[$m][1]."".$timediscount[$m][2]."".$timediscount[$m][3]; $mo=$timediscount[$m][4]."".$timediscount[$m][5]; $dd=$timediscount[$m][6]."".$timediscount[$m][7]; $hh=$timediscount[$m][8]."".$timediscount[$m][9]; $mm=$timediscount[$m][10]."".$timediscount[$m][11]; $min=$timediscount[$m][12]."".$timediscount[$m][13]; $expire .= $yy."-".$mo."-".$dd." ".$hh.":".$mm.":".$min."/"; $finalday=$yy."-".$mo."-".$dd." ".$hh.":".$mm.":".$min; $howtime.=$Superprice[$m]."-".$super_discount[$m][0]."-".$super_discount[$m][1]."-".$super_discount[$m][2]."-".$super_discount[$m][3]."-".$super_discount[$m][4]."-".$super_discount[$m][5]."-".$super_discount[$m][6]."/"; $datetime1 = new DateTime($SuperProducttoday); $datetime2 = new DateTime($finalday); $interval = $datetime1->diff($datetime2); $start_dis[$m]= $interval->format('%a'); if($start_dis[$m]==6) $disperday[$m]="".$super_discount[$m][6]."|0|0|0|0|0|0"; else if($start_dis[$m]==5) $disperday[$m]="".$super_discount[$m][6]."|".$super_discount[$m][5]."|0|0|0|0|0"; else if($start_dis[$m]==4) $disperday[$m]="".$super_discount[$m][6]."|".$super_discount[$m][5]."|".$super_discount[$m][4]."|0|0|0|0"; else if($start_dis[$m]==3) $disperday[$m]="".$super_discount[$m][6]."|".$super_discount[$m][5]."|".$super_discount[$m][4]."|".$super_discount[$m][3]."|0|0|0"; else if($start_dis[$m]==2) $disperday[$m]="".$super_discount[$m][6]."|".$super_discount[$m][5]."|".$super_discount[$m][4]."|".$super_discount[$m][3]."|".$super_discount[$m][2]."|0|0"; else if($start_dis[$m]==1) $disperday[$m]="".$super_discount[$m][6]."|".$super_discount[$m][5]."|".$super_discount[$m][4]."|".$super_discount[$m][3]."|".$super_discount[$m][2]."|".$super_discount[$m][1]."|0"; else if($start_dis[$m]==0) $disperday[$m]="".$super_discount[$m][6]."|".$super_discount[$m][5]."|".$super_discount[$m][4]."|".$super_discount[$m][3]."|".$super_discount[$m][2]."|".$super_discount[$m][1]."|".$super_discount[$m][0].""; } else $timediscount[0][0]=$timediscount[0][1]=$timediscount[0][2]=$timediscount[0][3]=$timediscount[0][4]=$timediscount[0][5]=$timediscount[0][6]=$timediscount[0][7]=$timediscount[0][8]=$timediscount[0][9]=$timediscount[0][10]=$timediscount[0][11]=0; } // ต้องการแสดง 5 หัวข้อ ต่อ 1 หน้า $pagesize = 1; // ถ้า $page ไม่มีค่า กำหนดให้เท่ากับ 1 if (empty($page)) $page=1; $rt = $SuperProductNumRows%$pagesize; // หาจำนวนหน้าทั้งหมด if($rt!=0) $totalpage = floor($SuperProductNumRows/$pagesize)+1; //floor() ปัดเศษลงให้เป็นจำนวนเต็ม else $totalpage = floor($SuperProductNumRows/$pagesize); //floor() ปัดเศษลงให้เป็นจำนวนเต็ม $goto = ($page-1)*$pagesize; // หาหน้าที่จะกระโดดไป $gototo=$goto.","; $SuperProduct->connect_DB('*',"all_product","WHERE bid_process >=2 AND time_discount > '".$today."' order by time_discount asc limit",$gototo,$pagesize); $SuperProduct->get_data(); /***********************************************************************************************************************************/ $firsttime=date('Ymd',mktime(0,0,0,date("m"),date("d")-6,date("Y"))); $endtime=date('Ymd',mktime(0,0,0,date("m"),date("d")+6,date("Y"))); $message = new cls_webboard(); $message->selectDB('imarket_main'); $message->connect_DB('*','message',"where datetime >= '".$firsttime."' AND datetime <= '".$endtime."' AND answer != 0",'order by (answer*ip) desc ,id asc'); $message->get_data(); $cc=0; for ($i=0;$i<$message->get_nums_rows();$i++){ $datacheck = str_split ($message->get_datetime($i)); $count=$message->get_ip($i); if($message->get_datetime($i) < date('Ymd',mktime(0,0,0,date("m"),date("d"),date("Y")))) { if(date('Ymd',mktime(0,0,0,date($datacheck[4]."".$datacheck[5]),date($datacheck[6]."".$datacheck[7])+$count,date($datacheck[0]."".$datacheck[1]."".$datacheck[2]."".$datacheck[3])))>date('Ymd',mktime(0,0,0,date("m"),date("d"),date("Y")))) { //echo $messageID=$message->get_id($i)."
"; $txthelp[$cc++]="".$message->get_topic($i).""; } else { echo $messageID=$message->get_id($i)." DeleMessage
"; } }else if($message->get_datetime($i) == date('Ymd',mktime(0,0,0,date("m"),date("d"),date("Y")))){ //if(date('Ymd',mktime(0,0,0,date($datacheck[4]."".$datacheck[5]),date($datacheck[6]."".$datacheck[7])-$count,date($datacheck[0]."".$datacheck[1]."".$datacheck[2]."".$datacheck[3])))get_topic($i).""; } } /***************************************************************************************************************************************/ $divdata=0; $offer=0; ?> Shopping
 
 
ร้านค้า Login
 
 
"; echo"
    "; $logic=0; for($m=0;$m<$membermenuNumRows;$m++) { $n=$m+1; //$membermenu_id[$m] = $membermenu->get_category_id($m); //$membermenu_name[$m] = $membermenu->get_category_name($m); $city_id = $membermenu->get_category_main_id($m); $ceta_name = $membermenu->get_category_main($m); $ceta_sub_name = $membermenu->get_category_sub($m); $ceta_sub_id = $membermenu->get_category_sub_id($m); $category_mine_number = $membermenu->get_category_mine_number($m); if($ceta_sub_id ==36)continue; if(($membermenu->get_category_main_id($m)!=$membermenu->get_category_main_id ($m-1) && $logic==1)){ echo "
";$logic=0;} if(($membermenu->get_category_main_id($m)==7 && $logic==0) ){ $x=$membermenu->get_category_main_id($m); if($x<=2)$x=1; else if($x==3)$x=2; else if($x>=4 && $x<=6)$x=3; else if($x>=7 && $x<=8)$x=4; else $x=5; echo "
  • $ceta_name"; echo"
  • "; echo"
    "; echo"
     
    "; echo"
    "; echo"
    "; echo"
    "; echo"
    "; } else { echo "
    "; echo "
    ชื่อ:
    "; echo "
    "; echo ""; echo "
    "; echo "
    "; echo "
    "; echo "
    รหัส:
    "; echo "
    "; echo ""; echo "
    "; echo "
    "; echo "
    "; echo "
     
    "; echo "
    ลืมรหัสผ่าน
    "; echo "
    "; echo ""; echo "
    "; echo "
     
    "; echo "
    "; echo "
    "; echo "
    "; echo "
    "; } ?>
     
     
     
     
     
     
     
     
     
    สนใจเปิดร้านค้ากับเรา
    เกี่ยวกับเรา
    -เราคือใคร ?
    -แนะนำ / ติชม
    -ติดต่อเรา
    นโยบาย