first commit
This commit is contained in:
41
web/ajax.php
Normal file
41
web/ajax.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
$type = !empty($_GET['type']) ? $_GET['type'] : null;
|
||||
|
||||
header('Content-type: application/json');
|
||||
|
||||
switch ($_GET['type']) {
|
||||
case 'email':
|
||||
if (!($email = getVal('email'))) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$emailCheck = \KupShop\KupShopBundle\Util\Compat\ServiceContainer::getService(\KupShop\KupShopBundle\Util\Mail\EmailCheck::class);
|
||||
|
||||
$result = returnSQLResult('SELECT id FROM users WHERE email=:email AND figure = \'Y\'', ['email' => $email]);
|
||||
echo json_encode(['found' => (bool) $result, 'validDomain' => $emailCheck->isEmailDomainValid($email)]);
|
||||
exit;
|
||||
|
||||
case 'urgent_cargus_cities':
|
||||
if (!($county = getVal('county'))) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$urgentCargus = Delivery::getClass('UrgentCargus');
|
||||
|
||||
echo json_encode($urgentCargus->getCities($county));
|
||||
exit;
|
||||
|
||||
case 'fan_courier_cities':
|
||||
if (!($county = getVal('county'))) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$fanCourier = Delivery::getClass('FANCourier');
|
||||
|
||||
echo json_encode($fanCourier->getCities($county));
|
||||
exit;
|
||||
default:
|
||||
header('HTTP/1.0 404 Not Found');
|
||||
exit;
|
||||
}
|
||||
Reference in New Issue
Block a user