goods.htm

来自「PHPShops多用户商城系统(简称PHPShops)是基于电子商务的一套平台交」· HTM 代码 · 共 671 行 · 第 1/2 页

HTM
671
字号
<!--<?php
include_once Template('header');
print <<<EOT
-->
<div id="content">
<!--
EOT;
if($manager_edit){print <<<EOT
-->
<div style="border:#EECAAD 1px solid;background:#FFFFFF;font:bold 14px Helvetica;padding:1em 1.5em 0.8em 1.5em;"><a style="color:#FF0000;font-size:18px;">提醒</a> 您正在编辑用户 <a>$userdb[username]</a> 的商品,请谨慎操作!</div><br />
<!--
EOT;
}if(empty($action)){print <<<EOT
-->
	<div class="h1Abox tar">
		<h1 class="active"><span>1.选择商品发布方式</span></h1>
		<h1><span><a>2.选择商品分类</a></span></h1>
		<h1><span><a>3.填写商品信息</a></span></h1>
	</div>
	<div class="c"></div>
	<div class="ipwords">
<!--
EOT;
if($db_teamgoods && $_S['sell_team_goods']){print <<<EOT
-->
		现在有<a href="$basename&action=$gonext&type=1" class="b orange">一口价发布</a>和<a href="$basename&action=$gonext&type=3" class="b orange">团购发布</a>两种商品发布形式
<!--
EOT;
} else{print <<<EOT
-->
		一口价发布
<!--
EOT;
}print <<<EOT
-->
	</div>
	<div class="boxA1">
		<div class="boxA1m">
			<div class="boxA1b">
				<div class="boxA1t" style="height:320px;">
					<div style="width:78%; margin:3em auto">
						<div style="width:45%;" class="fl"> <a href="$basename&action=$gonext&type=1" class="btA1"><img src="$imgpath/user/yi.gif" /><span class="f14 b">一口价发布</span><span class="gray">设定商品价格,让顾客可以即刻购买</span></a> </div>
<!--
EOT;
if($db_teamgoods && $_S['sell_team_goods']){print <<<EOT
-->	
						<div style="width:45%;" class="fr"> <a href="$basename&action=$gonext&type=3" class="btA1"><img src="$imgpath/user/tuan.gif" /><span class="f14 b">团购发布</span><span class="gray">设定价格和购买人数下限,让顾客团购商品</span></a> </div>
<!--
EOT;
}print <<<EOT
-->
					</div>
				</div>
			</div>
		</div>
	</div>
<!--
EOT;
}elseif($action == 'goods' || $action=='modify'){
if(!$step){print <<<EOT
-->
<style type="text/css">
#Category ul{border:1px solid #CECFCE; width:24%; float:left; height:250px; overflow-Y:auto; margin:1px;}
#Category li{padding:2px;}
.onfoucs{border:1px solid #089A00;background:#CEFFC6;}
</style>
	<div class="h1Abox tar">
		<h1><span><a href="$basename">1.选择商品发布方式</a></span></h1>
		<h1 class="active"><span><a>2.选择商品分类</a></span></h1>
		<h1><span><a>3.填写商品信息</a></span></h1>
	</div>
	<div class="c"></div>
<!--
EOT;
if($type=='1'){
	$goods_type = '发布一口价商品';
} elseif($type=='2'){
	$goods_type = '发布拍卖商品';
} elseif($type=='3'){
	$goods_type = '发布团购商品';
}print <<<EOT
-->
	<div class="ipwords">{$goods_type},<span class="orange">请选择商品分类</span> &raquo; <a style="cursor:pointer;" id="td_cid" onmouseover="read.open('menu_cid','td_cid');">常用分类</a></div>
	<div id="menu_cid" class="menu tac" style="display:none;">
		<ul>
<!--
EOT;
foreach($cidlist as $key=>$value){print <<<EOT
-->
			<li><a href="javascript:selinit('$key');">$value</a></li>
<!--
EOT;
}print <<<EOT
-->
		</ul>
	</div>
	<div class="boxA1">
		<div class="boxA1m">
			<div class="boxA1b">
				<div class="boxA1t" style="padding:">
					<div style="width:96%; margin:1em auto">
						<div id="Category">
							<ul id="Category0"></ul>
							<ul id="Category1"></ul>
							<ul id="Category2"></ul>
							<ul id="Category3"></ul>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="c" style="height:1em"></div>
	<div class="boxA1">
		<div class="boxA1m">
			<div class="boxA1b">
				<div class="boxA1t">
					<div style="width:96%; margin:1em auto;"> 你当前选择的分类:<span id="select"></span> </div>
				</div>
			</div>
		</div>
	</div>
	<div class="c"></div>
	<div class="tac" style="padding:1em"> <input id="btn" type="button" value="选好了,继续" onclick="selsubmit();" disabled /> </div>
<script language=javascript>
var selid  = 0;
var select = [0,0,0,0];
var jscate = {{$jscate}};
var jstype = new Array();
$jscode
function showcate(){
	var html = '';
	for(var i in jscate){
		html += "<li id=\"cate_"+i+"\" style=\"cursor:pointer;\" onclick=\"getcate(this.id,'0');\">"+(typeof jstype[i] != 'undefined' ? '<span class="fr">&raquo;</span>' : '')+jscate[i]+"</li>";
	}
	$('Category0').innerHTML = html;
}
function getcate(id,type){
	var n = id.substr(id.indexOf('_')+1);
	var s = $('Category'+type).getElementsByTagName('li');
	for(var i=0;i<s.length;i++){
		s[i].className = s[i].id == id ? 'onfoucs' : '';
	}
	select[type] = n;
	selid = n;
	showselect(type);
	if(++type>3) return;
	for(var i=type;i<4;i++){
		select[i] = 0;
		$('Category'+i).innerHTML = '';
	}
	if(typeof jstype[n] != 'undefined'){
		var html = '';
		var sub  = jstype[n];
		for(var i in sub){
			html += "<li id=\"cate_"+i+"\" style=\"cursor:pointer;\" onclick=\"getcate(this.id,'"+type+"');\">"+(typeof jstype[i] != 'undefined' ? '<span class="fr">&raquo;</span>' : '')+sub[i]+"</li>";
		}
		$('Category'+type).innerHTML = html;
		select[type] = n;
	}
}
function showselect(type){
	var html = jscate[select[0]];
	var j;
	for(var i=1;i<=type;i++){
		j = i-1;
		html += ' &raquo; ' + jstype[select[j]][select[i]];
	}
	$('select').innerHTML = html;
	$('btn').disabled = typeof(jstype[selid]) == 'undefined' ? false : true;
}
function selsubmit(){
	location.href = "$basename&type=$type&step=1&action=$action&tid=$tid&cid="+selid;
}
function selinit(id){
	if(id<1) return;
	var jsinit = id;
	while(typeof jscate[id] == 'undefined'){
		var debug = 0;
		for(var i in jstype){
			var j = jstype[i];
			if(typeof j[id] != 'undefined'){
				jsinit = i+','+jsinit;
				id = i;
				debug = 1;
				break;
			}
		}
		if(debug == 0){
			alert('错误的分类!');return;
		}
	}
	var sel = jsinit.split(',');
	for(var i=0;i<sel.length;i++){
		getcate('cate_'+sel[i],i);
	}
}
showcate();
selinit('$cid');
</script>
<!--
EOT;
}elseif($step==1){print <<<EOT
-->
	<script language="JavaScript">
	var imgpath='$imgpath';
	var stylepath='$stylepath';
	var attachnum=10;
	var allow_ext=' $db_uploadfiletype ';
	var aid=0;
	</script>
	<script language="JavaScript" src="js/zh_cn.js"></script>
<!--
EOT;
if($type=='1'){
	$goods_type = '发布一口价商品';
	$sel_type_1 = 'checked';
} elseif($type=='2'){
	$goods_type = '发布拍卖商品';
} elseif($type=='3'){
	$goods_type = '发布团购商品';
	$sel_type_3 = 'checked';
}print <<<EOT
-->
	<div class="h1Abox tar">
		<h1><span><a href="$basename">1.选择商品发布方式</a></span></h1>
		<h1><span><a href="$basename&action=$action&type=$type&tid=$tid&cid=$cid">2.选择商品分类</a></span></h1>
		<h1 class="active"><span>3.填写商品信息</span></h1>
	</div>
	<div class="c"></div>
	<div class="ipwords">{$goods_type},你当前选择的分类:$catename</div>
	<form name="goods" method="post" action="$basename&" enctype="multipart/form-data" onsubmit="return CheckGoods(document.goods);">
		<input name="tid" type="hidden" value="$tid" />
		<input name="step" type="hidden" value="2" />
		<input name="action" type="hidden" value="$action" />
		<input type="hidden" name="cid" value="$cid" />
		<div class="boxA1">
			<div class="boxA1m">
				<div class="boxA1b">
					<div class="boxA1t" style="padding:">
						<div style="width:96%; margin:1em auto" class="step3table"><style>.step3table td{ padding:.5em 0;} .step3table td input{ vertical-align:middle}</style>
						<table width="100%" align="center" cellspacing="0" cellpadding="0">
							<tr>
								<td width="20%">发布类型</td>
								<td><input type="radio" name="saletype" value="1" $sel_type_1 onclick="Select_item_type(1)" /> 一口价 
<!--
EOT;
if($db_teamgoods && $_S['sell_team_goods']){print <<<EOT
-->
								<input type="radio" name="saletype" value="3" $sel_type_3  onclick="Select_item_type(3)" /> 团购
<!--
EOT;
}print <<<EOT
-->							
								</td>
							</tr>
							<tr>
								<td>商品分类</td>
								<td>$catename&nbsp;&nbsp;[<a href="$basename&action=$action&type=$type&tid=$tid&cid=$cid">重新选择</a>]</td>
							</tr>
<!--
EOT;
if($Select_nameplate){print <<< EOT
-->
							<tr>
								<td>商品品牌</td>
								<td><select name="nameplate" style="width:120px;">$Select_nameplate</select></td>
							</tr>
<!--
EOT;
}if($dirs){print <<< EOT
-->
							<tr>
								<td>个人商品分类</td>
								<td><select name="dirid">$dirs</select></td>
							</tr>
<!--
EOT;
}print <<< EOT
-->
						<tr>
							<td>新旧程度</td>
							<td><input type="radio" name="degree" value="1" $degree_1 /> 全新 <input type="radio" name="degree" value="2" $degree_2 /> 二手</td>
						</tr>
<!--
EOT;
if($identity){print <<<EOT
-->
						<tr>
							<td>商品属性</td>
							<td>
<!--
EOT;
foreach($identity as $key=>$value){print <<<EOT
-->
							<div style="margin:5px 0">{$value[title]}:
<!--
EOT;
if($value[type]==2){
$s = explode(',',$value['content']);
foreach($s as $k=>$v){
$sel = in_array($k,$property[$key]) ? 'checked' : '';
print <<<EOT
-->
							<input type="checkbox" name="identity[$key][]" value="$k" $sel /> $v 
<!--
EOT;
}}elseif($value[type]==1){
$s = explode(',',$value['content']);
print <<<EOT
-->
							<select name="identity[$key]"><option></option>
<!--
EOT;
foreach($s as $k=>$v){
$sel = ($k==$property[$key] && $property[$key]!='')? 'selected' : '';
print <<<EOT
-->
							<option value="$k" $sel>$v</option>
<!--
EOT;
}print <<<EOT
-->
							</select>
<!--
EOT;
}else{print <<<EOT
-->
							<input type="text" name="identity[$key]" value="$property[$key]" />
<!--
EOT;
}if($value['explain']){$value['explain'] = str_replace("\n","<br />",$value['explain']);
print <<<EOT
-->
							<span class="gray">$value[explain]</span>
<!--

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?