-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfoxpost_ajax.php
executable file
·46 lines (26 loc) · 1020 Bytes
/
foxpost_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
<?php
/*
################################
# Foxpost Parcels #
# Copyright ToHr #
# 2015.09.18 #
# Foxpost parcels delivery core#
################################
*/
if (isset($_GET['shop'])) {
require_once(realpath(dirname(__FILE__).'/../../config/config.inc.php'));
require_once(realpath(dirname(__FILE__).'/../../init.php'));
global $cart;
if(is_numeric(substr($_GET['shop'], 0, 5))) {
$context = Context::getContext();
$json=file_get_contents("https://www.foxpost.hu/foxpost_terminals/foxpost_terminals.php");
$js=json_decode($json);
foreach ($js as $j) {
if ($j->place_id == $_GET['shop']) {
$context->cookie->__set("foxpost_automata_".$cart->id, $j->name." - (".$_GET['shop'].")");
}
}
}
echo json_encode(array());
}
?>