38 lines
1.4 KiB
PHP
Raw Normal View History

<?php
require_once(dirname(__FILE__).'../../../config/config.inc.php');
require_once(dirname(__FILE__).'../../../init.php');
require_once(dirname(__FILE__).'../../../modules/ant_changeaddress/ant_changeaddress.php');
$ant_changeaddress = new Ant_Changeaddress();
if($cookie->isLogged() && Tools::getValue('id_order')) {
if(Tools::getValue('getPR')
&& ($mode = (float) Tools::getValue('mode'))
&& ($h_xcoords = (float) Tools::getValue('h_xcoords'))
&& ($h_ycoords = (float) Tools::getValue('h_ycoords'))) {
$pr_list = array();
header('Content-Type: text/json');
die(json_encode(Db::getInstance()->ExecuteS('
SELECT *
FROM `'._DB_PREFIX_.'lapostews_pr`
WHERE `ycoords` >= '.(float) $h_ycoords.' - 0.02
AND `ycoords` <= '.(float) $h_ycoords.' + 0.02
AND `xcoords` >= '.(float) $h_xcoords.' - 0.01
AND `xcoords` <= '.(float) $h_xcoords.' + 0.01
AND `type` = "'.$mode.'"
')));
}
if(Tools::getValue('getAD')
&& ($id_address = Tools::getValue('id_address'))) {
$change_address = $ant_changeaddress->getAddress($id_address);
$html = '';
foreach ($change_address as $key => $value) {
$html .= '<li>'.$value.'</li>';
}
header('Content-Type: text/json');
die(json_encode($html));
}
die(json_encode('error1'));
} else {
die(json_encode('error'));
}