-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget.php
58 lines (42 loc) · 1.49 KB
/
get.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
<?php
require_once "seged.php";
$kapcsolat = dbKapcsolodas();
$adatok = lekerdezes($kapcsolat,
"SELECT * FROM `palyak` WHERE `palyaazon` = :palyaazon",
[ ":palyaazon" => $_GET['level'] ]);
$adat = $adatok[0];
$s = $adat['palya'].';'.$adat['falak'].';'.$adat['ido'];
function debugToConsole($msg) {
echo "<script>console.log(".json_encode($msg).")</script>";
}
echo $s;
/*$level = [
"board" => json_decode(utf8_encode($adat['palya'])),
"walls" => json_decode($adat['falak']),
"time" => json_decode($adat['ido'])
];
echo json_encode($level);*/
/*board: [
"▩▩▩▩▩◼▩▩▩▩▩",
"▩▩◼↑▩▩▩✹▩▩▩",
"▩▩▩↑▩▩▩▩▩▩▩",
"▩▩▩⮤←←←←↺▩▩",
"▩▩▩▩▩▩▩▩▩▩▩",
"▩◼▩▩▩▩▩⮘▩▩▩",
],
walls: [
{i: 4, j: 5, side: "top"},
{i: 4, j: 5, side: "left"},
],
time: 10000*/
/*{"board":["▩▩▩▩▩◼▩▩▩▩▩","▩▩◼↑▩▩▩✹▩▩▩","▩▩▩↑▩▩▩▩▩▩▩","▩▩▩⮤←←←←↺▩▩","▩▩▩▩▩▩▩▩▩▩▩","▩◼▩▩▩▩▩⮘▩▩▩"],
"walls":[{"i":4,"j":5,"side":"top"},{"i":4,"j":5,"side":"left"}],
"time":10000}
$file = file_get_contents("adat10.json");
$adatok = json_decode($file, true);
if($_GET['oldal']){
$oldal = $_GET['oldal'];
$adatok = array_slice($adatok, ($oldal-1)*5, 5);
echo json_encode($adatok);
}*/
?>