Пример #1
0
// echo "\n";
$FG_DEBUG = 2;
if (false) {
    print_r(A2Billing::DBHandle());
}
if (false) {
    require_once 'Class.Logger.php';
    $loog = new Logger();
    $loog->insertLog(0, 1, "TEST", "test entry!", 'aa', 'bb', 'cc');
}
if (false) {
    require_once 'Class.DynConf.php';
    $inst = DynConf::instance();
    $inst->PrefetchGroup('general');
    $inst->dbg_print_cached_config();
    DynConf::instance()->dbg_print_cached_config();
    $val = DynConf::GetCfg('general', 'test', 123);
    print_r($val);
    echo "\n";
    print_r(DynConf::GetCfg('general', 'test2'));
    echo "\n";
    print_r(DynConf::GetCfg('general', 'test'));
    echo "\n";
}
function isnumeric($v)
{
    //return (preg_match('/^\-?[0-9]+$/',$v)>=1);
    return preg_match('/^\\-?[0-9]+([,.][0-9]*)?$/', $v) >= 1;
}
if (false) {
    $examples = array('1', '500', '', 'ab123', '20 1234', '-100', '12-3', '--600', '9823748716249876194652', '1.0', '500,2', '', 'ab,123', '20, 1234', '-100.0', '12.3', '-600.', '98.23748716249876194652');
Пример #2
0
<?php

require_once "lib/defines.php";
require_once "lib/module.access.php";
$cfg = DynConf::instance();
?>
<script language="JavaScript">
<!--
var mywin
var prevdiv="dummydiv"
function imgidclick(imgID,divID)
{

	var agt=navigator.userAgent.toLowerCase();
    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);

    // Note: Opera and WebTV spoof Navigator.  We do strict client detection.
    // If you want to allow spoofing, take out the tests for opera and webtv.
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
	var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	
	
	if (is_ie){			
		if 	(document.all(divID).style.display == "none" )
		{		
			document.all(divID).style.display="";
Пример #3
0
if ($argc > 1 && $argv[1] == '--test') {
    AGI::verbose_s("Testing mode!", 0);
    define('DEFAULT_CONFIG', "../a2billing.conf");
    array_shift($argv);
    $argc--;
} else {
    define('DEFAULT_CONFIG', '/etc/a2billing.conf');
}
require_once 'Class.A2Billing.inc.php';
// create the objects
$a2b = A2Billing::instance();
if (!$a2b->load_res_dbsettings('/etc/asterisk/res_pgsql.conf')) {
    @syslog(LOG_ERR, "Cannot fetch settings from res_pgsql.conf");
    exit(2);
}
$dynconf = DynConf::instance();
if ($argc > 1 && is_numeric($argv[1]) && $argv[1] >= 0) {
    $idconfig = $argv[1];
} else {
    $idconfig = 1;
}
try {
    $dynconf->init();
    $dynconf->PrefetchGroup('agiconf' . $idconfig);
} catch (Exception $ex) {
    error_log($ex->getMessage());
    @syslog(LOG_ERR, "Cannot Fetch config!");
    @syslog(LOG_ERR, $ex->getMessage());
    exit;
}
if ($verbose_mode) {