'輸入框',"2"=>'文本',"3"=>'編輯器',"4"=>'RadioBox',"5"=>'CheckBox網站導航',"6"=>'圖片上傳',"7"=>'RadioBox文件上傳類型',"8"=>'文件上傳'); //1:網站設置 $GLOBALS['SITE_TYPE']=array("1"=>'1,2,3,4,5,6,7,11,12,9,10'); //常用常量 $GLOBALS['USER_SEX']=array("1"=>'男',"2"=>'女'); $GLOBALS['USER_STATE']=array("0"=>'未封鎖',"1"=>'已封鎖'); $GLOBALS['USER_STATE_OPERATE']=array("0"=>'解鎖',"1"=>'封鎖'); $GLOBALS['USER_LOG_TYPE']=array("1"=>'管理者回覆訊息',"2"=>'訂單備註訊息','3'=>'運費修改訊息'); $GLOBALS['CON_ACTIVE']=array("1"=>'上架',"2"=>'下架'); $GLOBALS['ADMIN_YESNO']=array("0"=>'否',"1"=>'是'); $GLOBALS['PRO_QNA_STATE']=array("0"=>'不隱藏',"1"=>'隱藏'); $GLOBALS['PRO_MAIN']=array("1"=>'餅乾先生',"2"=>'非常日本',"3"=>'晶天洞地',"4"=>'3C生活館'); $GLOBALS['PRO_MAIN_NUM']=array("one"=>'1',"two"=>'2',"three"=>'3',"four"=>'4'); $GLOBALS['PRO_MAIN_IMG']=array("1"=>'store1.jpg',"2"=>'store2.jpg',"3"=>'store3.jpg',"4"=>'store4.jpg'); $GLOBALS['PRO_TYPE']=array("1"=>'一般',"2"=>'團購',"3"=>'秒殺'); $GLOBALS['PRO_SHOW']=array("1"=>'推薦區',"2"=>'秒殺區',"3"=>'新進商品區',"4"=>'團購區 '); $GLOBALS['PRO_SHOW_TYPE']=array("1"=>'recommend',"2"=>'spike',"3"=>'new',"4"=>'group'); $GLOBALS['PRO_SHOW_IMG']=array("1"=>'pd_recommend.jpg',"2"=>'pd_soon.jpg',"4"=>'pd_team.jpg',"12"=>'pd_soon2.jpg',"14"=>'pd_team2.jpg'); $GLOBALS['ORDER_PAY_TYPE']=array("1"=>'ATM/銀行/無摺存款','2'=>'PayPal','3'=>'宅配貨到付款','4'=>'超商取貨付款','5'=>'自取','6'=>'信用卡付款'); //$GLOBALS['PAYCART_SHOW_PAY_TYPE']=array("1"=>'ATM/銀行/無摺存款

','2'=>'PayPal

','3'=>'宅配貨到付款

','4'=>'超商取貨付款

','5'=>'自取'); $GLOBALS['ORDER_PAY_STATE']=array("1"=>'尚未收到匯款','2'=>'已收到匯款','3'=>'匯款已回報'); $GLOBALS['ORDER_OUT_STATE']=array("0"=>'等待中',"1"=>'面交','2'=>'等待準備中','3'=>'出貨','4'=>'交易完成','5'=>'退貨','9'=>'暫不處理'); //$GLOBALS['ORDER_SEND_TYPE']=array("1"=>'宅配',"2"=>'超商',"3"=>'自取 下午1:00-6:30(周一到周六)'); $GLOBALS['ORDER_SEND_TYPE']=array("1"=>'宅配',"2"=>'超商取貨(超商取貨限制大小長+寬+高不得超過90cm請依照商品標示購買)',"3"=>'現場取貨(商品將為您保留一個星期,下午1:00-6:30 周一到周六)'); $GLOBALS['PAYCART_SHOW_SEND_TYPE']=array("1"=>'宅配

',"2"=>'超商取貨(超商取貨限制大小長+寬+高不得超過90cm請依照商品標示購買)

',"3"=>'現場取貨(商品將為您保留一個星期,下午1:00-6:30 周一到周六)'); $GLOBALS['ORDER_SEND_TIME_TYPE']=array("1"=>'上午',"2"=>'下午',"3"=>'晚上'); $GLOBALS['ORDER_SEND_TIME_ONE']=array("1"=>'上班時段',"2"=>'例假日'); $GLOBALS['ORDER_SEND_TIME_TWO']=array("1"=>'上午',"2"=>'下午',"3"=>'晚上'); $GLOBALS['SERVICE_TYPE']=array("0"=>'未回覆',"1"=>'已回覆',"2"=>'請讀取',"3"=>'已讀取'); $GLOBALS['MEDIA_TYPE']=array("1"=>'報導影音',"2"=>'平面媒體報導'); $GLOBALS['AD_SITE']=array( "1"=>'首頁左上廣告 243X96', "2"=>'首頁中部廣告(適用所有頁面底部),185X73', "3"=>'首頁底部餅乾先生大圖 206X129', "4"=>'首頁底部餅乾先生小圖 99X79', "5"=>'首頁底部非常日本大圖 206X129', "6"=>'首頁底部非常日本小圖 99X79', "7"=>'首頁底部晶天洞地大圖 206X129', "8"=>'首頁底部晶天洞地小圖 99X79', "9"=>'首頁底部其它館別大圖 206X129', "10"=>'首頁底部其它館別小圖 99X79', "11"=>'其它館別Banner大廣告 775X180', "12"=>'商品列表,內容頁,會員專區等左則廣告 194X85', "13"=>'搜尋結果頁,媒體報道,討論區等左則廣告 178X310', "14"=>'餅乾先生Banner大廣告 775X180', "15"=>'非常日本Banner大廣告 775X180', "16"=>'晶天洞地Banner大廣告 775X180', "17"=>'3C生活館Banner大廣告 775X180', ); //圖片上傳位址 define("UP_PRO_FILE_DIR","../upload/pro/"); define("UP_MEDIA_FILE_DIR","../upload/media/"); define("UP_AD_FILE_DIR","../upload/ad/"); define("UP_SITE_FILE_DIR","../upload/site/"); //表名 define("TABLE_ADMIN","tb_admin"); define("TABLE_ADMIN_SORT","tb_admin_sort"); define("TABLE_AREA","tb_area"); define("TABLE_AD","tb_ad"); define("TABLE_PRO","tb_pro"); define("TABLE_PRO_SORT","tb_pro_sort"); define("TABLE_PRO_EVAL","tb_pro_eval"); define("TABLE_PRO_QNA","tb_pro_qna"); define("TABLE_FORUM","tb_forum"); define("TABLE_FORUM_SORT","tb_forum_sort"); define("TABLE_FORUM_BACK","tb_forum_back"); define("TABLE_NEWS","tb_news"); define("TABLE_NEWSLETTER","tb_newsletter"); define("TABLE_MEDIA","tb_media"); define("TABLE_REPORT","tb_report"); define("TABLE_ORDER","tb_order"); define("TABLE_GROUP_ORDER","tb_group_order"); define("TABLE_ORDER_DETAIL","tb_order_detail"); define("TABLE_SERVICE","tb_service"); define("TABLE_SETUP","tb_setup"); define("TABLE_TREE","tb_tree"); define("TABLE_USER","tb_user"); define("TABLE_USER_LOG","tb_user_log"); define("TABLE_DB_LOG","tb_db_log"); //主要參數 $db=new database($host,$user,$password,$database); $SecondDb=new database($host,$user,$password,$database); $ThirdDb=new database($host,$user,$password,$database); $adTem=new Template(); $objResponse=new myxajax(); $Mail=new Mail(); //會員管理相關資訊 $GLOBALS['ErrMess']['require_urepass']=get_err_mess('密碼和確認密碼不相同!',200); $GLOBALS['ErrMess']['require_uname']=get_err_mess('請輸入姓名!'); $GLOBALS['ErrMess']['require_umobile']=get_err_mess('請輸入電話(M)!'); $GLOBALS['ErrMess']['require_uphone']=get_err_mess('請輸入電話(H)!'); $GLOBALS['ErrMess']['require_uophone']=get_err_mess('請輸入電話(O)!'); $GLOBALS['ErrMess']['require_uaddress']=get_err_mess('請輸入地址!'); $GLOBALS['ErrMess']['require_upass']=get_err_mess('請輸入密碼!'); $GLOBALS['ErrMess']['require_uaccount']=get_err_mess('請輸入帳號!'); //商品類別資訊 $GLOBALS['ErrMess']['require_sname']=get_err_mess('請輸入類別名稱!'); $GLOBALS['ErrMess']['require_sgroup']=get_err_mess('請選擇所屬館別!'); //商品錯誤資訊 $GLOBALS['ErrMess']['require_pname']=get_err_mess('請輸入商品名稱!'); $GLOBALS['ErrMess']['require_psid']=get_err_mess('請選擇商品類別!'); $GLOBALS['ErrMess']['require_pid']=get_err_mess('請輸入商品編號!'); //媒體資訊 $GLOBALS['ErrMess']['require_mtitle']=get_err_mess('請輸入標題!'); //權限錯誤資訊 $GLOBALS['ErrMess']['require_mname']=get_err_mess('輸入權限人帳號'); $GLOBALS['ErrMess']['require_mgroup']=get_err_mess('請選擇權限組'); $GLOBALS['ErrMess']['require_mpass']=get_err_mess('請輸入密碼'); $GLOBALS['ErrMess']['require_msname']=get_err_mess('請輸入權限組名稱'); //論壇資訊 $GLOBALS['ErrMess']['require_ftitle']=get_err_mess('請輸入標題!'); $GLOBALS['ErrMess']['require_fsort']=get_err_mess('請選擇所屬類別!'); $GLOBALS['ErrMess']['require_finfo']=get_err_mess('請輸入內容!'); //訊息資訊 $GLOBALS['ErrMess']['require_ntitle']=get_err_mess('請輸入標題!'); $GLOBALS['ErrMess']['require_ninfo']=get_err_mess('請輸入內容!'); //訊息資訊 $GLOBALS['ErrMess']['require_rtitle']=get_err_mess('請輸入標題!'); $GLOBALS['ErrMess']['require_rinfo']=get_err_mess('請輸入內容!'); //評價資訊 $GLOBALS['ErrMess']['require_eback']=get_err_mess('請輸入回覆!'); //客戶管理資訊 $GLOBALS['ErrMess']['require_saccount']=get_err_mess('請輸入發言人帳號!'); //論壇資訊 $GLOBALS['ErrMess']['require_binfo']=get_err_mess('請輸入回貼內容!'); //訂單錯誤資訊 $GLOBALS['ErrMess']['require_oname']=get_err_mess('請輸入訂購人'); $GLOBALS['ErrMess']['require_ocname']=get_err_mess('請輸入收件人'); $GLOBALS['ErrMess']['require_ophone']=get_err_mess('請輸入連絡電話'); $GLOBALS['ErrMess']['require_ocphone']=get_err_mess('請輸入連絡電話'); $GLOBALS['ErrMess']['require_oemail']=get_err_mess('請輸入E_mail'); $GLOBALS['ErrMess']['require_ocode']=get_err_mess('請輸入郵遞區號'); $GLOBALS['ErrMess']['require_oaddress']=get_err_mess('請輸入收件地址'); ?> $this->page_dir ); $this->adTem->set_var($iniPageValue); } function chk_user_lg($Url=null) { if(empty($Url)) $Url=$this->page_dir.'index.php'; if(!session_is_registered("loginUser")) MessageLocation($Url,"請先登入會員!"); } function userLogout() { session_unregister('loginUser'); $this->xajaxResponse->alert("您已經登出!"); $this->xajaxResponse->redirect($this->page_dir."index.php"); return $this->xajaxResponse; } function userLogin($formValue) { $newCode=false; if(empty($formValue['_User'])||empty($formValue['_Pass'])) { $this->xajaxResponse->alert("用戶名和密碼不能為空!"); $newCode=true; } else { $user=strtolower($formValue['_User']); $res=$this->db->get_data("select * from `".TABLE_USER."` where lower(`u_account`)='".$user."' and `u_pass`='".$formValue['_Pass']."' "); if(!$res) { $this->xajaxResponse->alert("用戶名或密碼錯誤!"); $newCode=true; } if($res['u_state']=='1') { $this->xajaxResponse->alert("對不起,您已經被封鎖,請您聯繫管理員!"); $newCode=true; } } if(!$newCode) { $_SESSION['loginUser']=$res; //$this->xajaxResponse->redirect($this->page_dir."user/index.php"); $this->xajaxResponse->redirect($this->page_dir."user/message.php"); //$this->xajaxResponse->script('window.open("'.$this->page_dir.'user/message.php","","scrollbars=yes,width=270,height=200");'); } return $this->xajaxResponse; } function setInitPage($type=false) { if( session_is_registered("loginUser") ) { $temp = $_SESSION['loginUser']['u_name'].', 你好! 登出|關於我們| 購物車|訂閱電子報|'; } else { $temp='會員登入|加入會員| 購物車|訂閱電子報 '; } $this->xajaxResponse->assign("indLoginUserInfo","innerHTML",$temp); $this->xajaxResponse->addOption('Type','請選擇館別',''); $this->xajaxResponse->addOption('Type','全部館別',''); foreach ($GLOBALS['PRO_MAIN'] as $key => $v) { $this->xajaxResponse->addOption('Type',$v,$key); } $this->db->query("update `".TABLE_SETUP."` set `Value`=`Value`+1 where `Name`='SiteView'"); $viewTotal=$this->db->get_data("select `Value` from `".TABLE_SETUP."` where `Name`='SiteView'"); $this->xajaxResponse->assign('siteViewTotal','innerHTML',$viewTotal['Value']); $orderDocument=$this->db->get_data("select `Value` from `".TABLE_SETUP."` where `Name`='OrderDocument'"); $this->xajaxResponse->assign('orderDocumentDownload','href',$this->page_dir.'upload/site/'.$orderDocument['Value']); $orderDocument=$this->db->get_data("select `Value` from `".TABLE_SETUP."` where `Name`='OrderSkin'"); $this->xajaxResponse->assign('orderSkinDownload','href',$this->page_dir.'upload/site/'.$orderDocument['Value']); $orderDocument=$this->db->get_data("select `Value` from `".TABLE_SETUP."` where `Name`='OrderMoon'"); $this->xajaxResponse->assign('orderMoonDownload','href',$this->page_dir.'upload/site/'.$orderDocument['Value']); return $this->xajaxResponse; } //前台都要用到(top頁面搜尋)2010-01-18添加 function topSearchInfo($formValue) { $toUrl=GetUrlData(array("Key"=>urlencode($formValue['Key']),"Type"=>$formValue['Type']),$this->page_dir.'product/searchList.php'); $this->xajaxResponse->redirect($toUrl); return $this->xajaxResponse; } //用戶相關頁面中right頁面找到密碼 function userFindPass($formValue) { $newCode=false; if(empty($formValue['_User'])) { $this->xajaxResponse->alert("帳號不能為空!"); $newCode=true; } else { $user=strtolower($formValue['_User']); $res=$this->db->get_data("select * from `".TABLE_USER."` where lower(`u_account`)='".$user."' "); if(!$res) { $this->xajaxResponse->alert("沒有此用戶!"); $newCode=true; } } if(!$newCode) { $body=''.$res['u_name'].'('.$res['u_account'].')您好,

您的帳號登入密碼為 '.$res['u_pass'].'
請妥善保存此密碼,並請最少每個月變更密碼一次,以維護資訊安全
謝謝 !!'; @send_mail($res['u_email'],'忘記密碼',$body);; //$this->Mail->findPassMail($res); $this->xajaxResponse->alert("密碼已經發送到您的信箱,請注意查收!"); $this->xajaxResponse->redirect($this->page_dir."index.php"); } return $this->xajaxResponse; } //轉寄好友檢測用戶名和Email function checkSendToFri($formValue) { $err=false; if(!eregi("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3}$",$formValue['Email'])) { $err=true; $errMsg.='您輸入的Email有誤! '; } if(empty($formValue['User'])) { $err=true; $errMsg.='請輸入姓名! '; } if($err) $this->xajaxResponse->alert($errMsg); return $err; } function getProShowImg($show) { if(!empty($show)) { $showArray=@explode(',',$show); $threeKey=@array_search('3',$showArray); if(!empty($threeKey)) unset($showArray[$threeKey]); asort($showArray); $newShow=@implode('',$showArray); return $GLOBALS['PRO_SHOW_IMG'][$newShow]; } } function addToCart($proId,$proNum) { if(session_is_registered('loginUser')) { if(empty($proNum)) $this->xajaxResponse->alert('請輸入商品數量!'); else { $proRes=$this->db->get_data("select * from `".TABLE_PRO."` where (`id`)='".$proId."' "); if($proRes['p_num']xajaxResponse->alert('本批預訂已經預訂一空,請等下一批開放在行搶購!'); else $this->xajaxResponse->alert('本商品已經搶購光光啦,下次手腳要快!!'); } else $this->xajaxResponse->alert('目前商品剩余數量為'.$proRes['p_num'].',請不要超此數量!'); } else { $preYes=false; $lastYes=false; $errYes=false; if($proRes['p_type']==2) $lastYes=true; if(count($_SESSION['userCart'])>0) { foreach ($_SESSION['userCart'] as $pId => $pNum) { $curRes=$this->db->get_data("select * from `".TABLE_PRO."` where (`id`)='".$pId."' "); if($curRes['p_type']==2) $preYes=true; } if( $preYes && $lastYes ) { if(!array_key_exists($proId,$_SESSION['userCart'])) $errYes=true; } else { if( ($preYes && !$lastYes) || (!$preYes && $lastYes)) $errYes=true; } } if($errYes) $this->xajaxResponse->alert('注意:購物車只能購買一種團購商品,不能與一般或秒殺商品組成訂單!'); else { $_SESSION['userCart'][$proId]+=$proNum; $this->xajaxResponse->alert('此商品已加到購物車!'); $this->xajaxResponse->redirect($this->page_dir.'user/myCart.php'); } } } } else { $this->xajaxResponse->alert('請先登入會員!'); } return $this->xajaxResponse; } function setMyCarPgInfo($numShow=true,$operate=true,$button=true,$oId=null,$isOrderFreight=true) { if(count($_SESSION['userCart'])==0) $this->xajaxResponse->assign("cart_info","innerHTML",'
目前購物車無資料
'); else { $myCarInfo='
購物清單
'; $myCarInfo.=($operate)?'':''; $myCarInfo.=''; foreach ($_SESSION['userCart'] as $Id => $num) { $proRes=$this->db->get_data("select * from `".TABLE_PRO."` where `id`='".$Id."' "); $proNum=($numShow)?'':$num; $myCarInfo.=''; $myCarInfo.=($operate)?' ':''; $myCarInfo.=''; $totalPay+=$proRes['p_price']*$num; } $myCarInfo.=' '; if(session_is_registered('userOrderFreight')) $orderFreightInputValue=$_SESSION['userOrderFreight']; else { $orderNoFreight=$this->db->get_data("select * from `".TABLE_SETUP."` where `id`='10' "); $orderFreight=$this->db->get_data("select * from `".TABLE_SETUP."` where `id`='9' "); if($totalPay<$orderNoFreight['Value']) $orderFreightInputValue=$orderFreight['Value']; else $orderFreightInputValue=0; } $totalPay+=$orderFreightInputValue; if($isOrderFreight) { $myCarInfo.=''; } else { $myCarInfo.=''; } /*$myCarInfo.=' ';*/ if(!empty($oId)) { $orderRes=$this->db->get_data("select * from `".TABLE_ORDER."` where MD5(`o_id`)='".$oId."'"); if(!empty($orderRes['o_freight'])) { $myCarInfo.=' '; $totalPay+=$orderRes['o_freight']; } } $myCarInfo.=' '; $myCarInfo.='
商品名稱 數量 單價 小計操作
'.$proRes['p_name'].' '.$proNum.' NT$ '.$proRes['p_price'].' NT$ '.($proRes['p_price']*$num).' 刪除
商品金額合計
NT$ '.$totalPay.'
運費預設也可自己填寫,可參考計算方式,土城面交自取請填寫0,如果不清楚可不填寫,回傳之後管理員會通知您!
運費
NT$
運費
NT$ '.$orderFreightInputValue.'
運費
'.$orderFreightInput.'
貨到付款手續費 NT$ '.$orderRes['o_freight'].'
總計
NT$ '.$totalPay.'
'; $myCarInfo.=($button)?'
         
':''; $this->xajaxResponse->assign("cart_info",'innerHTML',$myCarInfo); return $totalPay; } } function setMyCarPgInfoFromData($oId=null) { $myCarInfo='
購物清單
'.$strBr.' '; $this->db->query("select * from `".TABLE_ORDER_DETAIL."` where `d_oid`='".$oId."' "); while ($detailRes=$this->db->record()) { $proRes=$this->sDb->get_data("select * from `".TABLE_PRO."` where `id`='".$detailRes['d_pid']."' "); $myCarInfo.=''; $totalPay+=$proRes['p_price']*$detailRes['d_pnum']; } $myCarInfo.=' '; $orderRes=$this->db->get_data("select * from `".TABLE_ORDER."` where (`o_id`)='".$oId."'"); if(!empty($orderRes['o_freight'])) { $myCarInfo.=' '; } $myCarInfo.=' '; return $myCarInfo; } function getMyCarPgInfo($oId,$type=false) { $strBr=($type)?'

':''; $orderRes=$this->db->get_data("select * from `".TABLE_ORDER."` where `o_id`='".$oId."'"); $sendType=$GLOBALS['ORDER_SEND_TYPE'][$orderRes['o_sendtype']]; if($orderRes['o_sendtype']=='2') { if($orderRes['o_shop_type']==2) { $sendType.='
交易序號 : '.$orderRes['sn_id']. '
超商類別 : '.$orderRes['st_cate']. '
門市代碼 : '.$orderRes['st_code']. '
門市名稱 : '.$orderRes['st_name']. '
門市電話 : '.$orderRes['st_tel']. '
門市地址 : '.$orderRes['st_addr']; } else $sendType.=' '.$orderRes['o_storeaddress']; } $myCarInfo='
訂單資料
'.$strBr.'
商品名稱 數量 單價 小計
'.$proRes['p_name'].' '.$detailRes['d_pnum'].' NT$ '.$proRes['p_price'].' NT$ '.($proRes['p_price']*$detailRes['d_pnum']).'
商品金額合計 NT$ '.$totalPay.'
貨到付款手續費 NT$ '.$orderRes['o_freight'].'
運費 NT$ '.$orderRes['o_orderfreight'].'
總計 NT$ '.($orderRes['o_paytotal']).'
訂單編號 '.$orderRes['o_id'].' 訂購日期 '.date("Y-m-d",$orderRes['o_date']).'
訂購人 '.$orderRes['o_name'].' 收件人 '.$orderRes['o_cname'].'
連絡電話 '.$orderRes['o_phone'].' 連絡電話 '.$orderRes['o_cphone'].'
E_mail '.$orderRes['o_email'].' 收件地址 '.$orderRes['o_code'].$orderRes['o_address'].'
取貨方式 '.$sendType.'

付款方式 '.$GLOBALS['ORDER_PAY_TYPE'][$orderRes['o_paytype']].'

轉出帳號後五碼 轉帳日期:
ATM匯款才需要填寫其他免填
為避免其他相同金額匯入帳戶,請填寫你轉出帳號後五碼,以便確認核對你的款項。
備註 '.nl2br($orderRes['o_uback']).'

'; $myCarInfo.=''.$strBr.'
購物清單
'.$strBr.' '; $this->db->query("select * from `".TABLE_ORDER_DETAIL."` where `d_oid`='".$oId."' "); while ($detailRes=$this->db->record()) { $proRes=$this->sDb->get_data("select * from `".TABLE_PRO."` where `id`='".$detailRes['d_pid']."' "); $myCarInfo.=''; $totalPay+=$proRes['p_price']*$detailRes['d_pnum']; } $myCarInfo.=' '; if(!empty($orderRes['o_freight'])) { $myCarInfo.=' '; } $myCarInfo.=' '; $myCarInfo.='
商品名稱 數量 單價 小計
'.$proRes['p_name'].' '.$detailRes['d_pnum'].' NT$ '.$proRes['p_price'].' NT$ '.($proRes['p_price']*$detailRes['d_pnum']).'
商品金額合計 NT$ '.$totalPay.'
貨到付款手續費 NT$ '.$orderRes['o_freight'].'
運費 NT$ '.$orderRes['o_orderfreight'].'
總計 NT$ '.($orderRes['o_paytotal']).'

餅乾先生購物商城
匯款資訊:姓名:劉書榮 郵局:700 帳號:00018020163766
地址:北縣土城市承天路8巷19號
網址:www.mrcookie.tw
電話:0982-366738
fax:02-2267-6266
E-mail:mr.cookie888@gmail.com
'; return $myCarInfo; } function getMyCarMailInfo($oId,$type=false) { $strBr=($type)?'

':''; $orderRes=$this->db->get_data("select * from `".TABLE_ORDER."` where `o_id`='".$oId."'"); $myCarInfo='
訂單資料
'.$strBr.'
訂單編號 '.$orderRes['o_id'].' 訂購日期 '.date("Y-m-d",$orderRes['o_date']).'
訂購人 '.$orderRes['o_name'].' 收件人 '.$orderRes['o_cname'].'
連絡電話 '.$orderRes['o_phone'].' 連絡電話 '.$orderRes['o_cphone'].'
E_mail '.$orderRes['o_email'].' 收件地址 '.$orderRes['o_code'].$orderRes['o_address'].'
取貨方式 '.$GLOBALS['ORDER_SEND_TYPE'][$orderRes['o_sendtype']].'

轉出帳號後五碼 後五碼 : '.$orderRes['o_five'].'
轉帳日期:'.$orderRes['o_fivedate'].'
為避免其他相同金額匯入帳戶,請填寫你轉出帳號後五碼,以便確認核對你的款項。請到訂單查詢中查詢您的訂購單
備註 '.nl2br($orderRes['o_uback']).'

'; $myCarInfo.=''.$strBr.'
購物清單
'.$strBr.' '; $this->db->query("select * from `".TABLE_ORDER_DETAIL."` where `d_oid`='".$oId."' "); while ($detailRes=$this->db->record()) { $proRes=$this->sDb->get_data("select * from `".TABLE_PRO."` where `id`='".$detailRes['d_pid']."' "); $myCarInfo.=''; $totalPay+=$proRes['p_price']*$detailRes['d_pnum']; } $myCarInfo.=' '; if(!empty($orderRes['o_freight'])) { $myCarInfo.=' '; } $myCarInfo.=' '; $myCarInfo.='
商品名稱 數量 單價 小計
'.$proRes['p_name'].' '.$detailRes['d_pnum'].' NT$ '.$proRes['p_price'].' NT$ '.($proRes['p_price']*$detailRes['d_pnum']).'
商品金額合計 NT$ '.$totalPay.'
貨到付款手續費 NT$ '.$orderRes['o_freight'].'
運費 NT$ '.$orderRes['o_orderfreight'].'
總計 NT$ '.($orderRes['o_paytotal']).'

感謝你購買餅乾先生的東西要查詢訂單請按會員專區
餅乾先生購物商城
匯款資訊:姓名:劉書榮 郵局:700 帳號:00018020163766
地址:北縣土城市承天路8巷19號
網址:www.mrcookie.tw
電話:0982-366738
fax:02-2267-6266
E-mail:mr.cookie888@gmail.com
'; return $myCarInfo; } function getUserAccount($value=null) { if($value==0) return '超級管理員'; else { $userRes=$this->tDb->get_data("select `u_account` from `".TABLE_USER."` where `id`='".$value."'"); return $userRes['u_account']; } } //首頁中部,各頁底部 function getFootAdList() { $adList=''; $this->db->query("select * from `".TABLE_AD."` where `a_site`='2' order by `id` desc limit 0,5"); while ($adRes=$this->db->record()) { $adList.=''; } $adList.='
'; $this->xajaxResponse->assign("middleAdInfo",'innerHTML',$adList); } //商品頁左中 function getProductLeftAdList() { $this->db->query("select * from `".TABLE_AD."` where `a_site`='12' order by `id` desc limit 0,2"); while ($adRes=$this->db->record()) { $adList.='
'; } $this->xajaxResponse->assign("productLeftAdInfo",'innerHTML',$adList); } //稍殺區,討論等左 function getOtherLeftAdList() { $Type=$_GET['Type']; if($Type=='spike') { $adList='
'; } $this->db->query("select * from `".TABLE_AD."` where `a_site`='13' order by `id` desc limit 0,2"); while ($adRes=$this->db->record()) { $adList.='
'; } $this->xajaxResponse->assign("otherLeftAdInfo",'innerHTML',$adList); } //商品頁Banner function getProductBannerAdList() { $Type=$_GET['Type']; switch ($Type) { case 'one': $aSite='14'; break; case 'two': $aSite='15'; break; case 'three': $aSite='16'; break; case 'four': $aSite='17'; break; default: $aSite='11'; break; } $adRes=$this->db->get_data("select * from `".TABLE_AD."` where `a_site`='".$aSite."' order by `id` desc limit 0,1"); if($adRes) { $adList=''; $this->xajaxResponse->assign("productBannerAdInfo",'innerHTML',$adList); } } } ?> xajax->registerFunction(array("topSearchInfo",$this,"topSearchInfo")); //用戶登出程序 $this->xajax->registerFunction(array("userLogout",$this,"userLogout")); //頁面主體程序 $this->xajax->registerFunction(array("setPageInfo",$this,"setPageInfo")); $this->xajax->processRequests(); } function pg_value() { $adArray=array( "main"=>$this->page_dir."template/index.tpl", "top"=>$this->page_dir."template/file/top.tpl", "foot"=>$this->page_dir."template/file/foot.tpl" ); $this->adTem->set_file($adArray); $this->clPageValue(); $setupRes=$this->db->get_data("select * from `".TABLE_SETUP."` where `id`='1' "); if($setupRes) { $this->adTem->set_var("bannerAdInfo",$setupRes['Value']); } $this->adTem->set_var($this->pg_xajax_js()); $this->adTem->parse("pg_top","top"); $this->adTem->parse("pg_foot","foot"); $this->adTem->pparse("out","main"); } function setPageInfo() { //頁面主體程序 $this->setNewsListInfo(); $this->setSpikeProListInfo(); $this->setHotProListInfo(); $this->setRecommendProListInfo(); $this->setNewProListInfo(); $this->setGroupProListInfo(); $this->setAdLsitInfo(); return $this->setInitPage(); } function setNewsListInfo() { $sql=" select * from `".TABLE_NEWS."` order by `id` desc limit 0, 8"; $this->db->query($sql); while ($res=$this->db->record()) { $info.='
  • '.substrbig($res['n_title'],48).'
  • '; } $this->xajaxResponse->assign("newsListInfo",'innerHTML',$info); } function setSpikeProListInfo() { $sql=" select * from `".TABLE_PRO."` where `p_state`='1' and `p_bdate`<='".date("Y-m-d")."' and `p_edate`>='".date("Y-m-d")."' and `p_show` like '%2%' order by `id` desc limit 0, 3"; $this->db->query($sql); $i=0; while ($res=$this->db->record()) { $listInfo.='
    '.$res['p_price'].'
    '; $i++; } $this->xajaxResponse->assign("spikeProListInfo",'innerHTML',$listInfo); } function setHotProListInfo() { $sql=" select * from `".TABLE_PRO."` where `p_state`='1' and `p_bdate`<='".date("Y-m-d")."' and `p_edate`>='".date("Y-m-d")."' order by `p_view` desc limit 0, 5"; $this->db->query($sql); $imgArray=array("1"=>'no_1.gif',"2"=>'no_2.gif',"3"=>'no_3.gif',"4"=>'no_4.gif',"5"=>'no_5.gif'); $i=1; $listInfo=''; while ($res=$this->db->record()) { $listInfo.=''; $i++; } $listInfo.='
    '.$res['p_price'].'
    '; $this->xajaxResponse->assign("hotProListInfo",'innerHTML',$listInfo); } function setRecommendProListInfo() { $sql=" select * from `".TABLE_PRO."` where `p_state`='1' and `p_bdate`<='".date("Y-m-d")."' and `p_edate`>='".date("Y-m-d")."' and `p_show` like '%1%' order by `id` desc limit 0, 3"; $this->db->query($sql); while ($res=$this->db->record()) { $imgArray[]=''; $infoArray[]='
    '.substrbig($res['p_name'],28).'...
    '.$res['p_price'].'
    '; } $listInfo='
    '.$imgArray[0].' '.$imgArray[1].' '.$imgArray[2].'
    '.$infoArray[0].' '.$infoArray[1].' '.$infoArray[2].'
    '; $this->xajaxResponse->assign("recommendProListInfo",'innerHTML',$listInfo); } function setNewProListInfo() { $sql=" select * from `".TABLE_PRO."` where `p_state`='1' and `p_bdate`<='".date("Y-m-d")."' and `p_edate`>='".date("Y-m-d")."' and `p_show` like '%3%' order by `id` desc limit 0, 3"; $this->db->query($sql); while ($res=$this->db->record()) { $imgArray[]=''; $infoArray[]='
    '.substrbig($res['p_name'],28).'...
    '.$res['p_price'].'
    '; } $listInfo='
    '.$imgArray[0].' '.$imgArray[1].' '.$imgArray[2].'
    '.$infoArray[0].' '.$infoArray[1].' '.$infoArray[2].'
    '; $this->xajaxResponse->assign("newProListInfo",'innerHTML',$listInfo); } function setGroupProListInfo() { $sql=" select * from `".TABLE_PRO."` where `p_state`='1' and `p_bdate`<='".date("Y-m-d")."' and `p_edate`>='".date("Y-m-d")."' and `p_show` like '%4%' order by `id` desc limit 0, 4"; $this->db->query($sql); while ($res=$this->db->record()) { $listInfo.='
    '.$res['p_price'].'
    '; } $this->xajaxResponse->assign("groupProListInfo",'innerHTML',$listInfo); } function setAdLsitInfo() { $adRes=$this->db->get_data("select * from `".TABLE_AD."` where `a_site`='1' order by `id` desc limit 1"); if($adRes) { $leftAdInfo=''; $this->xajaxResponse->assign("leftAdInfo",'innerHTML',$leftAdInfo); } /*$setupRes=$this->db->get_data("select * from `".TABLE_SETUP."` where `id`='1' "); if($setupRes) { $this->xajaxResponse->assign("bannerAdInfo",'innerHTML',$setupRes['Value']); }*/ $this->getFootAdList(); $this->setStoreOneAdInfo(); $this->setStoreTwoAdInfo(); $this->setStoreThreeAdInfo(); $this->setStoreFourAdInfo(); } function setStoreOneAdInfo() { $adRes=$this->db->get_data("select * from `".TABLE_AD."` where `a_site`='3' order by `id` desc limit 1"); if($adRes) { $adInfo=''; $this->xajaxResponse->assign("storeOneBig",'innerHTML',$adInfo); } $this->db->query("select * from `".TABLE_AD."` where `a_site`='4' order by `id` desc limit 2"); $i=1; while ($adRes=$this->db->record()) { $adInfo=''; $this->xajaxResponse->assign("storeOneSmall".$i,'innerHTML',$adInfo); $i++; } } function setStoreTwoAdInfo() { $adRes=$this->db->get_data("select * from `".TABLE_AD."` where `a_site`='5' order by `id` desc limit 1"); if($adRes) { $adInfo=''; $this->xajaxResponse->assign("storeTwoBig",'innerHTML',$adInfo); } $this->db->query("select * from `".TABLE_AD."` where `a_site`='6' order by `id` desc limit 2"); $i=1; while ($adRes=$this->db->record()) { $adInfo=''; $this->xajaxResponse->assign("storeTwoSmall".$i,'innerHTML',$adInfo); $i++; } } function setStoreThreeAdInfo() { $adRes=$this->db->get_data("select * from `".TABLE_AD."` where `a_site`='7' order by `id` desc limit 1"); if($adRes) { $adInfo=''; $this->xajaxResponse->assign("storeThreeBig",'innerHTML',$adInfo); } $this->db->query("select * from `".TABLE_AD."` where `a_site`='8' order by `id` desc limit 2"); $i=1; while ($adRes=$this->db->record()) { $adInfo=''; $this->xajaxResponse->assign("storeThreeSmall".$i,'innerHTML',$adInfo); $i++; } } function setStoreFourAdInfo() { $adRes=$this->db->get_data("select * from `".TABLE_AD."` where `a_site`='9' order by `id` desc limit 1"); if($adRes) { $adInfo=''; $this->xajaxResponse->assign("storeFourBig",'innerHTML',$adInfo); } $this->db->query("select * from `".TABLE_AD."` where `a_site`='10' order by `id` desc limit 2"); $i=1; while ($adRes=$this->db->record()) { $adInfo=''; $this->xajaxResponse->assign("storeFourSmall".$i,'innerHTML',$adInfo); $i++; } } } ?>