-
Notifications
You must be signed in to change notification settings - Fork 2
/
backup.php
76 lines (54 loc) · 1.13 KB
/
backup.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
<?php
include_once("config.lib.php");
$backup=$_POST['backup'];
$curr=$_POST['curr'];
if (isset($_POST['backup']) && isset($_POST['curr']))
{
$sql= "SELECT * FROM `backup` WHERE `id` ='$curr'";
$set=0;
if ($conn->query($sql) == TRUE)
{
$result=mysqli_query($conn,$sql);
if($result){
$found=mysqli_num_rows($result);
if($found>0){
while($row = mysqli_fetch_array($result))
{
$var1= $row['inventory']; $var2=$row['pendingorder'];
$var3= $row['reserve'];$var4= $row['capacity'];
$set=1;
}
}
}
}
if($set==0){
echo '20 30 1000 30';
}
else{//ELSE REQUIRED
echo $var1." ".$var2." ".$var3." ".$var4;
}
$sql= "SELECT * FROM `cost` WHERE `playerid` ='$curr' ORDER BY `sno` DESC LIMIT 1";
$set=0;
if ($conn->query($sql) == TRUE)
{
$result=mysqli_query($conn,$sql);
if($result){
$found=mysqli_num_rows($result);
if($found>0){
while($row = mysqli_fetch_array($result))
{
$var1= $row['icost']; $var2=$row['bcost'];
$set=1;
}
}
}
}
if($set==0){
//echo "None";
echo ' 200 300 ';
}
else{
echo " ".$var1." ".$var2;
}
}
?>