当前位置: 首页>>代码示例>>PHP>>正文


PHP A2Billing::DbConnect方法代码示例

本文整理汇总了PHP中A2Billing::DbConnect方法的典型用法代码示例。如果您正苦于以下问题:PHP A2Billing::DbConnect方法的具体用法?PHP A2Billing::DbConnect怎么用?PHP A2Billing::DbConnect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在A2Billing的用法示例。


在下文中一共展示了A2Billing::DbConnect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: define

    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;
}
$instance_table = new Table();
/*
    Pay_Status :
        0 : First USE
        1 : Billed
        2 : Paid
        3 : UnPaid
*/
$QUERY = 'SELECT count(*) FROM cc_card INNER JOIN cc_card_subscription ON cc_card.id = cc_card_subscription.id_cc_card INNER JOIN cc_subscription_service ON cc_card_subscription.id_subscription_fee=cc_subscription_service.id' . ' WHERE cc_subscription_service.status=1 AND cc_card_subscription.startdate < NOW() AND (cc_card_subscription.stopdate = "0000-00-00 00:00:00" OR cc_card_subscription.stopdate > NOW())' . ' AND cc_subscription_service.startdate < NOW() AND (cc_subscription_service.stopdate = "0000-00-00 00:00:00" OR cc_subscription_service.stopdate > NOW()) AND cc_card_subscription.paid_status !=3';
$result = $instance_table->SQLExec($A2B->DBHandle, $QUERY);
$nb_card = $result[0][0];
开发者ID:ekamhara,项目名称:BootStrap-A2Billing-custom-templates,代码行数:31,代码来源:a2billing_subscription_fee.php

示例2: define

$A2B = new A2Billing();
$A2B->load_conf($agi);

if (!defined('PID'))
    define("PID", $A2B->config["daemon-info"]['pidfile']);

// CHECK IF THE DAEMON IS ALREADY RUNNING
if (ProcessHandler :: isActive())
    die("Already running!");
else
    ProcessHandler :: activate();

write_log(LOGFILE_API_CALLBACK, basename(__FILE__) . ' line:' . __LINE__ . "[#### CALLBACK BEGIN ####]");

if (!$A2B->DbConnect()) {
    echo "[Cannot connect to the database]\n";
    write_log(LOGFILE_API_CALLBACK, basename(__FILE__) . ' line:' . __LINE__ . "[Cannot connect to the database]");
    exit;
}

if ($A2B->config["database"]['dbtype'] == "postgres")
    $UNIX_TIMESTAMP = "date_part('epoch',";
else
    $UNIX_TIMESTAMP = "UNIX_TIMESTAMP(";

$instance_table = new Table();
$A2B -> set_instance_table ($instance_table);

while(true)
{
开发者ID:nixonch,项目名称:a2billing,代码行数:30,代码来源:callback_daemon.php


注:本文中的A2Billing::DbConnect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。