var obj = {
t: null
}
var $deffered = $.ajax({
type: "POST",
data: {'request':1},
url: "/json.php",
dataType: "json",
});
$deffered.done(function(data){
obj.t = data.data;
});
var t;
$.ajax({
type: "POST",
data: {'request':1},
url: "/json.php",
dataType: "json",
success: function(data){
t = data.data;
}
});
console.log(t);
var t;
$.ajax({
type: "POST",
data: {'request':1},
url: "/json.php",
dataType: "json",
success: function(data){
t = data.data;
callback();
}
});
function callback () {
console.log(t);
}
#!/usr/bin/php -q
<?php
require_once ('phpagi/phpagi.php');
$agi = new AGI();
// Получаем переменные из канала
$channel = $agi->request['agi_channel'];
$uniqueid = $agi->request['agi_uniqueid'];
$callerid = $agi->request['agi_callerid'];
$accountcode = $agi->request['agi_accountcode'];
$extension = $agi->request['agi_extension'];
$language = $agi->request['agi_language'];
?>
SELECT DISTINCT `res`.`id_page` FROM `fields_value` AS `res`
INNER JOIN `fields_value` AS `f1` ON (`f1`.`id_page` = `res`.`id_page` AND `f1`.`id_field` = 22 AND `f1`.`value` = 'Платный')
INNER JOIN `fields_value` AS `f2` ON (`f2`.`id_page` = `res`.`id_page` AND `f2`.`id_field` = 11 AND `f2`.`value` = '100')
INNER JOIN `fields_value` AS `f3` ON (`f3`.`id_page` = `res`.`id_page` AND `f3`.`id_field` = 33 AND `f3`.`value` = 'есть')