-
Notifications
You must be signed in to change notification settings - Fork 3
/
addcategory.php
235 lines (147 loc) · 6.54 KB
/
addcategory.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
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<?php
include "include/config.php";
include "top.php";
$id = $_REQUEST['id'];
if($_POST['submit']){
$ebay_account = $_POST['ebay_account'];
$category_name = $_POST['category_name'];
$note = $_POST['ebay_note'];
$rules = $_POST['rules'];
if($id == ""){
$sql = "insert into ebay_messagecategory(category_name,ebay_note,ebay_user,rules,ebay_account) values('$category_name','$note','$user','$rules','$ebay_account')";
}else{
$sql = "update ebay_messagecategory set category_name='$category_name',ebay_note='$note',rules='$rules',ebay_account='$ebay_account' where id='$id'";
}
if($dbcon->execute($sql)){
$status = " -[<font color='#33CC33'>操作记录: 记录保存成功</font>]";
}else{
$status = " -[<font color='#FF0000'>操作记录: 记录保存失败</font>]";
}
}
$sql = "select * from ebay_messagecategory where id='$id'";
$sql = $dbcon->execute($sql);
$sql = $dbcon->getResultArray($sql);
$category_name = $sql[0]['category_name'];
$note = $sql[0]['ebay_note'];
$rules = $sql[0]['rules'];
$ebay_account = $sql[0]['ebay_account'];
?>
<div id="main">
<div id="content" >
<table style="width:100%"><tr><td><div class='moduleTitle'>
<h2><?php echo $_REQUEST['action'].$status;?> </h2>
</div>
<div class='listViewBody'>
<div id='Accountsbasic_searchSearchForm' style='' class="edit view search basic">
<table width="90%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td nowrap="nowrap" scope="row" > <table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="login_txt_bt"> </td>
</tr>
<tr>
<td valign="top" class="left_txt">
<br>
<form id="ad" name="ad" method="post" action="addcategory.php?id=<?php echo $id;?>&module=message&action=Message分类">
<input type="hidden" value="<?php echo $_REQUEST['type'];?>" name="type" />
<table width="89%" border="0" cellpadding="0" cellspacing="0" class="login_txt">
<tr>
<td width="13%">分类名称:</td>
<td width="41%"><input name="category_name" type="text" id="category_name" value="<?php echo $category_name;?>"></td>
</tr>
<tr>
<td>分类规则:</td>
<td><textarea name="rules" cols="80" rows="8" id="rules" ><?php echo $rules;?></textarea>
<br />
每个字母或数字之前请使用英文状态下的逗号分开。</td>
</tr>
<tr>
<td>管理哪些帐号:</td>
<td><textarea name="ebay_account" cols="80" rows="8" id="ebay_account" ><?php echo $ebay_account;?></textarea>
<br />
每个eBay帐号请使用英文状态下的逗号分开</td>
</tr>
<tr>
<td>分类备注:</td>
<td><input name="ebay_note" type="text" id="ebay_note" value="<?php echo $note; ?>">
<input name="submit" type="submit" value="保存" id="submit" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</form>
<p> </p>
<p><br>
</p></td>
</tr>
</table></td>
</tr>
</table>
</div>
<div id='Accountsadvanced_searchSearchForm' style='display:none' class="edit view search advanced"></div>
<div id='Accountssaved_viewsSearchForm' style='display: none';></div>
</form>
<table cellpadding='0' cellspacing='0' width='100%' border='0' class='list view'>
<tr class='pagination'>
<td width="65%"> </td>
</tr>
<tr class='pagination'>
<td>
<table border='0' cellpadding='0' cellspacing='0' width='100%' class='paginationTable'>
<tr>
<td nowrap="nowrap" class='paginationActionButtons'></td>
</tr>
</table> </td>
</tr></table>
<div class="clear"></div>
<?php
include "bottom.php";
?>
<script language="javascript">
function del(ordersn,ebayid){
if(confirm("确认删除此条记录吗")){
location.href="ordermodifive.php?ordersn=<?php echo $ordersn ?>&ebayid=<?php echo $ebayid;?>&type=del&module=orders&action=新增订单";
}
}
function mod(ordersn,ebayid){
if(confirm("确认修改此条记录吗")){
var pname = document.getElementById('pname'+ebayid).value;
var pprice = document.getElementById('pprice'+ebayid).value;
var pqty = document.getElementById('pqty'+ebayid).value;
var psku = document.getElementById('psku'+ebayid).value;
var pitemid = document.getElementById('pitemid'+ebayid).value;
if(isNaN(pqty)){
alert("数量只能输入数字");
}else if(isNaN(pprice)){
alert("价格只能输入数字");
}else{
location.href="ordermodifive.php?ordersn=<?php echo $ordersn ?>&ebayid="+ebayid+"&type=mod&pname="+encodeURIComponent(pname)+"&pprice="+pprice+"&pqty="+pqty+"&psku="+psku+"&pitemid="+pitemid+"&module=orders&action="+urlencode(新增订单);
}
}
}
function add(ordersn){
var tname = document.getElementById('tname').value;
var tprice = document.getElementById('tprice').value;
var tqty = document.getElementById('tqty').value;
var tsku = document.getElementById('tsku').value;
var titemid = document.getElementById('titemid').value;
if(tname == ""){
alert("请输入产品名称");
document.getElementById('tname').select();
return false;
}
if(isNaN(tprice) || tprice == ""){
alert("数量只能输入数字");
document.getElementById('tprice').select();
return false;
}
if(isNaN(tqty)){
alert("价格只能输入数字");
document.getElementById('tqty').select();
return false;
}
location.href="ordermodifive.php?ordersn=<?php echo $ordersn ?>&type=add&tname="+encodeURIComponent(tname)+"&tprice="+tprice+"&tqty="+tqty+"&tsku="+tsku+"&titemid="+titemid+"&module=orders&action=新增订单";
}
</script>