@@ -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 rates_form { |
@@ -28,29 +28,29 @@ discard block |
||
28 | 28 | $this->CI = & get_instance(); |
29 | 29 | } |
30 | 30 | function get_termination_rate_form_fields() { |
31 | - $form['forms'] = array(base_url() . 'rates/termination_rate_save/', array('id' => 'termination_rate_form', 'method' => 'POST', 'name' => 'termination_rate_form')); |
|
31 | + $form['forms'] = array(base_url().'rates/termination_rate_save/', array('id' => 'termination_rate_form', 'method' => 'POST', 'name' => 'termination_rate_form')); |
|
32 | 32 | $form['Rate Information'] = array( |
33 | 33 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
34 | 34 | array('Trunk', 'trunk_id', 'SELECT', '', 'dropdown', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0")), |
35 | - array('Code', 'INPUT', array('name' => 'pattern', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''), |
|
36 | - array('Destination', 'INPUT', array('name' => 'comment', 'size' => '20', 'class' => "text field medium"), 'tOOL TIP', ''), |
|
37 | - array('Strip', 'INPUT', array('name' => 'strip', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
38 | - array('Prepend', 'INPUT', array('name' => 'prepend', 'size' => '20', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''), |
|
35 | + array('Code', 'INPUT', array('name' => 'pattern', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''), |
|
36 | + array('Destination', 'INPUT', array('name' => 'comment', 'size' => '20', 'class' => "text field medium"), 'tOOL TIP', ''), |
|
37 | + array('Strip', 'INPUT', array('name' => 'strip', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
38 | + array('Prepend', 'INPUT', array('name' => 'prepend', 'size' => '20', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''), |
|
39 | 39 | array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_status'), |
40 | 40 | |
41 | 41 | |
42 | 42 | ); |
43 | 43 | $form['Billing Information'] = array( |
44 | - array('Connect Cost', 'INPUT', array('name' => 'connectcost', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|currency_decimal|xss_clean', 'tOOL TIP', ''), |
|
44 | + array('Connect Cost', 'INPUT', array('name' => 'connectcost', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|currency_decimal|xss_clean', 'tOOL TIP', ''), |
|
45 | 45 | array('Included Seconds', 'INPUT', array('name' => 'includedseconds', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''), |
46 | 46 | array('Per Minute Cost', 'INPUT', array('name' => 'cost', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|currency_decimal|xss_clean', 'tOOL TIP', ''), |
47 | 47 | /** |
48 | 48 | ASTPP 3.0 |
49 | 49 | For Add Initial Increment field |
50 | 50 | **/ |
51 | - array('Initial Increment', 'INPUT', array('name' => 'init_inc', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''), |
|
51 | + array('Initial Increment', 'INPUT', array('name' => 'init_inc', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''), |
|
52 | 52 | /*******************************************************/ |
53 | - array('Increment', 'INPUT', array('name' => 'inc', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''), |
|
53 | + array('Increment', 'INPUT', array('name' => 'inc', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''), |
|
54 | 54 | array('Priority', 'INPUT', array('name' => 'precedence', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', '')); |
55 | 55 | |
56 | 56 | $form['button_cancel'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')'); |
@@ -60,14 +60,14 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | function get_origination_rate_form_fields() { |
63 | - $logintype=$this->CI->session->userdata('userlevel_logintype'); |
|
64 | - $trunk=null; |
|
65 | - if($logintype !=1) |
|
63 | + $logintype = $this->CI->session->userdata('userlevel_logintype'); |
|
64 | + $trunk = null; |
|
65 | + if ($logintype != 1) |
|
66 | 66 | $trunk = array('Force Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0")); |
67 | - $form['forms'] = array(base_url() . 'rates/origination_rate_save/', array('id' => 'origination_rate_form', 'method' => 'POST', 'name' => 'origination_rate_form')); |
|
67 | + $form['forms'] = array(base_url().'rates/origination_rate_save/', array('id' => 'origination_rate_form', 'method' => 'POST', 'name' => 'origination_rate_form')); |
|
68 | 68 | $form['Rate Information'] = array( |
69 | 69 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
70 | - array('Rate Group', 'pricelist_id', 'SELECT', '','', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0",'reseller_id'=>0)), |
|
70 | + array('Rate Group', 'pricelist_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0", 'reseller_id'=>0)), |
|
71 | 71 | array('Code', 'INPUT', array('name' => 'pattern', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''), |
72 | 72 | array('Destination', 'INPUT', array('name' => 'comment', 'size' => '20', 'class' => "text field medium"), 'tOOL TIP', ''), |
73 | 73 | //array('Priority', 'INPUT', array('name' => 'precedence', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''), |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | |
76 | 76 | ); |
77 | 77 | $form['Billing Information'] = array( |
78 | - array('Connect Cost', 'INPUT', array('name' => 'connectcost', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|currency_decimal|xss_clean', 'tOOL TIP', ''), |
|
79 | - array('Included Seconds', 'INPUT', array('name' => 'includedseconds', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''), |
|
80 | - array('Per Minute Cost', 'INPUT', array('name' => 'cost', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|currency_decimal|xss_clean', 'tOOL TIP', ''), |
|
78 | + array('Connect Cost', 'INPUT', array('name' => 'connectcost', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|currency_decimal|xss_clean', 'tOOL TIP', ''), |
|
79 | + array('Included Seconds', 'INPUT', array('name' => 'includedseconds', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''), |
|
80 | + array('Per Minute Cost', 'INPUT', array('name' => 'cost', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|currency_decimal|xss_clean', 'tOOL TIP', ''), |
|
81 | 81 | /** |
82 | 82 | ASTPP 3.0 |
83 | 83 | For Add Initial Increment field |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | /***************************************************************/ |
114 | 114 | array('Increment', 'INPUT', array('name' => 'inc[inc]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'inc[inc-integer]', '', '', '', 'search_int_type', ''), |
115 | 115 | array('Priority', 'INPUT', array('name' => 'prepend[prepend]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'prepend[prepend-string]', '', '', '', 'search_string_type', ''), |
116 | - array('Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0")),array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
116 | + array('Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0")), array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
117 | 117 | array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status', '', ''), |
118 | 118 | /****** |
119 | 119 | ASTPP 3.0 |
@@ -129,14 +129,14 @@ discard block |
||
129 | 129 | ASTPP 3.0 |
130 | 130 | Batch Delete |
131 | 131 | ******/ |
132 | - $form['button_search_delete'] = array('name' => 'action', 'id' => "termination_rate_batch_dlt",'onclick'=>"check_btn();", 'content' => 'Delete Search Record','style'=>'display:none;', 'value' => 'submit', 'type' => 'button', 'class' => 'btn pull-right btn btn-line-danger '); |
|
132 | + $form['button_search_delete'] = array('name' => 'action', 'id' => "termination_rate_batch_dlt", 'onclick'=>"check_btn();", 'content' => 'Delete Search Record', 'style'=>'display:none;', 'value' => 'submit', 'type' => 'button', 'class' => 'btn pull-right btn btn-line-danger '); |
|
133 | 133 | |
134 | 134 | /***********************/ |
135 | 135 | /****** |
136 | 136 | ASTPP 3.0 |
137 | 137 | Batch Delete |
138 | 138 | ******/ |
139 | - $form['button_search'] = array('name' => 'action', 'id' => "termination_rate_search_btn",'onclick'=>'search_btn();', 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right margin-x-10'); |
|
139 | + $form['button_search'] = array('name' => 'action', 'id' => "termination_rate_search_btn", 'onclick'=>'search_btn();', 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right margin-x-10'); |
|
140 | 140 | /***********************/ |
141 | 141 | $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'); |
142 | 142 | |
@@ -147,14 +147,14 @@ discard block |
||
147 | 147 | function termination_rate_batch_update_form() { |
148 | 148 | $form['forms'] = array("rates/termination_rate_batch_update/", array('id' => "termination_rate_batch_update")); |
149 | 149 | $form['Batch Update'] = array( |
150 | - array('Connect Cost', 'INPUT', array('name' => 'connectcost[connectcost]','id'=>'connectcost', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'connectcost[operator]','class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
151 | - array('Included Seconds', 'INPUT', array('name' => 'includedseconds[includedseconds]','id'=>'includedseconds', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'includedseconds[operator]','class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
152 | - array('Per Minute Cost', 'INPUT', array('name' => 'cost[cost]','id'=>'cost', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'cost[operator]','class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
150 | + array('Connect Cost', 'INPUT', array('name' => 'connectcost[connectcost]', 'id'=>'connectcost', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'connectcost[operator]', 'class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
151 | + array('Included Seconds', 'INPUT', array('name' => 'includedseconds[includedseconds]', 'id'=>'includedseconds', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'includedseconds[operator]', 'class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
152 | + array('Per Minute Cost', 'INPUT', array('name' => 'cost[cost]', 'id'=>'cost', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'cost[operator]', 'class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
153 | 153 | |
154 | - array('Increment', 'INPUT', array('name' => 'inc[inc]','id'=>'inc', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', array('name'=>'inc[operator]','class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
155 | - array('Priority', 'INPUT', array('name' => 'precedence[precedence]','id'=>'precedence', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', array('name'=>'precedence[operator]','class'=>'update_drp'), '', '', '', 'update_drp_type', ''), |
|
156 | - array('Prepand', 'INPUT', array('name' => 'prepend[prepend]','id'=>'prepend', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', array('name'=>'prepend[operator]','class'=>'update_drp'), '', '', '', 'update_drp_type', ''), |
|
157 | - array('Trunk', array('name'=> 'trunk_id[trunk_id]','id'=>'trunk_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0"),array('name'=>'trunk_id[operator]','class'=>'update_drp'), 'update_drp_type'), |
|
154 | + array('Increment', 'INPUT', array('name' => 'inc[inc]', 'id'=>'inc', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', array('name'=>'inc[operator]', 'class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
155 | + array('Priority', 'INPUT', array('name' => 'precedence[precedence]', 'id'=>'precedence', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', array('name'=>'precedence[operator]', 'class'=>'update_drp'), '', '', '', 'update_drp_type', ''), |
|
156 | + array('Prepand', 'INPUT', array('name' => 'prepend[prepend]', 'id'=>'prepend', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', array('name'=>'prepend[operator]', 'class'=>'update_drp'), '', '', '', 'update_drp_type', ''), |
|
157 | + array('Trunk', array('name'=> 'trunk_id[trunk_id]', 'id'=>'trunk_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0"), array('name'=>'trunk_id[operator]', 'class'=>'update_drp'), 'update_drp_type'), |
|
158 | 158 | ); |
159 | 159 | |
160 | 160 | $form['button_search'] = array('name' => 'action', 'id' => "batch_update_btn", 'content' => 'Update', 'value' => 'save', 'type' => 'button', 'class' =>'btn btn-line-parrot pull-right'); |
@@ -163,17 +163,17 @@ discard block |
||
163 | 163 | return $form; |
164 | 164 | } |
165 | 165 | function origination_rate_batch_update_form() { |
166 | - $logintype=$this->CI->session->userdata('userlevel_logintype'); |
|
167 | - $trunk=null; |
|
168 | - if($logintype !=1) |
|
169 | - $trunk = array('Force Trunk', array('name'=> 'trunk_id[trunk_id]','id'=>'trunk_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0"),array('name'=>'trunk_id[operator]','class'=>'update_drp'), 'update_drp_type'); |
|
170 | - $form['forms'] = array("rates/origination_rate_batch_update/",array('id' => "origination_rate_batch_update")); |
|
166 | + $logintype = $this->CI->session->userdata('userlevel_logintype'); |
|
167 | + $trunk = null; |
|
168 | + if ($logintype != 1) |
|
169 | + $trunk = array('Force Trunk', array('name'=> 'trunk_id[trunk_id]', 'id'=>'trunk_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0"), array('name'=>'trunk_id[operator]', 'class'=>'update_drp'), 'update_drp_type'); |
|
170 | + $form['forms'] = array("rates/origination_rate_batch_update/", array('id' => "origination_rate_batch_update")); |
|
171 | 171 | $form['Batch Update'] = array( |
172 | - array('Connect Cost', 'INPUT', array('name' => 'connectcost[connectcost]','id'=>'connectcost', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'connectcost[operator]','class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
173 | - array('Included Seconds', 'INPUT', array('name' => 'includedseconds[includedseconds]','id'=>'includedseconds', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1',array('name'=>'includedseconds[operator]','class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
174 | - array('Per Minute Cost', 'INPUT', array('name' => 'cost[cost]', 'id'=>'cost', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1',array('name'=>'cost[operator]','class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
175 | - array('Increment', 'INPUT', array('name' => 'inc[inc]', 'id'=>'inc', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', array('name'=>'inc[operator]','class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
176 | - array('Rate Group', array('name'=> 'pricelist_id[pricelist_id]','id'=>'pricelist_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0","reseller_id" => "0"),array('name'=>'pricelist_id[operator]','class'=>'update_drp'), 'update_drp_type'), |
|
172 | + array('Connect Cost', 'INPUT', array('name' => 'connectcost[connectcost]', 'id'=>'connectcost', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'connectcost[operator]', 'class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
173 | + array('Included Seconds', 'INPUT', array('name' => 'includedseconds[includedseconds]', 'id'=>'includedseconds', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'includedseconds[operator]', 'class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
174 | + array('Per Minute Cost', 'INPUT', array('name' => 'cost[cost]', 'id'=>'cost', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'cost[operator]', 'class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
175 | + array('Increment', 'INPUT', array('name' => 'inc[inc]', 'id'=>'inc', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', array('name'=>'inc[operator]', 'class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
176 | + array('Rate Group', array('name'=> 'pricelist_id[pricelist_id]', 'id'=>'pricelist_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0", "reseller_id" => "0"), array('name'=>'pricelist_id[operator]', 'class'=>'update_drp'), 'update_drp_type'), |
|
177 | 177 | $trunk, |
178 | 178 | ); |
179 | 179 | |
@@ -186,21 +186,21 @@ discard block |
||
186 | 186 | function build_rates_list_for_reseller() { |
187 | 187 | |
188 | 188 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
189 | -$currency_id=$account_info['currency_id']; |
|
190 | -$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
189 | +$currency_id = $account_info['currency_id']; |
|
190 | +$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
191 | 191 | |
192 | - $grid_field_arr = json_encode(array(array('Code', "140", "pattern", "pattern", "", "get_only_numeric_val","","true","center"), |
|
192 | + $grid_field_arr = json_encode(array(array('Code', "140", "pattern", "pattern", "", "get_only_numeric_val", "", "true", "center"), |
|
193 | 193 | array('Destination', "240", "comment", "", "", ""), |
194 | - array('Connection Cost('.$currency.')', "210", "connectcost", "connectcost", "connectcost", "convert_to_currency","","true","right"), |
|
195 | - array('Included Seconds', "180", "includedseconds", "", "", "","","true","center"), |
|
196 | - array('Per Minute Cost('.$currency.')', "180", "cost", "cost", "cost", "convert_to_currency","","true","right"), |
|
197 | - array('Increment', "140", "inc", "", "", "","","true","center"), |
|
198 | - array('Priority', "155", "precedence", "", "", "","","true","center"), |
|
194 | + array('Connection Cost('.$currency.')', "210", "connectcost", "connectcost", "connectcost", "convert_to_currency", "", "true", "right"), |
|
195 | + array('Included Seconds', "180", "includedseconds", "", "", "", "", "true", "center"), |
|
196 | + array('Per Minute Cost('.$currency.')', "180", "cost", "cost", "cost", "convert_to_currency", "", "true", "right"), |
|
197 | + array('Increment', "140", "inc", "", "", "", "", "true", "center"), |
|
198 | + array('Priority', "155", "precedence", "", "", "", "", "true", "center"), |
|
199 | 199 | )); |
200 | 200 | return $grid_field_arr; |
201 | 201 | } |
202 | 202 | function get_reseller_origination_rate_search_form() { |
203 | - $accountinfo=$this->CI->session->userdata('accountinfo'); |
|
203 | + $accountinfo = $this->CI->session->userdata('accountinfo'); |
|
204 | 204 | |
205 | 205 | $form['forms'] = array("", array('id' => "resellerrates_list_search")); |
206 | 206 | $form['Search My Rates'] = array( |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | array('Initial Increment', 'INPUT', array('name' => 'init_inc[init_inc]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'init_inc[init_inc-integer]', '', '', '', 'search_int_type', ''), |
237 | 237 | /**************************************************************/ |
238 | 238 | array('Increment', 'INPUT', array('name' => 'inc[inc]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'inc[inc-integer]', '', '', '', 'search_int_type', ''), |
239 | - array('Rate Group', 'pricelist_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0","reseller_id"=>"0")), |
|
239 | + array('Rate Group', 'pricelist_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0", "reseller_id"=>"0")), |
|
240 | 240 | array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status', '', ''), |
241 | 241 | array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
242 | 242 | array('', 'HIDDEN', 'advance_search', '1', '', '', ''), |
@@ -245,14 +245,14 @@ discard block |
||
245 | 245 | ASTPP 3.0 |
246 | 246 | Batch Delete |
247 | 247 | ******/ |
248 | - $form['button_search_delete'] = array('name' => 'action', 'id' => "origination_rate_batch_dlt",'onclick'=>"check_btn();", 'content' => 'Delete Search Record','style'=>'display:none;', 'value' => 'save', 'type' => 'button', 'class' => 'btn pull-right btn btn-line-danger '); |
|
248 | + $form['button_search_delete'] = array('name' => 'action', 'id' => "origination_rate_batch_dlt", 'onclick'=>"check_btn();", 'content' => 'Delete Search Record', 'style'=>'display:none;', 'value' => 'save', 'type' => 'button', 'class' => 'btn pull-right btn btn-line-danger '); |
|
249 | 249 | |
250 | 250 | /***********************/ |
251 | 251 | /******** |
252 | 252 | ASTPP 3.0 |
253 | 253 | Batch delete |
254 | 254 | *********/ |
255 | - $form['button_search'] = array('name' => 'action', 'id' => "origination_rate_list_search_btn",'onclick'=>'search_btn();', 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right margin-x-10'); |
|
255 | + $form['button_search'] = array('name' => 'action', 'id' => "origination_rate_list_search_btn", 'onclick'=>'search_btn();', 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right margin-x-10'); |
|
256 | 256 | /**************************/ |
257 | 257 | $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'); |
258 | 258 | |
@@ -268,34 +268,34 @@ discard block |
||
268 | 268 | |
269 | 269 | function build_termination_rate_for_admin() { |
270 | 270 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
271 | -$currency_id=$account_info['currency_id']; |
|
272 | -$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
271 | +$currency_id = $account_info['currency_id']; |
|
272 | +$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
273 | 273 | |
274 | 274 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
275 | - $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"), |
|
275 | + $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"), |
|
276 | 276 | /** |
277 | 277 | ASTPP 3.0 |
278 | 278 | For Termination Rate edit on Code |
279 | 279 | **/ |
280 | - array("Code", "78", "pattern", "pattern", "", "get_only_numeric_val","EDITABLE","true","center"), |
|
280 | + array("Code", "78", "pattern", "pattern", "", "get_only_numeric_val", "EDITABLE", "true", "center"), |
|
281 | 281 | /*********************************/ |
282 | - array("Destination", "80", "comment", "", "", "","","true","center"), |
|
283 | - array("Connect Cost($currency)", "125", "connectcost", "connectcost", "connectcost", "convert_to_currency","","true","right"), |
|
284 | - array("Included<br/> Seconds", "70", "includedseconds", "", "", "","","true","center"), |
|
285 | - array("Per Minute <br/>Cost($currency)", "100", "cost", "cost", "cost", "convert_to_currency","","true","right"), |
|
286 | - array("Initial <br/> Increment", "95", "init_inc", "", "", "","","true","center"), |
|
287 | - array("Increment", "75", "inc", "", "", "","","true","center"), |
|
288 | - array("Priority", "70", "precedence", "", "", "","","true","center"), |
|
289 | - array("Strip","60", "strip", "", "", "","","true","center"), |
|
290 | - array("Prepend", "70", "prepend", "pattern", "", "get_only_numeric_val","","true","center"), |
|
291 | - array("Trunk", "80", "trunk_id", "name", "trunks", "get_field_name","","true","center"), |
|
282 | + array("Destination", "80", "comment", "", "", "", "", "true", "center"), |
|
283 | + array("Connect Cost($currency)", "125", "connectcost", "connectcost", "connectcost", "convert_to_currency", "", "true", "right"), |
|
284 | + array("Included<br/> Seconds", "70", "includedseconds", "", "", "", "", "true", "center"), |
|
285 | + array("Per Minute <br/>Cost($currency)", "100", "cost", "cost", "cost", "convert_to_currency", "", "true", "right"), |
|
286 | + array("Initial <br/> Increment", "95", "init_inc", "", "", "", "", "true", "center"), |
|
287 | + array("Increment", "75", "inc", "", "", "", "", "true", "center"), |
|
288 | + array("Priority", "70", "precedence", "", "", "", "", "true", "center"), |
|
289 | + array("Strip", "60", "strip", "", "", "", "", "true", "center"), |
|
290 | + array("Prepend", "70", "prepend", "pattern", "", "get_only_numeric_val", "", "true", "center"), |
|
291 | + array("Trunk", "80", "trunk_id", "name", "trunks", "get_field_name", "", "true", "center"), |
|
292 | 292 | /* |
293 | 293 | ASTPP 3.0 |
294 | 294 | creation field show in grid |
295 | 295 | */ |
296 | - array("Status", "100", "status", "status", "outbound_routes", "get_status","","true","center"), |
|
296 | + array("Status", "100", "status", "status", "outbound_routes", "get_status", "", "true", "center"), |
|
297 | 297 | // array("Created<br/>Date", "80", "creation_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"), |
298 | - array("Modified Date", "150", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"), |
|
298 | + array("Modified Date", "150", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to", "", "true", "center"), |
|
299 | 299 | /********************************************************************/ |
300 | 300 | /* |
301 | 301 | ASTPP 3.0 |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | |
305 | 305 | /***********************************************************************/ |
306 | 306 | // array("Reseller", "103", "reseller_id", "number", "accounts", "get_field_name"), |
307 | - array("Action", "80", "", "", "", array("EDIT" => array("url" => "rates/termination_rate_edit/", "mode" => "popup","layout"=>"medium"), |
|
307 | + array("Action", "80", "", "", "", array("EDIT" => array("url" => "rates/termination_rate_edit/", "mode" => "popup", "layout"=>"medium"), |
|
308 | 308 | "DELETE" => array("url" => "rates/termination_rate_delete/", "mode" => "single"))) |
309 | 309 | )); |
310 | 310 | return $grid_field_arr; |
@@ -317,36 +317,36 @@ discard block |
||
317 | 317 | */ |
318 | 318 | function build_origination_rate_list_for_admin() { |
319 | 319 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
320 | -$currency_id=$account_info['currency_id']; |
|
321 | -$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
320 | +$currency_id = $account_info['currency_id']; |
|
321 | +$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
322 | 322 | |
323 | 323 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
324 | - $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"), |
|
324 | + $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"), |
|
325 | 325 | /** |
326 | 326 | ASTPP 3.0 |
327 | 327 | For Origination rate edit on code |
328 | 328 | **/ |
329 | - array("Code", "75", "pattern", "pattern", "", "get_only_numeric_val","EDITABLE","true","center"), |
|
329 | + array("Code", "75", "pattern", "pattern", "", "get_only_numeric_val", "EDITABLE", "true", "center"), |
|
330 | 330 | /************************************/ |
331 | - array("Destination", "100", "comment", "", "", "","","true","center"), |
|
332 | - array("Connect Cost($currency)", "130", "connectcost", "connectcost", "connectcost", "convert_to_currency","","true","right"), |
|
333 | - array("Included Seconds", "120", "includedseconds", "", "", "","","true","center"), |
|
334 | - array("Per Minute Cost($currency)", "150", "cost", "cost", "cost", "convert_to_currency","","true","right"), |
|
331 | + array("Destination", "100", "comment", "", "", "", "", "true", "center"), |
|
332 | + array("Connect Cost($currency)", "130", "connectcost", "connectcost", "connectcost", "convert_to_currency", "", "true", "right"), |
|
333 | + array("Included Seconds", "120", "includedseconds", "", "", "", "", "true", "center"), |
|
334 | + array("Per Minute Cost($currency)", "150", "cost", "cost", "cost", "convert_to_currency", "", "true", "right"), |
|
335 | 335 | /** |
336 | 336 | ASTPP 3.0 |
337 | 337 | For Add Initial Increment field |
338 | 338 | **/ |
339 | - array("Initial Increment", "130", "init_inc", "", "", "","","true","center"), |
|
339 | + array("Initial Increment", "130", "init_inc", "", "", "", "", "true", "center"), |
|
340 | 340 | /*******************************************************************/ |
341 | - array("Increment", "90", "inc", "", "", "","","true","center"), |
|
341 | + array("Increment", "90", "inc", "", "", "", "", "true", "center"), |
|
342 | 342 | //array("Priority", "72", "precedence", "", "", "","","true","center"), |
343 | - array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"), |
|
343 | + array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name", "", "true", "center"), |
|
344 | 344 | /* |
345 | 345 | ASTPP 3.0 creation field show in grid |
346 | 346 | */ |
347 | - array("Status", "100", "status", "status", "routes", "get_status","","true","center"), |
|
347 | + array("Status", "100", "status", "status", "routes", "get_status", "", "true", "center"), |
|
348 | 348 | // array("Created<br/>Date", "80", "creation_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"), |
349 | - array("Modified Date", "150", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"), |
|
349 | + array("Modified Date", "150", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to", "", "true", "center"), |
|
350 | 350 | |
351 | 351 | /********************************************************************/ |
352 | 352 | /* |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | chnage in status active or inactive |
355 | 355 | */ |
356 | 356 | |
357 | - array("Action", "95", "", "", "", array("EDIT" => array("url" => "rates/origination_rate_edit/", "mode" => "popup","layout"=>"medium"), |
|
357 | + array("Action", "95", "", "", "", array("EDIT" => array("url" => "rates/origination_rate_edit/", "mode" => "popup", "layout"=>"medium"), |
|
358 | 358 | "DELETE" => array("url" => "/rates/origination_rate_delete/", "mode" => "single"))) |
359 | 359 | )); |
360 | 360 | return $grid_field_arr; |
@@ -362,19 +362,19 @@ discard block |
||
362 | 362 | /****************************************************************************************/ |
363 | 363 | |
364 | 364 | function build_grid_buttons() { |
365 | - $buttons_json = json_encode(array(array("Create","btn btn-line-warning btn","fa fa-plus-circle fa-lg", "button_action", "/rates/termination_rate_add/", "popup","medium"), |
|
366 | - array("Delete", "btn btn-line-danger","fa fa-times-circle fa-lg", "button_action", "/rates/termination_rate_delete_multiple/"), |
|
367 | - array("import","btn btn-line-blue" ,"fa fa-upload fa-lg", "button_action", "/rates/termination_rate_import/", 'single'), |
|
368 | - array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/rates/termination_rate_export_cdr_xls/", 'single') |
|
365 | + $buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/rates/termination_rate_add/", "popup", "medium"), |
|
366 | + array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/rates/termination_rate_delete_multiple/"), |
|
367 | + array("import", "btn btn-line-blue", "fa fa-upload fa-lg", "button_action", "/rates/termination_rate_import/", 'single'), |
|
368 | + array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/rates/termination_rate_export_cdr_xls/", 'single') |
|
369 | 369 | )); |
370 | 370 | return $buttons_json; |
371 | 371 | } |
372 | 372 | |
373 | 373 | function build_grid_buttons_origination_rate() { |
374 | - $buttons_json = json_encode(array(array("Create","btn btn-line-warning btn","fa fa-plus-circle fa-lg", "button_action", "/rates/origination_rate_add/", "popup","medium"), |
|
375 | - array("Delete", "btn btn-line-danger","fa fa-times-circle fa-lg", "button_action", "/rates/origination_rate_delete_multiple/"), |
|
376 | - array("import", "btn btn-line-blue","fa fa-upload fa-lg", "button_action", "/rates/origination_rate_import/", 'single'), |
|
377 | - array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/rates/origination_rate_export_cdr_xls/", 'single') |
|
374 | + $buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/rates/origination_rate_add/", "popup", "medium"), |
|
375 | + array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/rates/origination_rate_delete_multiple/"), |
|
376 | + array("import", "btn btn-line-blue", "fa fa-upload fa-lg", "button_action", "/rates/origination_rate_import/", 'single'), |
|
377 | + array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/rates/origination_rate_export_cdr_xls/", 'single') |
|
378 | 378 | |
379 | 379 | )); |
380 | 380 | return $buttons_json; |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | function build_termination_rate_list_for_customer() { |
384 | 384 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
385 | 385 | $grid_field_arr = json_encode(array( |
386 | - array("<input type='checkbox' name='chkAll' class='ace checking checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"), |
|
386 | + array("<input type='checkbox' name='chkAll' class='ace checking checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"), |
|
387 | 387 | array("Code", "70", "pattern", "pattern", "", "get_only_numeric_val"), |
388 | 388 | array("Increment", "75", "inc", "", "", ""), |
389 | 389 | array("Connect <br> Charge", "100", "connectcost", "connectcost", "connectcost", "convert_to_currency"), |
@@ -398,16 +398,16 @@ discard block |
||
398 | 398 | function build_block_pattern_list_for_customer() { |
399 | 399 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
400 | 400 | $grid_field_arr = json_encode(array( |
401 | - array("<input type='checkbox' name='chkAll1' class='ace checking'/><label class='lbl'></label>", "30", "", "", "", "","","false","center","PatternChkBox"), |
|
401 | + array("<input type='checkbox' name='chkAll1' class='ace checking'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center", "PatternChkBox"), |
|
402 | 402 | array("Code", "350", "pattern", "pattern", "", "get_only_numeric_val"), |
403 | 403 | array("Destination", "350", "comment", "", "", ""), |
404 | 404 | )); |
405 | 405 | return $grid_field_arr; |
406 | 406 | } |
407 | - function build_pattern_list_for_customer($accountid,$accounttype) { |
|
407 | + function build_pattern_list_for_customer($accountid, $accounttype) { |
|
408 | 408 | |
409 | 409 | $grid_field_arr = json_encode(array( |
410 | - array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"), |
|
410 | + array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"), |
|
411 | 411 | array("Code", "450", "blocked_patterns", "blocked_patterns", "", "get_only_numeric_val"), |
412 | 412 | array("Destination", "450", "destination", "", "", ""), |
413 | 413 | array("Action", "100", "", "", "", array("DELETE" => array("url" => "accounts/".$accounttype."_delete_block_pattern/$accountid/", "mode" => "single"))) |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | } |
417 | 417 | |
418 | 418 | function set_pattern_grid_buttons($accountid) { |
419 | - $buttons_json = json_encode(array(array("Add Prefixes","btn btn-line-warning btn","fa fa-plus-circle fa-lg", "button_action", "/accounts/customer_add_blockpatterns/$accountid", "popup"))); |
|
419 | + $buttons_json = json_encode(array(array("Add Prefixes", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/customer_add_blockpatterns/$accountid", "popup"))); |
|
420 | 420 | return $buttons_json; |
421 | 421 | } |
422 | 422 | |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | |
435 | 435 | |
436 | 436 | function build_grid_buttons_rates() { |
437 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/rates/resellersrates_xls/", 'single'))); |
|
437 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/rates/resellersrates_xls/", 'single'))); |
|
438 | 438 | return $buttons_json; |
439 | 439 | } |
440 | 440 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | <div class="col-md-12"> |
19 | 19 | <div class="w-box"> |
20 | 20 | <span style="margin-left:10px; text-align: center;background-color: none;color:#DD191D;"> |
21 | - <? if(isset($error) && !empty($error)) { |
|
21 | + <? if (isset($error) && ! empty($error)) { |
|
22 | 22 | echo $error; |
23 | 23 | }?> |
24 | 24 | </span> |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | <div class="col-md-12 no-padding"> |
35 | 35 | <label class="col-md-3">Trunk List:</label> |
36 | 36 | <div class=""> |
37 | - <? $trunklist = form_dropdown('trunk_id', $this->db_model->build_dropdown("id,name", "trunks", "where_arr",array("status " => "0")), ''); |
|
37 | + <? $trunklist = form_dropdown('trunk_id', $this->db_model->build_dropdown("id,name", "trunks", "where_arr", array("status " => "0")), ''); |
|
38 | 38 | echo $trunklist; ?></div> |
39 | 39 | </div> |
40 | 40 | <div class="col-md-12 no-padding"> |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | <?}?> |
89 | 89 | |
90 | 90 | <?php |
91 | - if(isset($csv_tmp_data) && !empty($csv_tmp_data)){ ?> |
|
91 | + if (isset($csv_tmp_data) && ! empty($csv_tmp_data)) { ?> |
|
92 | 92 | |
93 | 93 | <section class="slice color-three padding-b-20"> |
94 | 94 | <div class="w-section inverse no-padding"> |
@@ -97,14 +97,14 @@ discard block |
||
97 | 97 | <div class="col-md-12 margin-t-10"> |
98 | 98 | <form id="import_form" name="import_form" action="<?=base_url()?>rates/termination_rate_rates_import/<?= $trunkid?>/<?=$check_header?>/" method="POST"> |
99 | 99 | <table width="100%" border="1" class="details_table table"> |
100 | - <? $cnt =7; |
|
101 | - foreach($csv_tmp_data as $csv_key => $csv_value){ |
|
102 | - if($csv_key < 15){ |
|
100 | + <? $cnt = 7; |
|
101 | + foreach ($csv_tmp_data as $csv_key => $csv_value) { |
|
102 | + if ($csv_key < 15) { |
|
103 | 103 | echo "<tr>"; |
104 | - foreach($csv_value as $field_name => $field_val){ |
|
105 | - if($csv_key == 0){ |
|
104 | + foreach ($csv_value as $field_name => $field_val) { |
|
105 | + if ($csv_key == 0) { |
|
106 | 106 | echo "<th>".ucfirst($field_name)."</th>"; |
107 | - }else{ |
|
107 | + } else { |
|
108 | 108 | echo "<td class='portlet-content'>".$field_val."</td>"; |
109 | 109 | } |
110 | 110 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | <div class="col-md-12"> |
16 | 16 | <div class="w-box"> |
17 | 17 | <span style="margin-left:10px; text-align: center;background-color: none;color:#DD191D;"> |
18 | - <? if(isset($error) && !empty($error)) { |
|
18 | + <? if (isset($error) && ! empty($error)) { |
|
19 | 19 | echo $error; |
20 | 20 | }?> |
21 | 21 | </span> |
@@ -31,19 +31,19 @@ discard block |
||
31 | 31 | <div class="col-md-12 no-padding"> |
32 | 32 | <label class="col-md-3">Rate Group:</label> |
33 | 33 | <div> |
34 | - <? $pricelists = form_dropdown('pricelist_id', $this->db_model->build_dropdown("id,name", "pricelists","where_arr", array("reseller_id" => "0", "status" => "0")), ''); |
|
34 | + <? $pricelists = form_dropdown('pricelist_id', $this->db_model->build_dropdown("id,name", "pricelists", "where_arr", array("reseller_id" => "0", "status" => "0")), ''); |
|
35 | 35 | echo $pricelists; |
36 | 36 | ?> |
37 | 37 | </div> |
38 | 38 | </div> |
39 | 39 | <? |
40 | - $logintype=$this->session->userdata('userlevel_logintype'); |
|
40 | + $logintype = $this->session->userdata('userlevel_logintype'); |
|
41 | 41 | // $trunk=null; |
42 | - if($logintype !=1) { ?> |
|
42 | + if ($logintype != 1) { ?> |
|
43 | 43 | <div class="col-md-12 no-padding"> |
44 | 44 | <label class="col-md-3">Force Trunk:</label> |
45 | 45 | <div> |
46 | - <? $trunklist = form_dropdown_all('trunk_id', $this->db_model->build_dropdown("id,name", "trunks","where_arr", array("status" => "0")), ''); |
|
46 | + <? $trunklist = form_dropdown_all('trunk_id', $this->db_model->build_dropdown("id,name", "trunks", "where_arr", array("status" => "0")), ''); |
|
47 | 47 | echo $trunklist; |
48 | 48 | ?> |
49 | 49 | </div> |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | <?}?> |
101 | 101 | |
102 | 102 | <?php |
103 | - if(isset($csv_tmp_data) && !empty($csv_tmp_data)){ ?> |
|
103 | + if (isset($csv_tmp_data) && ! empty($csv_tmp_data)) { ?> |
|
104 | 104 | |
105 | 105 | <section class="slice color-three"> |
106 | 106 | <div class="w-section inverse no-padding"> |
@@ -109,14 +109,14 @@ discard block |
||
109 | 109 | <div class="col-md-12 margin-t-10"> |
110 | 110 | <form id="import_form" name="import_form" action="<?=base_url()?>rates/origination_rate_import_file/<?= $pricelistid?>/<?=$trunkid?><?=$check_header?>/" method="POST"> |
111 | 111 | <table width="100%" border="1" class="details_table table"> |
112 | - <? $cnt =7; |
|
113 | - foreach($csv_tmp_data as $csv_key => $csv_value){ |
|
114 | - if($csv_key < 15){ |
|
112 | + <? $cnt = 7; |
|
113 | + foreach ($csv_tmp_data as $csv_key => $csv_value) { |
|
114 | + if ($csv_key < 15) { |
|
115 | 115 | echo "<tr>"; |
116 | - foreach($csv_value as $field_name => $field_val){ |
|
117 | - if($csv_key == 0){ |
|
116 | + foreach ($csv_value as $field_name => $field_val) { |
|
117 | + if ($csv_key == 0) { |
|
118 | 118 | echo "<th>".ucfirst($field_name)."</th>"; |
119 | - }else{ |
|
119 | + } else { |
|
120 | 120 | echo "<td class='portlet-content'>".$field_val."</td>"; |
121 | 121 | } |
122 | 122 | } |
@@ -51,49 +51,49 @@ |
||
51 | 51 | $data['reseller_id'] = $data['key_unique']; |
52 | 52 | unset($data['agreeCheck']); |
53 | 53 | unset($data['key_unique']); |
54 | - $data['creation']=gmdate('Y-m-d H:i:s'); |
|
54 | + $data['creation'] = gmdate('Y-m-d H:i:s'); |
|
55 | 55 | $data['expiry'] = date('Y-m-d H:i:s', strtotime('+10 years')); |
56 | - $this->db->insert("accounts",$data); |
|
56 | + $this->db->insert("accounts", $data); |
|
57 | 57 | return $this->db->insert_id(); |
58 | 58 | } |
59 | 59 | |
60 | - function check_user($accno,$email,$balance) |
|
60 | + function check_user($accno, $email, $balance) |
|
61 | 61 | { |
62 | - $info = array("number"=>$accno,"email"=>$email,"status"=>1); |
|
62 | + $info = array("number"=>$accno, "email"=>$email, "status"=>1); |
|
63 | 63 | $this->db->where($info); |
64 | 64 | $this->db->select('*'); |
65 | - $acc_res=$this->db->get('accounts'); |
|
66 | - if($acc_res->num_rows() > 0) |
|
65 | + $acc_res = $this->db->get('accounts'); |
|
66 | + if ($acc_res->num_rows() > 0) |
|
67 | 67 | { |
68 | - $acc_res=$acc_res->result_array(); |
|
69 | - $acc_res=$acc_res[0]; |
|
70 | - $this->db->where('pricelist_id',$acc_res['pricelist_id']); |
|
68 | + $acc_res = $acc_res->result_array(); |
|
69 | + $acc_res = $acc_res[0]; |
|
70 | + $this->db->where('pricelist_id', $acc_res['pricelist_id']); |
|
71 | 71 | $this->db->select("*"); |
72 | - $charge_res=$this->db->get('charges'); |
|
72 | + $charge_res = $this->db->get('charges'); |
|
73 | 73 | |
74 | - if($charge_res->num_rows() > 0){ |
|
75 | - $charge_res=$charge_res->result_array(); |
|
76 | - $charge_res=$charge_res[0]; |
|
77 | - $charge_acc_arr=array( |
|
74 | + if ($charge_res->num_rows() > 0) { |
|
75 | + $charge_res = $charge_res->result_array(); |
|
76 | + $charge_res = $charge_res[0]; |
|
77 | + $charge_acc_arr = array( |
|
78 | 78 | "charge_id"=>$charge_res['id'], |
79 | 79 | "accountid"=>$acc_res['id'], |
80 | 80 | "status"=>0, |
81 | 81 | "assign_date"=>date('Y-m-d H:i:s') |
82 | 82 | ); |
83 | - }else{ |
|
84 | - $charge_res=$charge_res->result_array(); |
|
83 | + } else { |
|
84 | + $charge_res = $charge_res->result_array(); |
|
85 | 85 | //echo "<pre>"; print_r($charge_res); exit; |
86 | 86 | $charge_acc_arr = array("charge_id"=>'id', |
87 | 87 | "accountid"=>$acc_res['id'], |
88 | 88 | "assign_date"=>date('Y-m-d H:i:s')); |
89 | 89 | } |
90 | - $result=$this->db->insert("charge_to_account",$charge_acc_arr); |
|
91 | - $update = array("status" => 0,"balance" => $balance ); |
|
90 | + $result = $this->db->insert("charge_to_account", $charge_acc_arr); |
|
91 | + $update = array("status" => 0, "balance" => $balance); |
|
92 | 92 | $this->db->where($info); |
93 | 93 | $result = $this->db->update('accounts', $update); |
94 | - $sip_device_update = array('username'=>$accno,"status"=>1); |
|
94 | + $sip_device_update = array('username'=>$accno, "status"=>1); |
|
95 | 95 | return 1; |
96 | - } else{ |
|
96 | + } else { |
|
97 | 97 | return 0; |
98 | 98 | } |
99 | 99 | } |
@@ -39,9 +39,9 @@ |
||
39 | 39 | <div class="row"> |
40 | 40 | <div class="col-md-4 col-md-offset-4"> |
41 | 41 | <span class="login_error"> |
42 | - <?php if (isset($astpp_notification)){ ?> |
|
42 | + <?php if (isset($astpp_notification)) { ?> |
|
43 | 43 | Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active. |
44 | - <?php }else{ |
|
44 | + <?php } else { |
|
45 | 45 | echo " "; |
46 | 46 | } ?> |
47 | 47 | </span> |
@@ -35,9 +35,9 @@ |
||
35 | 35 | <div class="row"> |
36 | 36 | |
37 | 37 | <div class="col-md-4 col-md-offset-4"> <span class="login_error"> |
38 | - <?php if (isset($astpp_notification)){ ?> |
|
38 | + <?php if (isset($astpp_notification)) { ?> |
|
39 | 39 | Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active. |
40 | - <?php }else{ |
|
40 | + <?php } else { |
|
41 | 41 | echo " "; |
42 | 42 | } |
43 | 43 | $astpp_err_msg = $this->session->flashdata('astpp_signupmsg'); |
@@ -95,9 +95,9 @@ |
||
95 | 95 | <div class="row"> |
96 | 96 | <div class="col-md-4 col-md-offset-4"> |
97 | 97 | <span class="login_error"> |
98 | - <?php if (isset($astpp_notification)){ ?> |
|
98 | + <?php if (isset($astpp_notification)) { ?> |
|
99 | 99 | Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active. |
100 | - <?php }else{ |
|
100 | + <?php } else { |
|
101 | 101 | echo " "; |
102 | 102 | } ?> |
103 | 103 | </span> |
@@ -35,9 +35,9 @@ |
||
35 | 35 | <div class="row"> |
36 | 36 | |
37 | 37 | <div class="col-md-4 col-md-offset-4"> <span class="login_error"> |
38 | - <?php if (isset($astpp_notification)){ ?> |
|
38 | + <?php if (isset($astpp_notification)) { ?> |
|
39 | 39 | Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active. |
40 | - <?php }else{ |
|
40 | + <?php } else { |
|
41 | 41 | echo " "; |
42 | 42 | } |
43 | 43 | $astpp_err_msg = $this->session->flashdata('astpp_signupmsg'); |
@@ -39,50 +39,50 @@ discard block |
||
39 | 39 | return $query; |
40 | 40 | } |
41 | 41 | |
42 | - function gettemplate_list($flag="", $start, $limit="") { |
|
42 | + function gettemplate_list($flag = "", $start, $limit = "") { |
|
43 | 43 | |
44 | 44 | |
45 | 45 | if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
46 | 46 | $account_data = $this->session->userdata("accountinfo"); |
47 | 47 | $reseller = $account_data['id']; |
48 | - $this->db->where('reseller_id',$reseller); |
|
49 | - $query = $this->db_model->select("*", "default_templates","","","","",""); |
|
50 | - |
|
51 | - if($query->num_rows() >0){ |
|
52 | - $result =$query->result_array(); |
|
53 | - $match_array =array(); |
|
54 | - $unmatch_array= array(); |
|
55 | - $i=0; |
|
56 | - $str=0; |
|
57 | - foreach($result as $value) |
|
48 | + $this->db->where('reseller_id', $reseller); |
|
49 | + $query = $this->db_model->select("*", "default_templates", "", "", "", "", ""); |
|
50 | + |
|
51 | + if ($query->num_rows() > 0) { |
|
52 | + $result = $query->result_array(); |
|
53 | + $match_array = array(); |
|
54 | + $unmatch_array = array(); |
|
55 | + $i = 0; |
|
56 | + $str = 0; |
|
57 | + foreach ($result as $value) |
|
58 | 58 | { |
59 | - $this->db->where('name',$value['name']); |
|
60 | - $this->db->where('reseller_id',0); |
|
61 | - $query = $this->db_model->select("id", "default_templates","", "id", "ASC", $limit, $start); |
|
62 | - $innerresult =$query->result_array(); |
|
63 | - foreach($innerresult as $value) |
|
59 | + $this->db->where('name', $value['name']); |
|
60 | + $this->db->where('reseller_id', 0); |
|
61 | + $query = $this->db_model->select("id", "default_templates", "", "id", "ASC", $limit, $start); |
|
62 | + $innerresult = $query->result_array(); |
|
63 | + foreach ($innerresult as $value) |
|
64 | 64 | { |
65 | - $str.=$value['id'].","; |
|
65 | + $str .= $value['id'].","; |
|
66 | 66 | } |
67 | 67 | } |
68 | - $str= rtrim($str,','); |
|
68 | + $str = rtrim($str, ','); |
|
69 | 69 | |
70 | 70 | $where = "id NOT IN ($str)"; |
71 | - $this->db->where('reseller_id',$reseller); |
|
72 | - $this->db->or_where('reseller_id',0); |
|
71 | + $this->db->where('reseller_id', $reseller); |
|
72 | + $this->db->or_where('reseller_id', 0); |
|
73 | 73 | $this->db->where($where); |
74 | 74 | } |
75 | 75 | else |
76 | 76 | { |
77 | - $this->db->where('reseller_id',0); |
|
77 | + $this->db->where('reseller_id', 0); |
|
78 | 78 | } |
79 | 79 | |
80 | - if($flag) { |
|
80 | + if ($flag) { |
|
81 | 81 | |
82 | - $query = $this->db_model->select("*", "default_templates","", "id", "ASC", $limit, $start); |
|
83 | - }else { |
|
82 | + $query = $this->db_model->select("*", "default_templates", "", "id", "ASC", $limit, $start); |
|
83 | + } else { |
|
84 | 84 | |
85 | - $query = $this->db_model->countQuery("*", "default_templates",""); |
|
85 | + $query = $this->db_model->countQuery("*", "default_templates", ""); |
|
86 | 86 | |
87 | 87 | } |
88 | 88 | } |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | $this->db->where($where); |
93 | 93 | $this->db_model->build_search('template_search'); |
94 | 94 | if ($flag) { |
95 | - $query = $this->db_model->select("*", "default_templates","", "id", "ASC", $limit, $start); |
|
95 | + $query = $this->db_model->select("*", "default_templates", "", "id", "ASC", $limit, $start); |
|
96 | 96 | } else { |
97 | - $query = $this->db_model->countQuery("*", "default_templates",""); |
|
97 | + $query = $this->db_model->countQuery("*", "default_templates", ""); |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
@@ -106,13 +106,13 @@ discard block |
||
106 | 106 | |
107 | 107 | $this->db->where("name", $name); |
108 | 108 | $this->db->update("system", $add_array); |
109 | - if($name == 'base_currency'){ |
|
109 | + if ($name == 'base_currency') { |
|
110 | 110 | |
111 | - $screen_path = getcwd() . "/cron"; |
|
112 | - $screen_filename = "CurrencyUpdate" . strtotime('now'); |
|
113 | - $command = "cd " . $screen_path . " && /usr/bin/screen -d -m -S $screen_filename php cron.php CurrencyUpdate"; |
|
111 | + $screen_path = getcwd()."/cron"; |
|
112 | + $screen_filename = "CurrencyUpdate".strtotime('now'); |
|
113 | + $command = "cd ".$screen_path." && /usr/bin/screen -d -m -S $screen_filename php cron.php CurrencyUpdate"; |
|
114 | 114 | exec($command); |
115 | - $this->db->update("currency",array("currencyrate"=>'1'),array("currency"=>"INR")); |
|
115 | + $this->db->update("currency", array("currencyrate"=>'1'), array("currency"=>"INR")); |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | function getcurrency_list($flag, $start = 0, $limit = 0) { |
180 | 180 | $this->db_model->build_search('currency_list_search'); |
181 | 181 | |
182 | - $where=array('currency <>' =>Common_model::$global_config['system_config']['base_currency']); |
|
182 | + $where = array('currency <>' =>Common_model::$global_config['system_config']['base_currency']); |
|
183 | 183 | if ($flag) { |
184 | 184 | $query = $this->db_model->select("*", "currency", $where, "id", "ASC", $limit, $start); |
185 | 185 | } else { |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $this->db->delete("currency"); |
206 | 206 | return true; |
207 | 207 | } |
208 | - function backup_insert($add_array='') |
|
208 | + function backup_insert($add_array = '') |
|
209 | 209 | { |
210 | 210 | unset($add_array["action"]); |
211 | 211 | $this->db->insert("backup_database", $add_array); |
@@ -222,13 +222,13 @@ discard block |
||
222 | 222 | } |
223 | 223 | function get_backup_data($id) |
224 | 224 | { |
225 | - $where=array('id'=>$id); |
|
225 | + $where = array('id'=>$id); |
|
226 | 226 | $query = $this->db_model->getSelect("*", "backup_database", $where); |
227 | 227 | return $query; |
228 | 228 | } |
229 | - function import_database($filename,$target_path) |
|
229 | + function import_database($filename, $target_path) |
|
230 | 230 | { |
231 | - $this->db->insert("backup_database", array('backup_name'=>$filename , 'path'=>$target_path)); |
|
231 | + $this->db->insert("backup_database", array('backup_name'=>$filename, 'path'=>$target_path)); |
|
232 | 232 | return true; |
233 | 233 | } |
234 | 234 | } |