forked from tinydeal/SupplierManagement
/
supplier_view_ls.php
114 lines (99 loc) · 3.32 KB
/
supplier_view_ls.php
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
<?php
/*
* @auther udzhou
* @date 2013-2-1
*/
require_once 'class/supplier_service.class.php';
require_once 'class/supplier.class.php';
require_once 'class/sub_pages.class.php';
if(isset($_GET["p"]))
$pageCurrent=$_GET["p"];
else
$pageCurrent=1;
//每页显示的条数
$page_size=10;
$supplier_service=new SupplierService();
//总条目数
//每次显示的页数
$sub_pages=10;
$url="index.php?mod=supplier&action=ls&p=";
if(isset($_GET["keywords"])){
$keywords=$_GET["keywords"];
$array_supplier=$supplier_service->listAllByKeywords($pageCurrent,$page_size,$keywords);
$nums=$supplier_service->getListRowsByKeywords($keywords);
if(!empty($keywords)){
$url="index.php?mod=supplier&action=ls&keywords=$keywords&p=";
}
}else{
$array_supplier=$supplier_service->listAll($pageCurrent,$page_size);
$nums=$supplier_service->getListRows();
}
?>
<div class="search-form">
<form class="form-inline" action="./index.php" method="get">
<input type="hidden" class="search-query" name="mod" value="supplier">
<input type="hidden" class="search-query" name="action" value="ls">
<input type="text" class="search-query" name="keywords" id="keywords">
<button type="submit" class="btn">搜索</button>
</form>
</div>
<div class="datatable">
<ul class="nav nav-tabs">
<li class="active">
<a href="#">供应商管理</a>
</li>
<a type='button' class='btn btn-primary' href='./index.php?mod=supplier&action=add_get' style="float: right;">新增供应商</a>
</ul>
<table class="table table-bordered table-striped table-hover" id="table">
<thead>
<tr>
<th>供应商名称</th>
<th>类别</th>
<th>批价区间</th>
<th>产品风格</th>
<th>产品属类</th>
<!-- <th>图片</th>
<th>网址</th>
<th>联系人</th>
<th>手机</th>
<th>地址</th>
<th>备注</th> -->
<th>操作</th>
</tr>
</thead>
<tbody>
<?php
foreach ($array_supplier as $supplier){
if($supplier->is_provide_pictures){
$supplier->is_provide_pictures="有";
}else{
$supplier->is_provide_pictures="无";
}
echo "<tr>
<td><a href='./index.php?mod=supplier&action=detail&did=$supplier->id'>$supplier->supplier_name</a></td>
<td>$supplier->supplier_category_name</td>
<td>$supplier->wholesale_num_min~$supplier->wholesale_num_max</td>
<td>$supplier->goods_style</td>
<td>$supplier->goods_category</td>
<td><a class='btn btn-primary' href='./index.php?mod=supplier&action=edit_get&eid=".$supplier->id."'>修改</a></td>
</tr>";
/*<td>$supplier->is_provide_pictures</td>
<td>$supplier->website</td>
<td>$supplier->linkman</td>
<td>$supplier->telephone</td>
<td>$supplier->province$supplier->city$supplier->village$supplier->address_detial</td>
<td>$supplier->note</td>
*/
}
?>
</tbody>
</table>
<?php
$subPages=new SubPages($page_size,$nums,$pageCurrent,$sub_pages,$url);
?>
</div>
<script>
$(function () {
$('#keywords').val("<?php echo $_GET["keywords"]?>");
} );
</script>