-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsystem_basic_list.php
More file actions
181 lines (177 loc) · 7.28 KB
/
system_basic_list.php
File metadata and controls
181 lines (177 loc) · 7.28 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<?php
require(dirname(__FILE__)."/include/config_base.php");
require(dirname(__FILE__)."/include/config_rglobals.php");
require(dirname(__FILE__)."/include/page.php");
require_once(dirname(__FILE__)."/include/checklogin.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/2019/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<link href="style/main.css" rel="stylesheet" type="text/css" />
<title><?php echo $cfg_softname;?>选择产品</title>
<script language="javascript">
function selectpro(value,id,gg,dw,s1,s2,s3,lid){
window.opener.document.<?php echo $form ?>.<?php echo $field ?>.value=value;
window.opener.document.<?php echo $form ?>.seek_number.value=id;
window.opener.document.<?php echo $form ?>.showinfo.value="产品名称:"+value+" 规格:"+gg;
window.opener.document.<?php echo $form ?>.showdw.value=dw;
window.opener.document.<?php echo $form ?>.sale.value=s1;
window.opener.document.<?php echo $form ?>.labid.value=lid;
window.opener.sale_string.innerHTML=" <input type='radio' name='sale1' checked value='"+s1+"' onclick='setsale(this.value)'>"+s1+" 零售<input type='radio' name='sale1' value='"+s2+"' onclick='setsale(this.value)'>"+s2+" 批发<input type='radio' name='sale1' value='"+s3+"' onclick='setsale(this.value)'>"+s3+" 特殊";
window.close();
return false;
}
</script>
<script language = "JavaScript">
var onecount;
onecount = 0;
subcat = new Array();
<?php
$count=0;
$rsql=New Dedesql(false);
$rsql->SetQuery("select * from #@__categories where reid!=0");
$rsql->Execute();
while($rs=$rsql->GetArray()){
?>
subcat[<?php echo $count;?>] = new Array("<?php echo $rs['categories'];?>","<?php echo $rs['reid'];?>","<?php echo $rs['id'];?>");
<?php
$count++;
}
$rsql->close();
?>
onecount=<?php echo $count?>;
function getCity(locationid)
{
document.form1.cp_categories_down.length = 0;
var locationid=locationid;
var i;
document.form1.cp_categories_down.options[0] = new Option('==所选分类的子分类==','');
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form1.cp_categories_down.options[document.form1.cp_categories_down.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
</head>
<body>
<table width="100%" border="0" id="table_style_all" cellpadding="0" cellspacing="0">
<tr>
<td id="table_style" class="l_t"> </td>
<td> </td>
<td id="table_style" class="r_t"> </td>
</tr>
<tr>
<td> </td>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="2">
<tr>
<td>
<table width="100%" border="0" cellspacing="0">
<tr><form action="system_basic_list.php?action=seek&form=<?php echo $form; ?>&field=<?php echo $field; ?>" name="form1" method="post">
<td>
<strong> 选择你要的产品</strong>
</td>
<td align="right">所在分类:
<?php
if ($action=='seek')
getcategories($cp_categories,$cp_categories_down);
else
getcategories(0,'');
?>
<select name="sort">
<option value="1">按货号查询</option>
<option value="2">按条码查询</option>
<option value="3" selected>按名称查询</option>
<option value="4">按助记词查询</option>
</select>
<input type="text" name="stext" size="15" value="<?php echo $stext; ?>"><input type="submit" value="开始检索">
</td>
</tr></form>
</table>
</td>
</tr>
<form method="post" name="sel">
<tr>
<td bgcolor="#FFFFFF">
<?php
echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" id=\"table_border\">";
if($action=='seek'){
if($cp_categories_down=='')echo "<script>alert('请选择小分类');history.go(-1);</script>";
switch($sort){
case "1"://按货号
$query="select * from #@__mainkc,#@__basic where #@__basic.cp_number='$stext' and #@__basic.cp_categories='$cp_categories' and #@__basic.cp_categories_down='$cp_categories_down' and #@__mainkc.p_id=#@__basic.cp_number and #@__basic.cp_style=1";
break;
case "2"://按条码
$query="select * from #@__mainkc,#@__basic where #@__basic.cp_tm='$stext' and #@__basic.cp_categories='$cp_categories' and #@__basic.cp_categories_down='$cp_categories_down' and #@__mainkc.p_id=#@__basic.cp_number and #@__basic.cp_style=1";
break;
case "3"://按名称
$query="select * from #@__mainkc,#@__basic where #@__basic.cp_name LIKE '%".$stext."%' and #@__basic.cp_categories='$cp_categories' and #@__basic.cp_categories_down='$cp_categories_down' and #@__mainkc.p_id=#@__basic.cp_number and #@__basic.cp_style=1";
break;
case "4"://按肋记词
$query="select * from #@__mainkc,#@__basic where #@__basic.cp_helpword LIKE '%".$stext."%' and #@__basic.cp_categories='$cp_categories' and #@__basic.cp_categories_down='$cp_categories_down' and #@__mainkc.p_id=#@__basic.cp_number and #@__basic.cp_style=1";
break;
}
}
else
$query="select * from #@__mainkc,#@__basic where #@__mainkc.p_id=#@__basic.cp_number and #@__basic.cp_style=1";
$csql=New Dedesql(false);
$dlist = new DataList();
$dlist->pageSize = $cfg_record;
$dlist->SetParameter("form",$form);
$dlist->SetParameter("field",$field);//设置GET参数表
if($action=='seek'){
$dlist->SetParameter("action",$action);
$dlist->SetParameter("cp_categories",$cp_categories);
$dlist->SetParameter("cp_categories_down",$cp_categories_down);
$dlist->SetParameter("sort",$sort);
$dlist->SetParameter("stext",$stext);
}
$dlist->SetSource($query);
echo "<tr class='row_color_head'>
<td>货号</td>
<td>名称</td>
<td>规格</td>
<td>分类</td>
<td>单位</td>
<td>库存</td>
<td>供应商</td>
<td>助记词</td>
<td>选择</td>
</tr>";
$mylist = $dlist->GetDataList();
while($row = $mylist->GetArray('dm')){
echo "<tr onMouseMove=\"javascript:this.bgColor='#EBF1F6';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\">\r\n
<td><center>".$row['cp_number']."</td>
<td><center> ".$row['cp_name']."</td>
<td><center>".$row['cp_gg']."</td>
<td><center>".get_name($row['cp_categories'],'categories').">".get_name($row['cp_categories_down'],'categories')."</td>
<td><center>".get_name($row['cp_dwname'],'dw')."</td>
<td style='color:red'><center>".$row['number']."</td>
<td><center>".$row['cp_gys']."</td>
<td><center>".$row['cp_helpword']."</td>
<td><center><input type='checkbox' name='sel_pro".$row['id']."' value='".$row['cp_name']."' onclick=\"selectpro(this.value,".$row['cp_number'].",'".$row['cp_gg']."','".get_name($row['cp_dwname'],'dw')."',".$row['cp_sale'].",".$row['cp_saleall'].",".$row['cp_sale1'].",".$row['l_id'].")\"></td>\r\n
</tr>";
}
echo "<tr><td colspan='8'> ".$dlist->GetPageList($cfg_record)."</td></tr>";
echo "</table>";
$csql->close();
?>
</td>
</tr></form>
</table>
</td>
<td> </td>
</tr>
<tr>
<td id="table_style" class="l_b"> </td>
<td> </td>
<td id="table_style" class="r_b"> </td>
</tr>
</table>
</body>
</html>