index.php
5.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?php $this->_extends('layout/admin_layout');?>
<?php $this->_block('main');?>
<?php if($this->view->status == 0):?>
<ul class="nav nav-tabs">
<li>
<a href="/admin/brand">品牌列表</a>
</li>
<li class="active">
<a href="/admin/prod">商品列表</a>
</li>
</ul>
<?php endif;?>
<?php if($this->view->status == 0):?>
<?php if(!empty($this->view->brand)):?>
<h4>
<img src="<?php echo Lib_Images::getImageUrl($this->view->brand['logo'],'0200x0150','fragmentimg');?>" width="50" height="50"/>
<?php echo $this->view->brand['name'];?> 商品列表
</h4>
<?php else:?>
<h4>商品列表</h4>
<?php endif;?>
<?php else:?>
<h4>限量商品</h4>
<?php endif;?>
<table class="table">
<caption style="text-align:left; padding-bottom:5px;">
<button class="btn" style="float:left;" id="add_prod" href="javascript:void(0)">添加商品</button>
</caption>
<thead>
<td width="9%">编号</td>
<td width="9%">名称</td>
<td width="9%">品牌ID</td>
<td width="9%">品牌LOGO</td>
<td>链接</td>
<td width="6%">图片</td>
<td width="9%">促销价格 ( 单位:元 ) </td>
<td width="9%">市场价格 ( 单位:元 ) </td>
<td width="12%">介绍</td>
<td>排序(值越大,排序越靠前)</td>
<td>创建时间</td>
<td width="12%">操作</td>
</thead>
<?php if (empty($this->view->data)) :?>
<tr><td colspan="10" style="text-align: center">无记录</td></tr>
<?php else :?>
<?php
$brands = $this->view->brands;
foreach ($this->view->data as $prod) :?>
<tr>
<td><?php echo $prod['id']?></td>
<td><?php echo $prod['name']?></td>
<td><?php echo $prod['brand_id']?></td>
<td><img src="<?php echo Lib_Images::getImageUrl($brands[$prod['brand_id']]['logo'], '0200x0150','fragmentimg');?>" width="50" height="50" /></td>
<td><a href='<?php echo $prod['url']?>' target="_blank">前往商品</a></td>
<td pic=<?php echo $prod['pic'];?>>
<?php
$arr = explode('|', $prod['pic']);
foreach ($arr as $val)
{
echo '<img src="'.$val.'" width="40" height="30">';
}
?>
</td>
<td><?php echo $prod['price'];?></td>
<td><?php echo $prod['market_price'];?></td>
<td><?php echo $prod['text']?></td>
<td><?php echo $prod['sort']?></td>
<td>
<?php echo date('Y-m-d h:i:s', $prod['create_time']);?>
<span id="prod_info" market_price="<?php echo $prod['market_price']?>" product_skn="<?php echo $prod['product_skn']?>" product_id="<?php echo $prod['product_id']?>"></span>
</td>
<td>
<button id="look_one_<?php echo $prod['id'];?>" class="btn look" recom_status="<?php echo $prod['recom_status'];?>">编辑</button>
<button val="<?php echo $prod['id'];?>" class="btn btn-danger del">删除</button>
</td>
</tr>
<?php endforeach;?>
<?php endif;?>
</table>
<?php $this->_component('Common_Pagination',array(
'pagination' => $this->view->pagination,'show_count' =>true,
));?>
<div id="form_pan" admin="<?php echo $this->view->admin?>" style="display:none">
<table class="table table-bordered">
<tbody>
<tr>
<td>商品链接</td>
<td colspan="3">
<input type="hidden" id="id" name="id"/>
<input type="text" id="url" name="url" /> <button id="get_prod" class="btn" style="margin-top: -10px;">提取</button>
</td>
</tr>
<tr>
<td>商品名称</td>
<td>
<input type="text" id="name" name="name" />
</td>
<td>排序</td>
<td>
<input type="text" id="sort" name="sort" value="0"/>
</td>
</tr>
<tr>
<td>图片<span class="text-error"> * </span></td>
<td>
<input type="hidden" id='pic' name='pic' />
</td>
<td>介绍<span class="text-error"> * </span></td>
<td>
<textarea type="text" id="text" name="text" style="height: 90px; width: 300px;"> </textarea>
</td>
</tr>
<tr>
<td>品牌ID</td>
<td><input type="text" id="brand_id" name="brand_id" value="<?php echo $this->view->brand_id;?>"/></td>
<td>创建时间</td>
<td>
<input type="text" readonly="readonly" class='span3 Wdate' id="create_time" name="create_time" />
</td>
</tr>
<tr>
<td>
促销价格 <span class="text-error"> * </span>
<br/>(单位:元)
<input type="hidden" name="market_price" id="market_price" value="0"/>
<input type="hidden" name="product_skn" id="product_skn" value="0" />
<input type="hidden" name="product_skn" id="product_id" value="0" />
</td>
<td>
<input type="price" id="price" name="text" value=""/>
</td>
<td>推荐状态<span class="text-error"> * </span></td>
<td>
<select name="recom_status" id="recom_status">
<option value="0">不推荐</option>
<option value="1">推荐</option>
</select>
</td>
</tr>
</tbody>
</table>
</div>
<?php $this->_endblock();?>
<?php $this->_block('js');?>
<?php $this->_js('star.js', array(
SITE_JS . '/lib/seajs.js',
));?>
<script type="text/javascript" src="<?php echo SITE_JS?>/lib/ui/date/WdatePicker.js"></script>
<script type="text/javascript">
seajs.use('admin/prod');
</script>
<?php $this->_endblock();?>