Пример #1
0
         $agi->stream_file('prepaid-no-enough-credit-make-call', '#');
     }
     $played_nec = true;
     ReleaseCard($card);
     $card = null;
     continue;
 }
 $played_nec = false;
 $dialnum = getDialNumber($card, $num_try == 0);
 if ($dialnum === false) {
     $agi->stream_file('prepaid-invalid-digits', '#');
     continue;
 }
 $agi->conlog("Dial number: " . $dialnum, 4);
 // CHECK SPEEDDIAL
 getSpeedDial($card, $dialnum);
 $QRY = str_dbparams($a2b->DBHandle(), 'SELECT * FROM RateEngine3(%#1, %2, %#3, now(), %4);', array($card['tgid'], $dialnum, $card['numplan'], $card_money['base']));
 $agi->conlog($QRY, 3);
 $res = $a2b->DBHandle()->Execute($QRY);
 // If the rate engine has anything to Notice/Warn, display that..
 if ($notice = $a2b->DBHandle()->NoticeMsg()) {
     $agi->verbose('DB:' . $notice, 2);
 }
 if (!$res) {
     $agi->verbose('Rate engine: query error!', 2);
     $agi->conlog($a2b->DBHandle()->ErrorMsg(), 2);
     if (getAGIconfig('say_errors', true)) {
         $agi->stream_file('allison2', '#');
     }
     ReleaseCard($card);
     $card = null;
Пример #2
0
    // Reformat the $data
    $data = removeNonIntSections($data);
    $data = removeEmptyPasswords($data);
    // Save the file
    $fonb->write_users($data);
    header("Location: users.php");
    exit;
}
### VIEW the edit user form
$id = $_GET["id"];
if (empty($id)) {
    header("Location: speeddials.php");
    exit;
}
$Json = array();
$Json['SpeedDial'] = getSpeedDial($id);
if ($_GET['encode'] == 'json') {
    echo json_encode($Json);
    exit;
}
// Get the Handlebars Template
$EditSpeedDialTemplateFilePath = realpath("../templates/admin/editspeeddial.html");
if ($EditSpeedDialTemplateFilePath === false) {
    // Error
    exit("Template edituser.html was not found");
}
$EditSpeedDialTemplate = file_get_contents($EditSpeedDialTemplateFilePath);
// Last step, output the html file
require 'Handlebars/Autoloader.php';
Handlebars\Autoloader::register();
use Handlebars\Handlebars;