index.php
6.29 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
156
157
158
159
160
161
<?php $this->_extends('layout/admin_layout');?>
<?php $this->_block('main');?>
<ul class="nav nav-tabs">
<li class="active">
<a href="/admin/brand">品牌列表</a>
</li>
<li>
<a href="/admin/prod">商品列表</a>
</li>
</ul>
<table class="table">
<caption style="text-align:left; padding-bottom:5px;">
<button class="btn" style="float:left;" id="add_brand" href="javascript:void(0)">添加品牌</button>
<form method="post" class="form-search search_panel" style="text-align:right;">
<select class="span2" name="state" id="state_from">
<option value="1" <?php if($this->view->state=='1'){echo 'selected="selected"';}?>>开启</option>
<option value="0" <?php if($this->view->state=='0'){echo 'selected="selected"';}?>>关闭</option>
</select>
<div class="input-append">
<button type="submit" class="btn">搜索</button>
</div>
</form>
</caption>
<thead>
<td>编号</td>
<td>名字</td>
<td>LOGO</td>
<td style="width:300px">描述</td>
<td>图片</td>
<td>booth编号</td>
<td>资讯IDS</td>
<td>店铺地址</td>
<td>排序</td>
<td>操作</td>
</thead>
<?php if (empty($this->view->data)) :?>
<tr><td colspan="10" style="text-align: center">无记录</td></tr>
<?php else :?>
<?php foreach ($this->view->data as $id => $brand) :?>
<tr>
<td><?php echo $brand['id']?></td>
<td><?php echo $brand['name'];?></td>
<td title="<?php echo $brand['logo'];?>"><img width=40 height=30 src="<?php echo Lib_Images::getImageUrl($brand['logo'],'0200x0150','fragmentimg');?>" /></td>
<td><?php echo $brand['description'];?></td>
<td title='<?php echo $brand['pics']?>'>
<?php
if(isset($brand['pics'])&&$brand['pics'])
{
$pics = json_decode($brand['pics'],true);
foreach($pics as $pic)
{
if($pic['type']=='video')
{
echo '<video src="'.Lib_Video::getVideoUrl($pic['url']).'" width="150" controls="controls"></video>';
}
elseif($pic['type']=='pic')
{
$url = Lib_Images::getImageUrl($pic['url'],'0200x0150','fragmentimg');
echo '<img src="'.$url.'" width="40" height="30">';
}
}
}
?>
</td>
<td><?php echo $brand['booth_id'];?></td>
<td><?php echo isset($this->view->brandRelas[$id]) ? $this->view->brandRelas[$id]:'';?></td>
<td><a href="<?php echo $brand['link'];?>" target="_blank">前往</a></td>
<td><?php echo $brand['seq'];?></td>
<td>
<button id="look_one_<?php echo $brand['id'];?>" class="btn look">编辑</button>
<button onclick='window.location.href="/admin/prod/index/brand_id/<?php echo $brand["id"]?>"' class="btn">查看商品</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>名称 <span class="text-error"> * </span></td>
<td><input type="text" id="name" name="name" maxLength="20"/>
<input type="hidden" id="id" name="id"/>
</td>
<td>LOGO(300x198)<span class="text-error"> * </span></td>
<td>
<span id="upload_logo" key="<?php echo $this->view->key?>"></span>
<button class="btn btn-info" type="button">上传</button>
<input type="hidden" id="logo" name="logo"/>
<img src="" id="logo_img" width="40" height="30" />
</td>
</tr>
<tr>
<td>描述</td>
<td colspan="3">
<textarea rows="3" style="margin-left: 0px; margin-right: 0px; width: 605px;" id="description" name="description"></textarea>
</td>
</tr>
<tr>
<td>图片(640x640)</td>
<td>
<span id="upload_pic" key="<?php echo $this->view->key?>"></span>
<button class="btn btn-info" type="button">上传</button>
<input type="hidden" id="pics" name="pics"/>
</td>
<td>视频</td>
<td>
<span id="upload_video" key="<?php echo $this->view->key?>"></span>
<button class="btn btn-info" type="button">上传</button>
<input type="hidden" id="video" name="video"/>
</td>
</tr>
<tr>
<td>Booth编号</td>
<td>
<input type="text" id="boothId" name="boothId"/>
</td>
<td>资讯IDS</td>
<td>
<label id="news_ids" name="news_ids" ></label>
</td>
</tr>
<tr>
<td>店铺链接 <span class="text-error"> * </span></td>
<td colspan="3">
<input type="text" id="link" name="link"/>
</td>
</tr>
<tr>
<td>状态</td>
<td>
<select class="span2" id="state">
<option value="1" selected="selected">开启</option>
<option value="0">关闭</option>
</select>
</td>
<td>排序</td>
<td>
<input type="text" id="seq" />
</td>
</tr>
</tbody>
</table>
</div>
<?php $this->_endblock();?>
<?php $this->_block('js');?>
<?php $this->_js('feedback.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/brand');
</script>
<?php $this->_endblock();?>