Пример #1
0
require_once "a2blib/Form.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
require_once "a2blib/Form/Class.RevRef.inc.php";
require_once "a2blib/Form/Class.TextSearchField.inc.php";
require_once "a2blib/Form/Class.ClauseField.inc.php";
require_once "a2blib/Form/Class.SelectionForm.inc.php";
$menu_section = 'menu_ratecard';
HelpElem::DoHelp(gettext("Sell rates are the prices the end customers will pay us."));
$SEL_Form = new SelectionForm();
$SEL_Form->init();
$SEL_Form->model[] = new TextSearchField(_("Destination"), 'destination');
$SEL_Form->model[] = new SqlRefField(_("Plan"), 'idrp', 'cc_retailplan', 'id', 'name', _("Retail plan"));
end($SEL_Form->model)->does_add = false;
$HD_Form = new FormHandler('cc_sellrate', _("Sell rates"), _("Sell rate"));
$HD_Form->checkRights(ACX_RATECARD);
$HD_Form->init();
$HD_Form->views['tooltip'] = new DetailsMcView();
$PAGE_ELEMS[] =& $SEL_Form;
$PAGE_ELEMS[] =& $HD_Form;
$PAGE_ELEMS[] = new AddNewButton($HD_Form);
$SEL_Form->enable($HD_Form->getAction() == 'list');
$clauses = $SEL_Form->buildClauses();
foreach ($clauses as $cla) {
    $HD_Form->model[] = new FreeClauseField($cla);
}
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new TextFieldEH(_("Destination"), 'destination');
$HD_Form->model[] = new SqlRefField(_("Plan"), 'idrp', 'cc_retailplan', 'id', 'name', _("Retail plan"));
$HD_Form->model[] = new FloatField(_("Rate"), 'rateinitial', _("End rate, per minute"));
$HD_Form->model[] = new IntField(_("Init Block"), 'initblock', _("Set the minimum duration charged to the customer. (i.e. 30 secs)"));
Пример #2
0
$SEL_Form->search_exprs['date_from'] = '>=';
$SEL_Form->search_exprs['date_to'] = '<=';
$SEL_Form->model[] = new TextSearchField(_("Destination"), 'destination');
$SEL_Form->model[] = new TextSearchField(_("Called number"), 'calledstation');
$SEL_Form->model[] = dontAdd(new SqlRefFieldN(_("Agent"), 'agid', 'cc_agent', 'id', 'name'));
end($SEL_Form->model)->fieldexpr = '(SELECT agentid FROM cc_card,cc_card_group
		WHERE cc_card.grp = cc_card_group.id AND cc_card.id = cc_call_v.cardid)';
end($SEL_Form->model)->combofield = "name || ' ('|| login || ')'";
/*$SEL_Form->model[] = new SqlRefField(_("Plan"),'idrp','cc_retailplan','id','name', _("Retail plan"));
	end($SEL_Form->model)->does_add = false;*/
$SEL_Form->model[] = dontAdd(new SqlRefFieldN(_("Server"), 'srvid', 'cc_a2b_server', 'id', 'host'));
$SEL_Form->model[] = dontAdd(new SqlRefFieldN(_("Trunk"), 'trunk', 'cc_trunk', 'id', 'trunkcode', _("Trunk used for the call")));
$PAGE_ELEMS[] =& $SEL_Form;
// HelpElem::DoHelp(gettext("*-*"),'vcard.png');
$HD_Form = new FormHandler('cc_call_v', _("Calls"), _("Call"));
$HD_Form->checkRights(ACX_CALL_REPORT);
$HD_Form->default_order = 'starttime';
$HD_Form->default_sens = 'DESC';
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$SEL_Form->enable($HD_Form->getAction() == 'list');
$HD_Form->model[] = DontList(new PKeyFieldTxt(_("Session ID"), 'sessionid'));
$HD_Form->model[] = DontList(new PKeyFieldTxt(_("Unique ID"), 'uniqueid'));
$HD_Form->model[] = DontList(new PKeyField(_("Card ID"), 'cardid'));
// nasipaddress  | text                        |
// qval          | double precision            |
$SEL_Form->appendClauses($HD_Form);
$HD_Form->model[] = new DateTimeFieldDH(_("Start Time"), 'starttime');
$HD_Form->model[] = new TextField(_("Mode"), 'cmode');
$HD_Form->model[] = DontList(new DateTimeField(_("Stop Time"), 'stoptime'));
$HD_Form->model[] = new SqlRefFieldN(_("Card"), 'cardid', 'cc_card', 'id', 'username');
Пример #3
0
/** One function that sets up page elems for an agent-session invoice */
function AgentSessionInvoice($sess_row, $rights, $booth_page)
{
    global $PAGE_ELEMS;
    global $FG_DEBUG;
    $dbhandle = A2Billing::DBHandle();
    $HD_Form = new FormHandler('cc_session_invoice', _("Transactions"), _("Transaction"));
    $HD_Form->checkRights($rights);
    $HD_Form->init(null, false);
    $HD_Form->views['list'] = new ListSumView();
    $HD_Form->views['pay'] = $HD_Form->views['true'] = $HD_Form->views['false'] = new IdleView();
    if ($FG_DEBUG) {
        $HD_Form->views['dump-form'] = new DbgDumpView();
    }
    $PAGE_ELEMS[] =& $HD_Form;
    $HD_Form->model[] = new ClauseField('sid', $sess_row['sid']);
    $HD_Form->model[] = new DateTimeField(_("Date"), 'starttime');
    $HD_Form->model[] = new TextField(_("Description"), 'descr');
    end($HD_Form->model)->fieldacr = _("Descr");
    $HD_Form->model[] = new TextField("", 'f2');
    $HD_Form->model[] = new TextField(_("Called Number"), 'cnum');
    end($HD_Form->model)->fieldacr = _("C. Num");
    //end($HD_Form->model)->fieldname ='agent';
    $HD_Form->model[] = new SecondsField(_("Duration"), "duration");
    end($HD_Form->model)->fieldacr = _("Dur");
    $HD_Form->model[] = new MoneyField(_("Credit"), "pos_charge");
    $HD_Form->model[] = new MoneyField(_("Charge"), "neg_charge");
    $HD_Form->views['list']->sum_fns = array('duration' => 'SUM', 'pos_charge' => 'SUM', 'neg_charge' => 'SUM');
    // Per date calls..
    $Sum_Form = new FormHandler('cc_session_calls', _("Per-date calls"));
    $Sum_Form->checkRights($rights);
    $Sum_Form->init(null, false);
    $Sum_Form->views['list'] = new SumMultiView();
    $Sum_Form->views['pay'] = $Sum_Form->views['true'] = $Sum_Form->views['false'] = new IdleView();
    if ($FG_DEBUG) {
        $Sum_Form->views['dump-form'] = new DbgDumpView();
    }
    $PAGE_ELEMS[] =& $Sum_Form;
    $Sum_Form->model[] = new ClauseField('sid', $sess_row['sid']);
    $Sum_Form->model[] = new DateField(_("Date"), 'starttime');
    end($Sum_Form->model)->fieldexpr = 'date_trunc(\'day\', starttime)';
    $Sum_Form->model[] = new IntField(_("Calls"), 'cnum');
    $Sum_Form->model[] = new SecondsField(_("Duration"), "duration");
    //$Sum_Form->model[] = new FloatField(_("Credit"), "pos_charge");
    $Sum_Form->model[] = new MoneyField(_("Charge"), "neg_charge");
    if ($sess_row['has_days'] == 't') {
        $Sum_Form->views['list']->sums[] = array('title' => _("Per day calls"), 'fns' => array('starttime' => true, 'cnum' => 'COUNT', 'duration' => 'SUM', 'neg_charge' => 'SUM'));
    }
    $Sum_Form->views['list']->sums[] = array('title' => _("Total"), 'fns' => array('cnum' => 'COUNT', 'duration' => 'SUM', 'neg_charge' => 'SUM'));
    if ($sess_row['is_open'] != 't') {
        $PAGE_ELEMS[] = new StringElem(_("Session is closed"));
    } elseif ($sess_row['is_inuse'] == 't') {
        $PAGE_ELEMS[] = new StringElem(_("Card is in use, cannot close session now."));
    } else {
        $pay_form = new SqlActionElem();
        $pay_form->action_do = 'pay';
        $pay_form->action_ask = 'list';
        $pay_form->init();
        $PAGE_ELEMS[] =& $pay_form;
        if ($sess_row['credit'] > 0) {
            $pay_form->ButtonStr = str_params(_("Pay back %1"), array($sess_row['credit_fmt']), 1);
            $pay_form->elem_success = new StringElem(_("Sesion paid back!"));
        } else {
            $pay_form->ButtonStr = str_params(_("Pay %1"), array($sess_row['credit_fmt']), 1);
            $pay_form->elem_success = new StringElem(_("Sesion paid!"));
        }
        $pay_form->follow_params['sum'] = $sess_row['credit'];
        $pay_form->follow_params['sid'] = $sess_row['sid'];
        $pay_form->QueryString = str_dbparams($dbhandle, 'SELECT pay_session(%1, %2, true) AS money;', array($sess_row['sid'], $_GET['sum']));
        $pay_form->elem_fail = new StringElem(_("Session could not be paid!"));
        $pay_form->elem_success->content .= "\n<br><a href=\"{$booth_page}\">" . _("Back to booths") . "</a>";
    }
}
Пример #4
0
<?php

require "lib/defines.php";
require "lib/module.access.php";
require_once DIR_COMMON . "Form.inc.php";
//require_once (DIR_COMMON."Form/Class.SqlActionForm.inc.php");
require_once DIR_COMMON . "Form/Class.TimeField.inc.php";
require_once DIR_COMMON . "Form/Class.ClauseField.inc.php";
$User_Form = new FormHandler("cc_card");
$User_Form->checkRights(ACX_ACCESS);
$User_Form->init(null, false);
$User_Form->views['list'] = new DetailsView();
// $User_Form->views['list']->table_class="user-info";
$User_Form->model[] = new ClauseField("id", $_SESSION['card_id']);
$User_Form->model[] = new TextField(_('First name'), 'firstname');
$User_Form->model[] = new TextField(_('Last name'), 'lastname');
$User_Form->model[] = new MoneyField(_('Credit'), 'credit');
$User_Form->model[] = new DateField(_('Last used'), 'lastuse');
$User_Form->submitString = _("Calculate!");
$User_Form->edit_no_records = _("Database error: your details cannot be found!");
$PAGE_ELEMS[] =& $User_Form;
require "PP_page.inc.php";
if (false) {
    //require (LANGUAGE_DIR.FILENAME_USERINFO);
    $QUERY = "SELECT  username, credit, lastname, firstname, address, city, state, country, zipcode, phone, email, fax, lastuse, activated, status FROM cc_card WHERE username = '******' AND uipass = '******'";
    $DBHandle_max = DbConnect();
    $numrow = 0;
    $resmax = $DBHandle_max->Execute($QUERY);
    if ($resmax) {
        $numrow = $resmax->RecordCount();
    } else {
Пример #5
0
$tmp->Form->model[] = new FreeClauseField("sessionbill IS NOT NULL");
$tmp->Form->model[] = new FreeClauseField("sessiontime > 0");
$tmp->Form->model[] = new DateTimeField(_("Time"), 'starttime');
$tmp->Form->model[] = new TextField(_("Number"), 'calledstation');
$tmp->Form->model[] = new TextField(_("Destination"), 'destination');
$tmp->Form->model[] = new SecondsField(_("Duration"), 'sessiontime');
end($tmp->Form->model)->fieldacr = _("Dur");
//$tmp->Form->model[] = new PKeyFieldTxt(_("ID"),'id');
$tmp->Form->model[] = new MoneyField(_("Bill"), 'sessionbill');
//one non-summed group
$tmp->Form->views['list']->sums[] = array('fns' => array('starttime' => true, 'calledstation' => true, 'destination' => true, 'sessiontime' => true, 'sessionbill' => true), 'order' => 'starttime');
//Per day/destination
$tmp->Form->views['list']->sums[] = array('title' => _("Sum per destination"), 'fns' => array('starttime' => false, 'destination' => true, 'sessiontime' => 'SUM', 'sessionbill' => 'SUM'), 'order' => 'sessiontime', 'sens' => 'DESC');
$tmp->Form->views['list']->sums[] = array('title' => _("Total"), 'fns' => array('calledstation' => 'COUNT', 'sessiontime' => 'SUM', 'sessionbill' => 'SUM'));
$hform = new FormHandler('cc_card');
$hform->checkRights(ACX_INVOICING);
$hform->init(null, false);
$hform->setAction('details');
$hform->views['details'] = new DetailsView();
$hform->model[] = new FreeClauseField(str_dbparams(A2Billing::DBHandle(), 'id = (SELECT cardid FROM cc_invoices WHERE id = %#1)', array($dform->getpost_dirty('id'))));
//$hform->model[] = new PKeyField(_("ID"),'id');
$hform->model[] = new TextField(_("Local number"), 'useralias');
$hform->model[] = new TextFieldN(_("First name"), 'firstname');
$hform->model[] = new TextFieldN(_("Last name"), 'lastname');
$hform->model[] = new TextAreaField(_("Address"), 'address');
$hform->model[] = new TextFieldN(_("City"), 'city');
$hform->model[] = new TextFieldN(_("State"), 'state');
$hform->model[] = new TextFieldN(_("Country"), 'country');
$hform->model[] = new TextFieldN(_("Zipcode"), 'zipcode');
//$hform->model[] = new TextFieldN(_("Phone"),'phone');
$hform->model[] = new TextFieldN(_("Fax"), 'fax');
Пример #6
0
<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
// require_once ("a2blib/Form/Class.TabField.inc.php");
require_once "a2blib/Form/Class.TimeField.inc.php";
// require_once ("a2blib/Class.JQuery.inc.php");
$menu_section = 'menu_queues';
HelpElem::DoHelp(_("Logs are the technical entries, directly from asterisk, of queue events."));
$HD_Form = new FormHandler('ast_queue_log', _("Logs"), _("Log"));
$HD_Form->checkRights(ACX_QUEUES);
$HD_Form->default_order = 'tstamp';
$HD_Form->default_sens = 'DESC';
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
// $PAGE_ELEMS[] = new AddNewButton($HD_Form);
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new DateTimeFieldDH(_("Date"), "tstamp", _("Event date"));
$HD_Form->model[] = new TextFieldN(_("Call"), 'callid', _("Asterisk call identifier."));
$HD_Form->model[] = new TextFieldN(_("Queue"), 'queuename', _("Queue name."));
$HD_Form->model[] = new TextFieldN(_("Agent"), 'agent', _("Agent which served the call, if any."));
$HD_Form->model[] = new TextFieldN(_("Event"), 'event', _("Asterisk event code."));
$HD_Form->model[] = dontList(new TextFieldN(_("P 1"), 'parm1', _("Event parameter 1.")));
$HD_Form->model[] = dontList(new TextFieldN(_("P 2"), 'parm2', _("Event parameter 2.")));
$HD_Form->model[] = dontList(new TextFieldN(_("P 3"), 'parm3', _("Event parameter 3.")));
// $HD_Form->model[] = new DelBtnField();
require "PP_page.inc.php";
Пример #7
0
<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
require_once "a2blib/Form/Class.RevRef.inc.php";
require_once "a2blib/Form/Class.RevRefForm.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
$menu_section = 'menu_config';
HelpElem::DoHelp(_("Reverse numplans are sets of rules that define the callerid of our customers on an outgoing call."), 'vcard.png');
$HD_Form = new FormHandler('cc_re_numplan', _("Reverse Numplans"), _("Reverse Numplan"));
$HD_Form->checkRights(ACX_NUMPLAN);
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$PAGE_ELEMS[] = new AddNewButton($HD_Form);
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new TextFieldEH(_("Name"), 'name', _('Name of group'));
$HD_Form->model[] = new DelBtnField();
$tmp = new RevRefForm(_("Pattern"), 'pat', 'id', 'cc_re_numplan_pattern', 'nplan');
$HD_Form->meta_elems[] = $tmp;
$tmp->Form->checkRights(ACX_NUMPLAN);
$tmp->Form->init();
$tmp->Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$tmp->Form->model[] = new SqlRefFieldN(_("Forward numplan"), 'fplan', 'cc_numplan', 'id', 'name', _("If set, this pattern will only apply to calls originating from cards in that numplan."));
end($tmp->Form->model)->fieldacr = _("F Nplan");
$tmp->Form->model[] = new TextField(_("Find"), 'find', _('Prefix of outgoing number to match. This will match the <b>translated</b> string by the forward numplan.'));
$tmp->Form->model[] = new TextField(_("Replace"), 'repl', _('String to replace the match prefix with. It may include special strings like %useralias, %nplan etc. See manual.'));
$tmp->Form->model[] = new TextFieldEH(_("Name"), 'nick', _('Name of pattern'));
//$tmp->Form->model[] = new SqlRefField(_("Out CLID Group"),'oclid','cc_outbound_cgroup','id','name');
//	end($tmp->Form->model)->fieldacr = _("OC GRP");
Пример #8
0
<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
require_once "a2blib/Form/Class.VolField.inc.php";
require_once "a2blib/Form/Class.TimeField.inc.php";
require_once "a2blib/Form/Class.RevRefForm.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
$menu_section = 'menu_did';
HelpElem::DoHelp(_("DID phonebooks help associate incoming CLIDs with names"));
$HD_Form = new FormHandler('did_phonebook', _("DID Phonebooks"), _("DID phonebook"));
$HD_Form->checkRights(ACX_DID);
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$PAGE_ELEMS[] = new AddNewButton($HD_Form);
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new TextFieldEH(_("Name"), 'name');
$HD_Form->model[] = new TextFieldN(_("Code"), 'code', _("A code, for syncing it with foreign ones."));
$HD_Form->model[] = dontList(new SqlRefFieldN(_("CLID Rules"), "rnplan", "cc_re_numplan", "id", "name", _("Use this book in those CLIDs only")));
$HD_Form->model[] = dontList(new SqlRefFieldN(_("Card Group"), "card_group", "cc_card_group", "id", "name", _("Use this book in that card group only")));
$HD_Form->model[] = dontList(new SqlBigRefField(_("Card"), "cardid", "cc_card", "id", "name", _("Use this book only for that card: private one.")));
$HD_Form->model[] = new DelBtnField();
$tmp = new RevRefForm(_("Entries"), 'ints', 'id', 'did_pb_entry', 'pb');
$HD_Form->meta_elems[] = $tmp;
$tmp->Form->checkRights(ACX_DID);
$tmp->Form->init();
$tmp->Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$tmp->Form->model[] = new TextField(_("Name"), 'name');
$tmp->Form->model[] = new TextField(_("Number"), 'dnum', _('Number, in intermediate incoming format.'));
Пример #9
0
$tmp->Form->model[] = new SecondsField(_("Duration"), 'sessiontime');
end($tmp->Form->model)->fieldacr = _("Dur");
//$tmp->Form->model[] = new PKeyFieldTxt(_("ID"),'id');
$tmp->Form->model[] = new MoneyField(_("Bill"), 'agentbill');
/*	//one non-summed group
	$tmp->Form->views['list']->sums[] =array( 'fns' => array( 'starttime' => true,
			'calledstation' => true,
			'destination' => true,
			'sessiontime' => true, 'agentbill' => true)); */
// sum per day/destination
$tmp->Form->views['list']->sums[] = array('fns' => array('starttime' => true, 'calledstation' => true, 'destination' => true, 'sessiontime' => 'SUM', 'agentbill' => 'SUM'), 'order' => 'starttime');
//Per day/destination
$tmp->Form->views['list']->sums[] = array('title' => _("Sum per destination"), 'fns' => array('starttime' => false, 'destination' => true, 'sessiontime' => 'SUM', 'agentbill' => 'SUM'), 'order' => 'sessiontime', 'sens' => 'DESC');
$tmp->Form->views['list']->sums[] = array('title' => _("Total"), 'fns' => array('calledstation' => 'COUNT', 'sessiontime' => 'SUM', 'agentbill' => 'SUM'));
$hform = new FormHandler('cc_agent');
$hform->checkRights(ACX_AGENTS);
$hform->init(null, false);
$hform->setAction('details');
$hform->views['details'] = new DetailsView();
$hform->model[] = new FreeClauseField(str_dbparams(A2Billing::DBHandle(), 'id = (SELECT agentid FROM cc_invoices WHERE id = %#1)', array($dform->getpost_dirty('id'))));
//$hform->model[] = new PKeyField(_("ID"),'id');
$hform->model[] = new TextField(_("Name"), "name");
$hform->model[] = new TextField(_("Address"), "location");
//$hform->model[] = new TextField(_("Name"), "name");
$hform->model[] = new SqlRefField(_("Tariff Plan"), "tariffgroup", "cc_tariffgroup", "id", "pubname");
$PAGE_ELEMS[] =& $hform;
$PAGE_ELEMS[] =& $dform;
if (isset($_GET['printable']) && $_GET['printable']) {
    require "PP_print.inc.php";
} else {
    require "PP_page.inc.php";
Пример #10
0
<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
require_once "a2blib/Form/Class.VolField.inc.php";
$menu_section = 'menu_servers';
HelpElem::DoHelp(gettext("Trunks are used to terminate the call!<br>" . "The trunk and ratecard is selected by the rating engine on the basis of the dialed digits.<br>" . "The trunk is used to dial out from your asterisk box which can be a zaptel interface or a voip provider."), 'hwbrowser.png');
$HD_Form = new FormHandler('cc_trunk', _("Trunks"), _("Trunk"));
$HD_Form->checkRights(ACX_TRUNK);
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$PAGE_ELEMS[] = new AddNewButton($HD_Form);
$status_list = array();
$status_list[] = array('1', gettext("Active"));
$status_list[] = array('0', gettext("Inactive"));
$trunkfmt_list = array();
$trunkfmt_list[] = array('1', '<Tech>/<IP>/<Number>');
$trunkfmt_list[] = array('2', '<Tech>/<Number>@<IP>');
$trunkfmt_list[] = array('3', '<Tech>/<IP>');
$trunkfmt_list[] = array('4', 'Local Peer: <[Tech]>/<@[IP:numplan]>');
$trunkfmt_list[] = array('5', 'Direct Peer: <[Tech]>/<@[IP:numplan]>');
$trunkfmt_list[] = array('6', 'Remote Peer: <[Tech]>/<@[IP:numplan]>');
$trunkfmt_list[] = array('7', 'Local Peer, cross Numplan');
$trunkfmt_list[] = array('8', 'Remote Peer, cross Numplan');
$trunkfmt_list[] = array('9', 'Group destination');
$trunkfmt_list[] = array('10', 'Email to local peer');
$trunkfmt_list[] = array('11', 'Email to cross numplan peer');
$trunkfmt_list[] = array('12', 'Voicemail to local peer');
Пример #11
0
require_once "./lib/module.access.php";
require_once "a2blib/Form.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";
require_once "a2blib/Form/Class.TextSearchField.inc.php";
// require_once ("a2blib/Form/Class.ClauseField.inc.php");
require_once "a2blib/Form/Class.SelectionForm.inc.php";
require_once "a2blib/Form/Class.SumMultiView.inc.php";
require_once "a2blib/Form/Class.ElemGraph.inc.php";
$menu_section = 'menu_netmon';
// Init the class early, so that ACL message appears here.
$sform = new FormHandler('nm.attr_float', _("Values"), _("Value"));
$sform->checkRights(ACX_NETMON);
$sform->init(null, false);
$SEL_Form = new SelectionForm();
$SEL_Form->init();
$SEL_Form->model[] = new DateTimeField(_("Period from"), 'date_from');
//end($SEL_Form->model)->does_add = false;
end($SEL_Form->model)->def_date = '00:00 - 7 days';
end($SEL_Form->model)->fieldexpr = 'tstamp';
$SEL_Form->model[] = new DateTimeField(_("Period to"), 'date_to');
//end($SEL_Form->model)->does_add = false;
end($SEL_Form->model)->def_date = 'now';
end($SEL_Form->model)->fieldexpr = 'tstamp';
$SEL_Form->fallbackClause = array('date_from');
/*$SEL_Form->model[] = new SqlRefFieldN(_("Agent"),'agentid','cc_agent','id','name');
	end($SEL_Form->model)->does_add = false;*/
$SEL_Form->search_exprs['date_from'] = '>=';
Пример #12
0
<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
require_once "a2blib/Form/Class.RevRef2.inc.php";
$menu_section = 'menu_servers';
HelpElem::DoHelp(_("Providers are the companies that offer us trunks."));
$HD_Form = new FormHandler('cc_provider', _("Providers"), _("Provider"));
$HD_Form->checkRights(ACX_SERVERS);
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$PAGE_ELEMS[] = new AddNewButton($HD_Form);
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new TextFieldEH(_("Name"), 'provider_name');
$HD_Form->model[] = new TextAreaField(_("Description"), 'description');
//RevRef2::html_body($action);
$HD_Form->model[] = new DelBtnField();
require "PP_page.inc.php";
Пример #13
0
function AgentMoney($agentid, &$sel_form, $intl, $rights)
{
    global $PAGE_ELEMS;
    global $FG_DEBUG;
    $dbhandle = A2Billing::DBHandle();
    $HD_Form = new FormHandler('cc_agent_money_v', _("Transactions"), _("Transaction"));
    $HD_Form->checkRights($rights);
    $HD_Form->init(null, false);
    $HD_Form->views['list'] = new SumMultiView();
    $HD_Form->views['pay'] = $HD_Form->views['true'] = $HD_Form->views['false'] = new IdleView();
    if ($FG_DEBUG) {
        $HD_Form->views['dump-form'] = new DbgDumpView();
    }
    $clauses = $sel_form->buildClauses();
    // $PAGE_ELEMS[] = new DbgElem(print_r($clauses,true));
    $PAGE_ELEMS[] =& $HD_Form;
    $HD_Form->model[] = new ClauseField('agentid', $agentid);
    if (isset($clauses['date_from'])) {
        $HD_Form->model[] = new FreeClauseField($clauses['date_from']);
    }
    if (isset($clauses['date_to'])) {
        $HD_Form->model[] = new FreeClauseField($clauses['date_to']);
    }
    $HD_Form->model[] = new DateTimeField(_("Date"), 'date');
    $HD_Form->model[] = new TextField(_("Type"), 'pay_type');
    if ($intl) {
        end($HD_Form->model)->fieldexpr = 'gettexti(pay_type,\'' . getenv('LANG') . '\')';
    } else {
        end($HD_Form->model)->fieldexpr = 'gettexti(pay_type,\'C\')';
    }
    $HD_Form->model[] = new TextField(_("Description"), 'descr');
    if ($intl) {
        end($HD_Form->model)->fieldexpr = 'gettext(descr,\'' . getenv('LANG') . '\')';
    }
    $HD_Form->model[] = new MoneyField(_("In"), 'pos_credit');
    $HD_Form->model[] = new MoneyField(_("Out"), 'neg_credit');
    $HD_Form->model[] = new MoneyField(_("Sum"), 'credit');
    $HD_Form->views['list']->sums[] = array('group' => false, 'fns' => array('date' => true, 'pay_type' => true, 'descr' => true, 'pos_credit' => true, 'neg_credit' => true));
    $HD_Form->views['list']->sums[] = array('fns' => array('descr' => array(_("Totals")), 'pos_credit' => 'SUM', 'neg_credit' => 'SUM'));
    $HD_Form->views['list']->sums[] = array('fns' => array('descr' => array(_("Sum Total")), 'credit' => 'SUM'));
    $Totals = new SqlDetailsActionForm();
    $Totals->checkRights($rights);
    $Totals->init();
    $Totals->setAction('true');
    $PAGE_ELEMS[] =& $Totals;
    $Totals->expectRows = false;
    $Totals->listclass = 'total';
    $Totals->headerString = _("Agent Totals");
    $Totals->successString = null;
    $dc2 = '';
    if (isset($clauses['date_from'])) {
        $dc2 .= ' AND ' . str_replace('date ', 'starttime ', $clauses['date_from']);
    }
    if (isset($clauses['date_to'])) {
        $dc2 .= ' AND ' . str_replace('date ', 'starttime ', $clauses['date_to']);
    }
    $cardsqr = "SELECT SUM(CASE WHEN credit > 0.0 THEN credit ELSE NULL END) AS pos_credit,\n\t\t\tSUM(CASE WHEN credit < 0.0 THEN (0.0 - credit) ELSE NULL END) AS neg_credit,\n\t\t\tSUM(creditlimit) AS climit\n\t\t\tFROM cc_card, cc_card_group\n\t\t\tWHERE cc_card.grp = cc_card_group.id AND cc_card_group.agentid IS NOT NULL\n\t\t\tAND agentid = %1";
    $callsqr = "SELECT SUM(sessionbill) AS calls \n\t\t\tFROM cc_call, cc_card, cc_card_group \n\t\t\tWHERE cc_call.cardid = cc_card.id AND cc_card_group.id = cc_card.grp\n\t\t\t\tAND cc_card_group.agentid = %1 " . $dc2;
    $dleftqr = "cc_calc_daysleft(%1,now(), interval '1 month')";
    $Totals->QueryString = str_dbparams($dbhandle, "SELECT format_currency(tc.pos_credit, %2) AS total_ccredit,\n\t\t format_currency(tc.neg_credit, %2) AS total_cdebit, " . "format_currency(tc.climit, %2) AS total_cclimit,\n\t\tformat_currency(sb.calls,%2) AS total_calls, format_currency((sb.calls * cc_agent.commission), %2) AS total_com,\n\t\tformat_currency((sb.calls * (1.0 - cc_agent.commission)), %2) AS total_wh,\n\t\tformat_currency(cc_agent.credit, %2) AS agent_credit, format_currency(cc_agent.climit, %2) AS climit, dleft.days_left\n\t\t  FROM ({$cardsqr}) AS tc, ({$callsqr}) AS sb, cc_agent, {$dleftqr} AS dleft\n\t\t  WHERE cc_agent.id = %1;", array($agentid, A2Billing::instance()->currency));
    $Totals->noRowsString = _("Totals could not be calculated!");
    $Totals->rmodel[] = new MoneyField(_("Total sum credited to customers"), 'total_ccredit');
    $Totals->rmodel[] = new MoneyField(_("Total sum debited from customers"), 'total_cdebit');
    $Totals->rmodel[] = new MoneyField(_("Total potential debit from customers"), 'total_cclimit');
    $Totals->rmodel[] = new IntField(_("Total calls made by customers"), 'total_calls');
    $Totals->rmodel[] = new MoneyField(_("Wholesale price of calls"), 'total_wh');
    $Totals->rmodel[] = new MoneyField(_("Estimated profit from calls"), 'total_com');
    $Totals->rmodel[] = new MoneyField(_("Outstanding balance"), 'agent_credit');
    $Totals->rmodel[] = new MoneyField(_("Credit Limit"), 'climit');
    $Totals->rmodel[] = new IntField(_("Estimated Days left"), 'days_left');
    // if ($vat>0) echo  " (" .gettext("includes VAT"). "$vat %)";
}
Пример #14
0
<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
require_once "a2blib/Form/Class.TimeField.inc.php";
require_once "a2blib/Form/Class.ClauseField.inc.php";
$menu_section = 'menu_invoicing';
HelpElem::DoHelp(gettext("Invoices for regular clients"));
$HD_Form = new FormHandler('cc_invoices', _("Invoices"), _("Invoice"));
$HD_Form->checkRights(ACX_INVOICING);
$HD_Form->default_order = 'id';
$HD_Form->default_sens = 'DESC';
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
// $PAGE_ELEMS[] = new AddNewButton($HD_Form);
$HD_Form->model[] = new FreeClauseField('agentid IS NULL');
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new SqlRefField(_("Card"), "cardid", "cc_card", "id", "username");
$HD_Form->model[] = new TextField(_("Ref"), "orderref");
$HD_Form->model[] = new DateTimeFieldDH(_("Start"), 'cover_startdate');
$HD_Form->model[] = new DateTimeField(_("Finish"), 'cover_enddate');
$HD_Form->model[] = dontList(new DateTimeField(_("Created"), 'created', _("Date this invoice was registered")));
$HD_Form->model[] = dontList(new MoneyField(_("Amount"), 'amount'));
$HD_Form->model[] = dontList(new MoneyField(_("Tax"), 'tax'));
$HD_Form->model[] = new MoneyField(_("Total"), 'total');
$HD_Form->model[] = new IntFieldN(_("Type"), "invoicetype");
//end($HD_Form->model)->refclause = "lang = 'C'";
$HD_Form->model[] = dontList(new TextFieldN(_("Filename"), "filename"));
Пример #15
0
<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
require_once "a2blib/Form/Class.RefField.inc.php";
require_once "a2blib/Form/Class.TimeField.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
$menu_section = 'menu_cront';
HelpElem::DoHelp(_("Data from run or pending alarms."));
$HD_Form = new FormHandler('cc_alarm_run', _("Alarm Data"), _("Alarm Data"));
$HD_Form->checkRights(ACX_CRONT_SERVICE);
$HD_Form->default_order = 'id';
$HD_Form->default_sens = 'DESC';
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$PAGE_ELEMS[] = new AddNewButton($HD_Form);
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new SqlRefField(_("Alarm"), 'alid', 'cc_alarm', 'id', 'name');
$HD_Form->model[] = dontAdd(dontList(new DateTimeField(_("Creation"), "tcreate", _("Creation date"))));
$HD_Form->model[] = dontAdd(new DateTimeField(_("Modify"), "tmodify", _("Last modification date")));
$mstates = array();
$mstates[] = array(0, _("Unknown"));
$mstates[] = array(1, _("Run"));
$mstates[] = array(2, _("Failed to run"));
$mstates[] = array(3, _("Raised Error"));
$mstates[] = array(10, _("Request to run"));
$mstates[] = array(12, _("Auto-ceased"));
$HD_Form->model[] = new RefField(_("Status"), 'status', $mstates);
end($HD_Form->model)->def_value = 10;
Пример #16
0
<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
// require_once ("a2blib/Form/Class.TabField.inc.php");
require_once "a2blib/Form/Class.TimeField.inc.php";
// require_once ("a2blib/Class.JQuery.inc.php");
$menu_section = 'menu_netmon';
HelpElem::DoHelp(_("Systems are any hardware or software entity."));
$HD_Form = new FormHandler('nm.system', _("Systems"), _("System"));
$HD_Form->checkRights(ACX_NETMON);
$HD_Form->default_order = 'id';
$HD_Form->default_sens = 'ASC';
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$PAGE_ELEMS[] = new AddNewButton($HD_Form);
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new TextFieldEH(_("Name"), 'name');
$HD_Form->model[] = new TextField(_("Code"), 'code');
$HD_Form->model[] = new SqlRefFieldN(_("Parent"), "par_id", "nm.system", "id", "name");
//$HD_Form->model[] = new TextAreaField(_("Comment"),'comment');
$HD_Form->model[] = new DelBtnField();
require "PP_page.inc.php";
Пример #17
0
<?php

include "./lib/defines.php";
include "./lib/module.access.php";
include "a2blib/Form.inc.php";
include "a2blib/Class.HelpElem.inc.php";
$menu_section = 'menu_billing';
HelpElem::DoHelp(gettext("Currency data are automaticaly updated from Yahoo Financial." . "<br>For more information please visite the website http://finance.yahoo.com." . "<br>The list below is based over your currency base :") . ' <b>' . BASE_CURRENCY . '</b>', 'favorites.png');
$HD_Form = new FormHandler('cc_currencies', _("Currencies"), _("Currency"));
$HD_Form->checkRights(ACX_AGENTS);
$HD_Form->default_order = 'id';
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
//$PAGE_ELEMS[] = new AddNewButton($HD_Form);
$HD_Form->model[] = new PKeyField(_("ID"), 'id');
$HD_Form->model[] = new TextField(_("Currency"), 'currency', _("Currency code"));
$HD_Form->model[] = new TextField(_("Name"), 'name', _("Currency name"));
$HD_Form->model[] = new FloatField(_("Value"), 'value', _("Rate to base currency"));
$HD_Form->model[] = new TextFieldN(_("Sign"), 'csign', _("Currency special symbol"));
end($HD_Form->model)->does_list = false;
$HD_Form->model[] = new BoolField(_("Prepend sign"), 'sign_pre', _("If true, symbol prepends amount, like USD \$ 1.00"));
end($HD_Form->model)->does_list = false;
$HD_Form->model[] = new TextField(_("Format"), 'cformat', _("SQL visual format"));
end($HD_Form->model)->does_list = false;
$HD_Form->model[] = new TextField(_("Format 2"), 'cformat2', _("SQL visual format for small amounts (eg. rates), use more precision here."));
end($HD_Form->model)->does_list = false;
$HD_Form->model[] = new EditBtnField();
//$HD_Form->model[] = new GroupField(array(new EditBtnField(),new DelBtnField()));
require "PP_page.inc.php";
// eof !
if (false) {
Пример #18
0
<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
require_once "a2blib/Form/Class.VolField.inc.php";
require_once "a2blib/Form/Class.TimeField.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
$menu_section = 'menu_billing';
HelpElem::DoHelp(_("Subscriptions are customers (cards) being attached to a recurring fee or special service."));
$HD_Form = new FormHandler('card_subscription', _("Subscriptions"), _("Subscription"));
$HD_Form->checkRights(ACX_BILLING);
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$PAGE_ELEMS[] = new AddNewButton($HD_Form);
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new SqlBigRefField(_("Card"), "card", "cc_card", "id", "username");
$HD_Form->model[] = new SqlRefField(_("Kind"), "template", "subscription_template", "id", "name");
$cs_list = array();
$cs_list[] = array("0", _("Inactive"));
$cs_list[] = array("1", _("Active"));
//$cs_list[]  = array("2", _("..."));
$HD_Form->model[] = dontAdd(new RefField(_("Status"), 'status', $cs_list));
$HD_Form->model[] = dontAdd(dontList(new DateTimeField(_("Creation date"), "creationdate", _("Date the subscription was registered"))));
end($HD_Form->model)->fieldacr = _("Creat");
$HD_Form->model[] = new DateTimeFieldN(_("Activation date"), "activedate", _("Date it becomes active"));
end($HD_Form->model)->fieldacr = _("Activ");
$HD_Form->model[] = new DateTimeFieldN(_("Expire date"), "expiredate", _("After this date it is no longer charged or used."));
end($HD_Form->model)->fieldacr = _("Exp.");
// $HD_Form->model[] = dontList(new SqlRefFieldN(_("CLID Rules"), "rnplan","cc_re_numplan", "id", "name"));
Пример #19
0
<?php

include "./lib/defines.php";
include "./lib/module.access.php";
include "a2blib/Form.inc.php";
include "a2blib/Class.HelpElem.inc.php";
$menu_section = 'menu_servers';
HelpElem::DoHelp(gettext("Group of server define the set of servers that are going to be used by the callback system. A callback is bound to a group of server, those server will be used to dispatch the callback requests."), 'yast_multihead.png');
$HD_Form = new FormHandler('cc_server_group', _("Server Groups"), _("Server group"));
$HD_Form->checkRights(ACX_ADMINISTRATOR);
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$PAGE_ELEMS[] = new AddNewButton($HD_Form);
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id', '5%');
$HD_Form->model[] = new TextFieldEH(_("Name"), 'name', _("Group name"));
$HD_Form->model[] = new TextAreaField(_("Description"), 'description', 35);
// $HD_Form->model[] = new GroupField(array(new EditBtnField(),new DelBtnField()));
$HD_Form->model[] = new DelBtnField();
require "PP_page.inc.php";
Пример #20
0
<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once DIR_COMMON . "Form.inc.php";
require_once DIR_COMMON . "Class.HelpElem.inc.php";
require_once DIR_COMMON . "Form/Class.SqlRefField.inc.php";
require_once DIR_COMMON . "Form/Class.TimeField.inc.php";
require_once DIR_COMMON . "Form/Class.ClauseField.inc.php";
$menu_section = 'menu_charge';
HelpElem::DoHelp(_("Charges are money transactions apart from calls. They are used to indicate that the customer should pay or receive extra money."));
$HD_Form = new FormHandler('cc_card_charge', _("Charges"), _("Charge"));
$HD_Form->checkRights(ACX_ACCESS);
$HD_Form->init();
// $HD_Form->views['list']=new ListView();
// $HD_Form->views['details'] = new DetailsView();
$PAGE_ELEMS[] =& $HD_Form;
//$PAGE_ELEMS[] = new AddNewButton($HD_Form);
// TODO: put static fields and fix them!
$HD_Form->views['ask-del'] = $HD_Form->views['delete'] = null;
$HD_Form->views['ask-add'] = $HD_Form->views['add'] = null;
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new ClauseField('agentid', $_SESSION['agent_id']);
$HD_Form->model[] = new SqlBigRefField(_("Card"), "card", "cc_card", "id", "username");
$HD_Form->model[] = new DateTimeFieldDH(_("Date"), 'creationdate');
$HD_Form->model[] = new SqlRefField(_("Type"), "chargetype", "cc_texts", "id", "txt");
$lng = getenv('LANG');
if (empty($lng) || $lng == 'en_US') {
    $lng = 'C';
}
end($HD_Form->model)->refclause = "lang = '{$lng}'";
Пример #21
0
<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
$menu_section = 'menu_config';
HelpElem::DoHelp(_("Mail templates are preset messages to be sent on alerts etc."));
$HD_Form = new FormHandler('cc_templatemail', _("Templates"), _("Template"));
$HD_Form->checkRights(ACX_MISC);
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$PAGE_ELEMS[] = new AddNewButton($HD_Form);
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new TextFieldEH(_("Type"), 'mtype');
$HD_Form->model[] = new RefField(_("Lang"), 'lang', get_locales(true));
$HD_Form->model[] = dontList(new TextField(_("From Name"), 'fromname', _("Human name of sender")));
$HD_Form->model[] = new TextField(_("From"), 'fromemail', _("Email of sender"));
$HD_Form->model[] = new TextField(_("Subject"), 'subject');
$HD_Form->model[] = dontList(new TextAreaField(_("Message"), 'message', _("The message, arguments are %-quoted")));
$HD_Form->model[] = dontList(new TextAreaField(_("Default args."), 'defargs', _("Default values for arguments, in URL parameter format.")));
$HD_Form->model[] = new DelBtnField();
require_once "a2blib/Form/Class.ImportView.inc.php";
require_once "a2blib/Class.DynConf.inc.php";
$HD_Form->views['ask-import'] = new AskImportView();
$HD_Form->views['import-analyze'] = new ImportMailAView($HD_Form->views['ask-import']);
// $HD_Form->views['import'] = new ImportView($HD_Form->views['ask-import']);
//$HD_Form->views['ask-import']->common = array('idrp');
$HD_Form->views['ask-import']->csvmode = false;
$HD_Form->views['ask-import']->mandatory = array('mtype', 'lang', 'fromemail', 'subject', 'message');
Пример #22
0
<?php

require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once "a2blib/Form.inc.php";
require_once "a2blib/Class.HelpElem.inc.php";
require_once "a2blib/Form/Class.SqlRefField.inc.php";
$menu_section = 'menu_customers';
HelpElem::DoHelp(gettext("CallerID <br> Set the caller ID so that the customer calling in is authenticated on the basis of the callerID rather than with account number."));
$HD_Form = new FormHandler('cc_callerid', _("CallerIDs"), _("CallerID"));
$HD_Form->checkRights(ACX_CUSTOMER);
$HD_Form->init();
$PAGE_ELEMS[] =& $HD_Form;
$PAGE_ELEMS[] = new AddNewButton($HD_Form);
$HD_Form->model[] = new PKeyFieldEH(_("ID"), 'id');
$HD_Form->model[] = new TextFieldEH(_("Caller ID"), 'cid', _("Insert the CallerID"));
$HD_Form->model[] = new SqlBigRefField(_("CardNumber"), "cardid", "cc_card", "id", "username");
end($HD_Form->model)->SetRefEntity("A2B_entity_card.php");
end($HD_Form->model)->SetRefEntityL("A2B_entity_card.php");
end($HD_Form->model)->SetEditTitle(_("Card ID"));
$actived_list = array();
$actived_list[] = array('t', gettext("Active"));
$actived_list[] = array('f', gettext("Inactive"));
$HD_Form->model[] = new RefField(_("ACTIVATED"), "activated", $actived_list, _("Allow the callerID to operate"), "4%");
$HD_Form->model[] = new DelBtnField();
require "PP_page.inc.php";
?>

Пример #23
0
require_once "./lib/defines.php";
require_once "./lib/module.access.php";
require_once DIR_COMMON . "Form.inc.php";
// require_once (DIR_COMMON."Class.HelpElem.inc.php");
// require_once (DIR_COMMON."Form/Class.SqlRefField.inc.php");
require_once DIR_COMMON . "Form/Class.TimeField.inc.php";
require_once DIR_COMMON . "Form/Class.ClauseField.inc.php";
require_once DIR_COMMON . "Form/Class.ListSumView.inc.php";
require_once DIR_COMMON . "Form/Class.SumMultiView.inc.php";
require_once DIR_COMMON . "Form/Class.RevRefForm.inc.php";
require_once DIR_COMMON . "Class.SqlActionElem.inc.php";
$menu_section = 'menu_reports';
// NOTE: for agents, we MUST put an agent clause in each (sub)form
// Use a detail view to list the invoice details
$dform = new FormHandler('cc_invoices', _("Transactions"), _("Transaction"));
$dform->checkRights(ACX_ACCESS);
$dform->init(null, false);
$dform->setAction('details');
$dform->views['details'] = new DetailsView();
$dform->model[] = new PKeyField(_("ID"), 'id');
$dform->model[] = new ClauseField('agentid', $_SESSION['agent_id']);
$dform->model[] = new TextField(_("Ref"), "orderref");
$dform->model[] = new DateTimeField(_("Period begin"), 'cover_startdate');
$dform->model[] = new DateTimeField(_("Period end"), 'cover_enddate');
$dform->model[] = dontList(new DateTimeField(_("Invoice date"), 'created', _("Date this invoice was registered")));
$dform->model[] = new MoneyField(_("Amount"), 'amount');
$dform->model[] = new MoneyField(_("Tax"), 'tax');
$dform->model[] = new MoneyField(_("Total"), 'total');
//$dform->model[] = new IntField(_("Type"), "invoicetype" /*,"cc_texts", "id", "txt"*/);
//end($dform->model)->refclause = "lang = 'C'";
//$dform->model[] = dontList(new TextField(_("Filename"), "filename"));