-
Notifications
You must be signed in to change notification settings - Fork 0
/
json.php
86 lines (70 loc) · 1.58 KB
/
json.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
<?php
require_once 'core/init.php';
$db = DB::getInstance();
//new main row
$coord = array();
for ($i=0; $i <6 ; $i++) {
$x=mt_rand(0,100);
$y=mt_rand(0,2300);
$coord[$i] = array('x' => $x, 'y' => $y);
}
//new side row
$coord1=array();
for ($i=0; $i <2 ; $i++) {
$x=mt_rand(300,580);
$y=mt_rand(510,642);
$coord1[$i] = array('x' => $x, 'y' => $y);
}
//new side row
$coord2=array();
for ($i=0; $i <2 ; $i++) {
$x=mt_rand(780,1030);
$y=mt_rand(786,930);
$coord2[$i] = array('x' => $x, 'y' => $y);
}
//new side row
$coord3=array();
for ($i=0; $i <2 ; $i++) {
$x=mt_rand(342,558);
$y=mt_rand(1005,1149);
$coord3[$i] = array('x' => $x, 'y' => $y);
}
//new side row
$coord4=array();
for ($i=0; $i <2 ; $i++) {
$x=mt_rand(774,1002);
$y=mt_rand(1221,1365);
$coord4[$i] = array('x' => $x, 'y' => $y);
}
//new side row
$coord5=array();
for ($i=0; $i <2 ; $i++) {
$x=mt_rand(296,560);
$y=mt_rand(1439,1583);
$coord5[$i] = array('x' => $x, 'y' => $y);
}
//new side row
$coord6=array();
for ($i=0; $i <2 ; $i++) {
$x=mt_rand(786,1003);
$y=mt_rand(1658,1790);
$coord6[$i] = array('x' => $x, 'y' => $y);
}
$coord = json_encode($coord);
$coord1 = json_encode($coord1);
$coord2 = json_encode($coord2);
$coord3 = json_encode($coord3);
$coord4 = json_encode($coord4);
$coord5 = json_encode($coord5);
$coord6 = json_encode($coord6);
$updateArray = array(
'coordinates' => $coord,
'coordside1' => $coord1,
'coordside2' => $coord2,
'coordside3' => $coord3,
'coordside4' => $coord4,
'coordside5' => $coord5,
'coordside6' => $coord6
);
$db->update("coords",1, $updateArray);
echo "updated";