header('Content-Type: text/html; charset=utf-8');
include_once ("init.php");
if(strpos($_SERVER['REQUEST_URI'],'index.php/')){
header("HTTP/1.1 301 Moved Permanently");
header("Location:".ROOT_PATH);
}
$c = $_REQUEST['c'];
$p1 = $_REQUEST['p1'];
$p2 = $_REQUEST['p2'];
$p3 = $_REQUEST['p3'];
$p4 = $_REQUEST['p4'];
$p5 = $_REQUEST['p5'];
if(strpos($_SERVER['REQUEST_URI'],'?c='.$c.'')){
$R_Url=$c.($p1?'-'.$p1:'').($p2?'-'.$p2:'').($p3?'-'.$p3:'').($p4?'-'.$p4:'').($p5?'-'.$p5:'').'.html';
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$R_Url."");
}
$pagenames = array (
'index' => 'home',
'contents' => 'contents',
'content' => 'content',
'products' => 'products',
'product' => 'product',
'pics' => 'pics',
'pic' => 'pic',
'member' => 'member',
'cart' => 'cart',
'inquiry' => 'inquiry',
'payout' => 'payout',
'downloads' => 'downloads'
);
$pagenames2 = array (
'getinquiryarea',
'getcartarea',
'getpayment',
'gettransport',
'getdiscount',
'getdiscountresult',
'getcontent',
'getstandard',
'success',
'sitemap',
'nan',
'yong',
'dong',
'jing',
'zhi',
'quan',
'jian',
'google5fd63b80b595dc02',
);
$pagename = "home";
if ($c) {
if ($pagenames[$c]) {
$pagename = $pagenames[$c];
} elseif ($urls[$c]) {
$pagename = $urls[$c];
} elseif (in_array($p1,array('gettopormenu','getproductpicsize'))) {
$pagename='common';
} elseif (in_array($c,$pagenames2)) {
$p1=$c;
} else {
redirect('notfound.htm');
}
}
define('USEDEFAULT', 0);
if(USEDEFAULT||check_setting('usedefault')){
define('INDEXPAGE', 'home.html');
if(!$c||($c=='index'&&!$p1)){
$p1='default';
}
}else{
define('INDEXPAGE',ROOT_PATH);
}
if (check_setting('order_open')) {
if(!$_SESSION['tempnum']){
$_SESSION['tempnum'] = time() . rand(100, 999);
}
$sql = "select a.*,b.useself,b.usets,b.usetprices,b.useps from orders_temp a left join prodtran b on a.proid=b.pid where ".($_SESSION['Mid']?'(a.mid='.$_SESSION['Mid'].' or a.tempnum="'.$_SESSION['tempnum'].'")':'a.tempnum="'.$_SESSION['tempnum']."\"")." order by a.id";
$temp_orders_objs = my_select($sql);
define('COUNTORDERS',count($temp_orders_objs??[]));
if ($settings['addition_open']) {
$temp_orders_addition_objs = my_select_bycolumn_arr("select * from orders_temp_addition where ".($_SESSION['Mid']?'(mid='.$_SESSION['Mid'].' or tempnum="'.$_SESSION['tempnum'].'")':'tempnum="'.$_SESSION['tempnum']."\"")." order by id","mainpid");
}
}
if(!$_SESSION['looked']){
$_SESSION['looked']=1;
my_query("update others set content=content+1 where id=11");
$others[11]['content']++;
if($others[13]['title']==date("Y-m-d")){
my_query("update others set content=content+1 where id=13");
$others[13]['content']++;
}else{
my_query("update others set content=1,title='".date("Y-m-d")."' where id=13");
$others[13]['content']=1;
}
}
$icons=my_select("select * from config where type=1 and wtype=1 order by orders desc");
$topthree=12;
if (check_setting('order_open')&&check_setting('member_open')) {
$topthree=4;
}elseif(check_setting('order_open')||check_setting('member_open')){
$topthree=6;
}
define('TOPTHREE', $topthree);
$topthree2=12;
if (check_setting('order_open')&&check_setting('member_open')) {
$topthree2=6;
}
define('TOPTHREE2', $topthree2);
if($usephone){
$tpn=0;
if (check_setting('prod_search')) {
$tpn++;
}
if (check_setting('order_open')) {
$tpn++;
}
if (check_setting('member_open')) {
$tpn++;
}
$tpa_value=($tpn>0)?(100/$tpn):0;
define('TPA',$tpa_value);
}
include (CONTROLLER_PATH . "/" . $pagename . ".php");
?>