-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsystem_basic_edit.php
More file actions
220 lines (214 loc) · 8.88 KB
/
system_basic_edit.php
File metadata and controls
220 lines (214 loc) · 8.88 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<?php
require(dirname(__FILE__)."/include/config_rglobals.php");
require(dirname(__FILE__)."/include/config_base.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" />
<script language="javascript" src="include/calendar.js"></script>
<script language="javascript" src="include/py.js"></script>
<title>产品基本信息录入</title>
<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>
<script type="text/vbscript">
function vbChr(c)
vbChr = chr(c)
end function
function vbAsc(n)
vbAsc = asc(n)
end function
</script>
</head>
<?php
if ($action=='save'){
if($cp_name=='') echo "<script language='javascript'>alert('请输入产品的名称!');history.go(-1)</script>";
if($cp_gg=='') echo "<script language='javascript'>alert('请输入产品的规格!');history.go(-1)</script>";
if($cp_categories=='') echo "<script language='javascript'>alert('请输入产品的分类!');history.go(-1)</script>";
if($cp_categories_down=='') echo "<script language='javascript'>alert('请输入产品的子分类!');history.go(-1)</script>";
if($cp_dwname=='') echo "<script language='javascript'>alert('请输入产品的基本单位!');history.go(-1)</script>";
if($cp_jj=='' || $cp_sale=='') echo "<script language='javascript'>alert('产品进价与建议零售价为必填项!');history.go(-1)</script>";
if(!(is_numeric($cp_jj) && is_numeric($cp_sale) )) echo "<script language='javascript'>alert('价格必须为数字!');history.go(-1)</script>";
if($cp_jj>$cp_sale) echo "<script language='javascript'>alert('零售价不能小于进价!');history.go(-1)</script>";
$bsql=New Dedesql(false);
$query="update #@__basic set cp_number='".$cp_number."',cp_tm='".$cp_tm."',cp_name='".$cp_name."',cp_gg='".$cp_gg."',cp_categories='".$cp_categories."',cp_categories_down='".$cp_categories_down."',cp_dwname='".$cp_dwname."',cp_style='".$cp_style."',cp_jj='".$cp_jj."',cp_sale='".$cp_sale."',cp_saleall='".$cp_saleall."',cp_sale1='".$cp_sale1."',cp_sdate='".$cp_sdate."',cp_edate='".$cp_edate."',cp_gys='".$cp_gys."',cp_helpword='".$cp_helpword."',cp_bz='".$cp_bz."' where id='$id'";
$bsql->ExecuteNoneQuery($query);
showmsg('成功修改了产品基本信息','system_basic_cp.php?action=seek');
$loginip=getip();
$logindate=getdatetimemk(time());
$username=GetCookie('VioomaUserID');
WriteNote('修改产品基本信息'.$cp_name.' 成功',$logindate,$loginip,$username);
$bsql->close();
exit();
}
$seekrs=New Dedesql(falsh);
$squery="select * from #@__basic where id='$id'";
$seekrs->SetQuery($squery);
$seekrs->Execute();
$rowcount=$seekrs->gettotalrow();
if($rowcount==0){
Showmsg('非法的参数','-1');
exit();
}
$row=$seekrs->GetOne();
$seekrs->close();
?>
<script language="javascript">
function check(e){
var e = window.event ? window.event : e;
if(e.keyCode == 13){
document.forms[0].cp_name.focus();
return false;
}
}
function checkForm(){
document.forms[0].submit();
}
</script>
<body onload="form1.cp_tm.focus()">
<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><strong> 产品基本信息管理</strong>(注:橙色背景为必填选项) - <a href="system_basic_cp.php">新产品登记</a> - <a href="system_basic_cp.php?action=seek">产品基本信息查询</a></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="table_border">
<form action="system_basic_edit.php?action=save" method="post" name="form1">
<tr>
<td class="cellcolor">产品货号:</td>
<td> <input type="hidden" value="<?php echo $id?>" name="id"><input type="text" name="cp_number" value="<?php echo $row['cp_number'] ?>" style="color:red;font-family:Verdana, Arial, Helvetica, sans-serif;"></td>
</tr>
<tr>
<td class="cellcolor" width="30%">产品条形码:<br>(如有条码扫描仪可直接扫描)</td>
<td> <input type="text" name="cp_tm" value="<?php echo $row['cp_tm'] ?>" onkeydown="check(event);"> 如使用条形码,销售时可直接使用</td>
</tr>
<tr>
<td class="cellcolor" width="30%">产品名称:</td>
<td> <input type="text" name="cp_name" id="need" onblur="pinyin(this.value)" value="<?php echo $row['cp_name'] ?>"></td>
</tr>
<tr>
<td class="cellcolor">产品规格:</td>
<td> <input type="text" name="cp_gg" id="need" value="<?php echo $row['cp_gg'] ?>"></td>
</tr>
<tr>
<td class="cellcolor">产品所属分类:</td>
<td>
<?php
getcategories($row['cp_categories'],$row['cp_categories_down']);
?> </td>
</tr>
<tr>
<td class="cellcolor">单位:</td>
<td> <?php getdw($row['cp_dwname']) ?></td>
</tr>
<td class="cellcolor">产品类型:</td>
<td>
<?php
if($row['cp_style']=='1')
echo "<select name='cp_style'><option selected value='1'>正常销售产品</option><option value='0'>非销售产品</option></select>";
else
echo "<select name='cp_style'><option value='1'>正常销售产品</option><option selected value='0'>非销售产品</option></select>";
?> 非销售产品将不会出现在销售列表中
</td>
<tr>
<td class="cellcolor">进货价格:</td>
<td> <input type="text" name="cp_jj" id="need" value="<?php echo $row['cp_jj'] ?>"></td>
</tr>
<tr>
<td class="cellcolor">建议零售价格:</td>
<td> <input type="text" name="cp_sale" id="need" value="<?php echo $row['cp_sale'] ?>"></td>
</tr>
<tr>
<td class="cellcolor">建议批发价格:</td>
<td> <input type="text" name="cp_saleall" value="<?php echo $row['cp_saleall'] ?>"></td>
</tr>
<tr>
<td class="cellcolor">自定义价格:</td>
<td> <input type="text" name="cp_sale1" value="<?php echo $row['cp_sale1'] ?>">
</tr>
<tr>
<td class="cellcolor">生产日期:</td>
<td> <input type="text" name="cp_sdate" onclick="setday(this)" value="<?php echo $row['cp_sdate'] ?>">
单击输入框选择时间 </td>
</tr>
<tr>
<td class="cellcolor">作废日期:</td>
<td> <input type="text" name="cp_edate" onclick="setday(this)" value="<?php echo $row['cp_edate'] ?>"> 单击输入框选择时间</td>
</tr>
<tr>
<td class="cellcolor">供应商:</td>
<td> <input type="text" name="cp_gys" readonly value="<?php echo $row['cp_gys'] ?>"> <img src="images/up.gif" border="0" align="absmiddle" style="cursor:hand;" onclick="window.open('select_gys.php?form=form1&field=cp_gys','selected','directorys=no,toolbar=no,status=no,menubar=no,resizable=no,width=250,height=270,top=200,left=520')" />点击选择供应商</td>
</tr>
<tr>
<td class="cellcolor">助记词:</td>
<td> <input type="text" name="cp_helpword" value="<?php echo $row['cp_helpword'] ?>"> (用于快速搜寻产品用,如不输入则按拼间首字字母记录)</td>
</tr>
<tr>
<td class="cellcolor">备注:</td>
<td>
<textarea rows="5" cols="30" name="cp_bz"><?php echo $row['cp_bz'] ?></textarea></td>
</tr>
<tr>
<td class="cellcolor"> </td>
<td> <input type="button" value=" 修改产品信息 " onclick="checkForm()"></td>
</tr></form>
</table>
</td>
</tr>
</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>
<?php
copyright();
?>
</body>
</html>