@@ -21,64 +21,64 @@ discard block |
||
21 | 21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 | 22 | ############################################################################### |
23 | 23 | if (!defined('BASEPATH')) |
24 | - exit('No direct script access allowed'); |
|
24 | + exit('No direct script access allowed'); |
|
25 | 25 | |
26 | 26 | class Reports_form { |
27 | - function __construct() { |
|
28 | - $this->CI = & get_instance(); |
|
29 | - } |
|
30 | - function get_customer_cdr_form() { |
|
27 | + function __construct() { |
|
28 | + $this->CI = & get_instance(); |
|
29 | + } |
|
30 | + function get_customer_cdr_form() { |
|
31 | 31 | $logintype = $this->CI->session->userdata('userlevel_logintype'); |
32 | 32 | if($logintype != 1){ |
33 | - if ($this->CI->session->userdata('logintype') == 1 || $this->CI->session->userdata('logintype') == 5) { |
|
34 | - $accountinfo = $this->CI->session->userdata['accountinfo']; |
|
35 | - $reseller_id = $accountinfo["id"]; |
|
36 | - } else { |
|
37 | - $reseller_id = "0"; |
|
38 | - } |
|
39 | - $form['forms'] = array("", array('id' => "cdr_customer_search")); |
|
40 | - $form['Search'] = array( |
|
41 | - array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_cdr_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
|
42 | - array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_cdr_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
|
43 | - array('Caller ID', 'INPUT', array('name' => 'callerid[callerid]', '', 'id' => 'first_name', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'callerid[callerid-string]', '', '', '', 'search_string_type', ''), |
|
44 | - array('Called Number', 'INPUT', array('name' => 'callednum[callednum]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'callednum[callednum-string]', '', '', '', 'search_string_type', ''), |
|
45 | - array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
46 | - array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
|
47 | - array('Duration ', 'INPUT', array('name' => 'billseconds[billseconds]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'billseconds[billseconds-integer]', '', '', '', 'search_int_type', ''), |
|
48 | - array('Debit ', 'INPUT', array('name' => 'debit[debit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'debit[debit-integer]', '', '', '', 'search_int_type', ''), |
|
49 | - array('Cost ', 'INPUT', array('name' => 'cost[cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'cost[cost-integer]', '', '', '', 'search_int_type', ''), |
|
50 | - array('Disposition', 'disposition', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_despostion'), |
|
51 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"GLOBAL")), |
|
33 | + if ($this->CI->session->userdata('logintype') == 1 || $this->CI->session->userdata('logintype') == 5) { |
|
34 | + $accountinfo = $this->CI->session->userdata['accountinfo']; |
|
35 | + $reseller_id = $accountinfo["id"]; |
|
36 | + } else { |
|
37 | + $reseller_id = "0"; |
|
38 | + } |
|
39 | + $form['forms'] = array("", array('id' => "cdr_customer_search")); |
|
40 | + $form['Search'] = array( |
|
41 | + array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_cdr_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
|
42 | + array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_cdr_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
|
43 | + array('Caller ID', 'INPUT', array('name' => 'callerid[callerid]', '', 'id' => 'first_name', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'callerid[callerid-string]', '', '', '', 'search_string_type', ''), |
|
44 | + array('Called Number', 'INPUT', array('name' => 'callednum[callednum]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'callednum[callednum-string]', '', '', '', 'search_string_type', ''), |
|
45 | + array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
46 | + array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
|
47 | + array('Duration ', 'INPUT', array('name' => 'billseconds[billseconds]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'billseconds[billseconds-integer]', '', '', '', 'search_int_type', ''), |
|
48 | + array('Debit ', 'INPUT', array('name' => 'debit[debit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'debit[debit-integer]', '', '', '', 'search_int_type', ''), |
|
49 | + array('Cost ', 'INPUT', array('name' => 'cost[cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'cost[cost-integer]', '', '', '', 'search_int_type', ''), |
|
50 | + array('Disposition', 'disposition', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_despostion'), |
|
51 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"GLOBAL")), |
|
52 | 52 | |
53 | 53 | array('Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`status`=2, concat(name,"","^"),name) as name', 'trunks', 'build_dropdown_deleted', '', array("status" => "1")), |
54 | 54 | |
55 | - array('Rate Group', 'pricelist_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`status`=2, concat(name,"","^"),name) as name', 'pricelists', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0")), |
|
56 | - array('Call Type', 'calltype', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_calltype'), |
|
57 | - array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
58 | - array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
59 | - } |
|
55 | + array('Rate Group', 'pricelist_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`status`=2, concat(name,"","^"),name) as name', 'pricelists', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0")), |
|
56 | + array('Call Type', 'calltype', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_calltype'), |
|
57 | + array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
58 | + array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
59 | + } |
|
60 | 60 | else |
61 | 61 | { |
62 | 62 | $form['forms'] = array("", array('id' => "cdr_customer_search")); |
63 | - $form['Search'] = array( |
|
64 | - array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_cdr_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
|
65 | - array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_cdr_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
|
66 | - array('Caller ID', 'INPUT', array('name' => 'callerid[callerid]', '', 'id' => 'first_name', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'callerid[callerid-string]', '', '', '', 'search_string_type', ''), |
|
67 | - array('Called Number', 'INPUT', array('name' => 'callednum[callednum]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'callednum[callednum-string]', '', '', '', 'search_string_type', ''), |
|
68 | - array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
69 | - array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
|
70 | - array('Duration ', 'INPUT', array('name' => 'billseconds[billseconds]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'billseconds[billseconds-integer]', '', '', '', 'search_int_type', ''), |
|
71 | - array('Debit ', 'INPUT', array('name' => 'debit[debit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'debit[debit-integer]', '', '', '', 'search_int_type', ''), |
|
72 | - array('Cost ', 'INPUT', array('name' => 'cost[cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'cost[cost-integer]', '', '', '', 'search_int_type', ''), |
|
73 | - array('Disposition', 'disposition', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_despostion'), |
|
74 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"GLOBAL")), |
|
63 | + $form['Search'] = array( |
|
64 | + array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_cdr_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
|
65 | + array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_cdr_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
|
66 | + array('Caller ID', 'INPUT', array('name' => 'callerid[callerid]', '', 'id' => 'first_name', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'callerid[callerid-string]', '', '', '', 'search_string_type', ''), |
|
67 | + array('Called Number', 'INPUT', array('name' => 'callednum[callednum]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'callednum[callednum-string]', '', '', '', 'search_string_type', ''), |
|
68 | + array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
69 | + array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
|
70 | + array('Duration ', 'INPUT', array('name' => 'billseconds[billseconds]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'billseconds[billseconds-integer]', '', '', '', 'search_int_type', ''), |
|
71 | + array('Debit ', 'INPUT', array('name' => 'debit[debit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'debit[debit-integer]', '', '', '', 'search_int_type', ''), |
|
72 | + array('Cost ', 'INPUT', array('name' => 'cost[cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'cost[cost-integer]', '', '', '', 'search_int_type', ''), |
|
73 | + array('Disposition', 'disposition', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_despostion'), |
|
74 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"GLOBAL")), |
|
75 | 75 | |
76 | 76 | //array('Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`status`=2, concat(name,"","^"),name) as name', 'trunks', 'build_dropdown_deleted', '', array("status" => "1")), |
77 | 77 | |
78 | - array('Rate Group', 'pricelist_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`status`=2, concat(name,"","^"),name) as name', 'pricelists', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0")), |
|
79 | - array('Call Type', 'calltype', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_calltype'), |
|
80 | - array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
81 | - array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
78 | + array('Rate Group', 'pricelist_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`status`=2, concat(name,"","^"),name) as name', 'pricelists', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0")), |
|
79 | + array('Call Type', 'calltype', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_calltype'), |
|
80 | + array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
81 | + array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
82 | 82 | |
83 | 83 | } |
84 | 84 | |
@@ -86,94 +86,94 @@ discard block |
||
86 | 86 | $form['display_in']=array('name' => 'search_in',"id"=>"search_in","function"=>"search_report_in", "content"=>"Display records in",'label_class' => "search_label col-md-3 no-padding","dropdown_class"=>"form-control","label_style"=>"font-size:13px;","dropdown_style"=>"background: #ddd; width: 21% !important;"); |
87 | 87 | |
88 | 88 | /****************************************/ |
89 | - $form['button_search'] = array('name' => 'action', 'id' => "cusotmer_cdr_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
90 | - $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
89 | + $form['button_search'] = array('name' => 'action', 'id' => "cusotmer_cdr_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
90 | + $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
91 | 91 | |
92 | - return $form; |
|
93 | - } |
|
92 | + return $form; |
|
93 | + } |
|
94 | 94 | |
95 | - function get_reseller_cdr_form() { |
|
96 | - $form['forms'] = array("", array('id' => "cdr_reseller_search")); |
|
97 | - $form['Search'] = array( |
|
98 | - array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_cdr_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'number[number-string]'), |
|
99 | - array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_cdr_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'number[number-string]'), |
|
100 | - array('Caller ID', 'INPUT', array('name' => 'callerid[callerid]', '', 'id' => 'first_name', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'callerid[callerid-string]', '', '', '', 'search_string_type', ''), |
|
101 | - array('Called Number', 'INPUT', array('name' => 'callednum[callednum]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'callednum[callednum-string]', '', '', '', 'search_string_type', ''), |
|
95 | + function get_reseller_cdr_form() { |
|
96 | + $form['forms'] = array("", array('id' => "cdr_reseller_search")); |
|
97 | + $form['Search'] = array( |
|
98 | + array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_cdr_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'number[number-string]'), |
|
99 | + array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_cdr_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'number[number-string]'), |
|
100 | + array('Caller ID', 'INPUT', array('name' => 'callerid[callerid]', '', 'id' => 'first_name', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'callerid[callerid-string]', '', '', '', 'search_string_type', ''), |
|
101 | + array('Called Number', 'INPUT', array('name' => 'callednum[callednum]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'callednum[callednum-string]', '', '', '', 'search_string_type', ''), |
|
102 | 102 | |
103 | - array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
104 | - array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
|
103 | + array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
104 | + array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
|
105 | 105 | |
106 | 106 | |
107 | - array('Duration ', 'INPUT', array('name' => 'billseconds[billseconds]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'billseconds[billseconds-integer]', '', '', '', 'search_int_type', ''), |
|
108 | - array('Debit ', 'INPUT', array('name' => 'debit[debit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'debit[debit-integer]', '', '', '', 'search_int_type', ''), |
|
109 | - array('Cost ', 'INPUT', array('name' => 'cost[cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'cost[cost-integer]', '', '', '', 'search_int_type', ''), |
|
107 | + array('Duration ', 'INPUT', array('name' => 'billseconds[billseconds]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'billseconds[billseconds-integer]', '', '', '', 'search_int_type', ''), |
|
108 | + array('Debit ', 'INPUT', array('name' => 'debit[debit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'debit[debit-integer]', '', '', '', 'search_int_type', ''), |
|
109 | + array('Cost ', 'INPUT', array('name' => 'cost[cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'cost[cost-integer]', '', '', '', 'search_int_type', ''), |
|
110 | 110 | |
111 | - array('Disposition', 'disposition', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_despostion'), |
|
112 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"1")), |
|
113 | - array('Rate Group', 'pricelist_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`status`=2, concat(name,"","^"),name) as name', 'pricelists', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0")), |
|
114 | - array('Call Type', 'calltype', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_calltype'), |
|
111 | + array('Disposition', 'disposition', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_despostion'), |
|
112 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"1")), |
|
113 | + array('Rate Group', 'pricelist_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`status`=2, concat(name,"","^"),name) as name', 'pricelists', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0")), |
|
114 | + array('Call Type', 'calltype', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_calltype'), |
|
115 | 115 | |
116 | - array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
117 | - array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
118 | - if ($this->CI->session->userdata('logintype') != 1 && $this->CI->session->userdata('logintype') != 5) { |
|
116 | + array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
117 | + array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
118 | + if ($this->CI->session->userdata('logintype') != 1 && $this->CI->session->userdata('logintype') != 5) { |
|
119 | 119 | $new_Array=array('Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "1")); |
120 | 120 | } |
121 | 121 | |
122 | 122 | $form['display_in']=array('name' => 'search_in',"id"=>"search_in","function"=>"search_report_in", "content"=>"Display records in ",'label_class' => "search_label col-md-3 no-padding","dropdown_class"=>"form-control","label_style"=>"font-size:13px;text-align:right;","dropdown_style"=>"background: #ddd; width: 23% !important;"); |
123 | 123 | |
124 | 124 | /****************************************/ |
125 | - $form['button_search'] = array('name' => 'action', 'id' => "reseller_cdr_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
126 | - $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
125 | + $form['button_search'] = array('name' => 'action', 'id' => "reseller_cdr_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
126 | + $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
127 | 127 | |
128 | - return $form; |
|
129 | - } |
|
128 | + return $form; |
|
129 | + } |
|
130 | 130 | |
131 | - function get_provider_cdr_form() { |
|
132 | - $form['forms'] = array("", array('id' => "cdr_provider_search")); |
|
133 | - $form['Search'] = array( |
|
134 | - array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_cdr_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'number[number-string]'), |
|
135 | - array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_cdr_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'number[number-string]'), |
|
136 | - array('Caller ID', 'INPUT', array('name' => 'callerid[callerid]', '', 'id' => 'first_name', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'callerid[callerid-string]', '', '', '', 'search_string_type', ''), |
|
137 | - array('Called Number', 'INPUT', array('name' => 'callednum[callednum]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'callednum[callednum-string]', '', '', '', 'search_string_type', ''), |
|
138 | - array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
139 | - array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
|
140 | - array('Duration', 'INPUT', array('name' => 'billseconds[billseconds]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'billseconds[billseconds-integer]', '', '', '', 'search_int_type', ''), |
|
141 | - array('Cost ', 'INPUT', array('name' => 'provider_call_cost[provider_call_cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'provider_call_cost[provider_call_cost-integer]', '', '', '', 'search_int_type', ''), |
|
131 | + function get_provider_cdr_form() { |
|
132 | + $form['forms'] = array("", array('id' => "cdr_provider_search")); |
|
133 | + $form['Search'] = array( |
|
134 | + array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_cdr_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'number[number-string]'), |
|
135 | + array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_cdr_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'number[number-string]'), |
|
136 | + array('Caller ID', 'INPUT', array('name' => 'callerid[callerid]', '', 'id' => 'first_name', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'callerid[callerid-string]', '', '', '', 'search_string_type', ''), |
|
137 | + array('Called Number', 'INPUT', array('name' => 'callednum[callednum]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'callednum[callednum-string]', '', '', '', 'search_string_type', ''), |
|
138 | + array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
139 | + array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
|
140 | + array('Duration', 'INPUT', array('name' => 'billseconds[billseconds]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'billseconds[billseconds-integer]', '', '', '', 'search_int_type', ''), |
|
141 | + array('Cost ', 'INPUT', array('name' => 'provider_call_cost[provider_call_cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'provider_call_cost[provider_call_cost-integer]', '', '', '', 'search_int_type', ''), |
|
142 | 142 | // array('Cost ', 'INPUT', array('name' => 'cost[cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'cost[cost-integer]', '', '', '', 'search_int_type', ''), |
143 | - array('Disposition', 'disposition', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_despostion'), |
|
143 | + array('Disposition', 'disposition', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_despostion'), |
|
144 | 144 | array('Account', 'provider_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"3")), |
145 | - array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
|
145 | + array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
|
146 | 146 | |
147 | 147 | // array('Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', '', ''), |
148 | 148 | |
149 | 149 | |
150 | - ); |
|
150 | + ); |
|
151 | 151 | $form['display_in']=array('name' => 'search_in',"id"=>"search_in","function"=>"search_report_in", "content"=>"Display records in",'label_class' => "search_label col-md-3 no-padding","dropdown_class"=>"form-control","label_style"=>"font-size:13px;","dropdown_style"=>"background: #ddd; width: 21% !important;"); |
152 | 152 | |
153 | 153 | /****************************************/ |
154 | - $form['button_search'] = array('name' => 'action', 'id' => "provider_cdr_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
155 | - $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
154 | + $form['button_search'] = array('name' => 'action', 'id' => "provider_cdr_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
155 | + $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
156 | 156 | |
157 | - return $form; |
|
158 | - } |
|
157 | + return $form; |
|
158 | + } |
|
159 | 159 | |
160 | 160 | /****** |
161 | 161 | ASTPP 3.0 |
162 | 162 | Addrecording field in grid |
163 | 163 | ******/ |
164 | - function build_report_list_for_customer() { |
|
164 | + function build_report_list_for_customer() { |
|
165 | 165 | $logintype = $this->CI->session->userdata('userlevel_logintype'); |
166 | 166 | if($logintype != 1){ |
167 | 167 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
168 | 168 | $currency_id=$account_info['currency_id']; |
169 | 169 | $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
170 | 170 | |
171 | - $recording=array(); |
|
172 | - $account_data = $this->CI->session->userdata("accountinfo"); |
|
173 | - if($account_data['type'] == 1){ |
|
174 | - $recording=array("Recording", "127", "recording", "", "", ""); |
|
175 | - } |
|
176 | - $grid_field_arr = json_encode(array( |
|
171 | + $recording=array(); |
|
172 | + $account_data = $this->CI->session->userdata("accountinfo"); |
|
173 | + if($account_data['type'] == 1){ |
|
174 | + $recording=array("Recording", "127", "recording", "", "", ""); |
|
175 | + } |
|
176 | + $grid_field_arr = json_encode(array( |
|
177 | 177 | array(gettext("Date"), "100", "callstart","callstart", "callstart", "convert_GMT_to","","true","center"), |
178 | 178 | array("Caller ID", "120", "callerid", "", "", "","","true","center"), |
179 | 179 | array("Called Number", "103", "callednum", "", "", "","","true","center"), |
@@ -184,14 +184,14 @@ discard block |
||
184 | 184 | array("Cost($currency)", "75", "cost", "cost", "cost", "convert_to_currency","","true","right"), |
185 | 185 | array("Disposition", "150", "disposition", "", "", "","","true","center"), |
186 | 186 | array("Account", "110", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
187 | - array("Trunk", "90", "trunk_id", "name", "trunks", "get_field_name","","true","center"), |
|
187 | + array("Trunk", "90", "trunk_id", "name", "trunks", "get_field_name","","true","center"), |
|
188 | 188 | array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"), |
189 | 189 | array("Call Type", "112", "calltype", "", "", ""), |
190 | - $recording, |
|
191 | - )); |
|
190 | + $recording, |
|
191 | + )); |
|
192 | 192 | |
193 | - } |
|
194 | - else{ |
|
193 | + } |
|
194 | + else{ |
|
195 | 195 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
196 | 196 | $currency_id=$account_info['currency_id']; |
197 | 197 | $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
@@ -207,51 +207,51 @@ discard block |
||
207 | 207 | array("Cost($currency)", "75", "cost", "cost", "cost", "convert_to_currency","","true","right"), |
208 | 208 | array("Disposition", "130", "disposition", "", "", "","","true","center"), |
209 | 209 | array("Account", "110", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
210 | - //array("Trunk", "90", "trunk_id", "name", "trunks", "get_field_name","","true","center"), |
|
210 | + //array("Trunk", "90", "trunk_id", "name", "trunks", "get_field_name","","true","center"), |
|
211 | 211 | array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"), |
212 | 212 | array("Call Type", "112", "calltype", "", "", ""), |
213 | - $recording, |
|
214 | - )); |
|
213 | + $recording, |
|
214 | + )); |
|
215 | 215 | |
216 | - } |
|
216 | + } |
|
217 | 217 | |
218 | - return $grid_field_arr; |
|
219 | - } |
|
218 | + return $grid_field_arr; |
|
219 | + } |
|
220 | 220 | /******************************/ |
221 | 221 | |
222 | - function build_report_list_for_reseller() { |
|
222 | + function build_report_list_for_reseller() { |
|
223 | 223 | |
224 | 224 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
225 | 225 | $currency_id=$account_info['currency_id']; |
226 | 226 | $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
227 | 227 | |
228 | - // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
|
229 | - $grid_field_arr = json_encode(array( |
|
230 | - array("Date", "100", "callstart", "callstart", "callstart", "convert_GMT_to","","true","center"), |
|
231 | - array("Caller ID", "100", "callerid", "", "", "","","true","center"), |
|
232 | - array("Called Number", "120", "callednum", "", "", "","","true","center"), |
|
233 | - array("Code", "80", "pattern", "pattern", "", "get_only_numeric_val","","true","center"), |
|
234 | - array("Destination", "120", "notes", "", "", "","","true","center"), |
|
235 | - array("Duration", "107", "billseconds", "reseller_cdr_list_search", "billseconds", "convert_to_show_in","","true","center"), |
|
236 | - array("Debit($currency)", "105", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
237 | - array("Cost($currency)", "104", "cost", "cost", "cost", "convert_to_currency","","true","right"), |
|
238 | - array("Disposition", "100", "disposition", "", "", "","","true","center"), |
|
239 | - array("Account", "120", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
240 | - array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"), |
|
241 | - array("Call Type", "120", "calltype", "", "", "","","true","center"), |
|
228 | + // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
|
229 | + $grid_field_arr = json_encode(array( |
|
230 | + array("Date", "100", "callstart", "callstart", "callstart", "convert_GMT_to","","true","center"), |
|
231 | + array("Caller ID", "100", "callerid", "", "", "","","true","center"), |
|
232 | + array("Called Number", "120", "callednum", "", "", "","","true","center"), |
|
233 | + array("Code", "80", "pattern", "pattern", "", "get_only_numeric_val","","true","center"), |
|
234 | + array("Destination", "120", "notes", "", "", "","","true","center"), |
|
235 | + array("Duration", "107", "billseconds", "reseller_cdr_list_search", "billseconds", "convert_to_show_in","","true","center"), |
|
236 | + array("Debit($currency)", "105", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
237 | + array("Cost($currency)", "104", "cost", "cost", "cost", "convert_to_currency","","true","right"), |
|
238 | + array("Disposition", "100", "disposition", "", "", "","","true","center"), |
|
239 | + array("Account", "120", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
240 | + array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"), |
|
241 | + array("Call Type", "120", "calltype", "", "", "","","true","center"), |
|
242 | 242 | |
243 | - )); |
|
244 | - return $grid_field_arr; |
|
245 | - } |
|
243 | + )); |
|
244 | + return $grid_field_arr; |
|
245 | + } |
|
246 | 246 | |
247 | - function build_report_list_for_provider() { |
|
247 | + function build_report_list_for_provider() { |
|
248 | 248 | |
249 | 249 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
250 | 250 | $currency_id=$account_info['currency_id']; |
251 | 251 | $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
252 | 252 | |
253 | - // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
|
254 | - $grid_field_arr = json_encode(array(array("Date", "100", "callstart", "callstart", "callstart", "convert_GMT_to","","true","center"), |
|
253 | + // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
|
254 | + $grid_field_arr = json_encode(array(array("Date", "100", "callstart", "callstart", "callstart", "convert_GMT_to","","true","center"), |
|
255 | 255 | array("Caller ID", "120", "callerid", "", "", "","","true","center"), |
256 | 256 | array("Called Number", "160", "callednum", "", "", "","","true","center"), |
257 | 257 | array("Code", "117", "pattern", "pattern", "", "get_only_numeric_val","","true","center"), |
@@ -260,356 +260,356 @@ discard block |
||
260 | 260 | array("Cost($currency)", "150", "provider_call_cost", "provider_cost", "provider_cost", "convert_to_currency","","true","right"), |
261 | 261 | array("Disposition", "200", "disposition", "", "", "","","true","center"), |
262 | 262 | array("Account", "181", "provider_id", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
263 | - )); |
|
264 | - return $grid_field_arr; |
|
265 | - } |
|
263 | + )); |
|
264 | + return $grid_field_arr; |
|
265 | + } |
|
266 | 266 | |
267 | - function build_grid_customer() { |
|
268 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/customerReport_export/", 'single'))); |
|
269 | - return $buttons_json; |
|
270 | - } |
|
267 | + function build_grid_customer() { |
|
268 | + $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/customerReport_export/", 'single'))); |
|
269 | + return $buttons_json; |
|
270 | + } |
|
271 | 271 | /** |
272 | 272 | ASTPP 3.0 |
273 | 273 | For Customer CDRs export |
274 | 274 | **/ |
275 | 275 | |
276 | - function build_grid_buttons_user() { |
|
277 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/user/user_report_export/", 'single'))); |
|
278 | - return $buttons_json; |
|
279 | - } |
|
276 | + function build_grid_buttons_user() { |
|
277 | + $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/user/user_report_export/", 'single'))); |
|
278 | + return $buttons_json; |
|
279 | + } |
|
280 | 280 | /*****************************************************************/ |
281 | - function build_grid_buttons_reseller() { |
|
282 | - $buttons_json = json_encode(array( array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/resellerReport_export/", 'single'))); |
|
283 | - return $buttons_json; |
|
284 | - } |
|
285 | - function build_grid_buttons_provider() { |
|
286 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/providerReport_export/", 'single'))); |
|
287 | - return $buttons_json; |
|
288 | - } |
|
281 | + function build_grid_buttons_reseller() { |
|
282 | + $buttons_json = json_encode(array( array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/resellerReport_export/", 'single'))); |
|
283 | + return $buttons_json; |
|
284 | + } |
|
285 | + function build_grid_buttons_provider() { |
|
286 | + $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/providerReport_export/", 'single'))); |
|
287 | + return $buttons_json; |
|
288 | + } |
|
289 | 289 | |
290 | - function build_report_list_for_user($accounttype = 'customer') { |
|
290 | + function build_report_list_for_user($accounttype = 'customer') { |
|
291 | 291 | |
292 | 292 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
293 | 293 | $currency_id=$account_info['currency_id']; |
294 | 294 | $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
295 | 295 | |
296 | 296 | |
297 | - if($accounttype == 'customer' || $accounttype =='reseller'){ |
|
298 | - $cost_array=array("Debit($currency)", "100", "debit", "debit", "debit", "convert_to_currency","","true","right"); |
|
299 | - } |
|
300 | - if(strtolower($accounttype)=='provider'){ |
|
301 | - $cost_array=array("Debit($currency)", "140", "cost", "cost", "cost", "convert_to_currency"); |
|
302 | - } |
|
303 | - // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
|
304 | - $grid_field_arr = json_encode(array( |
|
305 | - array("Date", "130", "callstart", "callstart", "callstart", "convert_GMT_to","","true","center"), |
|
306 | - array("Caller ID", "100", "callerid", "", "", "","","true","center"), |
|
307 | - array("Called Number", "120", "callednum", "", "", "","","true","center"), |
|
308 | - array("Destination", "135", "notes", "", "", "","","true","center"), |
|
297 | + if($accounttype == 'customer' || $accounttype =='reseller'){ |
|
298 | + $cost_array=array("Debit($currency)", "100", "debit", "debit", "debit", "convert_to_currency","","true","right"); |
|
299 | + } |
|
300 | + if(strtolower($accounttype)=='provider'){ |
|
301 | + $cost_array=array("Debit($currency)", "140", "cost", "cost", "cost", "convert_to_currency"); |
|
302 | + } |
|
303 | + // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
|
304 | + $grid_field_arr = json_encode(array( |
|
305 | + array("Date", "130", "callstart", "callstart", "callstart", "convert_GMT_to","","true","center"), |
|
306 | + array("Caller ID", "100", "callerid", "", "", "","","true","center"), |
|
307 | + array("Called Number", "120", "callednum", "", "", "","","true","center"), |
|
308 | + array("Destination", "135", "notes", "", "", "","","true","center"), |
|
309 | 309 | // array("Account Number", "120", "accountid", "number", "accounts", "get_field_name"), |
310 | - array("Duration", "120", "billseconds", "user_cdrs_report_search", "billseconds", "convert_to_show_in","","true","center"), |
|
311 | - $cost_array, |
|
312 | - array("Disposition", "160", "disposition", "", "", "","","true","center"), |
|
313 | - array("Call Type", "140", "calltype", "", "", "","","true","center"), |
|
314 | - )); |
|
315 | - return $grid_field_arr; |
|
316 | - } |
|
310 | + array("Duration", "120", "billseconds", "user_cdrs_report_search", "billseconds", "convert_to_show_in","","true","center"), |
|
311 | + $cost_array, |
|
312 | + array("Disposition", "160", "disposition", "", "", "","","true","center"), |
|
313 | + array("Call Type", "140", "calltype", "", "", "","","true","center"), |
|
314 | + )); |
|
315 | + return $grid_field_arr; |
|
316 | + } |
|
317 | 317 | |
318 | 318 | /****** |
319 | 319 | ASTPP 3.0 |
320 | 320 | Payment to refill |
321 | 321 | ******/ |
322 | - function build_refill_report_for_admin() { |
|
322 | + function build_refill_report_for_admin() { |
|
323 | 323 | |
324 | 324 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
325 | - $currency_id=$account_info['currency_id']; |
|
326 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
327 | - $grid_field_arr = json_encode(array( |
|
328 | - array(gettext("Date"), "225", "payment_date", "", "", "","","true","center"), |
|
329 | - array(gettext("Account"), "240", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
330 | - array("Amount($currency)", "250", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
331 | - array(gettext("Refill By"), "230", "payment_by", "payment_by", "payment_by", "get_refill_by","","true","center"), |
|
332 | - array(gettext("Note"), "327", "notes", "", "", "","","true","center") |
|
333 | - )); |
|
334 | - return $grid_field_arr; |
|
335 | - } |
|
336 | - function build_refillreport_buttons() { |
|
337 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/refillreport_export/", 'single'))); |
|
338 | - return $buttons_json; |
|
339 | - } |
|
340 | - function build_search_refill_report_for_admin() { |
|
341 | - $accountinfo=$this->CI->session->userdata('accountinfo'); |
|
342 | - $reseller_id=$accountinfo['type']==1 ? $accountinfo['id'] : 0 ; |
|
343 | - $form['forms'] = array("", array('id' => "cdr_refill_search")); |
|
344 | - $account_data = $this->CI->session->userdata("accountinfo"); |
|
345 | - $acc_arr= array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => $reseller_id,"type"=>"0,1,3")); |
|
346 | - $logintype = $this->CI->session->userdata('logintype'); |
|
347 | - if ($logintype == 1 || $logintype == 5) { |
|
348 | - $account_data = $this->CI->session->userdata("accountinfo"); |
|
349 | - $loginid = $account_data['id']; |
|
325 | + $currency_id=$account_info['currency_id']; |
|
326 | + $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
327 | + $grid_field_arr = json_encode(array( |
|
328 | + array(gettext("Date"), "225", "payment_date", "", "", "","","true","center"), |
|
329 | + array(gettext("Account"), "240", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
330 | + array("Amount($currency)", "250", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
331 | + array(gettext("Refill By"), "230", "payment_by", "payment_by", "payment_by", "get_refill_by","","true","center"), |
|
332 | + array(gettext("Note"), "327", "notes", "", "", "","","true","center") |
|
333 | + )); |
|
334 | + return $grid_field_arr; |
|
335 | + } |
|
336 | + function build_refillreport_buttons() { |
|
337 | + $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/refillreport_export/", 'single'))); |
|
338 | + return $buttons_json; |
|
339 | + } |
|
340 | + function build_search_refill_report_for_admin() { |
|
341 | + $accountinfo=$this->CI->session->userdata('accountinfo'); |
|
342 | + $reseller_id=$accountinfo['type']==1 ? $accountinfo['id'] : 0 ; |
|
343 | + $form['forms'] = array("", array('id' => "cdr_refill_search")); |
|
344 | + $account_data = $this->CI->session->userdata("accountinfo"); |
|
345 | + $acc_arr= array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => $reseller_id,"type"=>"0,1,3")); |
|
346 | + $logintype = $this->CI->session->userdata('logintype'); |
|
347 | + if ($logintype == 1 || $logintype == 5) { |
|
348 | + $account_data = $this->CI->session->userdata("accountinfo"); |
|
349 | + $loginid = $account_data['id']; |
|
350 | 350 | |
351 | - }else{ |
|
352 | - $loginid = "0"; |
|
353 | - } |
|
354 | - if($logintype==0 || $logintype==3){ |
|
355 | - $acc_arr=null; |
|
356 | - } |
|
357 | - $form['Search'] = array( |
|
358 | - array('From Date', 'INPUT', array('name' => 'payment_date[]', 'id' => 'refill_from_date', 'size' => '20', |
|
351 | + }else{ |
|
352 | + $loginid = "0"; |
|
353 | + } |
|
354 | + if($logintype==0 || $logintype==3){ |
|
355 | + $acc_arr=null; |
|
356 | + } |
|
357 | + $form['Search'] = array( |
|
358 | + array('From Date', 'INPUT', array('name' => 'payment_date[]', 'id' => 'refill_from_date', 'size' => '20', |
|
359 | 359 | 'class' => "text field "), '', 'tOOL TIP', '', 'payment_date[payment_date-date]'), |
360 | - array('To Date', 'INPUT', array('name' => 'payment_date[]', 'id' => 'refill_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'payment_date[payment_date-date]'), |
|
361 | - $acc_arr, |
|
360 | + array('To Date', 'INPUT', array('name' => 'payment_date[]', 'id' => 'refill_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'payment_date[payment_date-date]'), |
|
361 | + $acc_arr, |
|
362 | 362 | // array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0","type"=>"0")), |
363 | - array('Amount ', 'INPUT', array('name' => 'credit[credit]', 'value' => '', 'size' => '20', 'class' => "text field"), '', 'Tool tips info', '1', 'credit[credit-integer]', '', '', '', 'search_int_type', ''), |
|
364 | - // array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', ''), |
|
365 | - array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
363 | + array('Amount ', 'INPUT', array('name' => 'credit[credit]', 'value' => '', 'size' => '20', 'class' => "text field"), '', 'Tool tips info', '1', 'credit[credit-integer]', '', '', '', 'search_int_type', ''), |
|
364 | + // array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', ''), |
|
365 | + array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
366 | 366 | |
367 | - $form['button_search'] = array('name' => 'action', 'id' => "cusotmer_cdr_refill_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
368 | - $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
367 | + $form['button_search'] = array('name' => 'action', 'id' => "cusotmer_cdr_refill_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
368 | + $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
369 | 369 | //echo '<pre>'; print_r($form); exit; |
370 | - return $form; |
|
371 | - } |
|
370 | + return $form; |
|
371 | + } |
|
372 | 372 | /***************************/ |
373 | - function build_commission_report_for_admin() { |
|
374 | - $grid_field_arr = json_encode(array( |
|
375 | - array("Account", "150", "accountid", "first_name,last_name,number", "accounts", "build_concat_string"), |
|
376 | - array("Amount", "150", "amount", "credit", "credit", "convert_to_currency"), |
|
377 | - array("Description", "150", "description", "", "", ""), |
|
378 | - array("Reseller", "150", "reseller_id", "first_name,last_name,number", "accounts", "build_concat_string"), |
|
379 | - array("Commission Rate(%)", "150", "commission_percent", "", "", ""), |
|
380 | - array("Date", "150", "date", "", "", "") |
|
381 | - )); |
|
382 | - return $grid_field_arr; |
|
383 | - } |
|
384 | - function reseller_commission_search_form() { |
|
385 | - $form['forms'] = array("", array('id' => "reseller_commission_search")); |
|
373 | + function build_commission_report_for_admin() { |
|
374 | + $grid_field_arr = json_encode(array( |
|
375 | + array("Account", "150", "accountid", "first_name,last_name,number", "accounts", "build_concat_string"), |
|
376 | + array("Amount", "150", "amount", "credit", "credit", "convert_to_currency"), |
|
377 | + array("Description", "150", "description", "", "", ""), |
|
378 | + array("Reseller", "150", "reseller_id", "first_name,last_name,number", "accounts", "build_concat_string"), |
|
379 | + array("Commission Rate(%)", "150", "commission_percent", "", "", ""), |
|
380 | + array("Date", "150", "date", "", "", "") |
|
381 | + )); |
|
382 | + return $grid_field_arr; |
|
383 | + } |
|
384 | + function reseller_commission_search_form() { |
|
385 | + $form['forms'] = array("", array('id' => "reseller_commission_search")); |
|
386 | 386 | /****** |
387 | 387 | ASTPP 3.0 |
388 | 388 | Payment to refill |
389 | 389 | ******/ |
390 | - $form['User Refill Report'] = array( |
|
390 | + $form['User Refill Report'] = array( |
|
391 | 391 | /*************************/ |
392 | - array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
393 | - array('', 'HIDDEN', 'advance_search', '1', '', '', ''), |
|
394 | - array('From Date', 'INPUT', array('name' => 'date[]', 'id' => 'commission_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
|
395 | - array('To Date', 'INPUT', array('name' => 'date[]', 'id' => 'commission_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
|
396 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0","type"=>"1", "deleted" => "0")), |
|
397 | - array('Amount', 'INPUT', array('name' => 'amount[amount]', 'value' => '', 'size' => '20', 'class' => "text field"), '', 'Tool tips info', '1', 'amount[amount-integer]', '', '', '', 'search_int_type', ''), |
|
398 | - ); |
|
392 | + array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
393 | + array('', 'HIDDEN', 'advance_search', '1', '', '', ''), |
|
394 | + array('From Date', 'INPUT', array('name' => 'date[]', 'id' => 'commission_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
|
395 | + array('To Date', 'INPUT', array('name' => 'date[]', 'id' => 'commission_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
|
396 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0","type"=>"1", "deleted" => "0")), |
|
397 | + array('Amount', 'INPUT', array('name' => 'amount[amount]', 'value' => '', 'size' => '20', 'class' => "text field"), '', 'Tool tips info', '1', 'amount[amount-integer]', '', '', '', 'search_int_type', ''), |
|
398 | + ); |
|
399 | 399 | |
400 | - $form['button_search'] = array('name' => 'action', 'id' => "commission_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'ui-state-default float-right ui-corner-all ui-button'); |
|
401 | - $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear Search Filter', 'value' => 'cancel', 'type' => 'reset', 'class' => 'ui-state-default float-right ui-corner-all ui-button'); |
|
400 | + $form['button_search'] = array('name' => 'action', 'id' => "commission_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'ui-state-default float-right ui-corner-all ui-button'); |
|
401 | + $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear Search Filter', 'value' => 'cancel', 'type' => 'reset', 'class' => 'ui-state-default float-right ui-corner-all ui-button'); |
|
402 | 402 | |
403 | - return $form; |
|
404 | - } |
|
405 | - function get_providersummary_search_form() { |
|
406 | - $form['forms'] = array('', array('id' => "providersummary_search")); |
|
407 | - $form['Search'] = array( |
|
403 | + return $form; |
|
404 | + } |
|
405 | + function get_providersummary_search_form() { |
|
406 | + $form['forms'] = array('', array('id' => "providersummary_search")); |
|
407 | + $form['Search'] = array( |
|
408 | 408 | array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
409 | - array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
|
410 | - array('Account', 'provider_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"3")), |
|
411 | - array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
409 | + array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
|
410 | + array('Account', 'provider_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"3")), |
|
411 | + array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
412 | 412 | |
413 | - array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
|
413 | + array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
|
414 | 414 | // array('Account Number', 'number', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("type"=>"3", "deleted" => "0")), |
415 | - array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
416 | - array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
417 | - $form['button_search'] = array('name' => 'action', 'id' => "providersummary_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
418 | - $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
415 | + array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
416 | + array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
417 | + $form['button_search'] = array('name' => 'action', 'id' => "providersummary_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
418 | + $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
419 | 419 | |
420 | - return $form; |
|
421 | - } |
|
422 | - function build_providersummary(){ |
|
423 | - $grid_field_arr = json_encode(array( |
|
424 | - array("Provider", "220", "provider_id", "first_name,last_name,number", "accounts", "build_concat_string"), |
|
425 | - array("Code", "120", "pattern", "pattern", "", "get_only_numeric_val"), |
|
426 | - array("Destination", "150", "notes", "", "", ""), |
|
427 | - array("Attempted Calls", "130", "attempted_calls", "", "", ""), |
|
428 | - array("Completed Calls", "150", "description", "", "", ""), |
|
429 | - array("ASR","95","asr",'','',''), |
|
430 | - array("ACD","95","acd ",'','',''), |
|
431 | - array("MCD","95","mcd",'','',''), |
|
432 | - array("Bilable","100","billable",'','',''), |
|
433 | - array("Cost","115","cost",'','',''), |
|
420 | + return $form; |
|
421 | + } |
|
422 | + function build_providersummary(){ |
|
423 | + $grid_field_arr = json_encode(array( |
|
424 | + array("Provider", "220", "provider_id", "first_name,last_name,number", "accounts", "build_concat_string"), |
|
425 | + array("Code", "120", "pattern", "pattern", "", "get_only_numeric_val"), |
|
426 | + array("Destination", "150", "notes", "", "", ""), |
|
427 | + array("Attempted Calls", "130", "attempted_calls", "", "", ""), |
|
428 | + array("Completed Calls", "150", "description", "", "", ""), |
|
429 | + array("ASR","95","asr",'','',''), |
|
430 | + array("ACD","95","acd ",'','',''), |
|
431 | + array("MCD","95","mcd",'','',''), |
|
432 | + array("Bilable","100","billable",'','',''), |
|
433 | + array("Cost","115","cost",'','',''), |
|
434 | 434 | // array("Profit", "95", "profit", "", "", ""), |
435 | - )); |
|
436 | - return $grid_field_arr; |
|
437 | - } |
|
438 | - function build_grid_buttons_providersummary() { |
|
439 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/providersummary_export_cdr_xls", 'single'))); |
|
440 | - return $buttons_json; |
|
441 | - } |
|
442 | - function get_resellersummary_search_form() { |
|
443 | - $form['forms'] = array("",array('id' => "resellersummary_search")); |
|
444 | - $form['Search'] = array( |
|
445 | - array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
|
446 | - array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
|
447 | - array('Account', 'reseller_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"1")), |
|
448 | - array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
435 | + )); |
|
436 | + return $grid_field_arr; |
|
437 | + } |
|
438 | + function build_grid_buttons_providersummary() { |
|
439 | + $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/providersummary_export_cdr_xls", 'single'))); |
|
440 | + return $buttons_json; |
|
441 | + } |
|
442 | + function get_resellersummary_search_form() { |
|
443 | + $form['forms'] = array("",array('id' => "resellersummary_search")); |
|
444 | + $form['Search'] = array( |
|
445 | + array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
|
446 | + array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
|
447 | + array('Account', 'reseller_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"1")), |
|
448 | + array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
449 | 449 | |
450 | - array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
|
451 | - // array('Account Number', 'number', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("type"=>"1", "deleted" => "0")), |
|
450 | + array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
|
451 | + // array('Account Number', 'number', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("type"=>"1", "deleted" => "0")), |
|
452 | 452 | array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
453 | - $form['button_search'] = array('name' => 'action', 'id' => "resellersummary_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
454 | - $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
453 | + $form['button_search'] = array('name' => 'action', 'id' => "resellersummary_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
454 | + $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
455 | 455 | |
456 | - return $form; |
|
457 | - } |
|
458 | - function build_resellersummary(){ |
|
459 | - $grid_field_arr = json_encode(array( |
|
460 | - array("Account", "148", "accountid", "first_name,last_name,number", "accounts", "build_concat_string"), |
|
461 | - array("Code", "120", "pattern", "pattern", "", "get_only_numeric_val"), |
|
462 | - array("Destination", "150", "notes", "", "", ""), |
|
463 | - array("Attempted Calls", "120", "attempted_calls", "", "", ""), |
|
464 | - array("Completed Calls", "120", "description", "", "", ""), |
|
465 | - array("ASR","80","asr",'','',''), |
|
466 | - array("ACD","80","acd ",'','',''), |
|
467 | - array("MCD","80","mcd",'','',''), |
|
468 | - array("Bilable","90","billable",'','',''), |
|
469 | - array("Price","90","price",'','',''), |
|
470 | - array("Cost","90","cost",'','',''), |
|
471 | - array("Profit", "100", "profit", "", "", ""), |
|
472 | - )); |
|
473 | - return $grid_field_arr; |
|
474 | - } |
|
475 | - function build_grid_buttons_resellersummary() { |
|
476 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/resellersummary_export_cdr_xls", 'single'))); |
|
477 | - return $buttons_json; |
|
478 | - } |
|
479 | - function get_customersummary_search_form() { |
|
480 | - $form['forms'] = array("",array('id' => "customersummary_search")); |
|
481 | - $form['Search'] = array( |
|
482 | - array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
|
483 | - array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
|
484 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"GLOBAL")), |
|
485 | - array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
456 | + return $form; |
|
457 | + } |
|
458 | + function build_resellersummary(){ |
|
459 | + $grid_field_arr = json_encode(array( |
|
460 | + array("Account", "148", "accountid", "first_name,last_name,number", "accounts", "build_concat_string"), |
|
461 | + array("Code", "120", "pattern", "pattern", "", "get_only_numeric_val"), |
|
462 | + array("Destination", "150", "notes", "", "", ""), |
|
463 | + array("Attempted Calls", "120", "attempted_calls", "", "", ""), |
|
464 | + array("Completed Calls", "120", "description", "", "", ""), |
|
465 | + array("ASR","80","asr",'','',''), |
|
466 | + array("ACD","80","acd ",'','',''), |
|
467 | + array("MCD","80","mcd",'','',''), |
|
468 | + array("Bilable","90","billable",'','',''), |
|
469 | + array("Price","90","price",'','',''), |
|
470 | + array("Cost","90","cost",'','',''), |
|
471 | + array("Profit", "100", "profit", "", "", ""), |
|
472 | + )); |
|
473 | + return $grid_field_arr; |
|
474 | + } |
|
475 | + function build_grid_buttons_resellersummary() { |
|
476 | + $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/resellersummary_export_cdr_xls", 'single'))); |
|
477 | + return $buttons_json; |
|
478 | + } |
|
479 | + function get_customersummary_search_form() { |
|
480 | + $form['forms'] = array("",array('id' => "customersummary_search")); |
|
481 | + $form['Search'] = array( |
|
482 | + array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
|
483 | + array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
|
484 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"GLOBAL")), |
|
485 | + array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
486 | 486 | |
487 | - array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
|
488 | - // array('Account Number', 'number', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("type"=>"0", "deleted" => "0")), |
|
487 | + array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
|
488 | + // array('Account Number', 'number', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("type"=>"0", "deleted" => "0")), |
|
489 | 489 | array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
490 | - ); |
|
491 | - $form['button_search'] = array('name' => 'action', 'id' => "customersummary_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
492 | - $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
490 | + ); |
|
491 | + $form['button_search'] = array('name' => 'action', 'id' => "customersummary_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
492 | + $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
493 | 493 | |
494 | - return $form; |
|
495 | - } |
|
496 | - function build_customersummary(){ |
|
497 | - $grid_field_arr = json_encode(array( |
|
498 | - array("Account", "190", "accountid", "first_name,last_name,number", "accounts", "build_concat_string"), |
|
499 | - array("Code", "80", "pattern", "pattern", "", "get_only_numeric_val"), |
|
500 | - array("Destination", "110", "notes", "", "", ""), |
|
501 | - array("Attempted Calls", "140", "attempted_calls", "", "", ""), |
|
502 | - array("Completed Calls", "130", "description", "", "", ""), |
|
503 | - array("ASR","70","asr",'','',''), |
|
504 | - array("ACD","70","acd ",'','',''), |
|
505 | - array("MCD","80","mcd",'','',''), |
|
506 | - array("Bilable","80","billable",'','',''), |
|
507 | - array("Debit","85","cost",'','',''), |
|
508 | - array("Cost","110","price",'','',''), |
|
509 | - array("Profit", "123", "profit", "", "", ""), |
|
510 | - )); |
|
511 | - return $grid_field_arr; |
|
512 | - } |
|
513 | - function build_grid_buttons_customersummary() { |
|
514 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/customersummary_export_cdr_xls", 'single'))); |
|
515 | - return $buttons_json; |
|
516 | - } |
|
494 | + return $form; |
|
495 | + } |
|
496 | + function build_customersummary(){ |
|
497 | + $grid_field_arr = json_encode(array( |
|
498 | + array("Account", "190", "accountid", "first_name,last_name,number", "accounts", "build_concat_string"), |
|
499 | + array("Code", "80", "pattern", "pattern", "", "get_only_numeric_val"), |
|
500 | + array("Destination", "110", "notes", "", "", ""), |
|
501 | + array("Attempted Calls", "140", "attempted_calls", "", "", ""), |
|
502 | + array("Completed Calls", "130", "description", "", "", ""), |
|
503 | + array("ASR","70","asr",'','',''), |
|
504 | + array("ACD","70","acd ",'','',''), |
|
505 | + array("MCD","80","mcd",'','',''), |
|
506 | + array("Bilable","80","billable",'','',''), |
|
507 | + array("Debit","85","cost",'','',''), |
|
508 | + array("Cost","110","price",'','',''), |
|
509 | + array("Profit", "123", "profit", "", "", ""), |
|
510 | + )); |
|
511 | + return $grid_field_arr; |
|
512 | + } |
|
513 | + function build_grid_buttons_customersummary() { |
|
514 | + $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/customersummary_export_cdr_xls", 'single'))); |
|
515 | + return $buttons_json; |
|
516 | + } |
|
517 | 517 | /********* |
518 | 518 | ASTPP 3.0 .1 |
519 | 519 | Charges History |
520 | 520 | *********/ |
521 | - function build_charge_list_for_admin() { |
|
521 | + function build_charge_list_for_admin() { |
|
522 | 522 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
523 | 523 | $currency_id=$account_info['currency_id']; |
524 | 524 | $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
525 | - if ($this->CI->session->userdata("logintype") == '1') { |
|
526 | - $grid_field_arr = json_encode(array( |
|
527 | - array(gettext("Created Date"), "120", "created_date", "", "", "","","true","center"), |
|
528 | - array(gettext("Invoice Number"), "120", "created_date", "", "", "","","true","center"), |
|
529 | - array(gettext("Account"), "120", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
525 | + if ($this->CI->session->userdata("logintype") == '1') { |
|
526 | + $grid_field_arr = json_encode(array( |
|
527 | + array(gettext("Created Date"), "120", "created_date", "", "", "","","true","center"), |
|
528 | + array(gettext("Invoice Number"), "120", "created_date", "", "", "","","true","center"), |
|
529 | + array(gettext("Account"), "120", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
530 | 530 | // array("Reseller", "120", "reseller_id", "first_name,last_name,number", "accounts", "reseller_select_value"), |
531 | - array(gettext("Charge Type"), "120", "item_type", "", "", "","","true","center"), |
|
532 | - array("Before Balance<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency","","true","right"), |
|
533 | - array("Debit (-)<br/>($currency)", "110", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
534 | - array("Credit (+)<br/>($currency)", "110", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
535 | - array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency","","true","right"), |
|
536 | - array(gettext("Description"), "300", "description", "", "", "","","true","center"), |
|
537 | - )); |
|
531 | + array(gettext("Charge Type"), "120", "item_type", "", "", "","","true","center"), |
|
532 | + array("Before Balance<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency","","true","right"), |
|
533 | + array("Debit (-)<br/>($currency)", "110", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
534 | + array("Credit (+)<br/>($currency)", "110", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
535 | + array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency","","true","right"), |
|
536 | + array(gettext("Description"), "300", "description", "", "", "","","true","center"), |
|
537 | + )); |
|
538 | 538 | }else{ |
539 | - $grid_field_arr = json_encode(array( |
|
540 | - array("Created Date", "120", "created_date", "", "", "","","true","center"), |
|
541 | - array("Invoice Number", "120", "created_date", "", "", "","","true","center"), |
|
542 | - array("Account", "120", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
543 | - array("Charge Type", "120", "item_type", "", "", "","","true","center"), |
|
544 | - array("Before Balance<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency","","true","right"), |
|
545 | - array("Debit (-)<br/>($currency)", "110", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
546 | - array("Credit (+)<br/>($currency)", "110", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
547 | - array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency","","true","right"), |
|
548 | - array("Description", "300", "description", "", "", "","","true","center"), |
|
549 | - )); |
|
539 | + $grid_field_arr = json_encode(array( |
|
540 | + array("Created Date", "120", "created_date", "", "", "","","true","center"), |
|
541 | + array("Invoice Number", "120", "created_date", "", "", "","","true","center"), |
|
542 | + array("Account", "120", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
543 | + array("Charge Type", "120", "item_type", "", "", "","","true","center"), |
|
544 | + array("Before Balance<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency","","true","right"), |
|
545 | + array("Debit (-)<br/>($currency)", "110", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
546 | + array("Credit (+)<br/>($currency)", "110", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
547 | + array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency","","true","right"), |
|
548 | + array("Description", "300", "description", "", "", "","","true","center"), |
|
549 | + )); |
|
550 | 550 | |
551 | 551 | } |
552 | - return $grid_field_arr; |
|
553 | - } |
|
554 | - function get_charges_search_form() { |
|
555 | - $accountinfo=$this->CI->session->userdata('accountinfo'); |
|
556 | - $reseller_id=$accountinfo['type']==1 ? $accountinfo['id'] : 0; |
|
557 | - $form['forms'] = array("", array('id' => "charges_search")); |
|
558 | - $form['Search'] = array( |
|
559 | - array('From Date', 'INPUT', array('name' => 'created_date[]', 'id' => 'charge_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
|
560 | - array('To Date', 'INPUT', array('name' => 'created_date[]', 'id' => 'charge_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
|
561 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => $reseller_id,"type"=>"GLOBAL")), |
|
562 | - array('Debit ', 'INPUT', array('name' => 'debit[debit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'debit[debit-integer]', '', '', '', 'search_int_type', ''), |
|
563 | - array('Credit ', 'INPUT', array('name' => 'credit[credit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'credit[credit-integer]', '', '', '', 'search_int_type', ''), |
|
552 | + return $grid_field_arr; |
|
553 | + } |
|
554 | + function get_charges_search_form() { |
|
555 | + $accountinfo=$this->CI->session->userdata('accountinfo'); |
|
556 | + $reseller_id=$accountinfo['type']==1 ? $accountinfo['id'] : 0; |
|
557 | + $form['forms'] = array("", array('id' => "charges_search")); |
|
558 | + $form['Search'] = array( |
|
559 | + array('From Date', 'INPUT', array('name' => 'created_date[]', 'id' => 'charge_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
|
560 | + array('To Date', 'INPUT', array('name' => 'created_date[]', 'id' => 'charge_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
|
561 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => $reseller_id,"type"=>"GLOBAL")), |
|
562 | + array('Debit ', 'INPUT', array('name' => 'debit[debit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'debit[debit-integer]', '', '', '', 'search_int_type', ''), |
|
563 | + array('Credit ', 'INPUT', array('name' => 'credit[credit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'credit[credit-integer]', '', '', '', 'search_int_type', ''), |
|
564 | 564 | |
565 | - array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
566 | - array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
|
567 | - ); |
|
568 | - $form['button_search'] = array('name' => 'action', 'id' => "charges_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
569 | - $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
565 | + array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
566 | + array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
|
567 | + ); |
|
568 | + $form['button_search'] = array('name' => 'action', 'id' => "charges_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
569 | + $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
570 | 570 | |
571 | - return $form; |
|
572 | - } |
|
573 | - /*******************************/ |
|
574 | - /********* |
|
571 | + return $form; |
|
572 | + } |
|
573 | + /*******************************/ |
|
574 | + /********* |
|
575 | 575 | ASTPP 3.0 |
576 | 576 | Charges History |
577 | 577 | *********/ |
578 | - function build_charge_list_for_customer(){ |
|
578 | + function build_charge_list_for_customer(){ |
|
579 | 579 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
580 | 580 | $currency_id=$account_info['currency_id']; |
581 | 581 | $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
582 | 582 | |
583 | - $grid_field_arr = json_encode(array( |
|
584 | - array("Created Date", "100", "created_date", "", "", "","","true","center"), |
|
585 | - array("Invoice Number", "110", "created_date", "", "", "","","true","center"), |
|
586 | - array("Charge Type", "100", "item_type", "", "", "","","true","center"), |
|
587 | - array("Before Balance<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency","","true","right"), |
|
588 | - array("Debit (-)<br/>($currency)", "110", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
589 | - array("Credit (+)<br/>($currency)", "110", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
590 | - array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency","","true","right"), |
|
591 | - array("Description", "270", "description", "", "", "","","true","center"), |
|
592 | - )); |
|
593 | - return $grid_field_arr; |
|
594 | - } |
|
595 | - /********* |
|
583 | + $grid_field_arr = json_encode(array( |
|
584 | + array("Created Date", "100", "created_date", "", "", "","","true","center"), |
|
585 | + array("Invoice Number", "110", "created_date", "", "", "","","true","center"), |
|
586 | + array("Charge Type", "100", "item_type", "", "", "","","true","center"), |
|
587 | + array("Before Balance<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency","","true","right"), |
|
588 | + array("Debit (-)<br/>($currency)", "110", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
589 | + array("Credit (+)<br/>($currency)", "110", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
590 | + array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency","","true","right"), |
|
591 | + array("Description", "270", "description", "", "", "","","true","center"), |
|
592 | + )); |
|
593 | + return $grid_field_arr; |
|
594 | + } |
|
595 | + /********* |
|
596 | 596 | ASTPP 3.0 |
597 | 597 | Refill History |
598 | 598 | *********/ |
599 | - function build_refillreport_for_customer(){ |
|
599 | + function build_refillreport_for_customer(){ |
|
600 | 600 | |
601 | 601 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
602 | 602 | $currency_id=$account_info['currency_id']; |
603 | 603 | $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
604 | 604 | |
605 | - $grid_field_arr = json_encode(array( |
|
606 | - array("Date", "225", "payment_date", "", "", "","","true","center"), |
|
607 | - array("Amount($currency)", "250", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
608 | - array("Refill By", "230", "payment_by", "payment_by", "payment_by", "get_refill_by","","true","center"), |
|
609 | - array("Note", "325", "notes", "", "", "","","true","center") |
|
610 | - )); |
|
611 | - return $grid_field_arr; |
|
612 | - } |
|
605 | + $grid_field_arr = json_encode(array( |
|
606 | + array("Date", "225", "payment_date", "", "", "","","true","center"), |
|
607 | + array("Amount($currency)", "250", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
608 | + array("Refill By", "230", "payment_by", "payment_by", "payment_by", "get_refill_by","","true","center"), |
|
609 | + array("Note", "325", "notes", "", "", "","","true","center") |
|
610 | + )); |
|
611 | + return $grid_field_arr; |
|
612 | + } |
|
613 | 613 | |
614 | 614 | |
615 | 615 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | # You should have received a copy of the GNU Affero General Public License |
21 | 21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 | 22 | ############################################################################### |
23 | -if (!defined('BASEPATH')) |
|
23 | +if ( ! defined('BASEPATH')) |
|
24 | 24 | exit('No direct script access allowed'); |
25 | 25 | |
26 | 26 | class Reports_form { |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | } |
30 | 30 | function get_customer_cdr_form() { |
31 | 31 | $logintype = $this->CI->session->userdata('userlevel_logintype'); |
32 | - if($logintype != 1){ |
|
32 | + if ($logintype != 1) { |
|
33 | 33 | if ($this->CI->session->userdata('logintype') == 1 || $this->CI->session->userdata('logintype') == 5) { |
34 | 34 | $accountinfo = $this->CI->session->userdata['accountinfo']; |
35 | 35 | $reseller_id = $accountinfo["id"]; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | array('Debit ', 'INPUT', array('name' => 'debit[debit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'debit[debit-integer]', '', '', '', 'search_int_type', ''), |
49 | 49 | array('Cost ', 'INPUT', array('name' => 'cost[cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'cost[cost-integer]', '', '', '', 'search_int_type', ''), |
50 | 50 | array('Disposition', 'disposition', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_despostion'), |
51 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"GLOBAL")), |
|
51 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0", "type"=>"GLOBAL")), |
|
52 | 52 | |
53 | 53 | array('Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`status`=2, concat(name,"","^"),name) as name', 'trunks', 'build_dropdown_deleted', '', array("status" => "1")), |
54 | 54 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | array('Debit ', 'INPUT', array('name' => 'debit[debit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'debit[debit-integer]', '', '', '', 'search_int_type', ''), |
72 | 72 | array('Cost ', 'INPUT', array('name' => 'cost[cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'cost[cost-integer]', '', '', '', 'search_int_type', ''), |
73 | 73 | array('Disposition', 'disposition', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_despostion'), |
74 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"GLOBAL")), |
|
74 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0", "type"=>"GLOBAL")), |
|
75 | 75 | |
76 | 76 | //array('Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`status`=2, concat(name,"","^"),name) as name', 'trunks', 'build_dropdown_deleted', '', array("status" => "1")), |
77 | 77 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | |
86 | - $form['display_in']=array('name' => 'search_in',"id"=>"search_in","function"=>"search_report_in", "content"=>"Display records in",'label_class' => "search_label col-md-3 no-padding","dropdown_class"=>"form-control","label_style"=>"font-size:13px;","dropdown_style"=>"background: #ddd; width: 21% !important;"); |
|
86 | + $form['display_in'] = array('name' => 'search_in', "id"=>"search_in", "function"=>"search_report_in", "content"=>"Display records in", 'label_class' => "search_label col-md-3 no-padding", "dropdown_class"=>"form-control", "label_style"=>"font-size:13px;", "dropdown_style"=>"background: #ddd; width: 21% !important;"); |
|
87 | 87 | |
88 | 88 | /****************************************/ |
89 | 89 | $form['button_search'] = array('name' => 'action', 'id' => "cusotmer_cdr_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
@@ -109,17 +109,17 @@ discard block |
||
109 | 109 | array('Cost ', 'INPUT', array('name' => 'cost[cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'cost[cost-integer]', '', '', '', 'search_int_type', ''), |
110 | 110 | |
111 | 111 | array('Disposition', 'disposition', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_despostion'), |
112 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"1")), |
|
112 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0", "type"=>"1")), |
|
113 | 113 | array('Rate Group', 'pricelist_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`status`=2, concat(name,"","^"),name) as name', 'pricelists', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0")), |
114 | 114 | array('Call Type', 'calltype', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_calltype'), |
115 | 115 | |
116 | 116 | array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
117 | 117 | array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
118 | 118 | if ($this->CI->session->userdata('logintype') != 1 && $this->CI->session->userdata('logintype') != 5) { |
119 | - $new_Array=array('Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "1")); |
|
119 | + $new_Array = array('Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "1")); |
|
120 | 120 | } |
121 | 121 | |
122 | - $form['display_in']=array('name' => 'search_in',"id"=>"search_in","function"=>"search_report_in", "content"=>"Display records in ",'label_class' => "search_label col-md-3 no-padding","dropdown_class"=>"form-control","label_style"=>"font-size:13px;text-align:right;","dropdown_style"=>"background: #ddd; width: 23% !important;"); |
|
122 | + $form['display_in'] = array('name' => 'search_in', "id"=>"search_in", "function"=>"search_report_in", "content"=>"Display records in ", 'label_class' => "search_label col-md-3 no-padding", "dropdown_class"=>"form-control", "label_style"=>"font-size:13px;text-align:right;", "dropdown_style"=>"background: #ddd; width: 23% !important;"); |
|
123 | 123 | |
124 | 124 | /****************************************/ |
125 | 125 | $form['button_search'] = array('name' => 'action', 'id' => "reseller_cdr_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
@@ -141,14 +141,14 @@ discard block |
||
141 | 141 | array('Cost ', 'INPUT', array('name' => 'provider_call_cost[provider_call_cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'provider_call_cost[provider_call_cost-integer]', '', '', '', 'search_int_type', ''), |
142 | 142 | // array('Cost ', 'INPUT', array('name' => 'cost[cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'cost[cost-integer]', '', '', '', 'search_int_type', ''), |
143 | 143 | array('Disposition', 'disposition', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_despostion'), |
144 | - array('Account', 'provider_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"3")), |
|
145 | - array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
|
144 | + array('Account', 'provider_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0", "type"=>"3")), |
|
145 | + array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
|
146 | 146 | |
147 | 147 | // array('Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', '', ''), |
148 | 148 | |
149 | 149 | |
150 | 150 | ); |
151 | - $form['display_in']=array('name' => 'search_in',"id"=>"search_in","function"=>"search_report_in", "content"=>"Display records in",'label_class' => "search_label col-md-3 no-padding","dropdown_class"=>"form-control","label_style"=>"font-size:13px;","dropdown_style"=>"background: #ddd; width: 21% !important;"); |
|
151 | + $form['display_in'] = array('name' => 'search_in', "id"=>"search_in", "function"=>"search_report_in", "content"=>"Display records in", 'label_class' => "search_label col-md-3 no-padding", "dropdown_class"=>"form-control", "label_style"=>"font-size:13px;", "dropdown_style"=>"background: #ddd; width: 21% !important;"); |
|
152 | 152 | |
153 | 153 | /****************************************/ |
154 | 154 | $form['button_search'] = array('name' => 'action', 'id' => "provider_cdr_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
@@ -163,52 +163,52 @@ discard block |
||
163 | 163 | ******/ |
164 | 164 | function build_report_list_for_customer() { |
165 | 165 | $logintype = $this->CI->session->userdata('userlevel_logintype'); |
166 | - if($logintype != 1){ |
|
166 | + if ($logintype != 1) { |
|
167 | 167 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
168 | - $currency_id=$account_info['currency_id']; |
|
169 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
168 | + $currency_id = $account_info['currency_id']; |
|
169 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
170 | 170 | |
171 | - $recording=array(); |
|
171 | + $recording = array(); |
|
172 | 172 | $account_data = $this->CI->session->userdata("accountinfo"); |
173 | - if($account_data['type'] == 1){ |
|
174 | - $recording=array("Recording", "127", "recording", "", "", ""); |
|
173 | + if ($account_data['type'] == 1) { |
|
174 | + $recording = array("Recording", "127", "recording", "", "", ""); |
|
175 | 175 | } |
176 | 176 | $grid_field_arr = json_encode(array( |
177 | - array(gettext("Date"), "100", "callstart","callstart", "callstart", "convert_GMT_to","","true","center"), |
|
178 | - array("Caller ID", "120", "callerid", "", "", "","","true","center"), |
|
179 | - array("Called Number", "103", "callednum", "", "", "","","true","center"), |
|
180 | - array("Code", "71", "pattern", "pattern", "", "get_only_numeric_val","","true","center"), |
|
181 | - array("Destination", "90", "notes", "", "", "","","true","center"), |
|
182 | - array("Duration", "80", "billseconds", "customer_cdr_list_search", "billseconds", "convert_to_show_in","","true","center"), |
|
183 | - array("Debit($currency)", "75", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
184 | - array("Cost($currency)", "75", "cost", "cost", "cost", "convert_to_currency","","true","right"), |
|
185 | - array("Disposition", "150", "disposition", "", "", "","","true","center"), |
|
186 | - array("Account", "110", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
187 | - array("Trunk", "90", "trunk_id", "name", "trunks", "get_field_name","","true","center"), |
|
188 | - array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"), |
|
177 | + array(gettext("Date"), "100", "callstart", "callstart", "callstart", "convert_GMT_to", "", "true", "center"), |
|
178 | + array("Caller ID", "120", "callerid", "", "", "", "", "true", "center"), |
|
179 | + array("Called Number", "103", "callednum", "", "", "", "", "true", "center"), |
|
180 | + array("Code", "71", "pattern", "pattern", "", "get_only_numeric_val", "", "true", "center"), |
|
181 | + array("Destination", "90", "notes", "", "", "", "", "true", "center"), |
|
182 | + array("Duration", "80", "billseconds", "customer_cdr_list_search", "billseconds", "convert_to_show_in", "", "true", "center"), |
|
183 | + array("Debit($currency)", "75", "debit", "debit", "debit", "convert_to_currency", "", "true", "right"), |
|
184 | + array("Cost($currency)", "75", "cost", "cost", "cost", "convert_to_currency", "", "true", "right"), |
|
185 | + array("Disposition", "150", "disposition", "", "", "", "", "true", "center"), |
|
186 | + array("Account", "110", "accountid", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"), |
|
187 | + array("Trunk", "90", "trunk_id", "name", "trunks", "get_field_name", "", "true", "center"), |
|
188 | + array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name", "", "true", "center"), |
|
189 | 189 | array("Call Type", "112", "calltype", "", "", ""), |
190 | 190 | $recording, |
191 | 191 | )); |
192 | 192 | |
193 | 193 | } |
194 | - else{ |
|
194 | + else { |
|
195 | 195 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
196 | - $currency_id=$account_info['currency_id']; |
|
197 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
198 | - $recording=array("Recording", "127", "recording", "", "", ""); |
|
196 | + $currency_id = $account_info['currency_id']; |
|
197 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
198 | + $recording = array("Recording", "127", "recording", "", "", ""); |
|
199 | 199 | $grid_field_arr = json_encode(array( |
200 | - array("Date", "100", "callstart","callstart", "callstart", "convert_GMT_to","","true","center"), |
|
201 | - array("Caller ID", "100", "callerid", "", "", "","","true","center"), |
|
202 | - array("Called Number", "103", "callednum", "", "", "","","true","center"), |
|
203 | - array("Code", "71", "pattern", "pattern", "", "get_only_numeric_val","","true","center"), |
|
204 | - array("Destination", "90", "notes", "", "", "","","true","center"), |
|
205 | - array("Duration", "80", "billseconds", "customer_cdr_list_search", "billseconds", "convert_to_show_in","","true","center"), |
|
206 | - array("Debit($currency)", "75", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
207 | - array("Cost($currency)", "75", "cost", "cost", "cost", "convert_to_currency","","true","right"), |
|
208 | - array("Disposition", "130", "disposition", "", "", "","","true","center"), |
|
209 | - array("Account", "110", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
200 | + array("Date", "100", "callstart", "callstart", "callstart", "convert_GMT_to", "", "true", "center"), |
|
201 | + array("Caller ID", "100", "callerid", "", "", "", "", "true", "center"), |
|
202 | + array("Called Number", "103", "callednum", "", "", "", "", "true", "center"), |
|
203 | + array("Code", "71", "pattern", "pattern", "", "get_only_numeric_val", "", "true", "center"), |
|
204 | + array("Destination", "90", "notes", "", "", "", "", "true", "center"), |
|
205 | + array("Duration", "80", "billseconds", "customer_cdr_list_search", "billseconds", "convert_to_show_in", "", "true", "center"), |
|
206 | + array("Debit($currency)", "75", "debit", "debit", "debit", "convert_to_currency", "", "true", "right"), |
|
207 | + array("Cost($currency)", "75", "cost", "cost", "cost", "convert_to_currency", "", "true", "right"), |
|
208 | + array("Disposition", "130", "disposition", "", "", "", "", "true", "center"), |
|
209 | + array("Account", "110", "accountid", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"), |
|
210 | 210 | //array("Trunk", "90", "trunk_id", "name", "trunks", "get_field_name","","true","center"), |
211 | - array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"), |
|
211 | + array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name", "", "true", "center"), |
|
212 | 212 | array("Call Type", "112", "calltype", "", "", ""), |
213 | 213 | $recording, |
214 | 214 | )); |
@@ -222,23 +222,23 @@ discard block |
||
222 | 222 | function build_report_list_for_reseller() { |
223 | 223 | |
224 | 224 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
225 | -$currency_id=$account_info['currency_id']; |
|
226 | -$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
225 | +$currency_id = $account_info['currency_id']; |
|
226 | +$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
227 | 227 | |
228 | 228 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
229 | 229 | $grid_field_arr = json_encode(array( |
230 | - array("Date", "100", "callstart", "callstart", "callstart", "convert_GMT_to","","true","center"), |
|
231 | - array("Caller ID", "100", "callerid", "", "", "","","true","center"), |
|
232 | - array("Called Number", "120", "callednum", "", "", "","","true","center"), |
|
233 | - array("Code", "80", "pattern", "pattern", "", "get_only_numeric_val","","true","center"), |
|
234 | - array("Destination", "120", "notes", "", "", "","","true","center"), |
|
235 | - array("Duration", "107", "billseconds", "reseller_cdr_list_search", "billseconds", "convert_to_show_in","","true","center"), |
|
236 | - array("Debit($currency)", "105", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
237 | - array("Cost($currency)", "104", "cost", "cost", "cost", "convert_to_currency","","true","right"), |
|
238 | - array("Disposition", "100", "disposition", "", "", "","","true","center"), |
|
239 | - array("Account", "120", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
240 | - array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"), |
|
241 | - array("Call Type", "120", "calltype", "", "", "","","true","center"), |
|
230 | + array("Date", "100", "callstart", "callstart", "callstart", "convert_GMT_to", "", "true", "center"), |
|
231 | + array("Caller ID", "100", "callerid", "", "", "", "", "true", "center"), |
|
232 | + array("Called Number", "120", "callednum", "", "", "", "", "true", "center"), |
|
233 | + array("Code", "80", "pattern", "pattern", "", "get_only_numeric_val", "", "true", "center"), |
|
234 | + array("Destination", "120", "notes", "", "", "", "", "true", "center"), |
|
235 | + array("Duration", "107", "billseconds", "reseller_cdr_list_search", "billseconds", "convert_to_show_in", "", "true", "center"), |
|
236 | + array("Debit($currency)", "105", "debit", "debit", "debit", "convert_to_currency", "", "true", "right"), |
|
237 | + array("Cost($currency)", "104", "cost", "cost", "cost", "convert_to_currency", "", "true", "right"), |
|
238 | + array("Disposition", "100", "disposition", "", "", "", "", "true", "center"), |
|
239 | + array("Account", "120", "accountid", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"), |
|
240 | + array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name", "", "true", "center"), |
|
241 | + array("Call Type", "120", "calltype", "", "", "", "", "true", "center"), |
|
242 | 242 | |
243 | 243 | )); |
244 | 244 | return $grid_field_arr; |
@@ -247,25 +247,25 @@ discard block |
||
247 | 247 | function build_report_list_for_provider() { |
248 | 248 | |
249 | 249 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
250 | -$currency_id=$account_info['currency_id']; |
|
251 | -$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
250 | +$currency_id = $account_info['currency_id']; |
|
251 | +$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
252 | 252 | |
253 | 253 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
254 | - $grid_field_arr = json_encode(array(array("Date", "100", "callstart", "callstart", "callstart", "convert_GMT_to","","true","center"), |
|
255 | - array("Caller ID", "120", "callerid", "", "", "","","true","center"), |
|
256 | - array("Called Number", "160", "callednum", "", "", "","","true","center"), |
|
257 | - array("Code", "117", "pattern", "pattern", "", "get_only_numeric_val","","true","center"), |
|
258 | - array("Destination", "130", "notes", "", "", "","","true","center"), |
|
259 | - array("Duration", "110", "billseconds", "provider_cdr_list_search", "billseconds", "convert_to_show_in","","true","center"), |
|
260 | - array("Cost($currency)", "150", "provider_call_cost", "provider_cost", "provider_cost", "convert_to_currency","","true","right"), |
|
261 | - array("Disposition", "200", "disposition", "", "", "","","true","center"), |
|
262 | - array("Account", "181", "provider_id", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
254 | + $grid_field_arr = json_encode(array(array("Date", "100", "callstart", "callstart", "callstart", "convert_GMT_to", "", "true", "center"), |
|
255 | + array("Caller ID", "120", "callerid", "", "", "", "", "true", "center"), |
|
256 | + array("Called Number", "160", "callednum", "", "", "", "", "true", "center"), |
|
257 | + array("Code", "117", "pattern", "pattern", "", "get_only_numeric_val", "", "true", "center"), |
|
258 | + array("Destination", "130", "notes", "", "", "", "", "true", "center"), |
|
259 | + array("Duration", "110", "billseconds", "provider_cdr_list_search", "billseconds", "convert_to_show_in", "", "true", "center"), |
|
260 | + array("Cost($currency)", "150", "provider_call_cost", "provider_cost", "provider_cost", "convert_to_currency", "", "true", "right"), |
|
261 | + array("Disposition", "200", "disposition", "", "", "", "", "true", "center"), |
|
262 | + array("Account", "181", "provider_id", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"), |
|
263 | 263 | )); |
264 | 264 | return $grid_field_arr; |
265 | 265 | } |
266 | 266 | |
267 | 267 | function build_grid_customer() { |
268 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/customerReport_export/", 'single'))); |
|
268 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/reports/customerReport_export/", 'single'))); |
|
269 | 269 | return $buttons_json; |
270 | 270 | } |
271 | 271 | /** |
@@ -274,43 +274,43 @@ discard block |
||
274 | 274 | **/ |
275 | 275 | |
276 | 276 | function build_grid_buttons_user() { |
277 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/user/user_report_export/", 'single'))); |
|
277 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/user/user_report_export/", 'single'))); |
|
278 | 278 | return $buttons_json; |
279 | 279 | } |
280 | 280 | /*****************************************************************/ |
281 | 281 | function build_grid_buttons_reseller() { |
282 | - $buttons_json = json_encode(array( array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/resellerReport_export/", 'single'))); |
|
282 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/reports/resellerReport_export/", 'single'))); |
|
283 | 283 | return $buttons_json; |
284 | 284 | } |
285 | 285 | function build_grid_buttons_provider() { |
286 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/providerReport_export/", 'single'))); |
|
286 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/reports/providerReport_export/", 'single'))); |
|
287 | 287 | return $buttons_json; |
288 | 288 | } |
289 | 289 | |
290 | 290 | function build_report_list_for_user($accounttype = 'customer') { |
291 | 291 | |
292 | 292 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
293 | - $currency_id=$account_info['currency_id']; |
|
294 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
293 | + $currency_id = $account_info['currency_id']; |
|
294 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
295 | 295 | |
296 | 296 | |
297 | - if($accounttype == 'customer' || $accounttype =='reseller'){ |
|
298 | - $cost_array=array("Debit($currency)", "100", "debit", "debit", "debit", "convert_to_currency","","true","right"); |
|
297 | + if ($accounttype == 'customer' || $accounttype == 'reseller') { |
|
298 | + $cost_array = array("Debit($currency)", "100", "debit", "debit", "debit", "convert_to_currency", "", "true", "right"); |
|
299 | 299 | } |
300 | - if(strtolower($accounttype)=='provider'){ |
|
301 | - $cost_array=array("Debit($currency)", "140", "cost", "cost", "cost", "convert_to_currency"); |
|
300 | + if (strtolower($accounttype) == 'provider') { |
|
301 | + $cost_array = array("Debit($currency)", "140", "cost", "cost", "cost", "convert_to_currency"); |
|
302 | 302 | } |
303 | 303 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
304 | 304 | $grid_field_arr = json_encode(array( |
305 | - array("Date", "130", "callstart", "callstart", "callstart", "convert_GMT_to","","true","center"), |
|
306 | - array("Caller ID", "100", "callerid", "", "", "","","true","center"), |
|
307 | - array("Called Number", "120", "callednum", "", "", "","","true","center"), |
|
308 | - array("Destination", "135", "notes", "", "", "","","true","center"), |
|
305 | + array("Date", "130", "callstart", "callstart", "callstart", "convert_GMT_to", "", "true", "center"), |
|
306 | + array("Caller ID", "100", "callerid", "", "", "", "", "true", "center"), |
|
307 | + array("Called Number", "120", "callednum", "", "", "", "", "true", "center"), |
|
308 | + array("Destination", "135", "notes", "", "", "", "", "true", "center"), |
|
309 | 309 | // array("Account Number", "120", "accountid", "number", "accounts", "get_field_name"), |
310 | - array("Duration", "120", "billseconds", "user_cdrs_report_search", "billseconds", "convert_to_show_in","","true","center"), |
|
310 | + array("Duration", "120", "billseconds", "user_cdrs_report_search", "billseconds", "convert_to_show_in", "", "true", "center"), |
|
311 | 311 | $cost_array, |
312 | - array("Disposition", "160", "disposition", "", "", "","","true","center"), |
|
313 | - array("Call Type", "140", "calltype", "", "", "","","true","center"), |
|
312 | + array("Disposition", "160", "disposition", "", "", "", "", "true", "center"), |
|
313 | + array("Call Type", "140", "calltype", "", "", "", "", "true", "center"), |
|
314 | 314 | )); |
315 | 315 | return $grid_field_arr; |
316 | 316 | } |
@@ -322,37 +322,37 @@ discard block |
||
322 | 322 | function build_refill_report_for_admin() { |
323 | 323 | |
324 | 324 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
325 | - $currency_id=$account_info['currency_id']; |
|
326 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
325 | + $currency_id = $account_info['currency_id']; |
|
326 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
327 | 327 | $grid_field_arr = json_encode(array( |
328 | - array(gettext("Date"), "225", "payment_date", "", "", "","","true","center"), |
|
329 | - array(gettext("Account"), "240", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
330 | - array("Amount($currency)", "250", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
331 | - array(gettext("Refill By"), "230", "payment_by", "payment_by", "payment_by", "get_refill_by","","true","center"), |
|
332 | - array(gettext("Note"), "327", "notes", "", "", "","","true","center") |
|
328 | + array(gettext("Date"), "225", "payment_date", "", "", "", "", "true", "center"), |
|
329 | + array(gettext("Account"), "240", "accountid", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"), |
|
330 | + array("Amount($currency)", "250", "credit", "credit", "credit", "convert_to_currency", "", "true", "right"), |
|
331 | + array(gettext("Refill By"), "230", "payment_by", "payment_by", "payment_by", "get_refill_by", "", "true", "center"), |
|
332 | + array(gettext("Note"), "327", "notes", "", "", "", "", "true", "center") |
|
333 | 333 | )); |
334 | 334 | return $grid_field_arr; |
335 | 335 | } |
336 | 336 | function build_refillreport_buttons() { |
337 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/refillreport_export/", 'single'))); |
|
337 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/reports/refillreport_export/", 'single'))); |
|
338 | 338 | return $buttons_json; |
339 | 339 | } |
340 | 340 | function build_search_refill_report_for_admin() { |
341 | - $accountinfo=$this->CI->session->userdata('accountinfo'); |
|
342 | - $reseller_id=$accountinfo['type']==1 ? $accountinfo['id'] : 0 ; |
|
341 | + $accountinfo = $this->CI->session->userdata('accountinfo'); |
|
342 | + $reseller_id = $accountinfo['type'] == 1 ? $accountinfo['id'] : 0; |
|
343 | 343 | $form['forms'] = array("", array('id' => "cdr_refill_search")); |
344 | 344 | $account_data = $this->CI->session->userdata("accountinfo"); |
345 | - $acc_arr= array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => $reseller_id,"type"=>"0,1,3")); |
|
345 | + $acc_arr = array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => $reseller_id, "type"=>"0,1,3")); |
|
346 | 346 | $logintype = $this->CI->session->userdata('logintype'); |
347 | 347 | if ($logintype == 1 || $logintype == 5) { |
348 | 348 | $account_data = $this->CI->session->userdata("accountinfo"); |
349 | 349 | $loginid = $account_data['id']; |
350 | 350 | |
351 | - }else{ |
|
351 | + } else { |
|
352 | 352 | $loginid = "0"; |
353 | 353 | } |
354 | - if($logintype==0 || $logintype==3){ |
|
355 | - $acc_arr=null; |
|
354 | + if ($logintype == 0 || $logintype == 3) { |
|
355 | + $acc_arr = null; |
|
356 | 356 | } |
357 | 357 | $form['Search'] = array( |
358 | 358 | array('From Date', 'INPUT', array('name' => 'payment_date[]', 'id' => 'refill_from_date', 'size' => '20', |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | // array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0","type"=>"0")), |
363 | 363 | array('Amount ', 'INPUT', array('name' => 'credit[credit]', 'value' => '', 'size' => '20', 'class' => "text field"), '', 'Tool tips info', '1', 'credit[credit-integer]', '', '', '', 'search_int_type', ''), |
364 | 364 | // array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', ''), |
365 | - array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
365 | + array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
366 | 366 | |
367 | 367 | $form['button_search'] = array('name' => 'action', 'id' => "cusotmer_cdr_refill_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
368 | 368 | $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
@@ -392,9 +392,9 @@ discard block |
||
392 | 392 | array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
393 | 393 | array('', 'HIDDEN', 'advance_search', '1', '', '', ''), |
394 | 394 | array('From Date', 'INPUT', array('name' => 'date[]', 'id' => 'commission_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
395 | - array('To Date', 'INPUT', array('name' => 'date[]', 'id' => 'commission_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
|
396 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0","type"=>"1", "deleted" => "0")), |
|
397 | - array('Amount', 'INPUT', array('name' => 'amount[amount]', 'value' => '', 'size' => '20', 'class' => "text field"), '', 'Tool tips info', '1', 'amount[amount-integer]', '', '', '', 'search_int_type', ''), |
|
395 | + array('To Date', 'INPUT', array('name' => 'date[]', 'id' => 'commission_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
|
396 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0", "type"=>"1", "deleted" => "0")), |
|
397 | + array('Amount', 'INPUT', array('name' => 'amount[amount]', 'value' => '', 'size' => '20', 'class' => "text field"), '', 'Tool tips info', '1', 'amount[amount-integer]', '', '', '', 'search_int_type', ''), |
|
398 | 398 | ); |
399 | 399 | |
400 | 400 | $form['button_search'] = array('name' => 'action', 'id' => "commission_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'ui-state-default float-right ui-corner-all ui-button'); |
@@ -407,8 +407,8 @@ discard block |
||
407 | 407 | $form['Search'] = array( |
408 | 408 | array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
409 | 409 | array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
410 | - array('Account', 'provider_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"3")), |
|
411 | - array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
410 | + array('Account', 'provider_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0", "type"=>"3")), |
|
411 | + array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
412 | 412 | |
413 | 413 | array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
414 | 414 | // array('Account Number', 'number', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("type"=>"3", "deleted" => "0")), |
@@ -419,99 +419,99 @@ discard block |
||
419 | 419 | |
420 | 420 | return $form; |
421 | 421 | } |
422 | - function build_providersummary(){ |
|
422 | + function build_providersummary() { |
|
423 | 423 | $grid_field_arr = json_encode(array( |
424 | 424 | array("Provider", "220", "provider_id", "first_name,last_name,number", "accounts", "build_concat_string"), |
425 | 425 | array("Code", "120", "pattern", "pattern", "", "get_only_numeric_val"), |
426 | 426 | array("Destination", "150", "notes", "", "", ""), |
427 | 427 | array("Attempted Calls", "130", "attempted_calls", "", "", ""), |
428 | 428 | array("Completed Calls", "150", "description", "", "", ""), |
429 | - array("ASR","95","asr",'','',''), |
|
430 | - array("ACD","95","acd ",'','',''), |
|
431 | - array("MCD","95","mcd",'','',''), |
|
432 | - array("Bilable","100","billable",'','',''), |
|
433 | - array("Cost","115","cost",'','',''), |
|
429 | + array("ASR", "95", "asr", '', '', ''), |
|
430 | + array("ACD", "95", "acd ", '', '', ''), |
|
431 | + array("MCD", "95", "mcd", '', '', ''), |
|
432 | + array("Bilable", "100", "billable", '', '', ''), |
|
433 | + array("Cost", "115", "cost", '', '', ''), |
|
434 | 434 | // array("Profit", "95", "profit", "", "", ""), |
435 | 435 | )); |
436 | 436 | return $grid_field_arr; |
437 | 437 | } |
438 | 438 | function build_grid_buttons_providersummary() { |
439 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/providersummary_export_cdr_xls", 'single'))); |
|
439 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/reports/providersummary_export_cdr_xls", 'single'))); |
|
440 | 440 | return $buttons_json; |
441 | 441 | } |
442 | 442 | function get_resellersummary_search_form() { |
443 | - $form['forms'] = array("",array('id' => "resellersummary_search")); |
|
443 | + $form['forms'] = array("", array('id' => "resellersummary_search")); |
|
444 | 444 | $form['Search'] = array( |
445 | 445 | array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
446 | 446 | array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
447 | - array('Account', 'reseller_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"1")), |
|
448 | - array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
447 | + array('Account', 'reseller_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0", "type"=>"1")), |
|
448 | + array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
449 | 449 | |
450 | 450 | array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
451 | 451 | // array('Account Number', 'number', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("type"=>"1", "deleted" => "0")), |
452 | -array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
452 | +array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
453 | 453 | $form['button_search'] = array('name' => 'action', 'id' => "resellersummary_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
454 | 454 | $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
455 | 455 | |
456 | 456 | return $form; |
457 | 457 | } |
458 | - function build_resellersummary(){ |
|
458 | + function build_resellersummary() { |
|
459 | 459 | $grid_field_arr = json_encode(array( |
460 | 460 | array("Account", "148", "accountid", "first_name,last_name,number", "accounts", "build_concat_string"), |
461 | 461 | array("Code", "120", "pattern", "pattern", "", "get_only_numeric_val"), |
462 | 462 | array("Destination", "150", "notes", "", "", ""), |
463 | 463 | array("Attempted Calls", "120", "attempted_calls", "", "", ""), |
464 | 464 | array("Completed Calls", "120", "description", "", "", ""), |
465 | - array("ASR","80","asr",'','',''), |
|
466 | - array("ACD","80","acd ",'','',''), |
|
467 | - array("MCD","80","mcd",'','',''), |
|
468 | - array("Bilable","90","billable",'','',''), |
|
469 | - array("Price","90","price",'','',''), |
|
470 | - array("Cost","90","cost",'','',''), |
|
465 | + array("ASR", "80", "asr", '', '', ''), |
|
466 | + array("ACD", "80", "acd ", '', '', ''), |
|
467 | + array("MCD", "80", "mcd", '', '', ''), |
|
468 | + array("Bilable", "90", "billable", '', '', ''), |
|
469 | + array("Price", "90", "price", '', '', ''), |
|
470 | + array("Cost", "90", "cost", '', '', ''), |
|
471 | 471 | array("Profit", "100", "profit", "", "", ""), |
472 | 472 | )); |
473 | 473 | return $grid_field_arr; |
474 | 474 | } |
475 | 475 | function build_grid_buttons_resellersummary() { |
476 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/resellersummary_export_cdr_xls", 'single'))); |
|
476 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/reports/resellersummary_export_cdr_xls", 'single'))); |
|
477 | 477 | return $buttons_json; |
478 | 478 | } |
479 | 479 | function get_customersummary_search_form() { |
480 | - $form['forms'] = array("",array('id' => "customersummary_search")); |
|
480 | + $form['forms'] = array("", array('id' => "customersummary_search")); |
|
481 | 481 | $form['Search'] = array( |
482 | 482 | array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
483 | 483 | array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
484 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"GLOBAL")), |
|
484 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0", "type"=>"GLOBAL")), |
|
485 | 485 | array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
486 | 486 | |
487 | 487 | array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
488 | 488 | // array('Account Number', 'number', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("type"=>"0", "deleted" => "0")), |
489 | - array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
|
489 | + array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
|
490 | 490 | ); |
491 | 491 | $form['button_search'] = array('name' => 'action', 'id' => "customersummary_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
492 | 492 | $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
493 | 493 | |
494 | 494 | return $form; |
495 | 495 | } |
496 | - function build_customersummary(){ |
|
496 | + function build_customersummary() { |
|
497 | 497 | $grid_field_arr = json_encode(array( |
498 | 498 | array("Account", "190", "accountid", "first_name,last_name,number", "accounts", "build_concat_string"), |
499 | 499 | array("Code", "80", "pattern", "pattern", "", "get_only_numeric_val"), |
500 | 500 | array("Destination", "110", "notes", "", "", ""), |
501 | 501 | array("Attempted Calls", "140", "attempted_calls", "", "", ""), |
502 | 502 | array("Completed Calls", "130", "description", "", "", ""), |
503 | - array("ASR","70","asr",'','',''), |
|
504 | - array("ACD","70","acd ",'','',''), |
|
505 | - array("MCD","80","mcd",'','',''), |
|
506 | - array("Bilable","80","billable",'','',''), |
|
507 | - array("Debit","85","cost",'','',''), |
|
508 | - array("Cost","110","price",'','',''), |
|
503 | + array("ASR", "70", "asr", '', '', ''), |
|
504 | + array("ACD", "70", "acd ", '', '', ''), |
|
505 | + array("MCD", "80", "mcd", '', '', ''), |
|
506 | + array("Bilable", "80", "billable", '', '', ''), |
|
507 | + array("Debit", "85", "cost", '', '', ''), |
|
508 | + array("Cost", "110", "price", '', '', ''), |
|
509 | 509 | array("Profit", "123", "profit", "", "", ""), |
510 | 510 | )); |
511 | 511 | return $grid_field_arr; |
512 | 512 | } |
513 | 513 | function build_grid_buttons_customersummary() { |
514 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/customersummary_export_cdr_xls", 'single'))); |
|
514 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/reports/customersummary_export_cdr_xls", 'single'))); |
|
515 | 515 | return $buttons_json; |
516 | 516 | } |
517 | 517 | /********* |
@@ -520,45 +520,45 @@ discard block |
||
520 | 520 | *********/ |
521 | 521 | function build_charge_list_for_admin() { |
522 | 522 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
523 | - $currency_id=$account_info['currency_id']; |
|
524 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
523 | + $currency_id = $account_info['currency_id']; |
|
524 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
525 | 525 | if ($this->CI->session->userdata("logintype") == '1') { |
526 | 526 | $grid_field_arr = json_encode(array( |
527 | - array(gettext("Created Date"), "120", "created_date", "", "", "","","true","center"), |
|
528 | - array(gettext("Invoice Number"), "120", "created_date", "", "", "","","true","center"), |
|
529 | - array(gettext("Account"), "120", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
527 | + array(gettext("Created Date"), "120", "created_date", "", "", "", "", "true", "center"), |
|
528 | + array(gettext("Invoice Number"), "120", "created_date", "", "", "", "", "true", "center"), |
|
529 | + array(gettext("Account"), "120", "accountid", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"), |
|
530 | 530 | // array("Reseller", "120", "reseller_id", "first_name,last_name,number", "accounts", "reseller_select_value"), |
531 | - array(gettext("Charge Type"), "120", "item_type", "", "", "","","true","center"), |
|
532 | - array("Before Balance<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency","","true","right"), |
|
533 | - array("Debit (-)<br/>($currency)", "110", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
534 | - array("Credit (+)<br/>($currency)", "110", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
535 | - array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency","","true","right"), |
|
536 | - array(gettext("Description"), "300", "description", "", "", "","","true","center"), |
|
531 | + array(gettext("Charge Type"), "120", "item_type", "", "", "", "", "true", "center"), |
|
532 | + array("Before Balance<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency", "", "true", "right"), |
|
533 | + array("Debit (-)<br/>($currency)", "110", "debit", "debit", "debit", "convert_to_currency", "", "true", "right"), |
|
534 | + array("Credit (+)<br/>($currency)", "110", "credit", "credit", "credit", "convert_to_currency", "", "true", "right"), |
|
535 | + array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency", "", "true", "right"), |
|
536 | + array(gettext("Description"), "300", "description", "", "", "", "", "true", "center"), |
|
537 | 537 | )); |
538 | - }else{ |
|
538 | + } else { |
|
539 | 539 | $grid_field_arr = json_encode(array( |
540 | - array("Created Date", "120", "created_date", "", "", "","","true","center"), |
|
541 | - array("Invoice Number", "120", "created_date", "", "", "","","true","center"), |
|
542 | - array("Account", "120", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
543 | - array("Charge Type", "120", "item_type", "", "", "","","true","center"), |
|
544 | - array("Before Balance<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency","","true","right"), |
|
545 | - array("Debit (-)<br/>($currency)", "110", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
546 | - array("Credit (+)<br/>($currency)", "110", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
547 | - array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency","","true","right"), |
|
548 | - array("Description", "300", "description", "", "", "","","true","center"), |
|
540 | + array("Created Date", "120", "created_date", "", "", "", "", "true", "center"), |
|
541 | + array("Invoice Number", "120", "created_date", "", "", "", "", "true", "center"), |
|
542 | + array("Account", "120", "accountid", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"), |
|
543 | + array("Charge Type", "120", "item_type", "", "", "", "", "true", "center"), |
|
544 | + array("Before Balance<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency", "", "true", "right"), |
|
545 | + array("Debit (-)<br/>($currency)", "110", "debit", "debit", "debit", "convert_to_currency", "", "true", "right"), |
|
546 | + array("Credit (+)<br/>($currency)", "110", "credit", "credit", "credit", "convert_to_currency", "", "true", "right"), |
|
547 | + array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency", "", "true", "right"), |
|
548 | + array("Description", "300", "description", "", "", "", "", "true", "center"), |
|
549 | 549 | )); |
550 | 550 | |
551 | 551 | } |
552 | 552 | return $grid_field_arr; |
553 | 553 | } |
554 | 554 | function get_charges_search_form() { |
555 | - $accountinfo=$this->CI->session->userdata('accountinfo'); |
|
556 | - $reseller_id=$accountinfo['type']==1 ? $accountinfo['id'] : 0; |
|
555 | + $accountinfo = $this->CI->session->userdata('accountinfo'); |
|
556 | + $reseller_id = $accountinfo['type'] == 1 ? $accountinfo['id'] : 0; |
|
557 | 557 | $form['forms'] = array("", array('id' => "charges_search")); |
558 | 558 | $form['Search'] = array( |
559 | 559 | array('From Date', 'INPUT', array('name' => 'created_date[]', 'id' => 'charge_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
560 | 560 | array('To Date', 'INPUT', array('name' => 'created_date[]', 'id' => 'charge_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
561 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => $reseller_id,"type"=>"GLOBAL")), |
|
561 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => $reseller_id, "type"=>"GLOBAL")), |
|
562 | 562 | array('Debit ', 'INPUT', array('name' => 'debit[debit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'debit[debit-integer]', '', '', '', 'search_int_type', ''), |
563 | 563 | array('Credit ', 'INPUT', array('name' => 'credit[credit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'credit[credit-integer]', '', '', '', 'search_int_type', ''), |
564 | 564 | |
@@ -575,20 +575,20 @@ discard block |
||
575 | 575 | ASTPP 3.0 |
576 | 576 | Charges History |
577 | 577 | *********/ |
578 | - function build_charge_list_for_customer(){ |
|
578 | + function build_charge_list_for_customer() { |
|
579 | 579 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
580 | - $currency_id=$account_info['currency_id']; |
|
581 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
580 | + $currency_id = $account_info['currency_id']; |
|
581 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
582 | 582 | |
583 | 583 | $grid_field_arr = json_encode(array( |
584 | - array("Created Date", "100", "created_date", "", "", "","","true","center"), |
|
585 | - array("Invoice Number", "110", "created_date", "", "", "","","true","center"), |
|
586 | - array("Charge Type", "100", "item_type", "", "", "","","true","center"), |
|
587 | - array("Before Balance<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency","","true","right"), |
|
588 | - array("Debit (-)<br/>($currency)", "110", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
589 | - array("Credit (+)<br/>($currency)", "110", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
590 | - array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency","","true","right"), |
|
591 | - array("Description", "270", "description", "", "", "","","true","center"), |
|
584 | + array("Created Date", "100", "created_date", "", "", "", "", "true", "center"), |
|
585 | + array("Invoice Number", "110", "created_date", "", "", "", "", "true", "center"), |
|
586 | + array("Charge Type", "100", "item_type", "", "", "", "", "true", "center"), |
|
587 | + array("Before Balance<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency", "", "true", "right"), |
|
588 | + array("Debit (-)<br/>($currency)", "110", "debit", "debit", "debit", "convert_to_currency", "", "true", "right"), |
|
589 | + array("Credit (+)<br/>($currency)", "110", "credit", "credit", "credit", "convert_to_currency", "", "true", "right"), |
|
590 | + array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency", "", "true", "right"), |
|
591 | + array("Description", "270", "description", "", "", "", "", "true", "center"), |
|
592 | 592 | )); |
593 | 593 | return $grid_field_arr; |
594 | 594 | } |
@@ -596,17 +596,17 @@ discard block |
||
596 | 596 | ASTPP 3.0 |
597 | 597 | Refill History |
598 | 598 | *********/ |
599 | - function build_refillreport_for_customer(){ |
|
599 | + function build_refillreport_for_customer() { |
|
600 | 600 | |
601 | 601 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
602 | - $currency_id=$account_info['currency_id']; |
|
603 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
602 | + $currency_id = $account_info['currency_id']; |
|
603 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
604 | 604 | |
605 | 605 | $grid_field_arr = json_encode(array( |
606 | - array("Date", "225", "payment_date", "", "", "","","true","center"), |
|
607 | - array("Amount($currency)", "250", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
608 | - array("Refill By", "230", "payment_by", "payment_by", "payment_by", "get_refill_by","","true","center"), |
|
609 | - array("Note", "325", "notes", "", "", "","","true","center") |
|
606 | + array("Date", "225", "payment_date", "", "", "", "", "true", "center"), |
|
607 | + array("Amount($currency)", "250", "credit", "credit", "credit", "convert_to_currency", "", "true", "right"), |
|
608 | + array("Refill By", "230", "payment_by", "payment_by", "payment_by", "get_refill_by", "", "true", "center"), |
|
609 | + array("Note", "325", "notes", "", "", "", "", "true", "center") |
|
610 | 610 | )); |
611 | 611 | return $grid_field_arr; |
612 | 612 | } |
@@ -20,8 +20,9 @@ discard block |
||
20 | 20 | # You should have received a copy of the GNU Affero General Public License |
21 | 21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 | 22 | ############################################################################### |
23 | -if (!defined('BASEPATH')) |
|
24 | - exit('No direct script access allowed'); |
|
23 | +if (!defined('BASEPATH')) { |
|
24 | + exit('No direct script access allowed'); |
|
25 | +} |
|
25 | 26 | |
26 | 27 | class Reports_form { |
27 | 28 | function __construct() { |
@@ -56,8 +57,7 @@ discard block |
||
56 | 57 | array('Call Type', 'calltype', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_calltype'), |
57 | 58 | array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
58 | 59 | array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
59 | - } |
|
60 | - else |
|
60 | + } else |
|
61 | 61 | { |
62 | 62 | $form['forms'] = array("", array('id' => "cdr_customer_search")); |
63 | 63 | $form['Search'] = array( |
@@ -190,8 +190,7 @@ discard block |
||
190 | 190 | $recording, |
191 | 191 | )); |
192 | 192 | |
193 | - } |
|
194 | - else{ |
|
193 | + } else{ |
|
195 | 194 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
196 | 195 | $currency_id=$account_info['currency_id']; |
197 | 196 | $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
@@ -348,7 +347,7 @@ discard block |
||
348 | 347 | $account_data = $this->CI->session->userdata("accountinfo"); |
349 | 348 | $loginid = $account_data['id']; |
350 | 349 | |
351 | - }else{ |
|
350 | + } else{ |
|
352 | 351 | $loginid = "0"; |
353 | 352 | } |
354 | 353 | if($logintype==0 || $logintype==3){ |
@@ -535,7 +534,7 @@ discard block |
||
535 | 534 | array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency","","true","right"), |
536 | 535 | array(gettext("Description"), "300", "description", "", "", "","","true","center"), |
537 | 536 | )); |
538 | - }else{ |
|
537 | + } else{ |
|
539 | 538 | $grid_field_arr = json_encode(array( |
540 | 539 | array("Created Date", "120", "created_date", "", "", "","","true","center"), |
541 | 540 | array("Invoice Number", "120", "created_date", "", "", "","","true","center"), |
@@ -22,176 +22,176 @@ discard block |
||
22 | 22 | ############################################################################### |
23 | 23 | class Reports_model extends CI_Model { |
24 | 24 | |
25 | - function Reports_model() { |
|
26 | - parent::__construct(); |
|
27 | - } |
|
25 | + function Reports_model() { |
|
26 | + parent::__construct(); |
|
27 | + } |
|
28 | 28 | /** |
29 | 29 | ASTPP 3.0 |
30 | 30 | For Detail Customer Report List,Export |
31 | 31 | **/ |
32 | - function getcustomer_cdrs($flag, $start, $limit,$export =false) { |
|
33 | - $this->db_model->build_search('customer_cdr_list_search'); |
|
34 | - $account_data = $this->session->userdata("accountinfo"); |
|
35 | - $where['reseller_id']=$account_data['type']== 1 ? $account_data['id']:0; |
|
36 | - //$where['type']=0; |
|
37 | - if($this->session->userdata('advance_search') != 1){ |
|
38 | - $where['callstart >= ']=date("Y-m-d")." 00:00:00"; |
|
39 | - $where['callstart <=']=date("Y-m-d")." 23:59:59"; |
|
40 | - } |
|
32 | + function getcustomer_cdrs($flag, $start, $limit,$export =false) { |
|
33 | + $this->db_model->build_search('customer_cdr_list_search'); |
|
34 | + $account_data = $this->session->userdata("accountinfo"); |
|
35 | + $where['reseller_id']=$account_data['type']== 1 ? $account_data['id']:0; |
|
36 | + //$where['type']=0; |
|
37 | + if($this->session->userdata('advance_search') != 1){ |
|
38 | + $where['callstart >= ']=date("Y-m-d")." 00:00:00"; |
|
39 | + $where['callstart <=']=date("Y-m-d")." 23:59:59"; |
|
40 | + } |
|
41 | 41 | |
42 | - $types = array('0','3'); |
|
43 | - //$this->db->or_where_in('type', $types); |
|
42 | + $types = array('0','3'); |
|
43 | + //$this->db->or_where_in('type', $types); |
|
44 | 44 | $this->db->where_in('type', $types); |
45 | 45 | |
46 | - $this->db->where($where); |
|
47 | - if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
|
48 | - $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
|
49 | - }else{ |
|
50 | - $this->db->order_by("callstart desc"); |
|
51 | - } |
|
52 | - if ($flag) { |
|
53 | - if (!$export) |
|
54 | - $this->db->limit($limit, $start); |
|
55 | - $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,disposition,debit,cost,accountid,pricelist_id,calltype,is_recording,trunk_id,uniqueid'); |
|
56 | - }else { |
|
57 | - $this->db->select('count(*) as count,sum(billseconds) as billseconds,sum(debit) as total_debit,sum(cost) as total_cost,group_concat(distinct(pricelist_id)) as pricelist_ids,group_concat(distinct(trunk_id)) as trunk_ids,group_concat(distinct(accountid)) as accounts_ids'); |
|
58 | - } |
|
59 | - $result = $this->db->get('cdrs'); |
|
60 | - return $result; |
|
61 | - } |
|
46 | + $this->db->where($where); |
|
47 | + if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
|
48 | + $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
|
49 | + }else{ |
|
50 | + $this->db->order_by("callstart desc"); |
|
51 | + } |
|
52 | + if ($flag) { |
|
53 | + if (!$export) |
|
54 | + $this->db->limit($limit, $start); |
|
55 | + $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,disposition,debit,cost,accountid,pricelist_id,calltype,is_recording,trunk_id,uniqueid'); |
|
56 | + }else { |
|
57 | + $this->db->select('count(*) as count,sum(billseconds) as billseconds,sum(debit) as total_debit,sum(cost) as total_cost,group_concat(distinct(pricelist_id)) as pricelist_ids,group_concat(distinct(trunk_id)) as trunk_ids,group_concat(distinct(accountid)) as accounts_ids'); |
|
58 | + } |
|
59 | + $result = $this->db->get('cdrs'); |
|
60 | + return $result; |
|
61 | + } |
|
62 | 62 | /* |
63 | 63 | * Below function using by Detail reseller report |
64 | 64 | */ |
65 | - function getreseller_cdrs($flag, $start, $limit,$export=false) { |
|
66 | - $this->db_model->build_search('reseller_cdr_list_search'); |
|
67 | - $account_data = $this->session->userdata("accountinfo"); |
|
68 | - $where['reseller_id']=$account_data['type']== 1 ? $account_data['id']:0; |
|
69 | - $where["accountid <>"]=$account_data['type']== 1 ? $account_data['id']:0; |
|
65 | + function getreseller_cdrs($flag, $start, $limit,$export=false) { |
|
66 | + $this->db_model->build_search('reseller_cdr_list_search'); |
|
67 | + $account_data = $this->session->userdata("accountinfo"); |
|
68 | + $where['reseller_id']=$account_data['type']== 1 ? $account_data['id']:0; |
|
69 | + $where["accountid <>"]=$account_data['type']== 1 ? $account_data['id']:0; |
|
70 | 70 | if($this->session->userdata('advance_search') != 1){ |
71 | - $where['callstart >= ']=date("Y-m-d")." 00:00:00"; |
|
72 | - $where['callstart <=']=date("Y-m-d")." 23:59:59"; |
|
73 | - } |
|
74 | - $this->db->where($where); |
|
75 | - if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
|
76 | - $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
|
77 | - }else{ |
|
78 | - $this->db->order_by("callstart desc"); |
|
79 | - } |
|
80 | - if ($flag) { |
|
81 | - if (!$export) |
|
82 | - $this->db->limit($limit, $start); |
|
83 | - $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,disposition,debit,cost,accountid,pricelist_id,calltype'); |
|
84 | - } else { |
|
85 | - $this->db->select('count(*) as count,sum(billseconds) as billseconds,sum(debit) as total_debit,sum(cost) as total_cost,group_concat(distinct(pricelist_id)) as pricelist_ids'); |
|
86 | - } |
|
87 | - $result = $this->db->get('reseller_cdrs'); |
|
88 | - return $result; |
|
89 | - } |
|
90 | - /*Below function using by Detail provider report |
|
71 | + $where['callstart >= ']=date("Y-m-d")." 00:00:00"; |
|
72 | + $where['callstart <=']=date("Y-m-d")." 23:59:59"; |
|
73 | + } |
|
74 | + $this->db->where($where); |
|
75 | + if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
|
76 | + $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
|
77 | + }else{ |
|
78 | + $this->db->order_by("callstart desc"); |
|
79 | + } |
|
80 | + if ($flag) { |
|
81 | + if (!$export) |
|
82 | + $this->db->limit($limit, $start); |
|
83 | + $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,disposition,debit,cost,accountid,pricelist_id,calltype'); |
|
84 | + } else { |
|
85 | + $this->db->select('count(*) as count,sum(billseconds) as billseconds,sum(debit) as total_debit,sum(cost) as total_cost,group_concat(distinct(pricelist_id)) as pricelist_ids'); |
|
86 | + } |
|
87 | + $result = $this->db->get('reseller_cdrs'); |
|
88 | + return $result; |
|
89 | + } |
|
90 | + /*Below function using by Detail provider report |
|
91 | 91 | */ |
92 | - function getprovider_cdrs($flag, $start, $limit,$export=false) { |
|
93 | - $this->db_model->build_search('provider_cdr_list_search'); |
|
94 | - $account_data = $this->session->userdata("accountinfo"); |
|
95 | - $where=array(); |
|
96 | - if($account_data['type']== 3 ){ |
|
97 | - $where['provider_id']= $account_data['id']; |
|
98 | - } |
|
92 | + function getprovider_cdrs($flag, $start, $limit,$export=false) { |
|
93 | + $this->db_model->build_search('provider_cdr_list_search'); |
|
94 | + $account_data = $this->session->userdata("accountinfo"); |
|
95 | + $where=array(); |
|
96 | + if($account_data['type']== 3 ){ |
|
97 | + $where['provider_id']= $account_data['id']; |
|
98 | + } |
|
99 | 99 | |
100 | - if($this->session->userdata('advance_search') != 1){ |
|
101 | - $where['callstart >= ']=date("Y-m-d")." 00:00:00"; |
|
102 | - $where['callstart <=']=date("Y-m-d")." 23:59:59"; |
|
103 | - } |
|
104 | - $this->db->where('trunk_id !=', ''); |
|
105 | - $this->db->where($where); |
|
106 | - if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
|
107 | - $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
|
108 | - }else{ |
|
109 | - $this->db->order_by("callstart desc"); |
|
110 | - } |
|
111 | - if ($flag) { |
|
112 | - if (!$export) |
|
113 | - $this->db->limit($limit, $start); |
|
114 | - $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,provider_call_cost,disposition,provider_id,cost'); |
|
115 | - }else { |
|
116 | - $this->db->select('count(*) as count,sum(billseconds) as billseconds,sum(cost) as total_cost'); |
|
117 | - } |
|
118 | - $result = $this->db->get('cdrs'); |
|
119 | - // echo $this->db->last_query(); |
|
120 | - return $result; |
|
121 | - } |
|
122 | - function users_cdrs_list($flag,$accountid,$entity_type,$start,$limit) { |
|
100 | + if($this->session->userdata('advance_search') != 1){ |
|
101 | + $where['callstart >= ']=date("Y-m-d")." 00:00:00"; |
|
102 | + $where['callstart <=']=date("Y-m-d")." 23:59:59"; |
|
103 | + } |
|
104 | + $this->db->where('trunk_id !=', ''); |
|
105 | + $this->db->where($where); |
|
106 | + if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
|
107 | + $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
|
108 | + }else{ |
|
109 | + $this->db->order_by("callstart desc"); |
|
110 | + } |
|
111 | + if ($flag) { |
|
112 | + if (!$export) |
|
113 | + $this->db->limit($limit, $start); |
|
114 | + $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,provider_call_cost,disposition,provider_id,cost'); |
|
115 | + }else { |
|
116 | + $this->db->select('count(*) as count,sum(billseconds) as billseconds,sum(cost) as total_cost'); |
|
117 | + } |
|
118 | + $result = $this->db->get('cdrs'); |
|
119 | + // echo $this->db->last_query(); |
|
120 | + return $result; |
|
121 | + } |
|
122 | + function users_cdrs_list($flag,$accountid,$entity_type,$start,$limit) { |
|
123 | 123 | $where = "callstart >= '".date('Y-m-d 00:00:00')."' AND callstart <='".date('Y-m-d 23:59:59')."' AND "; |
124 | - $account_type= $entity_type =='provider' ? 'provider_id' :'accountid'; |
|
125 | - $where.="accountid = '".$accountid."' "; |
|
126 | - //~ if($entity_type == 'provider'){ |
|
127 | - //~ $where.="OR provider_id = '".$accountid."'"; |
|
128 | - //~ } |
|
129 | - $table=$entity_type=='reseller'?'reseller_cdrs' : 'cdrs'; |
|
130 | - if ($flag) { |
|
131 | - $query = $this->db_model->select("*", $table, $where, "callstart", "DESC", $limit, $start); |
|
132 | - } else { |
|
133 | - $query = $this->db_model->countQuery("*",$table, $where); |
|
134 | - } |
|
135 | - return $query; |
|
124 | + $account_type= $entity_type =='provider' ? 'provider_id' :'accountid'; |
|
125 | + $where.="accountid = '".$accountid."' "; |
|
126 | + //~ if($entity_type == 'provider'){ |
|
127 | + //~ $where.="OR provider_id = '".$accountid."'"; |
|
128 | + //~ } |
|
129 | + $table=$entity_type=='reseller'?'reseller_cdrs' : 'cdrs'; |
|
130 | + if ($flag) { |
|
131 | + $query = $this->db_model->select("*", $table, $where, "callstart", "DESC", $limit, $start); |
|
132 | + } else { |
|
133 | + $query = $this->db_model->countQuery("*",$table, $where); |
|
134 | + } |
|
135 | + return $query; |
|
136 | 136 | |
137 | - } |
|
137 | + } |
|
138 | 138 | |
139 | 139 | |
140 | 140 | /****** |
141 | 141 | ASTPP 3.0 |
142 | 142 | Payment to refill |
143 | 143 | ******/ |
144 | - function getuser_refill_list($flag, $start, $limit) { |
|
145 | - $this->db_model->build_search('cdr_refill_search'); |
|
146 | - $account_data = $this->session->userdata("accountinfo"); |
|
147 | - $this->db_model->build_search('customer_cdr_list_search'); |
|
148 | - $where = array("accountid" => $account_data["id"]); |
|
149 | - if ($flag) { |
|
150 | - $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC", $limit, $start); |
|
151 | - } else { |
|
152 | - $query = $this->db_model->countQuery("*", "payments", $where); |
|
153 | - } |
|
154 | - return $query; |
|
155 | - } |
|
144 | + function getuser_refill_list($flag, $start, $limit) { |
|
145 | + $this->db_model->build_search('cdr_refill_search'); |
|
146 | + $account_data = $this->session->userdata("accountinfo"); |
|
147 | + $this->db_model->build_search('customer_cdr_list_search'); |
|
148 | + $where = array("accountid" => $account_data["id"]); |
|
149 | + if ($flag) { |
|
150 | + $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC", $limit, $start); |
|
151 | + } else { |
|
152 | + $query = $this->db_model->countQuery("*", "payments", $where); |
|
153 | + } |
|
154 | + return $query; |
|
155 | + } |
|
156 | 156 | |
157 | - function get_refill_list($flag, $start, $limit,$export=false) { |
|
158 | - $this->db_model->build_search('cdr_refill_search'); |
|
159 | - $accountinfo = $this->session->userdata('accountinfo'); |
|
160 | - $where['payment_by']=$accountinfo['type']==1 ? $accountinfo['id']:-1; |
|
161 | - if ($flag) { |
|
162 | - if($export) |
|
163 | - $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC","",""); |
|
164 | - else |
|
165 | - $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC", $limit, $start); |
|
166 | - } else { |
|
167 | - $query = $this->db_model->countQuery("*", "payments", $where); |
|
168 | - } |
|
157 | + function get_refill_list($flag, $start, $limit,$export=false) { |
|
158 | + $this->db_model->build_search('cdr_refill_search'); |
|
159 | + $accountinfo = $this->session->userdata('accountinfo'); |
|
160 | + $where['payment_by']=$accountinfo['type']==1 ? $accountinfo['id']:-1; |
|
161 | + if ($flag) { |
|
162 | + if($export) |
|
163 | + $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC","",""); |
|
164 | + else |
|
165 | + $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC", $limit, $start); |
|
166 | + } else { |
|
167 | + $query = $this->db_model->countQuery("*", "payments", $where); |
|
168 | + } |
|
169 | 169 | |
170 | - return $query; |
|
171 | - } |
|
170 | + return $query; |
|
171 | + } |
|
172 | 172 | /******************/ |
173 | - function getreseller_commission_list($flag, $start, $limit) { |
|
174 | - $this->db_model->build_search('reseller_commission_search'); |
|
175 | - if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
176 | - $accountinfo = $this->session->userdata['accountinfo']; |
|
177 | - $reseller_id = $accountinfo["id"]; |
|
178 | - } else { |
|
179 | - $reseller_id = "0"; |
|
180 | - } |
|
181 | - if ($flag) { |
|
182 | - $query = $this->db_model->select_by_in("*", "commission","" , "date", "DESC", $limit, $start,"","reseller_id",$reseller_id); |
|
173 | + function getreseller_commission_list($flag, $start, $limit) { |
|
174 | + $this->db_model->build_search('reseller_commission_search'); |
|
175 | + if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
176 | + $accountinfo = $this->session->userdata['accountinfo']; |
|
177 | + $reseller_id = $accountinfo["id"]; |
|
178 | + } else { |
|
179 | + $reseller_id = "0"; |
|
180 | + } |
|
181 | + if ($flag) { |
|
182 | + $query = $this->db_model->select_by_in("*", "commission","" , "date", "DESC", $limit, $start,"","reseller_id",$reseller_id); |
|
183 | 183 | |
184 | - } else { |
|
185 | - $query = $this->db_model->countQuery_by_in("*", "commission", "","reseller_id",$reseller_id); |
|
186 | - } |
|
184 | + } else { |
|
185 | + $query = $this->db_model->countQuery_by_in("*", "commission", "","reseller_id",$reseller_id); |
|
186 | + } |
|
187 | 187 | |
188 | - return $query; |
|
189 | - } |
|
188 | + return $query; |
|
189 | + } |
|
190 | 190 | /*********** |
191 | 191 | ASTPP 3.0 |
192 | 192 | Charge History |
193 | 193 | ***********/ |
194 | - function getcharges_list($flag, $start = 0, $limit = 0) { |
|
194 | + function getcharges_list($flag, $start = 0, $limit = 0) { |
|
195 | 195 | $accountinfo=$this->session->userdata('accountinfo'); |
196 | 196 | $reseller_id=$accountinfo['id']; |
197 | 197 | if($accountinfo['type'] == 1){ |
@@ -214,38 +214,38 @@ discard block |
||
214 | 214 | $query = $this->db_model->countQuery("*", "invoice_details", ""); |
215 | 215 | } |
216 | 216 | return $query; |
217 | - } |
|
217 | + } |
|
218 | 218 | |
219 | 219 | /************************************/ |
220 | - /* ASTPP 3.0 |
|
220 | + /* ASTPP 3.0 |
|
221 | 221 | * This function using for customer edit |
222 | 222 | */ |
223 | 223 | function get_customer_charge_list($flag,$accountid,$start = 0, $limit = 0){ |
224 | - $this->db_model->build_search('charges_list_search'); |
|
225 | - $accountinfo=$this->session->userdata('accountinfo'); |
|
226 | - $reseller_id=$accountinfo['type']==1 ? $accountinfo['id'] : 0; |
|
227 | - $where['reseller_id']=$reseller_id; |
|
228 | - $where['accountid']=$accountid; |
|
229 | - if($this->session->userdata('advance_search') != 1){ |
|
230 | - $where['created_date >=']=gmdate("Y-m-1 00:00:00"); |
|
231 | - $where['created_date <=']=gmdate("Y-m-d 23:59:59"); |
|
232 | - } |
|
233 | - if ($flag) { |
|
234 | - $query = $this->db_model->select("*", "invoice_details", $where, "id", "DESC", $limit, $start); |
|
235 | - } else { |
|
236 | - $query = $this->db_model->countQuery("*", "invoice_details", $where); |
|
237 | - } |
|
238 | - return $query; |
|
239 | - } |
|
240 | - function get_customer_refillreport($flag,$accountid,$start = 0, $limit = 0){ |
|
241 | - $where = array("accountid"=>$accountid); |
|
242 | - if ($flag) { |
|
243 | - $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC", $limit, $start); |
|
244 | - } else { |
|
245 | - $query = $this->db_model->countQuery("*", "payments", $where); |
|
246 | - } |
|
224 | + $this->db_model->build_search('charges_list_search'); |
|
225 | + $accountinfo=$this->session->userdata('accountinfo'); |
|
226 | + $reseller_id=$accountinfo['type']==1 ? $accountinfo['id'] : 0; |
|
227 | + $where['reseller_id']=$reseller_id; |
|
228 | + $where['accountid']=$accountid; |
|
229 | + if($this->session->userdata('advance_search') != 1){ |
|
230 | + $where['created_date >=']=gmdate("Y-m-1 00:00:00"); |
|
231 | + $where['created_date <=']=gmdate("Y-m-d 23:59:59"); |
|
232 | + } |
|
233 | + if ($flag) { |
|
234 | + $query = $this->db_model->select("*", "invoice_details", $where, "id", "DESC", $limit, $start); |
|
235 | + } else { |
|
236 | + $query = $this->db_model->countQuery("*", "invoice_details", $where); |
|
237 | + } |
|
238 | + return $query; |
|
239 | + } |
|
240 | + function get_customer_refillreport($flag,$accountid,$start = 0, $limit = 0){ |
|
241 | + $where = array("accountid"=>$accountid); |
|
242 | + if ($flag) { |
|
243 | + $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC", $limit, $start); |
|
244 | + } else { |
|
245 | + $query = $this->db_model->countQuery("*", "payments", $where); |
|
246 | + } |
|
247 | 247 | |
248 | - return $query; |
|
249 | - } |
|
250 | - /*************************************************************************/ |
|
248 | + return $query; |
|
249 | + } |
|
250 | + /*************************************************************************/ |
|
251 | 251 | } |
@@ -29,31 +29,31 @@ discard block |
||
29 | 29 | ASTPP 3.0 |
30 | 30 | For Detail Customer Report List,Export |
31 | 31 | **/ |
32 | - function getcustomer_cdrs($flag, $start, $limit,$export =false) { |
|
32 | + function getcustomer_cdrs($flag, $start, $limit, $export = false) { |
|
33 | 33 | $this->db_model->build_search('customer_cdr_list_search'); |
34 | 34 | $account_data = $this->session->userdata("accountinfo"); |
35 | - $where['reseller_id']=$account_data['type']== 1 ? $account_data['id']:0; |
|
35 | + $where['reseller_id'] = $account_data['type'] == 1 ? $account_data['id'] : 0; |
|
36 | 36 | //$where['type']=0; |
37 | - if($this->session->userdata('advance_search') != 1){ |
|
38 | - $where['callstart >= ']=date("Y-m-d")." 00:00:00"; |
|
39 | - $where['callstart <=']=date("Y-m-d")." 23:59:59"; |
|
37 | + if ($this->session->userdata('advance_search') != 1) { |
|
38 | + $where['callstart >= '] = date("Y-m-d")." 00:00:00"; |
|
39 | + $where['callstart <='] = date("Y-m-d")." 23:59:59"; |
|
40 | 40 | } |
41 | 41 | |
42 | - $types = array('0','3'); |
|
42 | + $types = array('0', '3'); |
|
43 | 43 | //$this->db->or_where_in('type', $types); |
44 | 44 | $this->db->where_in('type', $types); |
45 | 45 | |
46 | 46 | $this->db->where($where); |
47 | - if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
|
48 | - $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
|
49 | - }else{ |
|
47 | + if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined') { |
|
48 | + $this->db->order_by($_GET['sortname'], ($_GET['sortorder'] == 'undefined') ? 'desc' : $_GET['sortorder']); |
|
49 | + } else { |
|
50 | 50 | $this->db->order_by("callstart desc"); |
51 | 51 | } |
52 | 52 | if ($flag) { |
53 | - if (!$export) |
|
53 | + if ( ! $export) |
|
54 | 54 | $this->db->limit($limit, $start); |
55 | 55 | $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,disposition,debit,cost,accountid,pricelist_id,calltype,is_recording,trunk_id,uniqueid'); |
56 | - }else { |
|
56 | + } else { |
|
57 | 57 | $this->db->select('count(*) as count,sum(billseconds) as billseconds,sum(debit) as total_debit,sum(cost) as total_cost,group_concat(distinct(pricelist_id)) as pricelist_ids,group_concat(distinct(trunk_id)) as trunk_ids,group_concat(distinct(accountid)) as accounts_ids'); |
58 | 58 | } |
59 | 59 | $result = $this->db->get('cdrs'); |
@@ -62,23 +62,23 @@ discard block |
||
62 | 62 | /* |
63 | 63 | * Below function using by Detail reseller report |
64 | 64 | */ |
65 | - function getreseller_cdrs($flag, $start, $limit,$export=false) { |
|
65 | + function getreseller_cdrs($flag, $start, $limit, $export = false) { |
|
66 | 66 | $this->db_model->build_search('reseller_cdr_list_search'); |
67 | 67 | $account_data = $this->session->userdata("accountinfo"); |
68 | - $where['reseller_id']=$account_data['type']== 1 ? $account_data['id']:0; |
|
69 | - $where["accountid <>"]=$account_data['type']== 1 ? $account_data['id']:0; |
|
70 | - if($this->session->userdata('advance_search') != 1){ |
|
71 | - $where['callstart >= ']=date("Y-m-d")." 00:00:00"; |
|
72 | - $where['callstart <=']=date("Y-m-d")." 23:59:59"; |
|
68 | + $where['reseller_id'] = $account_data['type'] == 1 ? $account_data['id'] : 0; |
|
69 | + $where["accountid <>"] = $account_data['type'] == 1 ? $account_data['id'] : 0; |
|
70 | + if ($this->session->userdata('advance_search') != 1) { |
|
71 | + $where['callstart >= '] = date("Y-m-d")." 00:00:00"; |
|
72 | + $where['callstart <='] = date("Y-m-d")." 23:59:59"; |
|
73 | 73 | } |
74 | 74 | $this->db->where($where); |
75 | - if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
|
76 | - $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
|
77 | - }else{ |
|
75 | + if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined') { |
|
76 | + $this->db->order_by($_GET['sortname'], ($_GET['sortorder'] == 'undefined') ? 'desc' : $_GET['sortorder']); |
|
77 | + } else { |
|
78 | 78 | $this->db->order_by("callstart desc"); |
79 | 79 | } |
80 | 80 | if ($flag) { |
81 | - if (!$export) |
|
81 | + if ( ! $export) |
|
82 | 82 | $this->db->limit($limit, $start); |
83 | 83 | $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,disposition,debit,cost,accountid,pricelist_id,calltype'); |
84 | 84 | } else { |
@@ -89,48 +89,48 @@ discard block |
||
89 | 89 | } |
90 | 90 | /*Below function using by Detail provider report |
91 | 91 | */ |
92 | - function getprovider_cdrs($flag, $start, $limit,$export=false) { |
|
92 | + function getprovider_cdrs($flag, $start, $limit, $export = false) { |
|
93 | 93 | $this->db_model->build_search('provider_cdr_list_search'); |
94 | 94 | $account_data = $this->session->userdata("accountinfo"); |
95 | - $where=array(); |
|
96 | - if($account_data['type']== 3 ){ |
|
97 | - $where['provider_id']= $account_data['id']; |
|
95 | + $where = array(); |
|
96 | + if ($account_data['type'] == 3) { |
|
97 | + $where['provider_id'] = $account_data['id']; |
|
98 | 98 | } |
99 | 99 | |
100 | - if($this->session->userdata('advance_search') != 1){ |
|
101 | - $where['callstart >= ']=date("Y-m-d")." 00:00:00"; |
|
102 | - $where['callstart <=']=date("Y-m-d")." 23:59:59"; |
|
100 | + if ($this->session->userdata('advance_search') != 1) { |
|
101 | + $where['callstart >= '] = date("Y-m-d")." 00:00:00"; |
|
102 | + $where['callstart <='] = date("Y-m-d")." 23:59:59"; |
|
103 | 103 | } |
104 | 104 | $this->db->where('trunk_id !=', ''); |
105 | 105 | $this->db->where($where); |
106 | - if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
|
107 | - $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
|
108 | - }else{ |
|
106 | + if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined') { |
|
107 | + $this->db->order_by($_GET['sortname'], ($_GET['sortorder'] == 'undefined') ? 'desc' : $_GET['sortorder']); |
|
108 | + } else { |
|
109 | 109 | $this->db->order_by("callstart desc"); |
110 | 110 | } |
111 | 111 | if ($flag) { |
112 | - if (!$export) |
|
112 | + if ( ! $export) |
|
113 | 113 | $this->db->limit($limit, $start); |
114 | 114 | $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,provider_call_cost,disposition,provider_id,cost'); |
115 | - }else { |
|
115 | + } else { |
|
116 | 116 | $this->db->select('count(*) as count,sum(billseconds) as billseconds,sum(cost) as total_cost'); |
117 | 117 | } |
118 | 118 | $result = $this->db->get('cdrs'); |
119 | 119 | // echo $this->db->last_query(); |
120 | 120 | return $result; |
121 | 121 | } |
122 | - function users_cdrs_list($flag,$accountid,$entity_type,$start,$limit) { |
|
122 | + function users_cdrs_list($flag, $accountid, $entity_type, $start, $limit) { |
|
123 | 123 | $where = "callstart >= '".date('Y-m-d 00:00:00')."' AND callstart <='".date('Y-m-d 23:59:59')."' AND "; |
124 | - $account_type= $entity_type =='provider' ? 'provider_id' :'accountid'; |
|
125 | - $where.="accountid = '".$accountid."' "; |
|
124 | + $account_type = $entity_type == 'provider' ? 'provider_id' : 'accountid'; |
|
125 | + $where .= "accountid = '".$accountid."' "; |
|
126 | 126 | //~ if($entity_type == 'provider'){ |
127 | 127 | //~ $where.="OR provider_id = '".$accountid."'"; |
128 | 128 | //~ } |
129 | - $table=$entity_type=='reseller'?'reseller_cdrs' : 'cdrs'; |
|
129 | + $table = $entity_type == 'reseller' ? 'reseller_cdrs' : 'cdrs'; |
|
130 | 130 | if ($flag) { |
131 | 131 | $query = $this->db_model->select("*", $table, $where, "callstart", "DESC", $limit, $start); |
132 | 132 | } else { |
133 | - $query = $this->db_model->countQuery("*",$table, $where); |
|
133 | + $query = $this->db_model->countQuery("*", $table, $where); |
|
134 | 134 | } |
135 | 135 | return $query; |
136 | 136 | |
@@ -154,13 +154,13 @@ discard block |
||
154 | 154 | return $query; |
155 | 155 | } |
156 | 156 | |
157 | - function get_refill_list($flag, $start, $limit,$export=false) { |
|
157 | + function get_refill_list($flag, $start, $limit, $export = false) { |
|
158 | 158 | $this->db_model->build_search('cdr_refill_search'); |
159 | 159 | $accountinfo = $this->session->userdata('accountinfo'); |
160 | - $where['payment_by']=$accountinfo['type']==1 ? $accountinfo['id']:-1; |
|
160 | + $where['payment_by'] = $accountinfo['type'] == 1 ? $accountinfo['id'] : -1; |
|
161 | 161 | if ($flag) { |
162 | - if($export) |
|
163 | - $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC","",""); |
|
162 | + if ($export) |
|
163 | + $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC", "", ""); |
|
164 | 164 | else |
165 | 165 | $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC", $limit, $start); |
166 | 166 | } else { |
@@ -179,10 +179,10 @@ discard block |
||
179 | 179 | $reseller_id = "0"; |
180 | 180 | } |
181 | 181 | if ($flag) { |
182 | - $query = $this->db_model->select_by_in("*", "commission","" , "date", "DESC", $limit, $start,"","reseller_id",$reseller_id); |
|
182 | + $query = $this->db_model->select_by_in("*", "commission", "", "date", "DESC", $limit, $start, "", "reseller_id", $reseller_id); |
|
183 | 183 | |
184 | 184 | } else { |
185 | - $query = $this->db_model->countQuery_by_in("*", "commission", "","reseller_id",$reseller_id); |
|
185 | + $query = $this->db_model->countQuery_by_in("*", "commission", "", "reseller_id", $reseller_id); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | return $query; |
@@ -192,22 +192,22 @@ discard block |
||
192 | 192 | Charge History |
193 | 193 | ***********/ |
194 | 194 | function getcharges_list($flag, $start = 0, $limit = 0) { |
195 | - $accountinfo=$this->session->userdata('accountinfo'); |
|
196 | - $reseller_id=$accountinfo['id']; |
|
197 | - if($accountinfo['type'] == 1){ |
|
198 | - $where['reseller_id']=$reseller_id; |
|
199 | - }else{ |
|
200 | - $where['reseller_id']=0; |
|
195 | + $accountinfo = $this->session->userdata('accountinfo'); |
|
196 | + $reseller_id = $accountinfo['id']; |
|
197 | + if ($accountinfo['type'] == 1) { |
|
198 | + $where['reseller_id'] = $reseller_id; |
|
199 | + } else { |
|
200 | + $where['reseller_id'] = 0; |
|
201 | 201 | } |
202 | - if($this->session->userdata('advance_search') != 1){ |
|
203 | - $where['created_date >=']=gmdate("Y-m-01 00:00:01"); |
|
204 | - $where['created_date <=']=gmdate("Y-m-d 23:59:59"); |
|
202 | + if ($this->session->userdata('advance_search') != 1) { |
|
203 | + $where['created_date >='] = gmdate("Y-m-01 00:00:01"); |
|
204 | + $where['created_date <='] = gmdate("Y-m-d 23:59:59"); |
|
205 | 205 | } |
206 | 206 | $this->db_model->build_search('charges_list_search'); |
207 | 207 | $this->db->where($where); |
208 | - $whr= "( invoiceid =0 OR invoiceid in ( select id from invoices where confirm = 1) )"; |
|
208 | + $whr = "( invoiceid =0 OR invoiceid in ( select id from invoices where confirm = 1) )"; |
|
209 | 209 | $this->db->where($whr); |
210 | - $this->db->where('item_type <>','STANDARD'); |
|
210 | + $this->db->where('item_type <>', 'STANDARD'); |
|
211 | 211 | if ($flag) { |
212 | 212 | $query = $this->db_model->select('*', "invoice_details", "", "id", "DESC", $limit, $start); |
213 | 213 | } else { |
@@ -220,15 +220,15 @@ discard block |
||
220 | 220 | /* ASTPP 3.0 |
221 | 221 | * This function using for customer edit |
222 | 222 | */ |
223 | - function get_customer_charge_list($flag,$accountid,$start = 0, $limit = 0){ |
|
223 | + function get_customer_charge_list($flag, $accountid, $start = 0, $limit = 0) { |
|
224 | 224 | $this->db_model->build_search('charges_list_search'); |
225 | - $accountinfo=$this->session->userdata('accountinfo'); |
|
226 | - $reseller_id=$accountinfo['type']==1 ? $accountinfo['id'] : 0; |
|
227 | - $where['reseller_id']=$reseller_id; |
|
228 | - $where['accountid']=$accountid; |
|
229 | - if($this->session->userdata('advance_search') != 1){ |
|
230 | - $where['created_date >=']=gmdate("Y-m-1 00:00:00"); |
|
231 | - $where['created_date <=']=gmdate("Y-m-d 23:59:59"); |
|
225 | + $accountinfo = $this->session->userdata('accountinfo'); |
|
226 | + $reseller_id = $accountinfo['type'] == 1 ? $accountinfo['id'] : 0; |
|
227 | + $where['reseller_id'] = $reseller_id; |
|
228 | + $where['accountid'] = $accountid; |
|
229 | + if ($this->session->userdata('advance_search') != 1) { |
|
230 | + $where['created_date >='] = gmdate("Y-m-1 00:00:00"); |
|
231 | + $where['created_date <='] = gmdate("Y-m-d 23:59:59"); |
|
232 | 232 | } |
233 | 233 | if ($flag) { |
234 | 234 | $query = $this->db_model->select("*", "invoice_details", $where, "id", "DESC", $limit, $start); |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | } |
238 | 238 | return $query; |
239 | 239 | } |
240 | - function get_customer_refillreport($flag,$accountid,$start = 0, $limit = 0){ |
|
240 | + function get_customer_refillreport($flag, $accountid, $start = 0, $limit = 0) { |
|
241 | 241 | $where = array("accountid"=>$accountid); |
242 | 242 | if ($flag) { |
243 | 243 | $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC", $limit, $start); |
@@ -46,14 +46,15 @@ discard block |
||
46 | 46 | $this->db->where($where); |
47 | 47 | if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
48 | 48 | $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
49 | - }else{ |
|
49 | + } else{ |
|
50 | 50 | $this->db->order_by("callstart desc"); |
51 | 51 | } |
52 | 52 | if ($flag) { |
53 | - if (!$export) |
|
54 | - $this->db->limit($limit, $start); |
|
53 | + if (!$export) { |
|
54 | + $this->db->limit($limit, $start); |
|
55 | + } |
|
55 | 56 | $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,disposition,debit,cost,accountid,pricelist_id,calltype,is_recording,trunk_id,uniqueid'); |
56 | - }else { |
|
57 | + } else { |
|
57 | 58 | $this->db->select('count(*) as count,sum(billseconds) as billseconds,sum(debit) as total_debit,sum(cost) as total_cost,group_concat(distinct(pricelist_id)) as pricelist_ids,group_concat(distinct(trunk_id)) as trunk_ids,group_concat(distinct(accountid)) as accounts_ids'); |
58 | 59 | } |
59 | 60 | $result = $this->db->get('cdrs'); |
@@ -74,12 +75,13 @@ discard block |
||
74 | 75 | $this->db->where($where); |
75 | 76 | if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
76 | 77 | $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
77 | - }else{ |
|
78 | + } else{ |
|
78 | 79 | $this->db->order_by("callstart desc"); |
79 | 80 | } |
80 | 81 | if ($flag) { |
81 | - if (!$export) |
|
82 | - $this->db->limit($limit, $start); |
|
82 | + if (!$export) { |
|
83 | + $this->db->limit($limit, $start); |
|
84 | + } |
|
83 | 85 | $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,disposition,debit,cost,accountid,pricelist_id,calltype'); |
84 | 86 | } else { |
85 | 87 | $this->db->select('count(*) as count,sum(billseconds) as billseconds,sum(debit) as total_debit,sum(cost) as total_cost,group_concat(distinct(pricelist_id)) as pricelist_ids'); |
@@ -105,14 +107,15 @@ discard block |
||
105 | 107 | $this->db->where($where); |
106 | 108 | if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
107 | 109 | $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
108 | - }else{ |
|
110 | + } else{ |
|
109 | 111 | $this->db->order_by("callstart desc"); |
110 | 112 | } |
111 | 113 | if ($flag) { |
112 | - if (!$export) |
|
113 | - $this->db->limit($limit, $start); |
|
114 | + if (!$export) { |
|
115 | + $this->db->limit($limit, $start); |
|
116 | + } |
|
114 | 117 | $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,provider_call_cost,disposition,provider_id,cost'); |
115 | - }else { |
|
118 | + } else { |
|
116 | 119 | $this->db->select('count(*) as count,sum(billseconds) as billseconds,sum(cost) as total_cost'); |
117 | 120 | } |
118 | 121 | $result = $this->db->get('cdrs'); |
@@ -159,10 +162,11 @@ discard block |
||
159 | 162 | $accountinfo = $this->session->userdata('accountinfo'); |
160 | 163 | $where['payment_by']=$accountinfo['type']==1 ? $accountinfo['id']:-1; |
161 | 164 | if ($flag) { |
162 | - if($export) |
|
163 | - $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC","",""); |
|
164 | - else |
|
165 | - $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC", $limit, $start); |
|
165 | + if($export) { |
|
166 | + $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC","",""); |
|
167 | + } else { |
|
168 | + $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC", $limit, $start); |
|
169 | + } |
|
166 | 170 | } else { |
167 | 171 | $query = $this->db_model->countQuery("*", "payments", $where); |
168 | 172 | } |
@@ -196,7 +200,7 @@ discard block |
||
196 | 200 | $reseller_id=$accountinfo['id']; |
197 | 201 | if($accountinfo['type'] == 1){ |
198 | 202 | $where['reseller_id']=$reseller_id; |
199 | - }else{ |
|
203 | + } else{ |
|
200 | 204 | $where['reseller_id']=0; |
201 | 205 | } |
202 | 206 | if($this->session->userdata('advance_search') != 1){ |
@@ -23,179 +23,179 @@ |
||
23 | 23 | |
24 | 24 | if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
25 | 25 | class invoices_form{ |
26 | - function __construct($library_name = '') { |
|
27 | - $this->CI = & get_instance(); |
|
28 | - } |
|
29 | - function build_invoices_list_for_admin(){ |
|
30 | - $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
|
31 | - $currency_id=$account_info['currency_id']; |
|
32 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
26 | + function __construct($library_name = '') { |
|
27 | + $this->CI = & get_instance(); |
|
28 | + } |
|
29 | + function build_invoices_list_for_admin(){ |
|
30 | + $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
|
31 | + $currency_id=$account_info['currency_id']; |
|
32 | + $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
33 | 33 | |
34 | - $logintype = $this->CI->session->userdata('logintype'); |
|
35 | - $url= ($logintype==0 ||$logintype==3 ) ? "/user/user_invoice_download/":'/invoices/invoice_main_download/'; |
|
36 | - $grid_field_arr = json_encode(array( |
|
37 | - array("Number","110","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
38 | - array("Type","130","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
39 | - array("Account","130","accountid","first_name,last_name,number","accounts","build_concat_string","","true","center"), |
|
40 | - array("Generated<br/> Date","140","invoice_date","invoice_date","","get_invoice_date","","true","center"), |
|
34 | + $logintype = $this->CI->session->userdata('logintype'); |
|
35 | + $url= ($logintype==0 ||$logintype==3 ) ? "/user/user_invoice_download/":'/invoices/invoice_main_download/'; |
|
36 | + $grid_field_arr = json_encode(array( |
|
37 | + array("Number","110","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
38 | + array("Type","130","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
39 | + array("Account","130","accountid","first_name,last_name,number","accounts","build_concat_string","","true","center"), |
|
40 | + array("Generated<br/> Date","140","invoice_date","invoice_date","","get_invoice_date","","true","center"), |
|
41 | 41 | array("From Date","120","from_date","from_date","","get_from_date","","true","center"), |
42 | 42 | array("Due Date","130","","","","","","true","center"), |
43 | 43 | array("Last <br/>Pay Date","100","","","","","","true","center"), |
44 | - array("Amount($currency)","120","id","id","id","get_invoice_total","","true","right"), |
|
44 | + array("Amount($currency)","120","id","id","id","get_invoice_total","","true","right"), |
|
45 | 45 | |
46 | - array("Outstanding <br/>Amount($currency)","140","","","","","","true","right"), |
|
46 | + array("Outstanding <br/>Amount($currency)","140","","","","","","true","right"), |
|
47 | 47 | // array("Payment", "110", "payment", "", "", ""), |
48 | - array("Action","120","","","",array( |
|
49 | - "DOWNLOAD"=>array("url"=>$url,"mode"=>"single"), |
|
50 | - // "VIEW" => array("url" => "invoices/invoice_summary_payment/", "mode" => "popup") |
|
48 | + array("Action","120","","","",array( |
|
49 | + "DOWNLOAD"=>array("url"=>$url,"mode"=>"single"), |
|
50 | + // "VIEW" => array("url" => "invoices/invoice_summary_payment/", "mode" => "popup") |
|
51 | 51 | )) |
52 | - )); |
|
53 | - return $grid_field_arr; |
|
54 | - } |
|
55 | - function build_invoices_list_for_customer_admin(){ |
|
56 | - $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
|
57 | - $currency_id=$account_info['currency_id']; |
|
58 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
52 | + )); |
|
53 | + return $grid_field_arr; |
|
54 | + } |
|
55 | + function build_invoices_list_for_customer_admin(){ |
|
56 | + $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
|
57 | + $currency_id=$account_info['currency_id']; |
|
58 | + $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
59 | 59 | |
60 | - $logintype = $this->CI->session->userdata('logintype'); |
|
61 | - $url= ($logintype==0 ||$logintype==3 ) ? "/user/user_invoice_download/":'/invoices/invoice_main_download/'; |
|
62 | - $grid_field_arr = json_encode(array( |
|
63 | - array("Number","110","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
64 | - array("Type","110","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
65 | - array("Generated<br/> Date","120","invoice_date","invoice_date","","get_invoice_date","","true","center"), |
|
60 | + $logintype = $this->CI->session->userdata('logintype'); |
|
61 | + $url= ($logintype==0 ||$logintype==3 ) ? "/user/user_invoice_download/":'/invoices/invoice_main_download/'; |
|
62 | + $grid_field_arr = json_encode(array( |
|
63 | + array("Number","110","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
64 | + array("Type","110","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
65 | + array("Generated<br/> Date","120","invoice_date","invoice_date","","get_invoice_date","","true","center"), |
|
66 | 66 | array("From Date","120","from_date","from_date","","get_from_date","","true","center"), |
67 | 67 | array("Due Date","130","","","","","","true","center"), |
68 | 68 | array("Last <br/>Pay Date","100","","","","","","true","center"), |
69 | - array("Amount($currency)","100","id","id","id","get_invoice_total","","true","right"), |
|
69 | + array("Amount($currency)","100","id","id","id","get_invoice_total","","true","right"), |
|
70 | 70 | |
71 | - array("Outstanding <br/>Amount($currency)","100","","","","","","true","right"), |
|
72 | - array("Action","120","","","",array( |
|
73 | - "DOWNLOAD"=>array("url"=>$url,"mode"=>"single"), |
|
71 | + array("Outstanding <br/>Amount($currency)","100","","","","","","true","right"), |
|
72 | + array("Action","120","","","",array( |
|
73 | + "DOWNLOAD"=>array("url"=>$url,"mode"=>"single"), |
|
74 | 74 | )) |
75 | - )); |
|
76 | - return $grid_field_arr; |
|
77 | - } |
|
78 | - function build_invoices_list_for_customer(){ |
|
79 | - $url=($this->CI->session->userdata('logintype')==0 )?"/user/user_invoice_download/":'/invoices/invoice_main_download/'; |
|
80 | - // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
|
81 | - $grid_field_arr = json_encode(array( |
|
82 | - array("Number","100","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
83 | - array("Account","110","accountid","first_name,last_name,number","accounts","build_concat_string","","true","center"), |
|
84 | - array("Generated Date","140","invoice_date","invoice_date","","get_invoice_date","","true","center"), |
|
75 | + )); |
|
76 | + return $grid_field_arr; |
|
77 | + } |
|
78 | + function build_invoices_list_for_customer(){ |
|
79 | + $url=($this->CI->session->userdata('logintype')==0 )?"/user/user_invoice_download/":'/invoices/invoice_main_download/'; |
|
80 | + // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
|
81 | + $grid_field_arr = json_encode(array( |
|
82 | + array("Number","100","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
83 | + array("Account","110","accountid","first_name,last_name,number","accounts","build_concat_string","","true","center"), |
|
84 | + array("Generated Date","140","invoice_date","invoice_date","","get_invoice_date","","true","center"), |
|
85 | 85 | array("From Date","140","from_date","from_date","","get_from_date","","true","center"), |
86 | 86 | array("Due Date","150","","","","","","true","center"), |
87 | 87 | array("Last Pay Date","150","","","","","","true","center"), |
88 | - array("Amount","150","id","id","id","get_invoice_total","","true","center"), |
|
88 | + array("Amount","150","id","id","id","get_invoice_total","","true","center"), |
|
89 | 89 | array("Outstanding Amount","150","","","",""), |
90 | 90 | // array("Payment", "110", "payment", "", "", ""), |
91 | - array("Action","160","","","",array( |
|
92 | - "DOWNLOAD"=>array("url"=>$url,"mode"=>"single"), |
|
93 | - // "VIEW" => array("url" => "invoices/invoice_summary_payment/", "mode" => "popup") |
|
91 | + array("Action","160","","","",array( |
|
92 | + "DOWNLOAD"=>array("url"=>$url,"mode"=>"single"), |
|
93 | + // "VIEW" => array("url" => "invoices/invoice_summary_payment/", "mode" => "popup") |
|
94 | 94 | )) |
95 | 95 | )); |
96 | - return $grid_field_arr; |
|
97 | - } |
|
96 | + return $grid_field_arr; |
|
97 | + } |
|
98 | 98 | function get_invoice_search_form() |
99 | - { |
|
99 | + { |
|
100 | 100 | $account_data = $this->CI->session->userdata("accountinfo"); |
101 | - $reseller_id=$account_data['type']==1 ? $account_data['id']:0; |
|
102 | - $form['forms'] = array("",array('id'=>"invoice_search")); |
|
103 | - $form['Search'] = array( |
|
104 | - array('Number', 'INPUT', array('name' => 'invoiceid[invoiceid]','','size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'id[invoiceid-string]', '', '','', 'search_string_type', ''), |
|
105 | - array('From Date', 'INPUT', array('name' => 'from_date[0]','id'=>'invoice_from_date','size' => '20', 'class' => "text field"), '', 'tOOL TIP', '', 'from_date[from_date-date]'), |
|
106 | - array('To Date', 'INPUT', array('name' => 'to_date[0]','id'=>'invoice_to_date','size' => '20', 'class' => "text field"), '', 'tOOL TIP', '', 'from_date[from_date-date]'), |
|
101 | + $reseller_id=$account_data['type']==1 ? $account_data['id']:0; |
|
102 | + $form['forms'] = array("",array('id'=>"invoice_search")); |
|
103 | + $form['Search'] = array( |
|
104 | + array('Number', 'INPUT', array('name' => 'invoiceid[invoiceid]','','size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'id[invoiceid-string]', '', '','', 'search_string_type', ''), |
|
105 | + array('From Date', 'INPUT', array('name' => 'from_date[0]','id'=>'invoice_from_date','size' => '20', 'class' => "text field"), '', 'tOOL TIP', '', 'from_date[from_date-date]'), |
|
106 | + array('To Date', 'INPUT', array('name' => 'to_date[0]','id'=>'invoice_to_date','size' => '20', 'class' => "text field"), '', 'tOOL TIP', '', 'from_date[from_date-date]'), |
|
107 | 107 | |
108 | - array('Amount', 'INPUT', array('name' => 'amount[amount]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'amount[amount-string]', '', '', '', 'search_string_type', ''), |
|
109 | - array('Generated Date', 'INPUT', array('name' => 'invoice_date[0]','','size' => '20', 'class' => "text field",'id'=>'invoice_date'), '', 'tOOL TIP', '', 'invoice_date[invoice_date-date]'), |
|
110 | - array('Invoice', 'deleted', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_invoice_details'), |
|
111 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => $reseller_id,"type"=>"GLOBAL")), |
|
112 | - array('', 'HIDDEN', 'ajax_search','1', '', '', ''), |
|
113 | - array('', 'HIDDEN', 'advance_search','1', '', '', '')); |
|
108 | + array('Amount', 'INPUT', array('name' => 'amount[amount]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'amount[amount-string]', '', '', '', 'search_string_type', ''), |
|
109 | + array('Generated Date', 'INPUT', array('name' => 'invoice_date[0]','','size' => '20', 'class' => "text field",'id'=>'invoice_date'), '', 'tOOL TIP', '', 'invoice_date[invoice_date-date]'), |
|
110 | + array('Invoice', 'deleted', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_invoice_details'), |
|
111 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => $reseller_id,"type"=>"GLOBAL")), |
|
112 | + array('', 'HIDDEN', 'ajax_search','1', '', '', ''), |
|
113 | + array('', 'HIDDEN', 'advance_search','1', '', '', '')); |
|
114 | 114 | |
115 | - $form['button_search'] = array('name' => 'action', 'id'=>"invoice_search_btn",'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
116 | - $form['button_reset'] = array('name' => 'action','id'=>"id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
115 | + $form['button_search'] = array('name' => 'action', 'id'=>"invoice_search_btn",'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
116 | + $form['button_reset'] = array('name' => 'action','id'=>"id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
117 | 117 | |
118 | - return $form; |
|
119 | - } |
|
118 | + return $form; |
|
119 | + } |
|
120 | 120 | |
121 | - function build_grid_buttons(){ |
|
121 | + function build_grid_buttons(){ |
|
122 | 122 | $buttons_json = json_encode(array( |
123 | - )); |
|
123 | + )); |
|
124 | 124 | return $buttons_json; |
125 | - } |
|
126 | - function get_invoiceconf_form_fields($invoiceconf = '0'){ |
|
127 | - if(!empty($invoiceconf)){ |
|
125 | + } |
|
126 | + function get_invoiceconf_form_fields($invoiceconf = '0'){ |
|
127 | + if(!empty($invoiceconf)){ |
|
128 | 128 | if($invoiceconf['logo'] != ''){ |
129 | - $logo=$invoiceconf['file']; |
|
129 | + $logo=$invoiceconf['file']; |
|
130 | 130 | }else{ |
131 | - $logo=$invoiceconf['logo']; |
|
131 | + $logo=$invoiceconf['logo']; |
|
132 | 132 | } |
133 | - $accountid=$invoiceconf['accountid']; |
|
134 | - if($logo != ''){ |
|
135 | - $file_name= base_url()."upload/$logo"; |
|
136 | - $image_path= array('Existing Image', 'IMAGE', array('type'=>'image','name' => 'image' ,'style'=>'width:100%;margin-top:20px;','src'=> $file_name), '', 'tOOL TIP', ''); |
|
137 | - $delete_logo=array('Delete logo', 'DEL_BUTTON', array('value'=>'ankit','style'=>'margin-top:20px;','name' => 'button','id'=>'logo_delete','size' => '20', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
|
138 | - }else{ |
|
139 | - $image_path= array('Existing Image', 'HIDDEN', array('type'=>'','name' => '' ,'style'=>'width:250px;'), '', 'tOOL TIP', ''); |
|
140 | - $delete_logo= array('Delete logo', 'HIDDEN', array('value'=>'ankit','style'=>'margin-top:0px;','name' => 'button','id'=>'logo_delete','size' => '20', 'maxlength' => '100', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
|
141 | - // $image_path=array(); |
|
142 | - } |
|
133 | + $accountid=$invoiceconf['accountid']; |
|
134 | + if($logo != ''){ |
|
135 | + $file_name= base_url()."upload/$logo"; |
|
136 | + $image_path= array('Existing Image', 'IMAGE', array('type'=>'image','name' => 'image' ,'style'=>'width:100%;margin-top:20px;','src'=> $file_name), '', 'tOOL TIP', ''); |
|
137 | + $delete_logo=array('Delete logo', 'DEL_BUTTON', array('value'=>'ankit','style'=>'margin-top:20px;','name' => 'button','id'=>'logo_delete','size' => '20', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
|
138 | + }else{ |
|
139 | + $image_path= array('Existing Image', 'HIDDEN', array('type'=>'','name' => '' ,'style'=>'width:250px;'), '', 'tOOL TIP', ''); |
|
140 | + $delete_logo= array('Delete logo', 'HIDDEN', array('value'=>'ankit','style'=>'margin-top:0px;','name' => 'button','id'=>'logo_delete','size' => '20', 'maxlength' => '100', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
|
141 | + // $image_path=array(); |
|
142 | + } |
|
143 | 143 | |
144 | - }else{ |
|
145 | - $logo = ''; |
|
146 | - $file_name = ''; |
|
147 | - $accountid=0; |
|
148 | - $image_path= array('Existing Image', 'HIDDEN', array('type'=>'','name' => '' ), '', 'tOOL TIP', ''); |
|
149 | - $delete_logo= array('Delete logo', 'HIDDEN', array('value'=>'','style'=>'margin-top:0px;','name' => 'button','onclick'=>'return image_delete('.$accountid.')','size' => '20', 'maxlength' => '100', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
|
150 | - //$image_path=array(); |
|
144 | + }else{ |
|
145 | + $logo = ''; |
|
146 | + $file_name = ''; |
|
147 | + $accountid=0; |
|
148 | + $image_path= array('Existing Image', 'HIDDEN', array('type'=>'','name' => '' ), '', 'tOOL TIP', ''); |
|
149 | + $delete_logo= array('Delete logo', 'HIDDEN', array('value'=>'','style'=>'margin-top:0px;','name' => 'button','onclick'=>'return image_delete('.$accountid.')','size' => '20', 'maxlength' => '100', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
|
150 | + //$image_path=array(); |
|
151 | 151 | |
152 | 152 | |
153 | - } |
|
153 | + } |
|
154 | 154 | $form['forms'] = array(base_url() . 'invoices/invoice_conf/',array('id'=>'invoice_conf_form','method'=>'POST','name'=>'invoice_conf_form','enctype'=>'multipart/form-data')); |
155 | - $form['Configuration '] = array( |
|
156 | - array('', 'HIDDEN', array('name'=>'id'),'', '', '', ''), |
|
157 | - array('', 'HIDDEN', array('name'=>'accountid'),'', '', '', ''), |
|
158 | - // array('', 'HIDDEN', array('name' => 'start_name','value' => '1'), '', '', ''), |
|
159 | - array('Company name', 'INPUT', array('name' => 'company_name','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
160 | - array('Address', 'INPUT', array('name' => 'address','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
161 | - array('City', 'INPUT', array('name' => 'city','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
162 | - array('Province', 'INPUT', array('name' => 'province','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
163 | - array('Country', 'INPUT', array('name' => 'country','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
164 | - array('Zipcode', 'INPUT', array('name' => 'zipcode','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
165 | - array('Telephone', 'INPUT', array('name' => 'telephone','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
166 | - array('Fax', 'INPUT', array('name' => 'fax','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
167 | - array('Email Address', 'INPUT', array('name' => 'emailaddress','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
168 | - array('Website', 'INPUT', array('name' => 'website','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
155 | + $form['Configuration '] = array( |
|
156 | + array('', 'HIDDEN', array('name'=>'id'),'', '', '', ''), |
|
157 | + array('', 'HIDDEN', array('name'=>'accountid'),'', '', '', ''), |
|
158 | + // array('', 'HIDDEN', array('name' => 'start_name','value' => '1'), '', '', ''), |
|
159 | + array('Company name', 'INPUT', array('name' => 'company_name','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
160 | + array('Address', 'INPUT', array('name' => 'address','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
161 | + array('City', 'INPUT', array('name' => 'city','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
162 | + array('Province', 'INPUT', array('name' => 'province','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
163 | + array('Country', 'INPUT', array('name' => 'country','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
164 | + array('Zipcode', 'INPUT', array('name' => 'zipcode','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
165 | + array('Telephone', 'INPUT', array('name' => 'telephone','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
166 | + array('Fax', 'INPUT', array('name' => 'fax','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
167 | + array('Email Address', 'INPUT', array('name' => 'emailaddress','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
168 | + array('Website', 'INPUT', array('name' => 'website','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
169 | 169 | |
170 | 170 | |
171 | - ); |
|
172 | - $form['Invoice Configuration '] = array( |
|
173 | - array('', 'HIDDEN', array('name'=>'id'),'', '', '', ''), |
|
174 | - array('', 'HIDDEN', array('name'=>'accountid'),'', '', '', ''), |
|
175 | - array('Invoice Notification', 'invoice_notification', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_allow_invoice'), |
|
176 | - array('Invoice Due Notification', 'invoice_due_notification', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_allow_invoice'), |
|
177 | - array('Invoice Date Interval', 'INPUT', array('name' => 'interval','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
178 | - array('Notify before days', 'INPUT', array('name' => 'notify_before_day','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
179 | - array('Invoice Prefix', 'INPUT', array('name' => 'invoice_prefix','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
180 | - array('Invoice Start Form', 'INPUT', array('name' => 'invoice_start_from','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
181 | - array('Invoice Taxes number', 'INPUT', array('name' => 'invoice_taxes_number','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
182 | - array('', 'HIDDEN', array('name'=>''),'', '', '', ''), |
|
183 | - array('', 'HIDDEN', array('name'=>''),'', '', '', ''), |
|
184 | - ); |
|
171 | + ); |
|
172 | + $form['Invoice Configuration '] = array( |
|
173 | + array('', 'HIDDEN', array('name'=>'id'),'', '', '', ''), |
|
174 | + array('', 'HIDDEN', array('name'=>'accountid'),'', '', '', ''), |
|
175 | + array('Invoice Notification', 'invoice_notification', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_allow_invoice'), |
|
176 | + array('Invoice Due Notification', 'invoice_due_notification', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_allow_invoice'), |
|
177 | + array('Invoice Date Interval', 'INPUT', array('name' => 'interval','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
178 | + array('Notify before days', 'INPUT', array('name' => 'notify_before_day','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
179 | + array('Invoice Prefix', 'INPUT', array('name' => 'invoice_prefix','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
180 | + array('Invoice Start Form', 'INPUT', array('name' => 'invoice_start_from','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
181 | + array('Invoice Taxes number', 'INPUT', array('name' => 'invoice_taxes_number','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
182 | + array('', 'HIDDEN', array('name'=>''),'', '', '', ''), |
|
183 | + array('', 'HIDDEN', array('name'=>''),'', '', '', ''), |
|
184 | + ); |
|
185 | 185 | $form['Company personalization'] = array( |
186 | 186 | |
187 | 187 | |
188 | 188 | array('Website Domain', 'INPUT', array('name' => 'domain', 'size' => '20', 'maxlength' => '100', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
189 | - array('Website Header', 'INPUT', array('name' => 'website_title', 'size' => '100', 'maxlength' => '100', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
190 | - array('Website Footer', 'INPUT', array('name' => 'website_footer', 'size' => '200', 'maxlength' => '200', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
191 | - array('Company logo', 'IMAGE', array('name' => 'file','size' => '20', 'maxlength' => '100', 'class' => "",'id'=>'uploadFile','type'=>'file'),'class' => '', 'tOOL TIP', 'Please Enter account number'), |
|
189 | + array('Website Header', 'INPUT', array('name' => 'website_title', 'size' => '100', 'maxlength' => '100', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
190 | + array('Website Footer', 'INPUT', array('name' => 'website_footer', 'size' => '200', 'maxlength' => '200', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
191 | + array('Company logo', 'IMAGE', array('name' => 'file','size' => '20', 'maxlength' => '100', 'class' => "",'id'=>'uploadFile','type'=>'file'),'class' => '', 'tOOL TIP', 'Please Enter account number'), |
|
192 | 192 | //array('', 'BLANL_DIV', array('name'=>'accountid','id'=>'imagePreview'),'', '', '', ''), |
193 | 193 | $delete_logo,$image_path, |
194 | - ); |
|
195 | - $form['button_save'] = array('name' => 'action', 'content' =>'Save' , 'value' => 'save', 'type' => 'submit', 'class' => 'btn btn-line-parrot'); |
|
194 | + ); |
|
195 | + $form['button_save'] = array('name' => 'action', 'content' =>'Save' , 'value' => 'save', 'type' => 'submit', 'class' => 'btn btn-line-parrot'); |
|
196 | 196 | |
197 | - return $form; |
|
197 | + return $form; |
|
198 | 198 | |
199 | - } |
|
199 | + } |
|
200 | 200 | } |
201 | 201 | ?> |
@@ -22,74 +22,74 @@ discard block |
||
22 | 22 | ############################################################################### |
23 | 23 | |
24 | 24 | if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
25 | -class invoices_form{ |
|
25 | +class invoices_form { |
|
26 | 26 | function __construct($library_name = '') { |
27 | 27 | $this->CI = & get_instance(); |
28 | 28 | } |
29 | - function build_invoices_list_for_admin(){ |
|
29 | + function build_invoices_list_for_admin() { |
|
30 | 30 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
31 | - $currency_id=$account_info['currency_id']; |
|
32 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
31 | + $currency_id = $account_info['currency_id']; |
|
32 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
33 | 33 | |
34 | 34 | $logintype = $this->CI->session->userdata('logintype'); |
35 | - $url= ($logintype==0 ||$logintype==3 ) ? "/user/user_invoice_download/":'/invoices/invoice_main_download/'; |
|
36 | - $grid_field_arr = json_encode(array( |
|
37 | - array("Number","110","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
38 | - array("Type","130","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
39 | - array("Account","130","accountid","first_name,last_name,number","accounts","build_concat_string","","true","center"), |
|
40 | - array("Generated<br/> Date","140","invoice_date","invoice_date","","get_invoice_date","","true","center"), |
|
41 | - array("From Date","120","from_date","from_date","","get_from_date","","true","center"), |
|
42 | - array("Due Date","130","","","","","","true","center"), |
|
43 | - array("Last <br/>Pay Date","100","","","","","","true","center"), |
|
44 | - array("Amount($currency)","120","id","id","id","get_invoice_total","","true","right"), |
|
35 | + $url = ($logintype == 0 || $logintype == 3) ? "/user/user_invoice_download/" : '/invoices/invoice_main_download/'; |
|
36 | + $grid_field_arr = json_encode(array( |
|
37 | + array("Number", "110", "id", "id,'',type", "invoices", "build_concat_string", "", "true", "center"), |
|
38 | + array("Type", "130", "id", "id,'',type", "invoices", "build_concat_string", "", "true", "center"), |
|
39 | + array("Account", "130", "accountid", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"), |
|
40 | + array("Generated<br/> Date", "140", "invoice_date", "invoice_date", "", "get_invoice_date", "", "true", "center"), |
|
41 | + array("From Date", "120", "from_date", "from_date", "", "get_from_date", "", "true", "center"), |
|
42 | + array("Due Date", "130", "", "", "", "", "", "true", "center"), |
|
43 | + array("Last <br/>Pay Date", "100", "", "", "", "", "", "true", "center"), |
|
44 | + array("Amount($currency)", "120", "id", "id", "id", "get_invoice_total", "", "true", "right"), |
|
45 | 45 | |
46 | - array("Outstanding <br/>Amount($currency)","140","","","","","","true","right"), |
|
46 | + array("Outstanding <br/>Amount($currency)", "140", "", "", "", "", "", "true", "right"), |
|
47 | 47 | // array("Payment", "110", "payment", "", "", ""), |
48 | - array("Action","120","","","",array( |
|
49 | - "DOWNLOAD"=>array("url"=>$url,"mode"=>"single"), |
|
48 | + array("Action", "120", "", "", "", array( |
|
49 | + "DOWNLOAD"=>array("url"=>$url, "mode"=>"single"), |
|
50 | 50 | // "VIEW" => array("url" => "invoices/invoice_summary_payment/", "mode" => "popup") |
51 | 51 | )) |
52 | 52 | )); |
53 | 53 | return $grid_field_arr; |
54 | 54 | } |
55 | - function build_invoices_list_for_customer_admin(){ |
|
55 | + function build_invoices_list_for_customer_admin() { |
|
56 | 56 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
57 | - $currency_id=$account_info['currency_id']; |
|
58 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
57 | + $currency_id = $account_info['currency_id']; |
|
58 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
59 | 59 | |
60 | 60 | $logintype = $this->CI->session->userdata('logintype'); |
61 | - $url= ($logintype==0 ||$logintype==3 ) ? "/user/user_invoice_download/":'/invoices/invoice_main_download/'; |
|
62 | - $grid_field_arr = json_encode(array( |
|
63 | - array("Number","110","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
64 | - array("Type","110","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
65 | - array("Generated<br/> Date","120","invoice_date","invoice_date","","get_invoice_date","","true","center"), |
|
66 | - array("From Date","120","from_date","from_date","","get_from_date","","true","center"), |
|
67 | - array("Due Date","130","","","","","","true","center"), |
|
68 | - array("Last <br/>Pay Date","100","","","","","","true","center"), |
|
69 | - array("Amount($currency)","100","id","id","id","get_invoice_total","","true","right"), |
|
61 | + $url = ($logintype == 0 || $logintype == 3) ? "/user/user_invoice_download/" : '/invoices/invoice_main_download/'; |
|
62 | + $grid_field_arr = json_encode(array( |
|
63 | + array("Number", "110", "id", "id,'',type", "invoices", "build_concat_string", "", "true", "center"), |
|
64 | + array("Type", "110", "id", "id,'',type", "invoices", "build_concat_string", "", "true", "center"), |
|
65 | + array("Generated<br/> Date", "120", "invoice_date", "invoice_date", "", "get_invoice_date", "", "true", "center"), |
|
66 | + array("From Date", "120", "from_date", "from_date", "", "get_from_date", "", "true", "center"), |
|
67 | + array("Due Date", "130", "", "", "", "", "", "true", "center"), |
|
68 | + array("Last <br/>Pay Date", "100", "", "", "", "", "", "true", "center"), |
|
69 | + array("Amount($currency)", "100", "id", "id", "id", "get_invoice_total", "", "true", "right"), |
|
70 | 70 | |
71 | - array("Outstanding <br/>Amount($currency)","100","","","","","","true","right"), |
|
72 | - array("Action","120","","","",array( |
|
73 | - "DOWNLOAD"=>array("url"=>$url,"mode"=>"single"), |
|
71 | + array("Outstanding <br/>Amount($currency)", "100", "", "", "", "", "", "true", "right"), |
|
72 | + array("Action", "120", "", "", "", array( |
|
73 | + "DOWNLOAD"=>array("url"=>$url, "mode"=>"single"), |
|
74 | 74 | )) |
75 | 75 | )); |
76 | 76 | return $grid_field_arr; |
77 | 77 | } |
78 | - function build_invoices_list_for_customer(){ |
|
79 | - $url=($this->CI->session->userdata('logintype')==0 )?"/user/user_invoice_download/":'/invoices/invoice_main_download/'; |
|
78 | + function build_invoices_list_for_customer() { |
|
79 | + $url = ($this->CI->session->userdata('logintype') == 0) ? "/user/user_invoice_download/" : '/invoices/invoice_main_download/'; |
|
80 | 80 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
81 | - $grid_field_arr = json_encode(array( |
|
82 | - array("Number","100","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
83 | - array("Account","110","accountid","first_name,last_name,number","accounts","build_concat_string","","true","center"), |
|
84 | - array("Generated Date","140","invoice_date","invoice_date","","get_invoice_date","","true","center"), |
|
85 | - array("From Date","140","from_date","from_date","","get_from_date","","true","center"), |
|
86 | - array("Due Date","150","","","","","","true","center"), |
|
87 | - array("Last Pay Date","150","","","","","","true","center"), |
|
88 | - array("Amount","150","id","id","id","get_invoice_total","","true","center"), |
|
89 | - array("Outstanding Amount","150","","","",""), |
|
81 | + $grid_field_arr = json_encode(array( |
|
82 | + array("Number", "100", "id", "id,'',type", "invoices", "build_concat_string", "", "true", "center"), |
|
83 | + array("Account", "110", "accountid", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"), |
|
84 | + array("Generated Date", "140", "invoice_date", "invoice_date", "", "get_invoice_date", "", "true", "center"), |
|
85 | + array("From Date", "140", "from_date", "from_date", "", "get_from_date", "", "true", "center"), |
|
86 | + array("Due Date", "150", "", "", "", "", "", "true", "center"), |
|
87 | + array("Last Pay Date", "150", "", "", "", "", "", "true", "center"), |
|
88 | + array("Amount", "150", "id", "id", "id", "get_invoice_total", "", "true", "center"), |
|
89 | + array("Outstanding Amount", "150", "", "", "", ""), |
|
90 | 90 | // array("Payment", "110", "payment", "", "", ""), |
91 | - array("Action","160","","","",array( |
|
92 | - "DOWNLOAD"=>array("url"=>$url,"mode"=>"single"), |
|
91 | + array("Action", "160", "", "", "", array( |
|
92 | + "DOWNLOAD"=>array("url"=>$url, "mode"=>"single"), |
|
93 | 93 | // "VIEW" => array("url" => "invoices/invoice_summary_payment/", "mode" => "popup") |
94 | 94 | )) |
95 | 95 | )); |
@@ -98,89 +98,89 @@ discard block |
||
98 | 98 | function get_invoice_search_form() |
99 | 99 | { |
100 | 100 | $account_data = $this->CI->session->userdata("accountinfo"); |
101 | - $reseller_id=$account_data['type']==1 ? $account_data['id']:0; |
|
102 | - $form['forms'] = array("",array('id'=>"invoice_search")); |
|
101 | + $reseller_id = $account_data['type'] == 1 ? $account_data['id'] : 0; |
|
102 | + $form['forms'] = array("", array('id'=>"invoice_search")); |
|
103 | 103 | $form['Search'] = array( |
104 | - array('Number', 'INPUT', array('name' => 'invoiceid[invoiceid]','','size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'id[invoiceid-string]', '', '','', 'search_string_type', ''), |
|
105 | - array('From Date', 'INPUT', array('name' => 'from_date[0]','id'=>'invoice_from_date','size' => '20', 'class' => "text field"), '', 'tOOL TIP', '', 'from_date[from_date-date]'), |
|
106 | - array('To Date', 'INPUT', array('name' => 'to_date[0]','id'=>'invoice_to_date','size' => '20', 'class' => "text field"), '', 'tOOL TIP', '', 'from_date[from_date-date]'), |
|
104 | + array('Number', 'INPUT', array('name' => 'invoiceid[invoiceid]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'id[invoiceid-string]', '', '', '', 'search_string_type', ''), |
|
105 | + array('From Date', 'INPUT', array('name' => 'from_date[0]', 'id'=>'invoice_from_date', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '', 'from_date[from_date-date]'), |
|
106 | + array('To Date', 'INPUT', array('name' => 'to_date[0]', 'id'=>'invoice_to_date', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '', 'from_date[from_date-date]'), |
|
107 | 107 | |
108 | 108 | array('Amount', 'INPUT', array('name' => 'amount[amount]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'amount[amount-string]', '', '', '', 'search_string_type', ''), |
109 | - array('Generated Date', 'INPUT', array('name' => 'invoice_date[0]','','size' => '20', 'class' => "text field",'id'=>'invoice_date'), '', 'tOOL TIP', '', 'invoice_date[invoice_date-date]'), |
|
109 | + array('Generated Date', 'INPUT', array('name' => 'invoice_date[0]', '', 'size' => '20', 'class' => "text field", 'id'=>'invoice_date'), '', 'tOOL TIP', '', 'invoice_date[invoice_date-date]'), |
|
110 | 110 | array('Invoice', 'deleted', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_invoice_details'), |
111 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => $reseller_id,"type"=>"GLOBAL")), |
|
112 | - array('', 'HIDDEN', 'ajax_search','1', '', '', ''), |
|
113 | - array('', 'HIDDEN', 'advance_search','1', '', '', '')); |
|
111 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => $reseller_id, "type"=>"GLOBAL")), |
|
112 | + array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
113 | + array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
114 | 114 | |
115 | - $form['button_search'] = array('name' => 'action', 'id'=>"invoice_search_btn",'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
116 | - $form['button_reset'] = array('name' => 'action','id'=>"id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
115 | + $form['button_search'] = array('name' => 'action', 'id'=>"invoice_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
116 | + $form['button_reset'] = array('name' => 'action', 'id'=>"id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
117 | 117 | |
118 | 118 | return $form; |
119 | 119 | } |
120 | 120 | |
121 | - function build_grid_buttons(){ |
|
121 | + function build_grid_buttons() { |
|
122 | 122 | $buttons_json = json_encode(array( |
123 | 123 | )); |
124 | 124 | return $buttons_json; |
125 | 125 | } |
126 | - function get_invoiceconf_form_fields($invoiceconf = '0'){ |
|
127 | - if(!empty($invoiceconf)){ |
|
128 | - if($invoiceconf['logo'] != ''){ |
|
129 | - $logo=$invoiceconf['file']; |
|
130 | - }else{ |
|
131 | - $logo=$invoiceconf['logo']; |
|
126 | + function get_invoiceconf_form_fields($invoiceconf = '0') { |
|
127 | + if ( ! empty($invoiceconf)) { |
|
128 | + if ($invoiceconf['logo'] != '') { |
|
129 | + $logo = $invoiceconf['file']; |
|
130 | + } else { |
|
131 | + $logo = $invoiceconf['logo']; |
|
132 | 132 | } |
133 | - $accountid=$invoiceconf['accountid']; |
|
134 | - if($logo != ''){ |
|
135 | - $file_name= base_url()."upload/$logo"; |
|
136 | - $image_path= array('Existing Image', 'IMAGE', array('type'=>'image','name' => 'image' ,'style'=>'width:100%;margin-top:20px;','src'=> $file_name), '', 'tOOL TIP', ''); |
|
137 | - $delete_logo=array('Delete logo', 'DEL_BUTTON', array('value'=>'ankit','style'=>'margin-top:20px;','name' => 'button','id'=>'logo_delete','size' => '20', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
|
138 | - }else{ |
|
139 | - $image_path= array('Existing Image', 'HIDDEN', array('type'=>'','name' => '' ,'style'=>'width:250px;'), '', 'tOOL TIP', ''); |
|
140 | - $delete_logo= array('Delete logo', 'HIDDEN', array('value'=>'ankit','style'=>'margin-top:0px;','name' => 'button','id'=>'logo_delete','size' => '20', 'maxlength' => '100', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
|
133 | + $accountid = $invoiceconf['accountid']; |
|
134 | + if ($logo != '') { |
|
135 | + $file_name = base_url()."upload/$logo"; |
|
136 | + $image_path = array('Existing Image', 'IMAGE', array('type'=>'image', 'name' => 'image', 'style'=>'width:100%;margin-top:20px;', 'src'=> $file_name), '', 'tOOL TIP', ''); |
|
137 | + $delete_logo = array('Delete logo', 'DEL_BUTTON', array('value'=>'ankit', 'style'=>'margin-top:20px;', 'name' => 'button', 'id'=>'logo_delete', 'size' => '20', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
|
138 | + } else { |
|
139 | + $image_path = array('Existing Image', 'HIDDEN', array('type'=>'', 'name' => '', 'style'=>'width:250px;'), '', 'tOOL TIP', ''); |
|
140 | + $delete_logo = array('Delete logo', 'HIDDEN', array('value'=>'ankit', 'style'=>'margin-top:0px;', 'name' => 'button', 'id'=>'logo_delete', 'size' => '20', 'maxlength' => '100', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
|
141 | 141 | // $image_path=array(); |
142 | 142 | } |
143 | 143 | |
144 | - }else{ |
|
144 | + } else { |
|
145 | 145 | $logo = ''; |
146 | 146 | $file_name = ''; |
147 | - $accountid=0; |
|
148 | - $image_path= array('Existing Image', 'HIDDEN', array('type'=>'','name' => '' ), '', 'tOOL TIP', ''); |
|
149 | - $delete_logo= array('Delete logo', 'HIDDEN', array('value'=>'','style'=>'margin-top:0px;','name' => 'button','onclick'=>'return image_delete('.$accountid.')','size' => '20', 'maxlength' => '100', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
|
147 | + $accountid = 0; |
|
148 | + $image_path = array('Existing Image', 'HIDDEN', array('type'=>'', 'name' => ''), '', 'tOOL TIP', ''); |
|
149 | + $delete_logo = array('Delete logo', 'HIDDEN', array('value'=>'', 'style'=>'margin-top:0px;', 'name' => 'button', 'onclick'=>'return image_delete('.$accountid.')', 'size' => '20', 'maxlength' => '100', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
|
150 | 150 | //$image_path=array(); |
151 | 151 | |
152 | 152 | |
153 | 153 | } |
154 | - $form['forms'] = array(base_url() . 'invoices/invoice_conf/',array('id'=>'invoice_conf_form','method'=>'POST','name'=>'invoice_conf_form','enctype'=>'multipart/form-data')); |
|
154 | + $form['forms'] = array(base_url().'invoices/invoice_conf/', array('id'=>'invoice_conf_form', 'method'=>'POST', 'name'=>'invoice_conf_form', 'enctype'=>'multipart/form-data')); |
|
155 | 155 | $form['Configuration '] = array( |
156 | - array('', 'HIDDEN', array('name'=>'id'),'', '', '', ''), |
|
157 | - array('', 'HIDDEN', array('name'=>'accountid'),'', '', '', ''), |
|
156 | + array('', 'HIDDEN', array('name'=>'id'), '', '', '', ''), |
|
157 | + array('', 'HIDDEN', array('name'=>'accountid'), '', '', '', ''), |
|
158 | 158 | // array('', 'HIDDEN', array('name' => 'start_name','value' => '1'), '', '', ''), |
159 | - array('Company name', 'INPUT', array('name' => 'company_name','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
160 | - array('Address', 'INPUT', array('name' => 'address','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
161 | - array('City', 'INPUT', array('name' => 'city','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
162 | - array('Province', 'INPUT', array('name' => 'province','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
163 | - array('Country', 'INPUT', array('name' => 'country','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
164 | - array('Zipcode', 'INPUT', array('name' => 'zipcode','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
165 | - array('Telephone', 'INPUT', array('name' => 'telephone','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
166 | - array('Fax', 'INPUT', array('name' => 'fax','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
167 | - array('Email Address', 'INPUT', array('name' => 'emailaddress','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
168 | - array('Website', 'INPUT', array('name' => 'website','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
159 | + array('Company name', 'INPUT', array('name' => 'company_name', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
160 | + array('Address', 'INPUT', array('name' => 'address', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
161 | + array('City', 'INPUT', array('name' => 'city', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
162 | + array('Province', 'INPUT', array('name' => 'province', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
163 | + array('Country', 'INPUT', array('name' => 'country', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
164 | + array('Zipcode', 'INPUT', array('name' => 'zipcode', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
165 | + array('Telephone', 'INPUT', array('name' => 'telephone', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
166 | + array('Fax', 'INPUT', array('name' => 'fax', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
167 | + array('Email Address', 'INPUT', array('name' => 'emailaddress', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
168 | + array('Website', 'INPUT', array('name' => 'website', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
169 | 169 | |
170 | 170 | |
171 | 171 | ); |
172 | 172 | $form['Invoice Configuration '] = array( |
173 | - array('', 'HIDDEN', array('name'=>'id'),'', '', '', ''), |
|
174 | - array('', 'HIDDEN', array('name'=>'accountid'),'', '', '', ''), |
|
173 | + array('', 'HIDDEN', array('name'=>'id'), '', '', '', ''), |
|
174 | + array('', 'HIDDEN', array('name'=>'accountid'), '', '', '', ''), |
|
175 | 175 | array('Invoice Notification', 'invoice_notification', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_allow_invoice'), |
176 | 176 | array('Invoice Due Notification', 'invoice_due_notification', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_allow_invoice'), |
177 | - array('Invoice Date Interval', 'INPUT', array('name' => 'interval','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
178 | - array('Notify before days', 'INPUT', array('name' => 'notify_before_day','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
179 | - array('Invoice Prefix', 'INPUT', array('name' => 'invoice_prefix','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
180 | - array('Invoice Start Form', 'INPUT', array('name' => 'invoice_start_from','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
181 | - array('Invoice Taxes number', 'INPUT', array('name' => 'invoice_taxes_number','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
182 | - array('', 'HIDDEN', array('name'=>''),'', '', '', ''), |
|
183 | - array('', 'HIDDEN', array('name'=>''),'', '', '', ''), |
|
177 | + array('Invoice Date Interval', 'INPUT', array('name' => 'interval', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
178 | + array('Notify before days', 'INPUT', array('name' => 'notify_before_day', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
179 | + array('Invoice Prefix', 'INPUT', array('name' => 'invoice_prefix', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
180 | + array('Invoice Start Form', 'INPUT', array('name' => 'invoice_start_from', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
181 | + array('Invoice Taxes number', 'INPUT', array('name' => 'invoice_taxes_number', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
182 | + array('', 'HIDDEN', array('name'=>''), '', '', '', ''), |
|
183 | + array('', 'HIDDEN', array('name'=>''), '', '', '', ''), |
|
184 | 184 | ); |
185 | 185 | $form['Company personalization'] = array( |
186 | 186 | |
@@ -188,11 +188,11 @@ discard block |
||
188 | 188 | array('Website Domain', 'INPUT', array('name' => 'domain', 'size' => '20', 'maxlength' => '100', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
189 | 189 | array('Website Header', 'INPUT', array('name' => 'website_title', 'size' => '100', 'maxlength' => '100', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
190 | 190 | array('Website Footer', 'INPUT', array('name' => 'website_footer', 'size' => '200', 'maxlength' => '200', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
191 | - array('Company logo', 'IMAGE', array('name' => 'file','size' => '20', 'maxlength' => '100', 'class' => "",'id'=>'uploadFile','type'=>'file'),'class' => '', 'tOOL TIP', 'Please Enter account number'), |
|
191 | + array('Company logo', 'IMAGE', array('name' => 'file', 'size' => '20', 'maxlength' => '100', 'class' => "", 'id'=>'uploadFile', 'type'=>'file'), 'class' => '', 'tOOL TIP', 'Please Enter account number'), |
|
192 | 192 | //array('', 'BLANL_DIV', array('name'=>'accountid','id'=>'imagePreview'),'', '', '', ''), |
193 | - $delete_logo,$image_path, |
|
193 | + $delete_logo, $image_path, |
|
194 | 194 | ); |
195 | - $form['button_save'] = array('name' => 'action', 'content' =>'Save' , 'value' => 'save', 'type' => 'submit', 'class' => 'btn btn-line-parrot'); |
|
195 | + $form['button_save'] = array('name' => 'action', 'content' =>'Save', 'value' => 'save', 'type' => 'submit', 'class' => 'btn btn-line-parrot'); |
|
196 | 196 | |
197 | 197 | return $form; |
198 | 198 |
@@ -21,7 +21,9 @@ discard block |
||
21 | 21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 | 22 | ############################################################################### |
23 | 23 | |
24 | -if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
24 | +if ( ! defined('BASEPATH')) { |
|
25 | + exit('No direct script access allowed'); |
|
26 | +} |
|
25 | 27 | class invoices_form{ |
26 | 28 | function __construct($library_name = '') { |
27 | 29 | $this->CI = & get_instance(); |
@@ -127,7 +129,7 @@ discard block |
||
127 | 129 | if(!empty($invoiceconf)){ |
128 | 130 | if($invoiceconf['logo'] != ''){ |
129 | 131 | $logo=$invoiceconf['file']; |
130 | - }else{ |
|
132 | + } else{ |
|
131 | 133 | $logo=$invoiceconf['logo']; |
132 | 134 | } |
133 | 135 | $accountid=$invoiceconf['accountid']; |
@@ -135,13 +137,13 @@ discard block |
||
135 | 137 | $file_name= base_url()."upload/$logo"; |
136 | 138 | $image_path= array('Existing Image', 'IMAGE', array('type'=>'image','name' => 'image' ,'style'=>'width:100%;margin-top:20px;','src'=> $file_name), '', 'tOOL TIP', ''); |
137 | 139 | $delete_logo=array('Delete logo', 'DEL_BUTTON', array('value'=>'ankit','style'=>'margin-top:20px;','name' => 'button','id'=>'logo_delete','size' => '20', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
138 | - }else{ |
|
140 | + } else{ |
|
139 | 141 | $image_path= array('Existing Image', 'HIDDEN', array('type'=>'','name' => '' ,'style'=>'width:250px;'), '', 'tOOL TIP', ''); |
140 | 142 | $delete_logo= array('Delete logo', 'HIDDEN', array('value'=>'ankit','style'=>'margin-top:0px;','name' => 'button','id'=>'logo_delete','size' => '20', 'maxlength' => '100', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
141 | 143 | // $image_path=array(); |
142 | 144 | } |
143 | 145 | |
144 | - }else{ |
|
146 | + } else{ |
|
145 | 147 | $logo = ''; |
146 | 148 | $file_name = ''; |
147 | 149 | $accountid=0; |
@@ -165,7 +165,7 @@ |
||
165 | 165 | </div> |
166 | 166 | <div class="col-md-5"><label style="text-align:left;float:left;" class="col-md-3"><?php echo gettext('Accounts'); ?> </label> |
167 | 167 | <?php |
168 | - if($login_type == -1){ |
|
168 | + if($login_type == -1){ |
|
169 | 169 | $where="deleted = '0' AND reseller_id = '0' AND status = '0' AND (type= '0' OR type= '3' OR type= '1')"; |
170 | 170 | }if($login_type == 1){ |
171 | 171 | $where="deleted = '0' AND reseller_id = '$id' AND status = '0' AND (type= '0' OR type= '3' OR type='1')"; |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | <?php |
127 | 127 | $login_type = $this->session->userdata['userlevel_logintype']; |
128 | 128 | $account_data = $this->session->userdata("accountinfo"); |
129 | - $id= $account_data['id']; |
|
129 | + $id = $account_data['id']; |
|
130 | 130 | |
131 | 131 | ?> |
132 | 132 | |
@@ -165,15 +165,15 @@ discard block |
||
165 | 165 | </div> |
166 | 166 | <div class="col-md-5"><label style="text-align:left;float:left;" class="col-md-3"><?php echo gettext('Accounts'); ?> </label> |
167 | 167 | <?php |
168 | - if($login_type == -1){ |
|
169 | - $where="deleted = '0' AND reseller_id = '0' AND status = '0' AND (type= '0' OR type= '3' OR type= '1')"; |
|
170 | - }if($login_type == 1){ |
|
171 | - $where="deleted = '0' AND reseller_id = '$id' AND status = '0' AND (type= '0' OR type= '3' OR type='1')"; |
|
168 | + if ($login_type == -1) { |
|
169 | + $where = "deleted = '0' AND reseller_id = '0' AND status = '0' AND (type= '0' OR type= '3' OR type= '1')"; |
|
170 | + }if ($login_type == 1) { |
|
171 | + $where = "deleted = '0' AND reseller_id = '$id' AND status = '0' AND (type= '0' OR type= '3' OR type='1')"; |
|
172 | 172 | |
173 | 173 | } |
174 | - $account=$this->db_model->build_dropdown_invoices('id,first_name,last_name,number,type', 'accounts', '', $where);?> |
|
174 | + $account = $this->db_model->build_dropdown_invoices('id,first_name,last_name,number,type', 'accounts', '', $where); ?> |
|
175 | 175 | |
176 | - <?php echo form_dropdown_all('accountid', $account,''); ?> |
|
176 | + <?php echo form_dropdown_all('accountid', $account, ''); ?> |
|
177 | 177 | </div> |
178 | 178 | <div> |
179 | 179 | <div><label style="text-align:left;float:left;" class="col-md-1"><?php echo gettext('Notes'); ?> </label> |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | <tr> |
107 | 107 | <td> |
108 | 108 | <b>Due Date : </b><span style="color:#a09d9d;"><?php |
109 | - echo date('Y-m-d', strtotime($payment_due_date)) ; |
|
109 | + echo date('Y-m-d', strtotime($payment_due_date)) ; |
|
110 | 110 | ?></span> |
111 | 111 | </td> |
112 | 112 | </tr> |
@@ -143,14 +143,14 @@ discard block |
||
143 | 143 | $paypal=0; |
144 | 144 | foreach($invoice_final_query as $value){ |
145 | 145 | |
146 | - if($value['item_type'] != 'INVPAY' && $value['item_type'] != 'PAYMENT') { |
|
147 | - $debit=$value['debit']; |
|
148 | - $credit=$value['credit']; |
|
149 | - $paypal+=$credit; |
|
150 | - $created_date=$value['created_date']; |
|
151 | - $paypalid=$value['item_id']; |
|
152 | - $outstanding=$amount-$paypal; |
|
153 | - $amount_visible='0000'; |
|
146 | + if($value['item_type'] != 'INVPAY' && $value['item_type'] != 'PAYMENT') { |
|
147 | + $debit=$value['debit']; |
|
148 | + $credit=$value['credit']; |
|
149 | + $paypal+=$credit; |
|
150 | + $created_date=$value['created_date']; |
|
151 | + $paypalid=$value['item_id']; |
|
152 | + $outstanding=$amount-$paypal; |
|
153 | + $amount_visible='0000'; |
|
154 | 154 | |
155 | 155 | |
156 | 156 | |
@@ -201,13 +201,13 @@ discard block |
||
201 | 201 | foreach($invoice_total_query as $value){ |
202 | 202 | |
203 | 203 | |
204 | - $debit=$value['debit']; |
|
205 | - $credit=$value['credit']; |
|
206 | - $paypal+=$credit; |
|
207 | - $created_date=$value['created_date']; |
|
208 | - $paypalid=$value['item_id']; |
|
209 | - $outstanding=$amount-$paypal; |
|
210 | - $amount_visible='0000'; |
|
204 | + $debit=$value['debit']; |
|
205 | + $credit=$value['credit']; |
|
206 | + $paypal+=$credit; |
|
207 | + $created_date=$value['created_date']; |
|
208 | + $paypalid=$value['item_id']; |
|
209 | + $outstanding=$amount-$paypal; |
|
210 | + $amount_visible='0000'; |
|
211 | 211 | |
212 | 212 | |
213 | 213 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | </tr> |
223 | 223 | |
224 | 224 | <?php } |
225 | - } ?> |
|
225 | + } ?> |
|
226 | 226 | <tr style="background-color:#f6f6f6;"> |
227 | 227 | <th colspan="2" width="30%" > |
228 | 228 | <span class="pull-right" style="color:#474747;">Paid Amount</span> |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | </h2> |
43 | 43 | </div> |
44 | 44 | <div class="col-md-12" style="border: 1px solid #ccc; border-radius: 5px;"> |
45 | - <?php if($logintype == 0){ ?> |
|
45 | + <?php if ($logintype == 0) { ?> |
|
46 | 46 | <form name="payment_form" id="payment_form" method="POST" > |
47 | - <?php } else{?> |
|
47 | + <?php } else {?> |
|
48 | 48 | <form name="admin_form" id="admin_form" action="/invoices/invoice_admin_payment/" method="POST"> |
49 | 49 | <?php } ?> |
50 | 50 | <br/> |
@@ -72,10 +72,10 @@ discard block |
||
72 | 72 | <td> |
73 | 73 | <font style="font-weight:bold;" >Email :</font> <font style="color:#a09d9d;" > |
74 | 74 | <?php /**** harsh ***/ |
75 | - if($accountdata['email']!=""){ |
|
76 | - $attac_exp=explode(",",$accountdata['email']); |
|
77 | - foreach($attac_exp as $key=>$value){ |
|
78 | - if($value != ''){ |
|
75 | + if ($accountdata['email'] != "") { |
|
76 | + $attac_exp = explode(",", $accountdata['email']); |
|
77 | + foreach ($attac_exp as $key=>$value) { |
|
78 | + if ($value != '') { |
|
79 | 79 | echo "<br/>".$value; |
80 | 80 | } |
81 | 81 | } |
@@ -100,13 +100,13 @@ discard block |
||
100 | 100 | </tr> |
101 | 101 | <tr> |
102 | 102 | <td> |
103 | - <b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)) ; ?></span> |
|
103 | + <b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)); ?></span> |
|
104 | 104 | </td> |
105 | 105 | </tr> |
106 | 106 | <tr> |
107 | 107 | <td> |
108 | 108 | <b>Due Date : </b><span style="color:#a09d9d;"><?php |
109 | - echo date('Y-m-d', strtotime($payment_due_date)) ; |
|
109 | + echo date('Y-m-d', strtotime($payment_due_date)); |
|
110 | 110 | ?></span> |
111 | 111 | </td> |
112 | 112 | </tr> |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | <tr style=""> |
121 | 121 | <td><b >Invoice Amount :</b></td> |
122 | 122 | <?php |
123 | -if(!empty($invoice_date)){ |
|
123 | +if ( ! empty($invoice_date)) { |
|
124 | 124 | ?> |
125 | - <td><span class="pull-right" style="color:#3278b6"><b><?php echo $this->common->currency_decimal($amount); ?> <?php echo $to_currency; ?></b> </span></td> |
|
125 | + <td><span class="pull-right" style="color:#3278b6"><b><?php echo $this->common->currency_decimal($amount); ?> <?php echo $to_currency; ?></b> </span></td> |
|
126 | 126 | <input type="hidden" name="total_amount" id="total_amount" class="article" value="<?php echo $amount; ?>" > |
127 | 127 | <input type="hidden" readonly name="recharge" value="paypal_invoice"> |
128 | 128 | </tr> |
@@ -140,24 +140,24 @@ discard block |
||
140 | 140 | </th> |
141 | 141 | </tr> |
142 | 142 | <?php |
143 | -$paypal=0; |
|
144 | - foreach($invoice_final_query as $value){ |
|
143 | +$paypal = 0; |
|
144 | + foreach ($invoice_final_query as $value) { |
|
145 | 145 | |
146 | - if($value['item_type'] != 'INVPAY' && $value['item_type'] != 'PAYMENT') { |
|
147 | - $debit=$value['debit']; |
|
148 | - $credit=$value['credit']; |
|
149 | - $paypal+=$credit; |
|
150 | - $created_date=$value['created_date']; |
|
151 | - $paypalid=$value['item_id']; |
|
152 | - $outstanding=$amount-$paypal; |
|
153 | - $amount_visible='0000'; |
|
146 | + if ($value['item_type'] != 'INVPAY' && $value['item_type'] != 'PAYMENT') { |
|
147 | + $debit = $value['debit']; |
|
148 | + $credit = $value['credit']; |
|
149 | + $paypal += $credit; |
|
150 | + $created_date = $value['created_date']; |
|
151 | + $paypalid = $value['item_id']; |
|
152 | + $outstanding = $amount - $paypal; |
|
153 | + $amount_visible = '0000'; |
|
154 | 154 | |
155 | 155 | |
156 | 156 | |
157 | 157 | ?> |
158 | 158 | <tr style="height:20px;"> |
159 | 159 | <td><?php echo $value['description']; ?> </td> |
160 | - <td><div class="pull-right"><?php echo $this->common->currency_decimal($this->common_model->calculate_currency($debit)); ?> <?php echo $to_currency; ?></div></td> |
|
160 | + <td><div class="pull-right"><?php echo $this->common->currency_decimal($this->common_model->calculate_currency($debit)); ?> <?php echo $to_currency; ?></div></td> |
|
161 | 161 | <input type="hidden" name="new_amount" value="<?php echo $this->common->currency_decimal($this->common_model->calculate_currency($debit)); ?>"> |
162 | 162 | |
163 | 163 | |
@@ -196,18 +196,18 @@ discard block |
||
196 | 196 | |
197 | 197 | </tr> |
198 | 198 | <?php |
199 | -$paypal=0; |
|
200 | -if($invoice_date){ |
|
201 | - foreach($invoice_total_query as $value){ |
|
199 | +$paypal = 0; |
|
200 | +if ($invoice_date) { |
|
201 | + foreach ($invoice_total_query as $value) { |
|
202 | 202 | |
203 | 203 | |
204 | - $debit=$value['debit']; |
|
205 | - $credit=$value['credit']; |
|
206 | - $paypal+=$credit; |
|
207 | - $created_date=$value['created_date']; |
|
208 | - $paypalid=$value['item_id']; |
|
209 | - $outstanding=$amount-$paypal; |
|
210 | - $amount_visible='0000'; |
|
204 | + $debit = $value['debit']; |
|
205 | + $credit = $value['credit']; |
|
206 | + $paypal += $credit; |
|
207 | + $created_date = $value['created_date']; |
|
208 | + $paypalid = $value['item_id']; |
|
209 | + $outstanding = $amount - $paypal; |
|
210 | + $amount_visible = '0000'; |
|
211 | 211 | |
212 | 212 | |
213 | 213 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | <tr> |
216 | 216 | <td> <?php echo date('Y-m-d ', strtotime($created_date)) ?></td> |
217 | 217 | <td><?php echo $value['description']; ?> <?php echo $paypalid; ?></td> |
218 | - <td><div class="pull-right"><?php echo $this->common->currency_decimal($this->common_model->calculate_currency($credit)); ?> <?php echo $to_currency; ?></div></td> |
|
218 | + <td><div class="pull-right"><?php echo $this->common->currency_decimal($this->common_model->calculate_currency($credit)); ?> <?php echo $to_currency; ?></div></td> |
|
219 | 219 | <input type="hidden" name="new_amount" value="<?php echo $this->common->currency_decimal($this->common_model->calculate_currency($debit)); ?>"> |
220 | 220 | |
221 | 221 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | </th> |
231 | 231 | <td align="right"> |
232 | 232 | <!--0--> |
233 | - <b><?php if($paypal){ echo $this->common->currency_decimal($this->common_model->calculate_currency($paypal)); }else { echo $this->common->currency_decimal($this->common_model->calculate_currency($amount_visible)); ;}?> <?php echo $to_currency; ?></b> |
|
233 | + <b><?php if ($paypal) { echo $this->common->currency_decimal($this->common_model->calculate_currency($paypal)); } else { echo $this->common->currency_decimal($this->common_model->calculate_currency($amount_visible)); ;}?> <?php echo $to_currency; ?></b> |
|
234 | 234 | </td> |
235 | 235 | |
236 | 236 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | |
252 | 252 | <tr style=""> |
253 | 253 | <td><b >Outstanding Amount :</b></td> |
254 | - <td><span class="pull-right" style="color:#3278b6"><b><?php if($debit == ''){ echo $this->common->currency_decimal($outstanding); ?> <?php echo $to_currency; }else { echo $this->common->currency_decimal($outstanding); ?> <?php echo $to_currency; } ?></b> </span></td> |
|
254 | + <td><span class="pull-right" style="color:#3278b6"><b><?php if ($debit == '') { echo $this->common->currency_decimal($outstanding); ?> <?php echo $to_currency; } else { echo $this->common->currency_decimal($outstanding); ?> <?php echo $to_currency; } ?></b> </span></td> |
|
255 | 255 | <input type="hidden" name="total_amount" id="total_amount" class="article" value="<?php echo $this->common->currency_decimal($amount); ?>" > |
256 | 256 | </tr> |
257 | 257 | </table> |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | <td width="50%" valign="top"> |
263 | 263 | </td> |
264 | 264 | <td width="50%" valign="top" style="border-left:2px solid #ccc;"> |
265 | - <?php if($logintype == 0 || $logintype == 3){ ?> |
|
265 | + <?php if ($logintype == 0 || $logintype == 3) { ?> |
|
266 | 266 | <table class="invoice_table1 pull-right"> |
267 | 267 | <tr style="border-bottom:2px solid #dfdfe1; color:#474747;"><th colspan="2">Payment Amount :</th></tr> |
268 | 268 | <tr> |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | </td> |
299 | 299 | </tr> |
300 | 300 | </table> |
301 | -<?php }elseif($logintype == 1){?> |
|
301 | +<?php }elseif ($logintype == 1) {?> |
|
302 | 302 | <table class="invoice_table1 pull-right"> |
303 | 303 | <tr style="border-bottom:2px solid #dfdfe1; color:#474747;"><th colspan="2">Payment Amount :</th></tr> |
304 | 304 | <tr> |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | </tr> |
321 | 321 | </table> |
322 | 322 | |
323 | -<?php }else{ ?> |
|
323 | +<?php } else { ?> |
|
324 | 324 | <table class="invoice_table1 pull-right"> |
325 | 325 | <tr style="border-bottom:2px solid #dfdfe1; color:#474747;"><th colspan="2">Payment Amount :</th></tr> |
326 | 326 | <tr> |
@@ -352,15 +352,15 @@ discard block |
||
352 | 352 | |
353 | 353 | <div class="col-md-12 padding-b-20"> |
354 | 354 | <div class="" style="margin-left:400px;"> |
355 | - <?php if($logintype == 0 ){ ?> |
|
355 | + <?php if ($logintype == 0) { ?> |
|
356 | 356 | <?php |
357 | -if($logintype == 0 && $accountdata['paypal_permission']== 0){ |
|
357 | +if ($logintype == 0 && $accountdata['paypal_permission'] == 0) { |
|
358 | 358 | ?> |
359 | - <input class="btn btn-line-parrot search_generate_bar" name="Paynow" id="Paynow" value="Pay With Paypal" type="button" onclick="return payment('<?php echo $paypal_url; ?>'); "> |
|
359 | + <input class="btn btn-line-parrot search_generate_bar" name="Paynow" id="Paynow" value="Pay With Paypal" type="button" onclick="return payment('<?php echo $paypal_url; ?>'); "> |
|
360 | 360 | <input id="ok" class="btn btn-line-sky margin-x-10" type="button" value="Cancel" onclick="window.history.back();"; name="action"> |
361 | 361 | <?php } } ?> |
362 | 362 | <div class="margin-t-20 "> |
363 | - <?php if($logintype == 2 || $logintype == 1){ ?> |
|
363 | + <?php if ($logintype == 2 || $logintype == 1) { ?> |
|
364 | 364 | <input class="btn btn-line-parrot search_generate_bar" name="action" name="save" id="save" value="Pay Now" type="button" onclick="return amidn_pay(); "> |
365 | 365 | <input id="ok" class="btn btn-line-sky margin-x-10" type="button" value="Cancel" onclick="window.history.back();" name="action"> |
366 | 366 | </div> |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | <input type="hidden" readonly name="quantity" value="1"> |
399 | 399 | <input type="hidden" readonly name="rm" value="2"> |
400 | 400 | <input type="hidden" readonly name="no_shipping" value="1"> |
401 | - <input type="hidden" readonly name="PHPSESSID" value="<?=session_id();?>"> |
|
401 | + <input type="hidden" readonly name="PHPSESSID" value="<?=session_id(); ?>"> |
|
402 | 402 | <input type="hidden" readonly name="currency_code" value="USD"> |
403 | 403 | <input type="hidden" readonly name="notify_url" value="<?=$notify_url?>"> |
404 | 404 | <input type="hidden" readonly name="return" value="<?=$response_url?>"> |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | </th> |
231 | 231 | <td align="right"> |
232 | 232 | <!--0--> |
233 | - <b><?php if($paypal){ echo $this->common->currency_decimal($this->common_model->calculate_currency($paypal)); }else { echo $this->common->currency_decimal($this->common_model->calculate_currency($amount_visible)); ;}?> <?php echo $to_currency; ?></b> |
|
233 | + <b><?php if($paypal){ echo $this->common->currency_decimal($this->common_model->calculate_currency($paypal)); } else { echo $this->common->currency_decimal($this->common_model->calculate_currency($amount_visible)); ;}?> <?php echo $to_currency; ?></b> |
|
234 | 234 | </td> |
235 | 235 | |
236 | 236 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | |
252 | 252 | <tr style=""> |
253 | 253 | <td><b >Outstanding Amount :</b></td> |
254 | - <td><span class="pull-right" style="color:#3278b6"><b><?php if($debit == ''){ echo $this->common->currency_decimal($outstanding); ?> <?php echo $to_currency; }else { echo $this->common->currency_decimal($outstanding); ?> <?php echo $to_currency; } ?></b> </span></td> |
|
254 | + <td><span class="pull-right" style="color:#3278b6"><b><?php if($debit == ''){ echo $this->common->currency_decimal($outstanding); ?> <?php echo $to_currency; } else { echo $this->common->currency_decimal($outstanding); ?> <?php echo $to_currency; } ?></b> </span></td> |
|
255 | 255 | <input type="hidden" name="total_amount" id="total_amount" class="article" value="<?php echo $this->common->currency_decimal($amount); ?>" > |
256 | 256 | </tr> |
257 | 257 | </table> |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | </td> |
299 | 299 | </tr> |
300 | 300 | </table> |
301 | -<?php }elseif($logintype == 1){?> |
|
301 | +<?php } elseif($logintype == 1){?> |
|
302 | 302 | <table class="invoice_table1 pull-right"> |
303 | 303 | <tr style="border-bottom:2px solid #dfdfe1; color:#474747;"><th colspan="2">Payment Amount :</th></tr> |
304 | 304 | <tr> |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | </tr> |
321 | 321 | </table> |
322 | 322 | |
323 | -<?php }else{ ?> |
|
323 | +<?php } else{ ?> |
|
324 | 324 | <table class="invoice_table1 pull-right"> |
325 | 325 | <tr style="border-bottom:2px solid #dfdfe1; color:#474747;"><th colspan="2">Payment Amount :</th></tr> |
326 | 326 | <tr> |
@@ -164,7 +164,7 @@ |
||
164 | 164 | <tr> |
165 | 165 | <td> |
166 | 166 | <b>Due Date : </b><span style="color:#a09d9d;"><?php |
167 | - echo date('Y-m-d', strtotime($payment_due_date)) ; |
|
167 | + echo date('Y-m-d', strtotime($payment_due_date)) ; |
|
168 | 168 | ?></span> |
169 | 169 | </td> |
170 | 170 | </tr> |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | } |
47 | 47 | var taxe_rate=0; |
48 | - var taxes_acc='<?= $taxes_to_accounts;?>'; |
|
48 | + var taxes_acc='<?= $taxes_to_accounts; ?>'; |
|
49 | 49 | var tax_per = '<?= $total_tax ?>'; |
50 | 50 | var total_tax=sum*tax_per/100; |
51 | 51 | $("#total_tax").html(total_tax.toFixed(2)); |
@@ -133,10 +133,10 @@ discard block |
||
133 | 133 | <font style="font-weight:bold;" >Email :</font> <font style="color:#a09d9d;" > |
134 | 134 | |
135 | 135 | <?php |
136 | - if($accountdata['email']!=""){ |
|
137 | - $attac_exp=explode(",",$accountdata['email']); |
|
138 | - foreach($attac_exp as $key=>$value){ |
|
139 | - if($value != ''){ |
|
136 | + if ($accountdata['email'] != "") { |
|
137 | + $attac_exp = explode(",", $accountdata['email']); |
|
138 | + foreach ($attac_exp as $key=>$value) { |
|
139 | + if ($value != '') { |
|
140 | 140 | echo $value; |
141 | 141 | } |
142 | 142 | } |
@@ -158,13 +158,13 @@ discard block |
||
158 | 158 | </tr> |
159 | 159 | <tr> |
160 | 160 | <td> |
161 | - <b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)) ; ?></span> |
|
161 | + <b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)); ?></span> |
|
162 | 162 | </td> |
163 | 163 | </tr> |
164 | 164 | <tr> |
165 | 165 | <td> |
166 | 166 | <b>Due Date : </b><span style="color:#a09d9d;"><?php |
167 | - echo date('Y-m-d', strtotime($payment_due_date)) ; |
|
167 | + echo date('Y-m-d', strtotime($payment_due_date)); |
|
168 | 168 | ?></span> |
169 | 169 | </td> |
170 | 170 | </tr> |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | <table width="50%" border="1" colspan="2" class="invoice_table4 pull-right"> |
178 | 178 | <tr style='border:2px;'> |
179 | 179 | <td height=35px style="padding-left:5px;"><b >Invoice Amount :</b></td> |
180 | - <td><span class="pull-right" style="color:#3278b6"><b><?php echo $this->common->currency_decimal($amount); ?> <?php echo $to_currency; ?></b> </span></td> |
|
180 | + <td><span class="pull-right" style="color:#3278b6"><b><?php echo $this->common->currency_decimal($amount); ?> <?php echo $to_currency; ?></b> </span></td> |
|
181 | 181 | <input type="hidden" name="total_amount" id="total_amount" class="article" value="<?php echo $amount; ?>" > |
182 | 182 | <input type="hidden" readonly name="recharge" value="paypal_invoice"> |
183 | 183 | </tr> |
@@ -195,11 +195,11 @@ discard block |
||
195 | 195 | <th >Amount</th> |
196 | 196 | </tr> |
197 | 197 | <?php |
198 | -for($i=1;$i <= $row_count ;$i++){ |
|
199 | -if($get_data['invoice_amount_'.$i] > 0){ |
|
200 | -$invoice_amt=$this->common->currency_decimal($this->common_model->calculate_currency($get_data['invoice_amount_'.$i])); |
|
201 | -}else{ |
|
202 | -$invoice_amt=''; |
|
198 | +for ($i = 1; $i <= $row_count; $i++) { |
|
199 | +if ($get_data['invoice_amount_'.$i] > 0) { |
|
200 | +$invoice_amt = $this->common->currency_decimal($this->common_model->calculate_currency($get_data['invoice_amount_'.$i])); |
|
201 | +} else { |
|
202 | +$invoice_amt = ''; |
|
203 | 203 | } |
204 | 204 | ?> |
205 | 205 | <tr> |
@@ -221,8 +221,8 @@ discard block |
||
221 | 221 | </td> |
222 | 222 | </tr> |
223 | 223 | <?php |
224 | -$taxi=0; |
|
225 | -foreach($taxes_to_accounts as $tax_val){ |
|
224 | +$taxi = 0; |
|
225 | +foreach ($taxes_to_accounts as $tax_val) { |
|
226 | 226 | |
227 | 227 | ?> |
228 | 228 | <input type="hidden" id="total_tax_input_<?= $taxi; ?>" name="total_tax_input_<?= $taxi; ?>" value="<?= $tax_val['taxes_rate']; ?>" > |
@@ -242,7 +242,7 @@ |
||
242 | 242 | for($i=1;$i<=$row_count;$i++){ |
243 | 243 | if($get_data['invoice_amount_'.$i] > 0){ |
244 | 244 | $invoice_amt=$this->common->currency_decimal($this->common_model->calculate_currency($get_data['invoice_amount_'.$i])); |
245 | -}else{ |
|
245 | +} else{ |
|
246 | 246 | $invoice_amt=''; |
247 | 247 | } |
248 | 248 | ?> |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | <div align="left"> |
64 | 64 | <table border="0" class="details_table"> |
65 | 65 | <tr class="invoice_heading"><td> |
66 | -To : <?=$accountinfo['first_name'];?> <?=$accountinfo['last_name']?> |
|
66 | +To : <?=$accountinfo['first_name']; ?> <?=$accountinfo['last_name']?> |
|
67 | 67 | </td></tr> |
68 | 68 | <tr><td> |
69 | 69 | Company name : <?=$accountinfo['company_name']?> |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | <td width="25%"><div align="center">Invoice Date</div></td> |
92 | 92 | </tr> |
93 | 93 | <tr> |
94 | - <td><div align="center"><?=$accountinfo['cc'];?></div></td> |
|
95 | - <td><div align="center"><?=$accountinfo['number'];?></div></td> |
|
94 | + <td><div align="center"><?=$accountinfo['cc']; ?></div></td> |
|
95 | + <td><div align="center"><?=$accountinfo['number']; ?></div></td> |
|
96 | 96 | <td><div align="center"><?=@$invoiceid?></div></td> |
97 | 97 | <td><div align="center"><?=@$invoicedate?></div></td> |
98 | 98 | </tr> |
@@ -109,8 +109,8 @@ discard block |
||
109 | 109 | </tr> |
110 | 110 | |
111 | 111 | <?php |
112 | - if(sizeof($invoice_cdr_list)>0) { |
|
113 | - foreach($invoice_cdr_list as $key => $value) {?> |
|
112 | + if (sizeof($invoice_cdr_list) > 0) { |
|
113 | + foreach ($invoice_cdr_list as $key => $value) {?> |
|
114 | 114 | <TR> |
115 | 115 | <TD><?=$value['callstart']?></TD> |
116 | 116 | <TD><?=$value['callerid']?></TD> |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | </tr> |
134 | 134 | |
135 | 135 | <?php |
136 | - if(sizeof($invoice_total_list)>0) { |
|
137 | - foreach($invoice_total_list as $key => $value) |
|
136 | + if (sizeof($invoice_total_list) > 0) { |
|
137 | + foreach ($invoice_total_list as $key => $value) |
|
138 | 138 | {?> |
139 | 139 | <TR> |
140 | 140 | <TD></td> |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | <tr> |
188 | 188 | <td> |
189 | 189 | <b>Due Date : </b><span style="color:#a09d9d;"><?php |
190 | - echo date('Y-m-d', strtotime($payment_due_date)) ; |
|
190 | + echo date('Y-m-d', strtotime($payment_due_date)) ; |
|
191 | 191 | ?></span> |
192 | 192 | </td> |
193 | 193 | </tr> |
@@ -221,9 +221,9 @@ discard block |
||
221 | 221 | $j=1; |
222 | 222 | |
223 | 223 | foreach($invoice_total_query as $value){ |
224 | - $id=$value['id']; |
|
225 | - $debit=$value['debit']; |
|
226 | - $created_date=$value['created_date']; |
|
224 | + $id=$value['id']; |
|
225 | + $debit=$value['debit']; |
|
226 | + $created_date=$value['created_date']; |
|
227 | 227 | ?> |
228 | 228 | <tr> |
229 | 229 | <td width="20" align="center"> |
@@ -156,10 +156,10 @@ discard block |
||
156 | 156 | <td> |
157 | 157 | <font style="font-weight:bold;" >Email :</font> <font style="color:#a09d9d;" > |
158 | 158 | <?php /**** harsh ***/ |
159 | - if($accountdata['email']!=""){ |
|
160 | - $attac_exp=explode(",",$accountdata['email']); |
|
161 | - foreach($attac_exp as $key=>$value){ |
|
162 | - if($value != ''){ |
|
159 | + if ($accountdata['email'] != "") { |
|
160 | + $attac_exp = explode(",", $accountdata['email']); |
|
161 | + foreach ($attac_exp as $key=>$value) { |
|
162 | + if ($value != '') { |
|
163 | 163 | echo $value; |
164 | 164 | } |
165 | 165 | } |
@@ -181,13 +181,13 @@ discard block |
||
181 | 181 | </tr> |
182 | 182 | <tr> |
183 | 183 | <td> |
184 | - <b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)) ; ?></span> |
|
184 | + <b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)); ?></span> |
|
185 | 185 | </td> |
186 | 186 | </tr> |
187 | 187 | <tr> |
188 | 188 | <td> |
189 | 189 | <b>Due Date : </b><span style="color:#a09d9d;"><?php |
190 | - echo date('Y-m-d', strtotime($payment_due_date)) ; |
|
190 | + echo date('Y-m-d', strtotime($payment_due_date)); |
|
191 | 191 | ?></span> |
192 | 192 | </td> |
193 | 193 | </tr> |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | <table width="50%" border="1" colspan="2" class="invoice_table4 pull-right"> |
201 | 201 | <tr style='background-color:#375c7c;color:#fff;height:30px;'> |
202 | 202 | <td><b >Invoice Amount :</b></td> |
203 | - <td><span class="pull-right" style="color:#3278b6"><b><?php echo $this->common->currency_decimal($amount); ?> <?php echo $to_currency; ?></b> </span></td> |
|
203 | + <td><span class="pull-right" style="color:#3278b6"><b><?php echo $this->common->currency_decimal($amount); ?> <?php echo $to_currency; ?></b> </span></td> |
|
204 | 204 | <input type="hidden" name="total_amount" id="total_amount" class="article" value="<?php echo $amount; ?>" > |
205 | 205 | <input type="hidden" readonly name="recharge" value="paypal_invoice"> |
206 | 206 | </tr> |
@@ -218,12 +218,12 @@ discard block |
||
218 | 218 | <th >Amount</th> |
219 | 219 | </tr> |
220 | 220 | <?php |
221 | -$j=1; |
|
221 | +$j = 1; |
|
222 | 222 | |
223 | - foreach($invoice_total_query as $value){ |
|
224 | - $id=$value['id']; |
|
225 | - $debit=$value['debit']; |
|
226 | - $created_date=$value['created_date']; |
|
223 | + foreach ($invoice_total_query as $value) { |
|
224 | + $id = $value['id']; |
|
225 | + $debit = $value['debit']; |
|
226 | + $created_date = $value['created_date']; |
|
227 | 227 | ?> |
228 | 228 | <tr> |
229 | 229 | <td width="20" align="center"> |
@@ -239,11 +239,11 @@ discard block |
||
239 | 239 | <?php |
240 | 240 | $j++; |
241 | 241 | } |
242 | -for($i=1;$i<=$row_count;$i++){ |
|
243 | -if($get_data['invoice_amount_'.$i] > 0){ |
|
244 | -$invoice_amt=$this->common->currency_decimal($this->common_model->calculate_currency($get_data['invoice_amount_'.$i])); |
|
245 | -}else{ |
|
246 | -$invoice_amt=''; |
|
242 | +for ($i = 1; $i <= $row_count; $i++) { |
|
243 | +if ($get_data['invoice_amount_'.$i] > 0) { |
|
244 | +$invoice_amt = $this->common->currency_decimal($this->common_model->calculate_currency($get_data['invoice_amount_'.$i])); |
|
245 | +} else { |
|
246 | +$invoice_amt = ''; |
|
247 | 247 | } |
248 | 248 | ?> |
249 | 249 | <tr> |
@@ -274,8 +274,8 @@ discard block |
||
274 | 274 | </tr> |
275 | 275 | --> |
276 | 276 | <?php |
277 | -$taxi=0; |
|
278 | -foreach($taxes_to_accounts as $tax_val){ |
|
277 | +$taxi = 0; |
|
278 | +foreach ($taxes_to_accounts as $tax_val) { |
|
279 | 279 | |
280 | 280 | ?> |
281 | 281 | <input type="hidden" id="total_tax_input_<?= $taxi; ?>" name="total_tax_input_<?= $taxi; ?>" value="<?= $tax_val['taxes_rate']; ?>" > |
@@ -242,7 +242,7 @@ |
||
242 | 242 | for($i=1;$i<=$row_count;$i++){ |
243 | 243 | if($get_data['invoice_amount_'.$i] > 0){ |
244 | 244 | $invoice_amt=$this->common->currency_decimal($this->common_model->calculate_currency($get_data['invoice_amount_'.$i])); |
245 | -}else{ |
|
245 | +} else{ |
|
246 | 246 | $invoice_amt=''; |
247 | 247 | } |
248 | 248 | ?> |
@@ -14,7 +14,7 @@ |
||
14 | 14 | <div class="w-section inverse no-padding"> |
15 | 15 | <?php echo $form; ?> |
16 | 16 | <?php |
17 | - if(isset($validation_errors) && $validation_errors != ''){ ?> |
|
17 | + if(isset($validation_errors) && $validation_errors != ''){ ?> |
|
18 | 18 | <script> |
19 | 19 | var ERR_STR = '<?php echo $validation_errors; ?>'; |
20 | 20 | print_error(ERR_STR); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <? extend('master.php') ?> |
2 | -<?php error_reporting(E_ERROR);?> |
|
2 | +<?php error_reporting(E_ERROR); ?> |
|
3 | 3 | <? startblock('extra_head') ?> |
4 | 4 | |
5 | 5 | <?php endblock() ?> |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | <div class="w-section inverse no-padding"> |
15 | 15 | <?php echo $form; ?> |
16 | 16 | <?php |
17 | - if(isset($validation_errors) && $validation_errors != ''){ ?> |
|
17 | + if (isset($validation_errors) && $validation_errors != '') { ?> |
|
18 | 18 | <script> |
19 | 19 | var ERR_STR = '<?php echo $validation_errors; ?>'; |
20 | 20 | print_error(ERR_STR); |