コード例 #1
0
<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Form/Class.SqlActionForm.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
/*require_once ("a2blib/Form/Class.RevRef.inc.php");
require_once ("a2blib/Form/Class.TimeField.inc.php");*/
require_once "a2blib/Form/Class.SqlRefField.inc.php";
// require_once ("a2blib/Form/Class.RevRefForm.inc.php");
$menu_section = 'menu_invoicing';
$HD_Form = new SqlActionForm();
$HD_Form->checkRights(ACX_BILLING);
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$per_list = array();
$per_list[] = array('1 month', _("Monthly"));
$per_list[] = array('1 year', _("Yearly"));
$per_list[] = array('1 week', _("Weekly"));
$per_list[] = array('3 months', _("Quarterly"));
$per_list[] = array('1 day', _("Daily"));
$HD_Form->model[] = new SqlRefFieldN(_("Agent"), 'agentid', 'cc_agent', 'id', 'name', _("The agent to create for, or <u>(null) for all agents.</u>"));
$HD_Form->model[] = new RefField(_("Period"), "period", $per_list, _("Billing period for invoices"));
$HD_Form->QueryString = 'SELECT agent_create_all_invoices(id, %period) FROM cc_agent ' . ' WHERE cc_agent.id = %#agentid OR %!agentid IS NULL;';
$HD_Form->expectRows = false;
$HD_Form->submitString = _("Generate Invoices!");
$HD_Form->successString = _("Generated invoices!");
//$HD_Form->contentString = 'Generated:<br>';
//$HD_Form->rowString =
require "PP_page.inc.php";
コード例 #2
0
ファイル: index.php プロジェクト: sayemk/a2billing
<?php

require_once "lib/defines.php";
require_once "lib/module.access.php";
if (!isset($_SERVER['HTTPS'])) {
    $safe_base = "https://" . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'];
    header("Location: {$safe_base}");
    exit;
}
require_once DIR_COMMON . "Form.inc.php";
require_once DIR_COMMON . "Form/Class.SqlActionForm.inc.php";
$HD_Form = new SqlActionForm();
$HD_Form->checkRights(1);
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$HD_Form->model[] = new TextField(_("First Name"), 'firstname');
$HD_Form->model[] = new TextField(_("Last Name"), 'lastname');
$HD_Form->model[] = new TextField(_("E-mail"), 'email');
$HD_Form->model[] = new TextField(_("Address"), 'address');
$HD_Form->model[] = new TextField(_("City"), 'city');
$HD_Form->model[] = new TextField(_("State"), 'state');
$HD_Form->model[] = new TextField(_("Country"), 'country');
$HD_Form->model[] = new TextField(_("Postal code"), 'zipcode');
// language
// captcha
/* The signup->mail actions are defined here, into this ugly query, so that
   one different signup "mode" could call those SQL functions differently and
   alter this logic */
$HD_Form->QueryString = 'SELECT create_mail( \'' . DynConf::GetCfg(SIGNUP_CFG, 'mail_template', 'signup') . '\',' . 'email, \'' . getenv('LANG') . "', replace(replace(" . "'firstname=' || firstname || '&lastname=' || lastname || '&loginkey=' || loginkey ||" . "'&username='******'&userpass='******' ','%%20'), E'\\n','%%0A') ) AS mailid " . ", email" . " FROM gen_card_signup(" . DynConf::GetCfg(SIGNUP_CFG, 'card_group', '0', true) . ', ' . DynConf::GetCfg(SIGNUP_CFG, 'voip_group', 'NULL') . ', %firstname, %lastname, %email, %address, %city, %state, %country, %zipcode, %lang);';
//'SELECT gen_cards(%#grp, %ser, %#num, %startn, %#ucfg) AS ncards;';
$HD_Form->expectRows = true;
コード例 #3
0
ファイル: Gen_booths.php プロジェクト: sayemk/a2billing
<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Form/Class.SqlActionForm.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
/*require_once ("a2blib/Form/Class.RevRef.inc.php");
require_once ("a2blib/Form/Class.TimeField.inc.php");*/
require_once "a2blib/Form/Class.SqlRefField.inc.php";
// require_once ("a2blib/Form/Class.RevRefForm.inc.php");
$menu_section = 'menu_agents';
// HelpElem::DoHelp(gettext("*-*"),'vcard.png');
$HD_Form = new SqlActionForm();
$HD_Form->checkRights(ACX_CUSTOMER);
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$HD_Form->model[] = new SqlRefField(_("Card Group"), "grp", "cc_card_group", "id", "name", _("Card group used for the generated cards. Will also define the numplan and the agent, if exists."));
end($HD_Form->model)->combotable = 'cc_card_group, cc_agent';
end($HD_Form->model)->combofield = 'cc_agent.name || \': \' || cc_card_group.name';
end($HD_Form->model)->comboclause = 'cc_card_group.agentid = cc_agent.id';
end($HD_Form->model)->comboid = 'cc_card_group.id';
$HD_Form->model[] = new IntField(_("Count of booths"), 'num');
end($HD_Form->model)->def_value = 4;
// $HD_Form->model[] = new RefField(_("Numbering"),'ser', $ser_list);
$HD_Form->model[] = new TextField(_("Start Number"), 'startn');
end($HD_Form->model)->def_value = 1;
$HD_Form->model[] = new SqlRefFieldN(_("VoIP Conf"), "ucfg", "cc_ast_users_config", "id", "cfg_name", _("If set, use this configuration to also generate Asterisk peers."));
$HD_Form->QueryString = 'SELECT gen_booths(%#grp, %#num, %startn, %#ucfg) AS ncards;';
$HD_Form->expectRows = true;
$HD_Form->submitString = _("Generate Booths!");