-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathajax.php
65 lines (58 loc) · 1.89 KB
/
ajax.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
<?php require_once $_SERVER['DOCUMENT_ROOT'].'/assets/libs/init.php'; # Desarrollado por Alan Casillas. alan.stratos@hotmail.com
$con = new assets\libs\connection();
if( !@$_SERVER["HTTP_X_REQUESTED_WITH"] ){
http_response_code(403);
include(ROOT.'/errores/403.php');
die();
}
$json = new assets\libs\jsonSearch($con);
if($_SERVER["REQUEST_METHOD"] == "POST"){
if(filter_input(INPUT_POST, 'id_pais', FILTER_VALIDATE_INT)){
echo $json->getStates($_POST['id_pais']);
}
if(filter_input(INPUT_POST, 'id_estado', FILTER_VALIDATE_INT)){
echo $json->getCities($_POST['id_estado']);
}
if(isset($_POST['bookmark_add'])){
$json->add_bookmark($_POST['bookmark_add']);
}
if(isset($_POST['bookmark_del'])){
$json->del_bookmark($_POST['bookmark_del']);
}
if(isset($_POST['recommend_add'])){
$json->add_recommend($_POST['recommend_add']);
}
if(isset($_POST['recommend_del'])){
$json->del_recommend($_POST['recommend_del']);
}
if(isset($_POST['wishlist_add'])){
$json->add_wishlist($_POST['wishlist_add']);
}
if(isset($_POST['wishlist_del'])){
$json->del_wishlist($_POST['wishlist_del']);
}
if(isset($_POST['the_url'])){
echo $json->set_friendly_url($_POST['the_url']);
}
if(isset($_POST['cert_username'])){
echo $json->get_username_cert($_POST['cert_username']);
}
if(isset($_POST['load_username'])){
echo $json->get_username_load($_POST['load_username']);
}
if(isset($_POST['currency']) && isset($_POST['total']) && isset($_POST['commission'])){
echo $json->calculate_esmarties($_POST['currency'], $_POST['total'], $_POST['commission']);
}
}
if($_SERVER["REQUEST_METHOD"] == "GET"){
if(filter_input(INPUT_GET, 'referral')){
echo $json->getUsers($_GET['referral']);
}
// if(filter_input(INPUT_GET, 'certificate')){
// echo $json->get_certificates('%'.$_GET['certificate'].'%');
// }
if(filter_input(INPUT_GET, 'business')){
echo $json->get_businesses('%'.$_GET['business'].'%');
}
}
?>