<!DOCTYPE html>
<html>
	<?php echo $this->fetch('head.html'); ?>
	<style>
		.video{
			width: 320px;
			height: auto;
		}
	</style>
	<body>
		<?php echo $this->fetch('s2c_product/nav.html'); ?>
		<div class="main-body">
			<form method="post" action="/moduleadmin.php?m=s2c_product&a=save">
				<input type="hidden" name="id" style="display:none;" value="<?php echo $this->_var['data']['id']; ?>">
				<table class="table-add">
					<tr>
						<td>名称：</td>
						<td><input type="text" name="title" id="title" value="<?php echo $this->_var['data']['title']; ?>"></td>
					</tr>
					<tr>
						<td>分类：</td>
						<td>
							<select name="catid">
								<option value="0">请选择</option>
								<?php $_from = $this->_var['catlist']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
									<option value="<?php echo $this->_var['c']['catid']; ?>" <?php if ($this->_var['data']['catid'] == $this->_var['c']['catid']): ?>selected<?php endif; ?>><?php echo $this->_var['c']['title']; ?></option>
									<?php if ($this->_var['c']['child']): ?>
									<?php $_from = $this->_var['c']['child']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'cc');if (count($_from)):
    foreach ($_from AS $this->_var['cc']):
?>
									<option value="<?php echo $this->_var['cc']['catid']; ?>" <?php if ($this->_var['data']['catid'] == $this->_var['cc']['catid']): ?>selected<?php endif; ?>>|--<?php echo $this->_var['cc']['title']; ?></option>
									<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
									<?php endif; ?>
								<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
							</select>
						</td>
					</tr>
					<tr>
						<td>描述：</td>
						<td><input type="text" name="description" id="description" value="<?php echo $this->_var['data']['description']; ?>"></td>
					</tr>
					<tr>
						<td>图片：</td>
						<td>
							<div class="js-upload-item">
								<input type="file" id="upa" class="js-upload-file" style="display: none;" />
								<div class="upimg-btn js-upload-btn">+</div>
								<input type="hidden" name="imgurl" class="js-imgurl" value="<?php echo $this->_var['data']['imgurl']; ?>" />
								<div class="js-imgbox">
									<?php if ($this->_var['data']['imgurl']): ?>
									<img src="<?php echo images_site($this->_var['data']['imgurl']); ?>.100x100.jpg">
									<?php endif; ?>
								</div>
							</div>
					
						</td>
					</tr>
					<tr>
						<td>价格：</td>
						<td><input type="text" class="w100" name="price" id="price" value="<?php echo $this->_var['data']['price']; ?>">元</td>
					</tr>
					<tr>
						<td>促销价：</td>
						<td><input type="text" name="lower_price" id="lower_price" value="<?php echo $this->_var['data']['lower_price']; ?>"></td>
					</tr>
					<tr>
						<td>市场价：</td>
						<td><input type="text" name="market_price" id="market_price" value="<?php echo $this->_var['data']['market_price']; ?>"></td>
					</tr> 
					<tr>
						<td>抽成比例</td>
						<td>
							<input class="w100" type="text" name="per_money" value="<?php echo $this->_var['data']['per_money']; ?>" />%
						</td>
					</tr>
					<tr>
						<td>库存：</td>
						<td><input type="text" name="total_num" id="total_num" value="<?php echo $this->_var['data']['total_num']; ?>"></td>
					</tr>
					<tr>
						<td>销量：</td>
						<td><input type="text" name="buy_num" id="buy_num" value="<?php echo $this->_var['data']['buy_num']; ?>"></td>
					</tr>
					
					<tr>
						<td>重量：</td>
						<td><input class="w100" type="text" name="weight" id="weight" value="<?php echo $this->_var['data']['weight']; ?>">Kg</td>
					</tr>
					
					 
					<tr>
						<td>款式名称：</td>
						<td><input type="text" name="ks_label_name" id="ks_label_name" value="<?php echo $this->_var['data']['ks_label_name']; ?>"></td>
					</tr>
					<tr>
						<td>款式尺寸：</td>
						<td><input type="text" name="ks_label_size" id="ks_label_size" value="<?php echo $this->_var['data']['ks_label_size']; ?>"></td>
					</tr>
					<tr>
						<td>月销：</td>
						<td><input type="text" name="month_buy_num" id="month_buy_num" value="<?php echo $this->_var['data']['month_buy_num']; ?>"></td>
					</tr>
					<tr>
						<td>视频：</td>
						<td>
							<div id="upmp4-btn" class="btn mgb-10">上传视频</div>
							<span id="progress"></span>
							<div style="padding: 10px; color: #f60;">视频小于100M，只支持mp4格式</div>
							<div id="mp4box">
								<?php if ($this->_var['data']['mp4url']): ?>
								<video controls="" src="<?php echo images_site($this->_var['data']['mp4url']); ?>" class="video"></video>
								<?php endif; ?>
							</div>
							
							<input type="hidden" name="videourl" id="mp4url" value="<?php echo $this->_var['data']['videourl']; ?>" />
						 
							<div style="display: none;">
								<input type="file" id="upvideo" name="upfile" />
							</div>
							 
						
						</td>
					</tr>
					<tr>
						<td>最新：</td>
						<td>
							<input type="radio" name="isnew" <?php if ($this->_var['data']['isnew'] == 1): ?>checked<?php endif; ?> value="1">是
							<input type="radio" name="isnew" <?php if ($this->_var['data']['isnew'] != 1): ?>checked<?php endif; ?> value="0">否
						
						</td>
					</tr>
					<tr>
						<td>最热：</td>
						<td>
							<input type="radio" name="ishot" <?php if ($this->_var['data']['ishot'] == 1): ?>checked<?php endif; ?> value="1">是
							<input type="radio" name="ishot" <?php if ($this->_var['data']['ishot'] != 1): ?>checked<?php endif; ?> value="0">否
						</td>
					</tr>
					<tr>
						<td>推荐：</td>
						<td>
							<input type="radio" name="isrecommend" <?php if ($this->_var['data']['isrecommend'] == 1): ?>checked<?php endif; ?> value="1">是
							<input type="radio" name="isrecommend" <?php if ($this->_var['data']['isrecommend'] != 1): ?>checked<?php endif; ?> value="0">否
						</td>
					</tr>
					
					 
					<tr>
						<td>状态</td>
						<td>
							<input type="radio" name="status" <?php if ($this->_var['data']['status'] == 1): ?> checked<?php endif; ?> value="1" />显示
							
							<input type="radio" name="status" <?php if ($this->_var['data']['status'] != 1): ?> checked<?php endif; ?>  value="2" />隐藏
						</td>
					</tr>
					<tr>
						<td>创建时间：</td>
						<td><?php echo $this->_var['data']['createtime']; ?></td>
					</tr>
					<tr>
						<td>内容：</td>
						<td>
							<script type="text/plain" id="content" name="content"><?php echo $this->_var['data']['content']; ?></script>
						</td>
					</tr>
				</table>
				<div class="btn-row-submit js-submit">保存</div>
			</form>
		</div>
		<?php echo $this->fetch('footer.html'); ?>
		<script src="/static/admin/js/upload.js"></script>
		<script src="<?php echo $this->_var['skins']; ?>/s2c_product/upload-video.js"></script>
		<?php loadEditor();;?>
		<script>
			var editor = UE.getEditor('content', options);
		 
		</script>
		<script src="/plugin/laydate/laydate.js"></script>
		<script>
			laydate.render({
				elem:"#startTime",
				type:"datetime"
			})
		</script>
	</body>
</html>
