Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 623

Přidáno uživatelem Roman Ševčík před více než 14 roky(ů)

Přidáno základní rozhraní pro billing. Přidán driver pro NFX billing a zobrazení aktuálního stavu billingu.

Zobrazit rozdíly:

freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php
'basic data' => 'Základní údaje',
'basic information' => 'Základní informace',
'basic' => 'Základní',
'billing settings' => 'Nastavení Billingu',
'birthday' => 'Datum narození',
'bitrate' => 'Rychlost přenosu',
'cannot delete, there are other records depending on this one' => 'Nelze smazat, na položce jsou závislé jiné záznamy',
......
'error: parameter ID is required!' => 'Chyba: parametr ID je povinný!',
'etc' => 'apod',
'example' => 'Příklad',
'exclude numbers' => 'Vynechaná čísla',
'execution time' => 'Doba provádění',
'executive counsil' => 'Správní rada',
'expenditure-earning' => 'Výdej-Příjem',
......
'export to xls' => 'Exportovat do XLS',
'export to csv (utf-8)' => 'Exportovat do CSV (utf-8)',
'export to csv (windows-1250)' => 'Exportovat do CSV (windows-1250)',
'failed' => 'Selhání',
'fatal error' => 'Kritická chyba',
'february' => 'Únor',
'february' => 'Únor',
'fee' => 'Poplatek',
'fee has been successfully added' => 'Poplatek byl úspěšně uložen',
'fee has been successfully deleted' => 'Poplatek byl úspěšně smazán',
......
'fees have been successfully deducted' => 'Členské příspěvky byly úspěšně strženy.',
'fees have been successfully recounted' => 'Členské příspěvky byly úspěšně přepočítány.',
'fees have not been set!' => 'Členské příspěvky nebyly nastaveny!',
'fifth-degree certified engineers' => 'Certifikování technici pátého stupně',
'fifth-degree certified engineers' => 'Certifikování technici pátého stupně',
'file' => 'Soubor',
'file type' => 'Typ souboru',
'file with bank transfer listing' => 'Soubor s bankovním výpisem',
......
'generation of configuration files' => 'Generování konfiguračních souborů',
'gps' => 'GPS souřadnice',
'group' => 'Skupina',
'growth of members' => 'Růst členů',
'growth of members' => 'Růst členů',
'honorary member' => 'Čestný člen',
'hours' => 'Hodin',
'hours2' => 'Hodiny',
......
'import has been successfully finished' => 'Import byl úspěšně dokončen.',
'import new invoice' => 'Import nové faktury',
'import results' => 'Výsledky importu',
'inactive' => 'Neaktivní',
'inbound' => 'Příchozí',
'increase of members' => 'Přírůstek členů',
'increase of members' => 'Přírůstek členů',
'indefinitely' => 'Na neurčito',
'information' => 'Informace',
'information about main user' => 'Informace o hlavním uživateli',
......
'port name' => 'Název portu',
'ports list' => 'Seznam portů',
'ports' => 'Porty',
'postpaid' => 'Paušální',
'post title' => 'Tituly za jménem',
'pppoe' => 'pppoe',
'pre title' => 'Tituly před jménem',
'previous transfer' => 'Předchozí převod',
'prepaid' => 'Předplacený',
'price' => 'Cena',
'price vat' => 'Cena s DPH',
'primary dns' => 'Primární DNS.',
......
'regular member' => 'Řádný člen',
'regular members' => 'Řádní členové',
'recharge voip credit' => 'Dobít VoIP kredit',
'recharging of voip credit' => 'Dobítí VoIP kreditu',
'recharging of voip credit' => 'Dobití VoIP kreditu',
'remove' => 'Odebrat',
'remove broadcast ip address' => 'Odebrat IP adresu broadcastu',
'remove network ip address' => 'Odebrat IP adresu sítě',
......
'save' => 'Uložit',
'save wireless setting' => 'Uložit bezdrátové nastavení',
'search' => 'Hledat',
'second-degree certified engineers' => 'Certifikovaní technici druhého stupně',
'second-degree certified engineers' => 'Certifikovaní technici druhého stupně',
'secondary dns' => 'Sekundární DNS.',
'section' => 'Sekce',
'send' => 'Odeslat',
......
'send sms' => 'Pošli SMS',
'send sms message' => 'Poslat SMS zprávu',
'send to member' => 'Pošli členovi',
'september' => 'Září',
'september' => 'Září',
'service' => 'Služba',
'settings' => 'Nastavení',
'settings for configuration files has been successfully updated' => 'Nastavení pro kofigurační soubory bylo úspěšně upraveno',
'seventh-degree certified engineers' => 'Certifikování technici sedmého stupně',
'seventh-degree certified engineers' => 'Certifikování technici sedmého stupně',
'show' => 'Zobrazit',
'show all confirmed works' => 'Zobraz všechnny potvrzené práce',
'show all transfers on the account' => 'Ukaž všechny převody tohoto účtu',
......
'show works' => 'Zobrazit práce',
'signature of applicant member' => 'podpis žadatele - člena',
'signature and stamp' => 'Podpis a razítko',
'sixth-degree certified engineers' => 'Certifikování technici šestého stupně',
'sixth-degree certified engineers' => 'Certifikování technici šestého stupně',
'smokeping menu parent' => 'Rodič v menu smokepingu',
'smokeping monitoring' => 'Monitorování smokepingem',
'smokeping record has been successfully added' => 'Záznam smokepingu byl úspěšně přidán',
......
'specific symbol' => 'Specifický symbol',
'start amount' => 'Počáteční částka',
'static ip' => 'Statická IP',
'stats' => 'Statistiky',
'state' => 'Stav',
'stats' => 'Statistiky',
'street' => 'Ulice',
'street already exists' => 'Ulice již existuje',
'street detail' => 'Detail ulice',
......
'system variables' => 'Systémové proměnné',
'system variables have been successfully updated' => 'Systémové proměnné byly úspěšně aktualizovány',
'system variables havent been updated' => 'Systémové proměnné nebyly úspěšně aktualizovány',
'table' => 'Tabulka',
'table' => 'Tabulka',
'tag_802_1q' => 'tag 802.1Q',
'target website' => 'Cílový web pro přesměrování',
'technology' => 'Technologie',
......
'template has been successfully added' => 'Šablona byla úspěšně přidána.',
'template has been successfully updated' => 'Šablona byla úspěšně upravena.',
'template name' => 'Název šablony',
'tenth-degree certified engineers' => 'Certifikování technici desátého stupně',
'tenth-degree certified engineers' => 'Certifikování technici desátého stupně',
'tertiary dns' => 'Terciární DNS.',
'testing driver' => 'Test ovladače',
'the first bank account information' => 'Údaje o prvním bankovním účtu',
'the parsed account is unknown' => 'Parsovaný účet je neznámý',
'the transfer successfully done' => 'Převod úspěšně dokončen',
'there are no items yet' => 'Neobsahuje žádné záznamy.',
'third-degree certified engineers' => 'Certifikovaní technici třetího stupně',
'third-degree certified engineers' => 'Certifikovaní technici třetího stupně',
'this account does not exist' => 'Tento účet neexistuje.',
'this month has been already deducted!' => 'Tento měsíc už byl stržen!',
'time' => 'Čas',
......
'wireless setting has been successfully updated' => 'Bezdrátové nastavení bylo úspěšně upraveno.',
'without inner transfers' => 'Bez vnitřních převodů',
'voip admins' => 'VoIP správci',
'voip information' => 'VoIP informace',
'voip number interval must be in format xxxxxxxxx-xxxxxxxxx' => 'Rozsah VoIP čísel musí být ve formátu xxxxxxxxx-xxxxxxxxx',
'voip number must be 9 characters long' => 'VoIP číslo musí obsahovat 9 znaků',
'voip number must be a number' => 'VoIP číslo musí být číslo',
'voip settings' => 'Nastavení VoIP',
'warning' => 'Varování',
'website after redirection' => 'Webová stránka po přesměrování',
'without change' => 'Beze změny',
......
'wrong password' => 'Špatné heslo',
'year' => 'Rok',
'yes' => 'ano',
'you are in debt' => 'Jste v dluhu',
'you have been successfully logged out' => 'Byl jste úspěšně odhlášen.',
'you have no permission to access redirection' => 'Nemáte práva k zobrazení přesměrování',
'you have no permission to delete redirection' => 'Nemáte práva ke smazání přesměrování',
freenetis/trunk/kohana/application/vendors/billing/lbilling/example.php
<?php
require_once 'lbilling.php';
$lbilling = new lbilling();
$lbilling->set_auth_data('<partner>','<password>');
$account = $lbilling->get_account(1);
if ($account == null)
{
$err = $lbilling->get_error();
print'<pre>';
print_r($err);
print'</pre>';
}
else
{
print'<pre>';
print_r($account);
print'</pre>';
}
$account = $lbilling->get_account_calls(1,0,time());
if ($account == null)
{
$err = $lbilling->get_error();
print'<pre>';
print_r($err);
print'</pre>';
}
else
{
print'<pre>';
print_r($account);
print'</pre>';
}
?>
freenetis/trunk/kohana/application/vendors/billing/lbilling/perl/lbilling-get_account.pl
#!/usr/bin/perl
use strict;
use DBI;
use Getopt::Std;
use Data::Dumper;
use warnings;
if ($#ARGV != 2) {
print "Wrong number of parameters", "\n";
exit 0;
}
my $account = {"billingid" => $ARGV[2]};
use SOAP::Lite +autodispatch =>
uri => "http://sip.nfx.czf/lBilling",
proxy => 'https://'.$ARGV[0].':'.$ARGV[1].'@sip.nfx.czf/cgi-bin/admin/lbilling/soap.pl';
my $lbilling = lBilling->new();
unless ( $lbilling ) {
print "Could not create SOAP instance", "\n";
exit 0;
}
my $result;
my $i;
if ( $result = $lbilling->get_account($account) ) {
print $result->{"valid_to"}, ";";
print $result->{"valid_from"}, ";";
print $result->{"descr"}, ";";
print $result->{"state"}, ";";
print $result->{"billingid"}, ";";
print $result->{"currency"}, ";";
print $result->{"ballance"}, ";";
print $result->{"limit"}, ";";
print $result->{"type"}, ";";
print $result->{"partner"}, "\n";
unless ( $result->{"subscribers"} ) {
print "0", "\n";
exit 1;
}
my $count = @{$result->{"subscribers"}};
print $count, "\n";
for ($i=0; $i<$count; $i++)
{
print $result->{"subscribers"}[$i]->{"valid_to"}, ";";
print $result->{"subscribers"}[$i]->{"valid_from"}, ";";
print $result->{"subscribers"}[$i]->{"descr"}, ";";
print $result->{"subscribers"}[$i]->{"state"}, ";";
print $result->{"subscribers"}[$i]->{"billingid"}, ";";
print $result->{"subscribers"}[$i]->{"tarif"}, ";";
print $result->{"subscribers"}[$i]->{"cid"}, ";";
print $result->{"subscribers"}[$i]->{"limit"}, "\n";
}
exit 1;
} else {
my $error = $lbilling->get_error();
my $errcount = @{$lbilling->get_error()};
for ($i=0; $i<$errcount; $i++)
{
print $lbilling->get_error()->[$i], "\n";
}
exit 0;
}
freenetis/trunk/kohana/application/vendors/billing/lbilling/perl/lbilling-test_conn.pl
#!/usr/bin/perl
use strict;
use DBI;
use Getopt::Std;
use Data::Dumper;
use warnings;
if ($#ARGV != 1) {
print "Wrong number of parameters", "\n";
exit 0;
}
use SOAP::Lite +autodispatch =>
uri => "http://sip.nfx.czf/lBilling",
proxy => 'https://'.$ARGV[0].':'.$ARGV[1].'@sip.nfx.czf/cgi-bin/admin/lbilling/soap.pl';
my $lbilling = lBilling->new();
unless ( $lbilling ) {
print "Could not create SOAP instance", "\n";
exit 0;
}
exit 1;
freenetis/trunk/kohana/application/vendors/billing/lbilling/perl/lbilling-get_account_cost.pl
#!/usr/bin/perl
use strict;
use DBI;
use Getopt::Std;
use Data::Dumper;
use warnings;
if ($#ARGV != 1) {
print "Wrong number of parameters", "\n";
exit 0;
}
use SOAP::Lite +autodispatch =>
uri => "http://sip.nfx.czf/lBilling",
proxy => 'https://'.$ARGV[0].':'.$ARGV[1].'@sip.nfx.czf/cgi-bin/admin/lbilling/soap.pl';
my $lbilling = lBilling->new();
unless ( $lbilling ) {
print "Could not create SOAP instance", "\n";
exit 0;
}
my $result;
my $line;
my @error;
my $account = {"billingid" => 1949, "from" => 0, "to" => time()};
if ( $result = $lbilling->get_account_cost($account) ) {
#print $result->{"valid_to"}, "\n";
#print $result->{"valid_from"}, "\n";
#print $result->{"descr"}, "\n";
#print $result->{"state"}, "\n";
#print $result->{"billingid"}, "\n";
#print $result->{"currency"}, "\n";
#print $result->{"ballance"}, "\n";
#print $result->{"limit"}, "\n";
#print $result->{"type"}, "\n";
#print $result->{"partner"}, "\n";
print Dumper($result);
exit 1;
} else {
@error = $lbilling->get_error();
print Dumper($lbilling->get_error());
#print $error[0][0], "\n";
#print $error[0][1], "\n";
exit 0;
}
freenetis/trunk/kohana/application/vendors/billing/lbilling/perl/lbilling-get_account_calls.pl
#!/usr/bin/perl
use strict;
use DBI;
use Getopt::Std;
use Data::Dumper;
use warnings;
if ($#ARGV != 4) {
print "Wrong number of parameters", "\n";
exit 0;
}
use SOAP::Lite +autodispatch =>
uri => "http://sip.nfx.czf/lBilling",
proxy => 'https://'.$ARGV[0].':'.$ARGV[1].'@sip.nfx.czf/cgi-bin/admin/lbilling/soap.pl';
my $lbilling = lBilling->new();
unless ( $lbilling ) {
print "Could not create SOAP instance", "\n";
exit 0;
}
my $result;
my $i;
my $account = {"billingid" => $ARGV[2], "from" => $ARGV[3], "to" => $ARGV[4]};
if ( $result = $lbilling->get_account_calls($account) ) {
print $result->{"billingid"}, ";";
print $result->{"from"}, ";";
print $result->{"to"}, "\n";
unless ( $result->{"calls"} ) {
print "0", "\n";
exit 1;
}
my $count = @{$result->{"calls"}};
print $count, "\n";
for ($i=0; $i<$count; $i++)
{
print $result->{"calls"}[$i]->{"provider"}, ";";
print $result->{"calls"}[$i]->{"rate_vat"}, ";";
print $result->{"calls"}[$i]->{"subscriber"}, ";";
print $result->{"calls"}[$i]->{"account"}, ";";
print $result->{"calls"}[$i]->{"area"}, ";";
print $result->{"calls"}[$i]->{"callee"}, ";";
print $result->{"calls"}[$i]->{"status"}, ";";
print $result->{"calls"}[$i]->{"emergency"}, ";";
print $result->{"calls"}[$i]->{"rate_sum"}, ";";
print $result->{"calls"}[$i]->{"currency"}, ";";
print $result->{"calls"}[$i]->{"end_date"}, ";";
print $result->{"calls"}[$i]->{"callcon"}, ";";
print $result->{"calls"}[$i]->{"caller"}, ";";
print $result->{"calls"}[$i]->{"type"}, ";";
print $result->{"calls"}[$i]->{"start_date"}, ";";
print $result->{"calls"}[$i]->{"result"}, "\n";
}
exit 1;
} else {
my $error = $lbilling->get_error();
my $errcount = @{$lbilling->get_error()};
for ($i=0; $i<$errcount; $i++)
{
print $lbilling->get_error()->[$i], "\n";
}
exit 0;
}
freenetis/trunk/kohana/application/vendors/billing/lbilling/lbilling.php
<?php
class lbilling
{
private $path;
private $partner;
private $pass;
private $init;
private $error;
public function lbilling()
{
$this->path = 'perl '.APPPATH.'vendors/billing/lbilling/';
$this->partner = null;
$this->pass = null;
$this->init = false;
$this->error = array();
}
public function set_auth_data($partner, $pass)
{
$this->partner = $partner;
$this->pass = $pass;
$this->init = true;
}
public function test_conn()
{
if (!$this->init)
{
$e[0] = 'No auth data.';
$this->set_error($e);
return false;
}
exec($this->path.'perl/lbilling-test_conn.pl '.$this->partner.' '.$this->pass, $output, $err);
if ( $err == 1)
{
return true;
}
else
{
$this->set_error($output);
return false;
}
}
public function get_account($accountid)
{
if (!$this->init)
{
$e[0] = 'No auth data.';
$this->set_error($e);
return null;
}
exec($this->path.'perl/lbilling-get_account.pl '.$this->partner.' '.$this->pass.' '.$accountid, $output, $err);
if ( $err == 0)
{
$this->set_error($output);
return null;
}
else if ( $err == 1)
{
$line = 0;
$acc = explode(";", $output[$line]);
$account->valid_to = $acc[0];
$account->valid_from = $acc[1];
$account->desc = $acc[2];
$account->state = $acc[3];
$account->billingid = $acc[4];
$account->currency = $acc[5];
$account->ballance = $acc[6];
$account->limit = $acc[7];
$account->type = $acc[8];
$account->partner = $acc[9];
$line++;
$count = $output[$line] + $line + 1;
$line++;
$i = 0;
for ($line; $line < $count; $line++)
{
$acc = explode(";", $output[$line]);
$account->subscribers[$i]->valid_to = $acc[0];
$account->subscribers[$i]->valid_from = $acc[1];
$account->subscribers[$i]->descr = $acc[2];
$account->subscribers[$i]->state = $acc[3];
$account->subscribers[$i]->billingid = $acc[4];
$account->subscribers[$i]->tarif = $acc[5];
$account->subscribers[$i]->cid = $acc[6];
$account->subscribers[$i]->limit = $acc[7];
$i++;
}
return $account;
}
$e[0] = 'Unknow error. ';
$this->set_error($e);
return null;
}
public function get_account_calls($accountid, $from, $to)
{
if (!$this->init)
{
$e[0] = 'No auth data.';
$this->set_error($e);
return null;
}
exec('perl perl/lbilling-get_account_calls.pl '.$this->partner.' '.$this->pass.' '.$accountid.' '.$from.' '.$to , $output, $err);
if ( $err == 0)
{
$this->set_error($output);
return null;
}
else if ( $err == 1)
{
$line = 0;
$acc = explode(";", $output[$line]);
$account->billingid = $acc[0];
$account->from = $acc[1];
$account->to = $acc[2];
$line++;
$count = $output[$line] + $line + 1;
$line++;
$i = 0;
for ($line; $line < $count; $line++)
{
$acc = explode(";", $output[$line]);
$account->calls[$i]->provider = $acc[0];
$account->calls[$i]->rate_vat = $acc[1];
$account->calls[$i]->subscriber = $acc[2];
$account->calls[$i]->account = $acc[3];
$account->calls[$i]->area = $acc[4];
$account->calls[$i]->callee = $acc[5];
$account->calls[$i]->status = $acc[6];
$account->calls[$i]->emergency = $acc[7];
$account->calls[$i]->rate_sum = $acc[8];
$account->calls[$i]->currency = $acc[9];
$account->calls[$i]->end_date = $acc[10];
$account->calls[$i]->callcon = $acc[11];
$account->calls[$i]->caller = $acc[12];
$account->calls[$i]->type = $acc[13];
$account->calls[$i]->start_date = $acc[14];
$account->calls[$i]->result = $acc[15];
$i++;
}
return $account;
}
$e[0] = 'Unknow error. ';
$this->set_error($e);
return null;
}
protected function set_error($error)
{
$this->error = $error;
}
public function get_error()
{
return $this->error;
}
}
?>
freenetis/trunk/kohana/application/controllers/members.php
$voip_grid->action_field('user_id')->label(url_lang::lang('texts.Account'))->url(url_lang::base().'voip/show')->action(url_lang::lang('texts.Show'));
$voip_grid->action_field('user_id')->label(url_lang::lang('texts.User'))->url(url_lang::base().'users/show')->action(url_lang::lang('texts.Show'));
$voip_grid->datasource($voip);
$billing = new Billing();
// view
$view = new View('main');
$view->title = url_lang::lang('texts.Display member');
......
$view->content->account = $account;
$view->content->users = $user_grid;
$view->content->voip = $voip_grid;
$view->content->billing_has_driver = $billing->has_driver();
$view->content->billing_account = $billing->get_account($member_id);
$view->content->mis = $mi_grid;
foreach($member_data as $key=>$val)
{
freenetis/trunk/kohana/application/controllers/settings.php
$this->form = new Forge(url_lang::base()."settings/voip", '', 'POST', array('id' => 'voip_form'));
$this->form->set_attr('class', 'form_class')->set_attr('method', 'post');
$this->form->group('')->label(url_lang::lang('texts.VoIP'));
$this->form->group('')->label(url_lang::lang('texts.VoIP settings'));
// page title
$this->form->input('voip_number_interval')->label(url_lang::lang('texts.Number interval').':')->rules('length[19,19]|required')->value(addslashes($this->setting->voip_number_interval))->callback(array($this,'valid_voip_number_interval'));
$this->form->input('voip_number_exclude')->label(url_lang::lang('texts.Exclude numbers').':')->rules('length[9,100]')->value(addslashes($this->setting->voip_number_exclude))->callback(array($this,'valid_voip_number_exclude'));
$this->form->input('voip_sip_server')->label(url_lang::lang('texts.SIP Server').':')->rules('length[1,30]|required')->value(addslashes($this->setting->voip_sip_server));
$this->form->input('voip_sip_server')->label(url_lang::lang('texts.SIP server').':')->rules('length[1,30]|required')->value(addslashes($this->setting->voip_sip_server));
$this->form->group('')->label(url_lang::lang('texts.Billing settings'));
$this->form->dropdown('voip_billing_driver')->label(url_lang::lang('texts.Driver').':')->rules('required')->options(array("inactive" => url_lang::lang('texts.Inactive'),"lbilling" => "lBilling - NFX"))->selected($this->setting->voip_billing_driver);
$this->form->input('voip_billing_partner')->label(url_lang::lang('texts.Partner').':')->rules('length[1,50]')->value($this->setting->voip_billing_partner);
$this->form->input('voip_billing_password')->label(url_lang::lang('texts.Password').':')->rules('length[1,50]')->value($this->setting->voip_billing_password);
$this->form->submit('submit')->value(url_lang::lang('texts.Save'));
special::required_forge_style($this->form, ' *', 'required');
// form validate
if ($this->form->validate())
{
......
$message = $this->session->get_once('message');
if (!empty($message))
$view->content->message = $message;
$billing = new Billing();
if ($billing->has_driver())
{
if($billing->test_conn())
{
$view->content->aditional_info = url_lang::lang('texts.Testing driver').' : lBilling - NFX......<span style="color:green">OK</span>';
}
else
{
$view->content->aditional_info = url_lang::lang('texts.Testing driver').' : lBilling - NFX......<span style="color:red">'.url_lang::lang('texts.Failed').'</span>';
}
}
$view->render(TRUE);
}
freenetis/trunk/kohana/application/controllers/transfers.php
if ($this->acl_check_new('Accounts_Controller', 'transfers', $account->member_id))
{
$grid->add_new_button(url_lang::base().'transfers/add/'.$account_id, url_lang::lang('texts.Send money to other account'));
$voip_sip = new Voip_sip_Model();
if ($voip_sip->cout_record_by_member($this->session->get('member_id')) > 0)
$billing = new Billing();
$account= ORM::factory('account')->where('id', $account_id)->find();
if ($billing->has_driver() && ($billing->get_account($account->member_id) != null))
$grid->add_new_button(url_lang::base().'transfers/add_voip/'.$account_id, url_lang::lang('texts.Recharge VoIP credit'));
}
if ($account->account_attribute_id == Account_attribute_Model::$credit)
......
*/
function add_voip($origin_account = NULL)
{
$voip_sip = new Voip_sip_Model();
if ($voip_sip->cout_record_by_member($this->session->get('member_id')) < 1)
if (!isset($origin_account))
Controller::warning(PARAMETER);
$billing = new Billing();
$account= ORM::factory('account')->where('id', $origin_account)->find();
if (!$billing->has_driver() || ($billing->get_account($account->member_id) == null))
url::redirect(url_lang::base().'transfers/show_by_account/'.$origin_account);
if (isset($origin_account)) { // transfer from specific account ?
......
$origin_acc = new Account_Model(); // yes = create object of all accounts
$dst_accounts = $origin_accounts = $origin_acc->get_some_doubleentry_account_names();
}
foreach ($dst_accounts as $dst_account) { // convert the object into array (used for HTML select list)
$arr_dst_accounts[$dst_account->id] =
"$dst_account->name, $dst_account->addr - ".url_lang::lang('texts.Account ID')." $dst_account->id - "
.url_lang::lang('texts.Member ID')." $dst_account->member_id - "
.url_lang::lang('texts.Account type'). " $dst_account->account_attribute_id";
}
asort($arr_dst_accounts);
if (!isset($origin_account)) // for transfer from any account, use the same array for origin account list
$arr_orig_accounts=$arr_dst_accounts;
else
$arr_orig_accounts[$origin_acc->id] =
"$origin_acc->name - ".url_lang::lang('texts.Account ID')." $origin_acc->name - "
.url_lang::lang('texts.Member ID')." $origin_acc->member_id";
$arr_orig_accounts[$origin_acc->id] =
"$origin_acc->name - ".url_lang::lang('texts.Account ID')." $origin_acc->name - "
.url_lang::lang('texts.Member ID')." $origin_acc->member_id";
// form
$form = new Forge(url_lang::base().'transfers/add_voip/'.$origin_account, '', 'POST', array('id' => 'article_form'));
freenetis/trunk/kohana/application/libraries/Billing.php
<?php
class Billing
{
private $driver;
private $c;
private $billing;
public function Billing()
{
$config_model = new Config_Model();
$this->c = new Setting();
if ($this->c->voip_billing_driver == 'lbilling')
{
$this->driver = true;
require_once(APPPATH.'vendors/billing/lbilling/lbilling.php');
$this->billing = new lbilling();
$this->billing->set_auth_data($this->c->voip_billing_partner,$this->c->voip_billing_password);
}
else
{
$this->driver = false;
}
}
public function has_driver()
{
return $this->driver;
}
public function test_conn()
{
if (!$this->driver)
{
$e[0] = 'No driver.';
$this->set_error($e);
return false;
}
return $this->billing->test_conn();
}
public function get_account($accountid)
{
if (!$this->driver)
{
$e[0] = 'No driver.';
$this->set_error($e);
return false;
}
return $this->billing->get_account($accountid);
}
public function get_account_calls($accountid, $from, $to)
{
return null;
}
public function get_error()
{
return $this->billing->get_error();
}
}
?>
freenetis/trunk/kohana/application/views/members_show.php
<td><?php echo number_format((float)$member_data->debt_payment_rate, 2, ',', ' ').' '.$this->setting->currency ?></td>
</tr>
<?php } ?>
<?php if ($billing_has_driver && ($billing_account != null))
{ ?>
<tr>
<th colspan="2"><?php echo url_lang::lang('texts.VoIP information') ?></th>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.State') ?></th>
<td><?php echo ($billing_account->state == 'active') ? '<b style="color:green">'.url_lang::lang('texts.Active').'</b>' : '<b style="color:red">'.url_lang::lang('texts.Inactive').'</b>' ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Current credit') ?></th>
<td><?php echo $billing_account->ballance.' '.$billing_account->currency ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Limit') ?></th>
<td><?php echo $billing_account->limit.' '.$billing_account->currency.'&nbsp;&nbsp;-&nbsp;&nbsp;'.url_lang::lang('texts.Change') ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Type') ?></th>
<td><?php echo ($billing_account->type == 'prepaid') ? url_lang::lang('texts.Prepaid') : url_lang::lang('texts.Postpaid') ?></td>
</tr>
<?php } ?>
<?php if ($this->acl_check_view('Members_Controller', 'qos_ceil', $member_data->member_id) ||
$this->acl_check_view('Members_Controller', 'qos_rate', $member_data->member_id) ||
$this->acl_check_view('Members_Controller', 'comment', $member_data->member_id)
freenetis/trunk/kohana/application/views/voip/show.php
<th colspan="2"><?php echo url_lang::lang('texts.Voicemail information') ?></th>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.heslo') ?></th>
<th><?php echo url_lang::lang('texts.Password') ?></th>
<td><?php echo $voicemail->password ?></td>
</tr>
<tr>
freenetis/trunk/kohana/application/views/form.php
<?php echo (isset($message)) ? '<div class="message">'.$message.'</div>' : '' ?>
<?php echo $link_back ?>
<br /><br />
<?php echo $form ?>
<?php echo $form ?>
<br />
<?php echo (isset($aditional_info)) ? $aditional_info : '' ?>

Také k dispozici: Unified diff