-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEditNum.php
More file actions
46 lines (36 loc) · 922 Bytes
/
Copy pathEditNum.php
File metadata and controls
46 lines (36 loc) · 922 Bytes
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
<?php
//-3:EditValue不是數字
//-2:無法取得SerialNumbers
//-1:沒有這個號碼
//其他正數:換號成功
require_once("session.php");
$se=new session();
if(!$SerialNumbers=$se->get_value("SerialNumbers"))
{
echo "-2";
exit();
}
require_once("connect_mysql_class.php");
require_once("mysql_inc.php");
$ItemID=$_POST['ItemID'];
$EditValue=$_POST['EditValue'];
if(!is_numeric($EditValue))
{
echo -3;
exit();
}
$db=new DB();
$db->connect_db($_DB['host'], $_DB['username'], $_DB['password'], $_DB['dbname']);
$query="SELECT * FROM custom_information WHERE store='".$SerialNumbers."' and item='".$ItemID."' and number='".$EditValue."' and life='0'";
$db->query($query);
if($db->get_num_rows()>0)
{
$query="UPDATE `".$SerialNumbers."` SET `Now_Value`=\"".$EditValue."\" where `ID` =\"".$ItemID."\"";
$db->query($query);
echo $EditValue;
}
else
{
echo "-1";
}
?>