day of week	 0-7 (0 or 7 is Sun, or use names)
	
****************************************************************************/

set_time_limit(0);
error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));

include (dirname(__FILE__) . "/lib/admin.defines.php");
include (dirname(__FILE__) . "/lib/ProcessHandler.php");

if (!defined('PID')) {
	define("PID", "/var/run/a2billing/a2billing_batch_billing_pid.php");
}

// CHECK IF THE CRONT PROCESS IS ALREADY RUNNING
if (ProcessHandler :: isActive()) {
	die(); // Already running!
} else {
	ProcessHandler :: activate();
}


//Flag to show the debuging information
$verbose_level = 0;

$groupcard = 5000;
$oneday = 24 * 60 * 60;

$A2B = new A2Billing();
$A2B->load_conf($agi, NULL, 0, $idconfig);
    month	 		1-12 (or names, see below)
    day of week	 	0-7 (0 or 7 is Sun, or use names)

    The sample above will run the script every 21 of each month at 10AM

****************************************************************************/
set_time_limit(0);
error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));
include dirname(__FILE__) . "/lib/admin.defines.php";
include dirname(__FILE__) . "/lib/ProcessHandler.php";
if (!defined('PID')) {
    define("PID", "/var/run/a2billing/a2billing_subscription_fee_pid.php");
}
// CHECK IF THE CRONT PROCESS IS ALREADY RUNNING
$pH = new ProcessHandler();
if ($pH->isActive()) {
    die;
    // Already running!
} else {
    $pH->activate();
}
$verbose_level = 1;
$groupcard = 5000;
$A2B = new A2Billing();
$A2B->load_conf($agi, NULL, 0, $idconfig);
write_log(LOGFILE_CRONT_SUBSCRIPTIONFEE, basename(__FILE__) . ' line:' . __LINE__ . "[#### BATCH BEGIN ####]");
if (!$A2B->DbConnect()) {
    echo "[Cannot connect to the database]\n";
    write_log(LOGFILE_CRONT_SUBSCRIPTIONFEE, basename(__FILE__) . ' line:' . __LINE__ . "[Cannot connect to the database]");
    exit;
}
    month	 		1-12 (or names, see below)
    day of week	 	0-7 (0 or 7 is Sun, or use names)

    The sample above will run the script every day at 6AM

****************************************************************************/
set_time_limit(120);
error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));
include dirname(__FILE__) . "/lib/admin.defines.php";
include dirname(__FILE__) . "/lib/ProcessHandler.php";
if (!defined('PID')) {
    define("PID", "/var/run/a2billing/currencies_update_yahoo_pid.php");
}
// CHECK IF THE CRONT PROCESS IS ALREADY RUNNING
$prcHandler = new ProcessHandler();
if ($prcHandler->isActive()) {
    die;
    // Already running!
} else {
    $prcHandler->activate();
}
$FG_DEBUG = 0;
$A2B = new A2Billing();
$A2B->load_conf($agi, DEFAULT_A2BILLING_CONFIG, 1);
// DEFINE FOR THE DATABASE CONNECTION
define("BASE_CURRENCY", strtoupper($A2B->config["global"]['base_currency']));
$A2B->load_conf($agi, NULL, 0, $idconfig);
write_log(LOGFILE_CRONT_CURRENCY_UPDATE, basename(__FILE__) . ' line:' . __LINE__ . "[#### START CURRENCY UPDATE ####]");
if (!$A2B->DbConnect()) {
    echo "[Cannot connect to the database]\n";
    write_log(LOGFILE_CRONT_CURRENCY_UPDATE, basename(__FILE__) . ' line:' . __LINE__ . "[Cannot connect to the database]");