-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
63 lines (62 loc) · 1.73 KB
/
index.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
<?php
require dirname(__FILE__).'/api/api.php';
$api_files = 'api\api.php';
ob_start();
session_start();
if($_GET){
}else{
rdr("?page=index");
}
if(isset($_GET['page'])){
$page = 'page/page.'.$_GET['page'].'.php';
if(file_exists($page)){
include $page;
}else{
rdr("?page=index");
}
}
if(isset($_GET['action'])) {
$page_a = 'page/action.' . $_GET['action'] . '.php';
if (file_exists($page_a)) {
include $page_a;
} elseif (isset($_GET['action']) == "SaveRedeem") {
if ($_POST) {
$name = $_POST['name'];
$command = $_POST['command'];
if ($api->redeem->SaveRedeem($name,$command)) {
rdr("?page=backend");
} else {
echo "error";
}
}
} elseif (isset($_GET['action']) == "Delitem") {
if ($_GET) {
$id = isset($_GET['id']);
if ($api->shop->Delete($id)) {
rdr("?page=backend");
} else {
echo "Failed";
}
}
} elseif (isset($_GET['action']) == "addItem") {
if ($_POST) {
$image = $_POST['image'];
$title = $_POST['name'];
$price = $_POST['price'];
$command = $_POST['command'];
$page = $_POST['page'];
if ($api->shop->add($title, $price, $command, $image,$page)) {
rdr("?page=backend");
}
}
} elseif (isset($_GET['action']) == "AddRedeem") {
if ($_POST) {
$redeem = $_POST['redeem'];
if ($api->redeen->AddRedeem($redeem)) {
} else {
}
}
} else {
rdr("?page=index");
}
}