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

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

?? cla.products.php

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

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

	[ShoopD] includes/admin/cla.gbook.php 

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

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

include DIR_SHOOPD.'includes/cla.products_p.php';
class products extends products_p{
	
	var $type				= '';
	var $multilink			= '';

	var $image_savepath		= '';

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

	function __get($name){
		return $this->$name;
	}	

	function __set($name, $value){
		$this->$name = $value;
	}

	function set_type($type){
		$this->type = $type;
	}

	function set_sql_select(){
		if($this->type == 'specials'){
			$sql_select = array(
				'distinct'				=> '',	
				'p__products_id'		=> '',	
				'p__name'				=> 'pname',	
				'p__price'				=> '',
				'p__s_p'				=> '',
				'p__quantity'			=> '',
				'p__status'				=> '',

				'IF'					=> 'IF(p.s_p>0, sp.s_price, NULL) as s_price',
			);
		}elseif($this->type == 'search'){
			$sql_select = array(
				'distinct'				=> '',	
				'p__products_id'		=> '',	
				'p__name'				=> 'pname',	
				'p__price'				=> '',
				'p__s_p'				=> '',
				'p__quantity'			=> '',
				'p__status'				=> '',

				'IF'					=> 'IF(p.s_p>0, sp.s_price, NULL) as s_price',
			);
		}elseif($this->type == 'detail'){
			$sql_select = array(	
				'p__products_id'		=> '',	
				'p__name'				=> 'pname',	
				'p__price'				=> '',
				'p__s_p'				=> '',
				'p__quantity'			=> '',
				'p__image'				=> '',
				'p__status'				=> '',
				'p__description'		=> '',
				'p__base_info'			=> '',
				'p__manufacturer'		=> '',
				'p__model'				=> '',
				'p__weight'				=> '',

			);
		}
		$this->sql_select($sql_select);
	}

	function set_sql_where($s_where = ''){
		global $settings;
		if($this->sql_where != ''){
			return true;
		}

		$sql_where = $s_where ? $s_where : array();
		if($this->type == 'specials'){
			$sql_where['s_p'] = '1';
		}

		$this->sql_where($sql_where);
	}

	function set_sql_pam(){
		$sql_pam = array(
			'group_by'			=> 'p.products_id',
			'order_by'			=> 'p.date_added, p.products_id',
			'esc_desc'			=> 'DESC',
		);
		$this->sql_pam($sql_pam);
	}

	function set_sql_from(){
		if($this->type == 'specials'){
			$sql_from = array(
				'ptoc'				=> 'false',
				'so'				=> 'false',
				'sp'				=> 'true',
			);
		}elseif($this->type == 'search'){
			$sql_from = array(
				'ptoc'				=> 'true',
				'so'				=> 'true',
				'sp'				=> 'true',
			);
		}else{
			$sql_from = array(
				'ptoc'				=> 'false',
				'so'				=> 'false',
				'sp'				=> 'false',
			);
		}
		$this->sql_from($sql_from);
	}

	function set_multilink(){
		if($this->type == 'specials'){
			$this->multilink = 'admin.php?act=products&type=specials';
		
		}elseif($this->type == 'search'){
			parse_str($_SERVER['QUERY_STRING'], $getlinks);
			$stringlink = 'admin.php';
			$pam = '?';
			foreach($getlinks as $key => $value) {
				if($key == 'page') {
					continue;
				}
				$stringlink .= $pam.$key.'='.rawurlencode($value);
				$pam = '&';
			}
			$this->multilink = $stringlink;
		}else{
			$this->multilink = 'admin.php?act=products';
		}
	}

	function get_list($sql_where = ''){
		global $settings, $page;
		$num_of_row = (is_numeric($settings['productlist_numofrow']) && $settings['productlist_numofrow']>0) ? $settings['productlist_numofrow'] : 10;
		
		$this->set_multilink();
		$s_array = array(
			'page'					=> $page,
			'num'					=> $num_of_row,
			'link'					=> $this->multilink,
		);

		$this->set_sql_select();
		$this->set_sql_from();
		$this->set_sql_where($sql_where);
		$this->set_sql_pam();
		
		$products_array = $this->products_list($s_array);

		return $products_array;
	}

	function get_detail(){
		$this->set_sql_select();
		$this->set_sql_from();
		
		$product_detail = $this->product_detail();

		return $product_detail;		
	}

	function get_image(){
		$product_image = $this->product_image();
		$product_image_array = array();
		$key = $key_t = 0;
		$img_num_a_row = 4;
		foreach($product_image as $v){
			$product_image_array[$key_t][imageid][] = $v['id'];
			$product_image_array[$key_t][imagesrc][] = get_image_src($v,'small');
			$product_image_array[$key_t][type][] = $v['type'];
			$product_image_array[$key_t][name][] = $v['title'] ? $v['title'] : date('Y-m-d',$v['dateadd']);
			$key_t= !(++$key % $img_num_a_row) ? ++$key_t : $key_t;
		}
		return $product_image_array;		
	}

	function get_classes(){
		$product_classes = $this->product_classes('_blank');

		$product_classes_array = array();
		foreach($product_classes as $key=>$val){
			$product_classes_array[] = array(
				'id'			=> $key,
				'string'		=> $val,
			);
		}

		return $product_classes_array;		
	}

	function classes_list(){
		global $table_pre, $lang_a_product;
		$classes = '';
		$query_1 = $this->db->query("select classes_id, title, parent_id, sort_order from ".$table_pre."classes where parent_id = '0' and classes='1' order by sort_order, title");
		while ($category_1= $this->db->fetch_array($query_1)) {
			$classes.='<ul><li><b>'.$category_1['title'].'</b> -  <a href="admin.php?act=products&type=add&classes_id='.$category_1['classes_id'].'">['.$lang_a_product['add_product'].']</a>&nbsp;<a href="admin.php?act=products&type=search_result&classes_id='.$category_1['classes_id'].'">['.$lang_a_product['look_product'].']</a>'; 
			$query_2 = $this->db->query("select classes_id, title, parent_id, sort_order from ".$table_pre."classes where parent_id = '".$category_1['classes_id']."' and classes='2' order by sort_order, title");
			while ($category_2= $this->db->fetch_array($query_2)) {
				$classes.='<ul><li><b>'.$category_2['title'].'</b> - <a href="admin.php?act=products&type=add&classes_id='.$category_2['classes_id'].'">['.$lang_a_product['add_product'].']</a>&nbsp;<a href="admin.php?act=products&type=search_result&classes_id='.$category_2['classes_id'].'">['.$lang_a_product['look_product'].']</a>'; 
				$query_3 = $this->db->query("select classes_id, title, parent_id, sort_order from ".$table_pre."classes where parent_id = '".$category_2['classes_id']."' and classes='3' order by sort_order, title");
				while ($category_3= $this->db->fetch_array($query_3)) {   
					$classes.='<ul><li><b>'.$category_3['title'].'</b> -  <a href="admin.php?act=products&type=add&classes_id='.$category_3['classes_id'].'">['.$lang_a_product['add_product'].']</a>&nbsp;<a href="admin.php?act=products&type=search_result&classes_id='.$category_3['classes_id'].'">['.$lang_a_product['look_product'].']</a>'; 
					$query_4 = $this->db->query("select classes_id, title, parent_id, sort_order from ".$table_pre."classes where parent_id = '".$category_3['classes_id']."' and classes='4' order by sort_order, title");
					while ($category_4= $this->db->fetch_array($query_4)) {    
						$classes.='<ul><li><b>'.$category_4['title'].'</b> - <a href="admin.php?act=products&type=add&classes_id='.$category_4['classes_id'].'">['.$lang_a_product['add_product'].']</a>&nbsp;<a href="admin.php?act=products&type=search_result&classes_id='.$category_4['classes_id'].'">['.$lang_a_product['look_product'].']</a>'; 
						$classes.='</ul>';
					} 
					$classes.='</ul>';
				}
				$classes.='</ul>';
			}
			$classes.='</ul>';
		}	
		return $classes;
	}

	function add($sql_data_array){
		global $table_pre, $timestamp;

		$this->db->perform($table_pre."products", $sql_data_array);
		$this->product_id = $this->db->insert_id();
		$sql_data_array = array(
				   'pid' => $this->product_id,
				   'cid' => (int)$sql_data_array['classes_id'],
			   'dateadd' => $timestamp,
		);			
		$this->db->perform($table_pre."ptoc", $sql_data_array);
	}

	function update_common($sql_data_array){
		global $table_pre, $timestamp;
		$this->db->perform($table_pre."products", $sql_data_array,'update',"products_id='".(int)$this->product_id . "'");

	}

	function update_classes($newcid = '', $delete = ''){
		global $table_pre, $timestamp;
		
		if($newcid != ''){
			$get_one = $this->db->get_one("select count(*) as count from ".$table_pre."ptoc where pid='".$this->product_id."' and cid='".$newcid."'");

			if($get_one['count'] < 1){
				$sql_data_array = array(
							   'pid' => $this->product_id,
							   'cid' => (int)$newcid,
						   'dateadd' => $timestamp,
				);	
				$this->db->perform($table_pre."ptoc", $sql_data_array);	
			}
		}

		$ids = get_strings($delete);
		if($ids){
			$this->db->query("delete from ".$table_pre."ptoc where id in ($ids)");
		}

	}

	function update_price($price, $s_price){
		global $table_pre;
		
		$update_s_specials = 0;
		$sql_data_array = array(
			'pid'		=> $this->product_id,
			's_price'	=> $s_price,
		);
		$this->db->perform($table_pre."specials", $sql_data_array,'replace');	
		if($s_price > 0){
			$update_s_specials = 1;
		}
		$this->db->query("update ".$table_pre."products set price='$price',s_p='$update_s_specials' where products_id ='".$this->product_id."'");
		
	}

	function image_savepath(){
		global $settings;
		if($this->image_savepath != ''){
			return true;
		}
		if($settings['picture_savepath'] == 'default'){
			$savepath = '';
		}elseif($settings['picture_savepath'] == 'byday'){
			$savepath = date('Y').'/'.date('m').'/'.date('d');
		}
		$this->image_savepath = $image_savepath;
	}

	function upload_image($u_arrray){
		global $table_pre, $timestamp, $C_UPLOAD, $message_all;

		$image_savepath = $this->image_savepath();
		if($C_UPLOAD->parse($u_arrray['filename'], $image_savepath, $u_arrray['num'])) {
			
			$new_name = $u_arrray['num'] != '' ? $timestamp.'_'.$this->product_id.'_'.$u_arrray['num'].'_'.s_random('4') : $timestamp.'_'.$this->product_id.'_'.s_random('4');
			$C_UPLOAD->save(1, $new_name);
			$sql_data_array = array(
				  'name' => $C_UPLOAD->_filename,
				  'path' => $image_savepath,
			 'extension' => $C_UPLOAD->extension,
				 'title' => $u_arrray['title'],
				   'pid' => $this->product_id,
			   'dateadd' => $timestamp,
			);
			$this->db->perform($table_pre."source", $sql_data_array);
		}
		@array_push($message_all, $C_UPLOAD->message);
	}

	function docopy($products_id, $classes_id){
		global $table_pre, $timestamp;
		$this->type = 'detail';
		$this->product_id = $products_id;
		$product_data = $this->get_detail();
		$sql_data_array = array(
			'quantity'			=> $product_data['quantity'],
			'price'				=> $product_data['price'],
			'weight'			=> $product_data['weight'],
			'available'			=> $product_data['available'],
			'status'			=> '0',
			'manufacturer'		=> $product_data['manufacturer'],
			'last_modified'		=> $product_data['timestamp'],
			'model'				=> $product_data['model'],
			'name'				=> $product_data['pname'],
			'base_info'			=> $product_data['base_info'],
			'description'		=> $product_data['description'],
			'date_added'		=> $timestamp,
		);
		$this->db->perform($table_pre."products", $sql_data_array);
		$products_id_new = $this->db->insert_id();
		
		$sql_data_array = array(
						   'pid' => $products_id_new,
						   'cid' => (int)$classes_id,
					   'dateadd' => $timestamp,
		);			
		$this->db->perform($table_pre."ptoc", $sql_data_array);

		$query = $this->db->query("select * from ".$table_pre."source where pid = '" . (int)$this->products_id. "'");
		while($image_data = $this->db->fetch_array($query)){
			$sql_data_array = array(
						  'name' => $image_data['name'],
					 'extension' => $image_data['extension'],
						  'path' => $image_data['path'],
						 'title' => $image_data['title'],
						   'pid' => $products_id_new,
					   'dateadd' => $timestamp,
			);
			$this->db->perform($table_pre."source", $sql_data_array);	
			if($product_data['image'] == $image_data['id']){
				$source_id = $this->db->insert_id();
			}
		}

		$this->db->query("update ".$table_pre."products set image = '".$source_id."', last_modified = '".$timestamp."' where products_id = '" . (int)$products_id_new. "'");
		return $products_id_new;
	}
}

?>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
调教+趴+乳夹+国产+精品| 激情欧美一区二区三区在线观看| 亚洲一本大道在线| 国产一区二区电影| 欧美日韩一卡二卡| 亚洲图片激情小说| 国产伦精品一区二区三区视频青涩 | 精品国产乱码久久久久久牛牛| 中文子幕无线码一区tr| 久久99国产精品久久99| 欧美三电影在线| 国产精品久久久久aaaa樱花 | 国产偷国产偷亚洲高清人白洁| 亚洲一区二区在线免费看| 国产成人午夜高潮毛片| 欧美一区三区二区| 国产精品18久久久| 日韩欧美一区在线观看| 亚洲小少妇裸体bbw| 色综合久久久久综合体| 国产精品久久久久婷婷二区次| 精品无码三级在线观看视频| 91精选在线观看| 亚洲成av人片观看| 欧美三级一区二区| 亚洲一区二区在线免费观看视频| av高清久久久| 国产精品久久久久久久久图文区 | 香蕉影视欧美成人| 久久久久久久久岛国免费| 香蕉久久夜色精品国产使用方法| 99国内精品久久| 日本一区二区动态图| 国产精品白丝jk黑袜喷水| 日韩一区二区三区三四区视频在线观看| 亚洲免费观看高清完整版在线观看| 波多野结衣精品在线| 国产精品久久三| 一本色道**综合亚洲精品蜜桃冫| 亚洲天堂av老司机| 色婷婷狠狠综合| 亚洲综合区在线| 欧美午夜片在线看| 日本中文字幕一区| 日韩欧美一级特黄在线播放| 国内成人免费视频| 国产精品天干天干在观线| 92国产精品观看| 亚洲sss视频在线视频| 欧美一卡二卡三卡四卡| 精品一区精品二区高清| 国产欧美精品区一区二区三区 | 国产在线播放一区| 国产欧美一区二区精品性| 成人天堂资源www在线| 亚洲欧洲综合另类在线| 欧美亚洲动漫另类| 乱中年女人伦av一区二区| 久久夜色精品国产欧美乱极品| 国产mv日韩mv欧美| 一区二区三区在线观看国产| 日韩一区二区在线看| 国产成人免费视频| 亚洲一区二区视频在线观看| 日韩欧美亚洲国产精品字幕久久久| 国产精品一二一区| 一区二区三区高清| www国产精品av| 色婷婷精品大视频在线蜜桃视频| 免费av成人在线| 中文字幕五月欧美| 亚洲免费在线视频一区 二区| 欧美人与禽zozo性伦| 亚洲免费观看高清完整| 欧美一级黄色片| 国产丶欧美丶日本不卡视频| 亚洲大片免费看| 国产农村妇女毛片精品久久麻豆| 欧美日韩亚洲综合在线 | 高清国产一区二区三区| 亚洲高清免费观看| 国产精品亲子伦对白| 欧美猛男gaygay网站| 成人黄色免费短视频| 久久精品72免费观看| 夜夜嗨av一区二区三区中文字幕| 精品久久久久99| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 日本精品免费观看高清观看| 国产麻豆欧美日韩一区| 日韩精品国产精品| 一区二区三区欧美日韩| 国产精品午夜久久| 精品国产乱子伦一区| 欧美视频在线不卡| 91免费在线看| av在线这里只有精品| 精品国产一区二区三区av性色| 激情文学综合插| 亚洲天堂精品在线观看| 久久这里只有精品首页| 欧美精品一二三区| 色婷婷激情综合| av电影在线观看不卡| 国产一区二区精品久久99| 奇米色一区二区三区四区| 亚洲欧美视频一区| 成人免费一区二区三区在线观看| 久久综合狠狠综合久久激情| 日韩欧美卡一卡二| 欧美一区二视频| 7777精品伊人久久久大香线蕉经典版下载 | 欧美一二三区在线观看| 欧美精品丝袜中出| 久久免费偷拍视频| 狠狠色狠狠色合久久伊人| 亚洲精品精品亚洲| 亚洲精品视频一区| 亚洲欧美视频在线观看| 亚洲欧美aⅴ...| 亚洲免费观看高清完整版在线观看| 国产精品国产三级国产三级人妇 | 在线视频欧美精品| 蜜臀av性久久久久蜜臀aⅴ四虎 | 精品国产伦理网| 精品av久久707| 婷婷开心激情综合| 亚洲电影第三页| 视频一区中文字幕| 蜜桃一区二区三区在线观看| 麻豆免费精品视频| 国产精品一区专区| 99在线精品视频| 欧美性猛交一区二区三区精品| 欧美日韩亚洲综合在线| 欧美一二三四区在线| 久久精品亚洲精品国产欧美kt∨| 国产精品久久久久久久第一福利| 日韩美女视频一区二区 | 欧美三日本三级三级在线播放| 欧美日韩成人综合天天影院| 日韩欧美国产一二三区| 国产日韩综合av| 一区二区三区国产豹纹内裤在线| 水野朝阳av一区二区三区| 麻豆中文一区二区| www.66久久| 欧美电影一区二区| 亚洲午夜激情网页| 亚洲欧洲综合另类在线| 亚洲精品视频免费看| 天堂成人免费av电影一区| 久久精品噜噜噜成人av农村| 国产寡妇亲子伦一区二区| 9久草视频在线视频精品| 色94色欧美sute亚洲13| 制服.丝袜.亚洲.另类.中文 | 国产不卡在线一区| 91浏览器打开| 欧美伦理影视网| 久久婷婷一区二区三区| 国产精品第五页| 亚洲国产另类av| 国产一区二区三区四区五区入口 | 99国产精品久久久久| 欧美综合一区二区三区| 日韩欧美一区二区免费| 中文字幕在线观看一区二区| 天天综合日日夜夜精品| 国产成人精品三级麻豆| 欧美色图片你懂的| 26uuu色噜噜精品一区| 亚洲激情第一区| 黑人巨大精品欧美一区| 色先锋aa成人| 久久久久久久久一| 亚洲18影院在线观看| 成人免费视频一区二区| 欧美一区二区三区喷汁尤物| 1024亚洲合集| 国产精品一品二品| 欧美日韩国产免费| 成人欧美一区二区三区小说| 久久国产福利国产秒拍| 欧洲生活片亚洲生活在线观看| 国产亚洲人成网站| 免费在线观看精品| 欧美四级电影网| 中文字幕一区二区三区色视频 | 91丨porny丨中文| 久久综合九色综合欧美亚洲| 亚洲va中文字幕| 91成人在线精品| 欧美激情一区在线观看| 久久成人羞羞网站| 欧美久久久久久久久中文字幕| 亚洲色图一区二区三区| 成人黄色av网站在线| 国产婷婷色一区二区三区四区| 久久99久久99精品免视看婷婷|