亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cla.confirm.php

?? 很好的電子商務程序,品品哈哈哈好的很好的很
?? PHP
字號:
<?php

/*--------------------------------------------------------------
	[ShoopD] includes/user/cla.confirm.php 

	Version: 1.6.0
	Author: soolan (soolan@qq.com)
	Copyright: soolan (www.shoopd.com)
	Last Modified: 2006/4/13 10:00

--------------------------------------------------------------*/

class confirm{
	
	var $db						= '';
	var $products_data			= '';
	var $customer_data			= '';
	var $shipping_data			= '';
	var $billing_data			= '';
	var $order_total_data		= '';

	var $products_total			= '';
	var $products_weight		= '';
	var $shipping_cost			= '';
	var $shipping_list_data		= '';

	var $insert_order_id		= '';

	var $check_stock			= '';

	function confirm(){
		global $db;
		$this->db = $db;
	}

	function products_data($reget = ''){
		global $products_cart, $table_pre, $settings;
		if (!$products_cart) {
			$products_cart = cart_get_product();
			if (!is_array($products_cart)) {
				return false;
			}
		}
		if($reget == ''){
			if(is_array($this->products_data) && is_array($this->products_data['0'])){
				return true;
			}
		}
		$products_data = array();
		foreach($products_cart as $key=>$val){
			$product_data = $this->db->get_one("SELECT p.products_id,p.name,p.model,p.s_p,p.price,p.quantity,p.weight,IF(p.s_p>0,sp.s_price,NULL) AS s_price FROM ".$table_pre."products  AS p left join ".$table_pre."specials AS sp ON p.products_id=sp.pid WHERE p.products_id = '".$key."'");
			$product_price = s_price($product_data);
			$product_data['price_array'] = $product_price;
			$product_data['final_price'] = $product_price['two']['value'];
			$product_data['price_total'] = $product_price['two']['value']*$val['quantity'];
			$product_data['price_total_text'] = display_price($product_data['price_total']);
			$product_data['buy_quantity'] = $val['quantity'];

			$this->check_stock = true;
			if ($settings['stock_check'] == 'true') {
				$stock_left = $product_data['quantity'] - $val['quantity'];
				if ($stock_left < 0) {
					$this->check_stock = false;
					if(defined('CURRSCRIPT') && CURRSCRIPT == 'cart'){
						$product_data['stock_limitsign'] = $settings['stock_limitsign'];
					}
				}
			}

			$products_data[] = $product_data;
		}

		$this->products_data = $products_data;
	}

	function products_email($reget = ''){
		$this->products_data();
		$products_email = '';
		if(is_array($this->products_data)){
			foreach($this->products_data as $key=>$val){
				$products_email .= "<tr bgcolor=\"#FFFFFF\"><td>".$val['name']."</td><td>".display_price($product_price['two']['value'])."</td><td>".$val['quantity']."</td><td>".display_price($small_total)."</td></tr>";
			}
		}
		return $products_email;
	}

	function customer_data($reget = ''){
		global $table_pre, $customer_id;
		if($reget == ''){
			if(is_array($this->customer_data) && $this->customer_data['email']){
				return true;
			}
		}		
		$customer_data = $this->db->get_one("SELECT email, shipto, shipping_method, billto, deli_s_bill, payment_method, comment, money FROM ".$table_pre."customers WHERE customers_id='".$customer_id."'");
		$this->customer_data = $customer_data;
	}

	function shipping_data($reget = ''){
		global $table_pre;
		if($reget == ''){
			if(is_array($this->shipping_data) && $this->shipping_data['abid']){
				return true;
			}
		}		
		$this->customer_data();
		$this->shipping_data = $this->db->get_one("SELECT * FROM ".$table_pre."address_book WHERE abid='".$this->customer_data['shipto']."'");
	}

	function billing_data($reget = ''){
		global $table_pre;
		if($reget == ''){
			if(is_array($this->billing_data) && $this->billing_data['abid']){
				return true;
			}
		}		
		$this->customer_data();
		if($this->customer_data['deli_s_bill'] == '1'){
			return true;
		}
		$this->billing_data = $this->db->get_one("SELECT * FROM ".$table_pre."address_book WHERE abid='".$this->customer_data['billto']."'");
	}

	function products_total($reget = ''){
		$this->products_data();
		if(!is_array($this->products_data)){
			return false;
		}
		if($reget == ''){
			if($this->products_total != ''){
				return true;
			}
		}	
		$price_total = 0;
		foreach($this->products_data as $k=>$v){
			$price_total += $v['price_total'];
		}
		$this->products_total = $price_total;
	}

	function products_weight($reget = ''){
		$this->products_data();
		if(!is_array($this->products_data)){
			return false;
		}
		if($reget == ''){
			if($this->products_weight != ''){
				return true;
			}
		}	
		$weight_total = 0;
		foreach($this->products_data as $k=>$v){
			$weight_total += $v['weight'];
		}
		$this->products_weight = $weight_total;
	}

	function shipping_cost($reget = ''){
		global $table_pre;
		if($reget == ''){
			if($this->shipping_cost != ''){
				return true;
			}
		}	
		$this->shipping_list_data();
		$shipping_show_data = $this->shipping_list_data;
		$this->customer_data();
		$this->shipping_cost = $shipping_show_data[$this->customer_data['shipping_method']]['money_value'];
	}

	function shipping_list_data($reget = ''){
		global $table_pre;
		if($reget == ''){
			if($this->shipping_list_data != ''){
				return true;
			}
		}	
		$this->shipping_data();
		$this->products_weight();
		$_array_ = array(
			'address_data'			=> $this->shipping_data,
			'products_weight'		=> $this->products_weight,
		);
		$this->shipping_list_data = shipping($_array_);
	}

	function order_total_data($reget = ''){
		if($reget == ''){
			if(is_array($this->order_total_data)){
				return true;
			}
		}			
		$this->products_total();
		$this->shipping_cost();
		$this->customer_data();
		$total_array = array(
			'product'		=> $this->products_total,
			'shipping'		=> $this->shipping_cost,
			'leavermoney'	=> $this->customer_data['money'],
		);
		$this->order_total_data = order_total($total_array);
	}

	function order_total_email($reget = ''){
		$this->order_total_data();
		if(is_array($this->order_total_data)){
			return false;
		}
		$order_total_email = '';
		foreach($this->order_total_data as $key=>$val){	
			$order_total_email .= "<tr><td align=\"right\">".$val['title']."</td><td>".$val['money_text']."</td></tr>";
		}
		return $order_total_email;
	}

	function check_shipping(){
		global $table_pre;
		$this->customer_data();
		if($this->customer_data['shipping_method'] == ''){
			return false;
		}

		$this->shipping_list_data();
		$shipping_show_data = $this->shipping_list_data;
		if($shipping_show_data[$this->customer_data['shipping_method']]['shippingid'] == ''){
			$this->db->query("UPDATE ".$table_pre."customers SET shipping_method='' WHERE customers_id='".$this->customer_data['customer_id']."'");
			return false;
		}		
		return true;
	}

	function check_payment(){
		global $cache_payment, $cache_shipping, $table_pre;
		$this->customer_data();
		$customer_data = $this->customer_data;
		if(!$customer_data['payment_method']){
			return false;
		}

		if(!is_array($cache_payment)){
			include_once(cacheexists('payment'));
		}
		if(!is_array($cache_shipping)){
			include_once(cacheexists('shipping'));
		}
		if($cache_payment[$customer_data['payment_method']]['pay_key'] == 'goodsarrivepay' && $cache_shipping[$customer_data['shipping_method']]['filename'] != 'goodsself'){
			$this->db->query("UPDATE ".$table_pre."customers set payment_method='' WHERE customers_id='".$this->customer_data['customer_id']."'");
			return false;
		}
		return true;
	}

	function check_stock(){
		global $settings;
		if($settings['stock_check'] != 'true') {
			return true;
		}
		$this->products_data();
		if(!is_array($this->products_data)){
			return true;
		}
		return $this->check_stock;
	}

	function insert_order_total(){
		global $table_pre, $customer_id, $settings;

		$this->order_total_data();
		if(!is_array($this->order_total_data)){
			return false;
		}
		$this->insert_order();
		foreach($this->order_total_data as $key=>$val){
			$sql_data_array = array(
				'orders_id'		=> $this->insert_order_id,
				'value'			=> $val['money_value'], 
				'classes'		=> $key
			);                   
			$this->db->perform($table_pre."orders_total", $sql_data_array);
		}
		reset($order_total);
		if($settings['user_leavepay'] == 'true'){
			$leaverpay_value = $this->order_total_data['leaverpay']['money_value'];
		}else{
			$leaverpay_value = 0;
		}
		$sql_data_array = array(
			'orders_id'		=> $this->insert_order_id,
			'value'			=> $leaverpay_value, 
			'classes'		=> 'paid'
		);                   
		$this->db->perform($table_pre."orders_total", $sql_data_array);
		if($settings['user_leavepay'] == 'true'){
			$this->db->query("update ".$table_pre."customers set money=money-".$leaverpay_value." WHERE customers_id='".$customer_id."'");
		}

	}

	function insert_order(){
		global $customer_id, $table_pre, $timestamp;
		
		if($this->insert_order_id != ''){
			return true;
		}			

		$this->customer_data();
		$this->shipping_data();
		$this->billing_data();
		$sql_data_array = array(
			'cid'				=> $customer_id,
			'c_email'			=> $this->customer_data['email'],
			'd_name'			=> $this->shipping_data['name'], 
			'd_country'			=> $this->shipping_data['country'], 
			'd_province'		=> $this->shipping_data['province'], 
			'd_city'			=> $this->shipping_data['city'],
			'd_street_address'	=> $this->shipping_data['street_address'], 
			'd_postcode'		=> $this->shipping_data['postcode'], 
			'd_tel_regular'		=> $this->shipping_data['tel_regular'], 
			'd_tel_mobile'		=> $this->shipping_data['tel_mobile'], 

			'deli_s_bill'		=> $this->customer_data['deli_s_bill'], 
														
			'payment_method'	=> $this->customer_data['payment_method'], 
			'shipping_method'	=> $this->customer_data['shipping_method'],
			'date_purchased'	=> $timestamp,
			'last_modified'		=> $timestamp,
			'do_mark'			=> '0',
			'orders_status'		=> 'noauditing',
		);

		if(!$this->customer_data['deli_s_bill']){
			$sql_data_array2 = array(
				'b_name'			=> $this->billing_data['name'], 
				'b_country'			=> $this->billing_data['country'], 
				'b_province'		=> $this->billing_data['province'], 
				'b_city'			=> $this->billing_data['city'], 
				'b_street_address'	=> $this->billing_data['street_address'], 
				'b_postcode'		=> $this->billing_data['postcode'], 
				'b_tel_regular'		=> $this->billing_data['tel_regular'], 
				'b_tel_mobile'		=> $this->billing_data['tel_mobile'],
			);
			$sql_data_array = array_merge($sql_data_array,$sql_data_array2);
		}

		$this->db->perform($table_pre."orders", $sql_data_array);
		$this->insert_order_id = $this->db->insert_id();		

	}

	function insert_history(){
		global $table_pre, $timestamp;
		$this->insert_order();
		$sql_data_array = array(
			'orders_id'			=> $this->insert_order_id, 
			'orders_status'		=> 'noauditing', 
			'date_added'		=> $timestamp
		);
		$this->db->perform($table_pre."orders_history", $sql_data_array);
	}

	function insert_products(){
		global $settings, $table_pre, $timestamp;
		$this->products_data();
		if(!is_array($this->products_data)){
			return false;
		}

		$this->insert_order();
		foreach($this->products_data as $key=>$val){
			$update_and = '';
			if($settings['stock_check'] == 'true'){
				$update_and .= " quantity = quantity-".$val['buy_quantity'];
				if($val['buy_quantity'] >= $val['quantity']){
					$update_and .= " ,available = '0' ";
				}
			}
			$this->db->query("UPDATE ".$table_pre."products SET ordered = ordered + " .$val['buy_quantity']. " ".$update_and." WHERE products_id = '".$val['products_id']."'",'ub');
			$sql_data_array = array(  
				'orders_id'			=> $this->insert_order_id, 
				'products_id'		=> $val['products_id'], 
				'model'				=> $val['model'], 
				'name'				=> $val['name'], 
				'price'				=> $val['price'], 
				'quantity'			=> $val['buy_quantity'],
				'final_price'		=> $val['final_price'],
			);

			$this->db->perform($table_pre."orders_products", $sql_data_array);
		}
	}


	function process_mail(){
		global $timestamp, $settings, $cache_payment, $lang_payment, $lang_process;
		if($settings['sendmail_createorder'] != 'true'){
			return true;
		}
		$create_date = gmdate($settings['date_format'], $timestamp+ $settings['time_ofset'] * 3600);
		$this->insert_order();
		$orders_id = $this->insert_order_id;

		if(!is_array($cache_payment)){
			include(cacheexists('payment'));
		}
		$this->customer_data();
		$payment_title = payment_title($cache_payment[$this->customer_data['payment_method']], $lang_payment);
		$products_list = $this->products_email();
		$order_total_list = $this->order_total_email();

		$emailcontents = emailcontents('order_create');
		eval("\$emailcontents = \"" .addslashes($emailcontents). "\";");
		sendmail($this->customer_data['email'],$lang_process['email_subject'],$emailcontents);
	}

}

?>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产九色sp调教91| 在线免费观看日本一区| 成人avav影音| 欧美日韩不卡在线| 国产精品免费看片| 久久成人免费网站| 欧美日韩欧美一区二区| 久久精品一区二区三区av| 亚洲国产aⅴ成人精品无吗| 国产ts人妖一区二区| 欧美精品久久99久久在免费线| 中文字幕乱码久久午夜不卡| 蜜臀av亚洲一区中文字幕| 日本高清无吗v一区| 国产精品婷婷午夜在线观看| 精品在线免费观看| 欧美一区二区大片| 天堂久久久久va久久久久| 91在线免费视频观看| 久久久综合视频| 精品写真视频在线观看| 91麻豆精品91久久久久久清纯| 亚洲欧美乱综合| 99视频一区二区| 国产精品久线在线观看| 成人免费毛片app| 国产天堂亚洲国产碰碰| 日本在线播放一区二区三区| 欧美精品乱码久久久久久| 亚洲午夜在线观看视频在线| 日本福利一区二区| 亚洲人成网站色在线观看| aaa亚洲精品一二三区| 国产精品日韩成人| 成人国产在线观看| 国产精品区一区二区三| 高清成人免费视频| 中文字幕一区二区三| 99天天综合性| 亚洲精品美国一| 在线亚洲免费视频| 日韩激情中文字幕| 欧美电视剧免费观看| 国产一区二区日韩精品| 国产欧美日韩在线看| 99这里都是精品| 亚洲韩国一区二区三区| 欧美喷水一区二区| 精品在线观看免费| 一色桃子久久精品亚洲| 91传媒视频在线播放| 五月天网站亚洲| 久久久亚洲精品一区二区三区| 成人伦理片在线| 亚洲国产视频一区| 欧美tickle裸体挠脚心vk| 国产高清不卡二三区| 亚洲精品乱码久久久久久久久| 精品视频123区在线观看| 美女免费视频一区二区| 国产亚洲综合色| 在线观看三级视频欧美| 蜜臀久久久99精品久久久久久| 久久精品一区二区三区四区| 色综合色综合色综合色综合色综合 | 夜夜揉揉日日人人青青一国产精品 | 欧美丰满少妇xxxxx高潮对白| 六月婷婷色综合| 1区2区3区国产精品| 欧美区一区二区三区| 国产原创一区二区| 一区二区三区成人| 久久久av毛片精品| 在线视频一区二区三| 黑人巨大精品欧美一区| 亚洲欧美一区二区三区国产精品 | 国产精品亚洲第一区在线暖暖韩国 | 国产成人午夜99999| 夜色激情一区二区| 国产三级一区二区三区| 欧美日韩性生活| 不卡视频一二三四| 毛片一区二区三区| 亚洲欧美日韩电影| 久久久影视传媒| 欧美一区二区美女| 91国内精品野花午夜精品| 国产精品综合二区| 日韩和欧美一区二区三区| 亚洲色欲色欲www| 久久视频一区二区| 欧美精选午夜久久久乱码6080| 成人性色生活片| 激情综合五月婷婷| 婷婷一区二区三区| 亚洲综合色噜噜狠狠| 国产精品久久一卡二卡| 久久人人97超碰com| 欧美一级一区二区| 欧美日韩免费一区二区三区| 91在线云播放| 99久久亚洲一区二区三区青草| 国产主播一区二区| 极品少妇xxxx精品少妇偷拍| 婷婷综合在线观看| 亚洲成a人片在线观看中文| 亚洲欧美日韩国产另类专区| 亚洲天堂中文字幕| 亚洲三级在线免费观看| 国产精品久久免费看| 国产精品久久久久久久岛一牛影视| 337p日本欧洲亚洲大胆色噜噜| 这里只有精品电影| 4438x成人网最大色成网站| 欧美日韩国产经典色站一区二区三区 | 艳妇臀荡乳欲伦亚洲一区| 国产精品人成在线观看免费| 国产亚洲成aⅴ人片在线观看| 欧美一级午夜免费电影| 日韩欧美精品三级| 精品久久久久久久久久久久久久久| 日韩视频永久免费| 精品乱人伦小说| 久久久久高清精品| 国产精品乱人伦中文| 国产精品国产精品国产专区不片| 中文av一区特黄| 亚洲男帅同性gay1069| 亚洲自拍欧美精品| 欧美a级理论片| 国产一区二区久久| 99精品视频一区| 欧美伊人久久久久久午夜久久久久| 欧美日韩免费观看一区三区| 欧美一卡2卡三卡4卡5免费| 久久综合久久久久88| 中文字幕av资源一区| 亚洲欧美日韩国产成人精品影院| 亚洲成人1区2区| 久久精品国产99久久6| 国产成人午夜精品影院观看视频| 91网上在线视频| 欧美精品vⅰdeose4hd| 亚洲精品在线一区二区| 中文字幕一区二区三区视频| 一区二区欧美国产| 免费看日韩a级影片| 成人综合婷婷国产精品久久蜜臀 | 欧美亚洲一区三区| 91精品国产一区二区三区| 久久综合九色综合欧美98 | 99视频超级精品| 欧美日韩国产小视频在线观看| 精品国产精品网麻豆系列| 亚洲日穴在线视频| 日韩不卡在线观看日韩不卡视频| 国产99久久久国产精品| 欧美精品一卡两卡| 国产精品丝袜91| 日本美女视频一区二区| 91影院在线观看| 精品国产三级a在线观看| 亚洲美女免费在线| 国产福利一区二区三区在线视频| 欧美日韩国产影片| 亚洲欧洲成人精品av97| 久久精品国产久精国产| 91麻豆视频网站| 久久影院午夜论| 亚洲gay无套男同| 97se狠狠狠综合亚洲狠狠| 精品国产乱码久久久久久1区2区| 一区二区三区四区不卡在线 | 99精品久久免费看蜜臀剧情介绍| 91精品国产91久久综合桃花 | 国产日韩精品一区二区三区| 午夜电影网亚洲视频| 91网页版在线| 欧美高清在线一区二区| 久久91精品国产91久久小草| 欧美日本一区二区三区| 亚洲精品亚洲人成人网在线播放| 成人听书哪个软件好| 久久久欧美精品sm网站| 激情伊人五月天久久综合| 91精品国产综合久久蜜臀 | 日韩激情一二三区| 日本乱人伦一区| 国产精品美女久久久久av爽李琼| 精品写真视频在线观看| 欧美电影免费观看高清完整版 | 日本成人在线网站| 欧美日韩一区二区三区免费看| 亚洲私人黄色宅男| 91视频在线观看免费| 国产精品日产欧美久久久久| 成人性生交大合| ...中文天堂在线一区| av一区二区三区黑人| 国产精品青草综合久久久久99|