require_once 'config.inc.php'; require_once 'captcha.php'; date_default_timezone_set("Asia/Taipei"); // include utility files // Reference our configuration file // Class that extends Smarty, used to process and display Smarty files require_once 'db_func.php'; require_once('class.phpmailer.php'); $mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch $mail->IsMail(); $gDbManager = new DbManager(MYSQL_CONNECTION_STRING); $gDbManager->DbQuery("SET NAMES 'Utf8'"); //require_once "Sajax.php"; $today = date("Y-m-d", time()); $dmtoday = date("Ymd", time()); $todayTime = date("Y-m-d H:i:s", time()); if($_SERVER['HTTP_X_FORWARDED_FOR']){ $m_user_ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } elseif($_SERVER['HTTP_CLIENT_IP']){ $m_user_ip = $_SERVER['HTTP_CLIENT_IP']; } else{ $m_user_ip = $_SERVER['REMOTE_ADDR']; } $m_user_ip = preg_match('/^([0-9]{1,3}\.){3}[0-9]{1,3}$/',$m_user_ip) ? $m_user_ip : 'Unknown'; //require_once "city.php"; $WORKPRG = ''; $sql = "select * from mt_set,mt_shopping_set"; $rec_set = $gDbManager->DbGetAll($sql); $rs_set = $rec_set[0]; $tset = new Tset(); $tset->HomeTxt = stripslashes($rs_set['HomeTxt']); $tset->eHomeTxt = stripslashes($rs_set['eHomeTxt']); $tset->foot2 = stripslashes($rs_set['foot2']); $tset->efoot2 = stripslashes($rs_set['eFoot2']); $tset->pay_intro = $rs_set['pay_intro']; $tset->fee1 = $rs_set['fee1']; $tset->nofee1 = $rs_set['nofee1']; $tset->fee2 = $rs_set['fee2']; $tset->nofee2 = $rs_set['nofee2']; $tset->fee3 = $rs_set['fee3']; $tset->nofee3 = $rs_set['nofee3']; $tset->bgtime = $rs_set['bg_time']; //order auto reply $tset->ordout_head = $rs_set['ordout_head']; $tset->eordout_head = $rs_set['eOrdout_head']; $tset->ordout = $rs_set['ordout']; $tset->eordout = $rs_set['eOrdout']; $tset->ordpay_title=$rs_set['ordpay_title']; $tset->eordpay_title=$rs_set['eOrdpay_title']; $tset->ordpay=$rs_set['ordpay']; $tset->eordpay=$rs_set['eOrdpay']; $tset->ordship_title=$rs_set['ordShip_title']; $tset->eordship_title=$rs_set['eOrdShip_title']; $tset->ordship=$rs_set['ordShip']; $tset->eordship=$rs_set['eOrdShip']; $tset->adminemail = $rs_set['adminEmail']; $tset->adminemailname = $rs_set['adminEmailName']; //$tset->dock = explode(",", $rs_set['dock']); $tset->discount= $rs_set['discount'];//首登購物金 $tset->discountmorethan= $rs_set['discountMoreThan'];//滿多少才可用購物金 $thisTime=time(); $str_time_now=time(); $exprTime=strtotime($rs_set['exprTime']." 00:00:00"); if($thisTime >= $exprTime){ //到了活動截止日 $tset->percentoff=100; }else{ $tset->percentoff=$rs_set['percentOff'];//全館85折 //echo $thisTime.",".$exprTime; } define("MYSTORENAME", $rs_set['adminEmailName']); $sql = "select * from mt_mod where isOn=1 order by Seq"; $list_mod = $gDbManager->DbGetAll($sql); $sql = "select * from mt_mod_type"; $list_modType = $gDbManager->DbGetAll($sql); foreach($list_modType as $val){ $Num=$val['Num']; $list_modType_link[$Num]=$val['vLink']; } $sql = "select * from mt_mod_type where Num = '".$modTypeNum."'"; $row_modType = $gDbManager->DbGetRow($sql); if($modNum){ $sql = "select * from mt_mod where Num = '".$modNum."'"; $row_mod = $gDbManager->DbGetRow($sql); } if($mecnum){ $sql = "select * from mt_product where Num = '".$mecnum."'"; $row_mec = $gDbManager->DbGetRow($sql); $classNum=$row_mec['MecType']; } if($classNum){ $sql = "select * from mt_product_class where Num = '".$classNum."'"; $row_class = $gDbManager->DbGetRow($sql); } $rs_seo['iHead']=$row_mec['iHead']?$row_mec['iHead']:($row_class['iHead']?$row_class['iHead']:($row_mod['iHead']?$row_mod['iHead']:$rs_set['iHead'])); $rs_seo['iKey']=$row_mec['iKey']?$row_mec['iKey']:($row_class['iKey']?$row_class['iKey']:($row_mod['iKey']?$row_mod['iKey']:$rs_set['iKey'])); $rs_seo['iDesc']=$row_mec['iDesc']?$row_mec['iDesc']:($row_class['iDesc']?$row_class['iDesc']:($row_mod['iDesc']?$row_mod['iDesc']:$rs_set['iDesc'])); $rs_seo['eHead']=$row_mec['eHead']?$row_mec['eHead']:($row_class['eHead']?$row_class['eHead']:($row_mod['eHead']?$row_mod['eHead']:$rs_set['eHead'])); $rs_seo['eKey']=$row_mec['eKey']?$row_mec['eKey']:($row_class['eKey']?$row_class['eKey']:($row_mod['eKey']?$row_mod['eKey']:$rs_set['eKey'])); $rs_seo['eDesc']=$row_mec['eDesc']?$row_mec['eDesc']:($row_class['eDesc']?$row_class['eDesc']:($row_mod['eDesc']?$row_mod['eDesc']:$rs_set['eDesc'])); $set_Area=array(1=>"國內",2=>"離島(金門,澎湖,馬祖)",3=>"海外-大陸、港澳",4=>"海外-日韓",5=>"海外-新馬"); if($_lang=="en") $set_Area=array(1=>"Taiwan",2=>"Overseas Islands,Taiwan",3=>"China, H.K. , Macau",4=>"Japan, Korea",5=>"Singapore, Malaysia"); $set_area_price=array(1=>"0|0",2=>"0|0",3=>"530|100",4=>"580|100",5=>"380|100"); include_once("Smarty.class.php"); $smarty = new Smarty(); if($_lang=="en"){ $smarty->setTemplateDir(dirname(__FILE__).'/../tpl/en'); }else{ $smarty->setTemplateDir(dirname(__FILE__).'/../tpl/cn'); } $smarty->compile_check=true; ?>