Completed
Push — v3.0 ( 300813...495b61 )
by Samir
13:52
created
web_interface/astpp/application/modules/user/controllers/payment.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -31,17 +31,17 @@  discard block
 block discarded – undo
31 31
 
32 32
   }
33 33
 
34
-  function index(){
34
+  function index() {
35 35
 	  $account_data = $this->session->userdata("accountinfo");
36 36
 	  $data["accountid"] = $account_data["id"];
37 37
 	  $data["accountid"] = $account_data["id"];
38 38
 	  $data["page_title"] = "Recharge";      
39 39
       
40 40
 	   $system_config = common_model::$global_config['system_config'];
41
-	   if($system_config["paypal_mode"]==0){
41
+	   if ($system_config["paypal_mode"] == 0) {
42 42
 		   $data["paypal_url"] = $system_config["paypal_url"];
43 43
 		   $data["paypal_email_id"] = $system_config["paypal_id"];
44
-	   }else{
44
+	   } else {
45 45
 		   $data["paypal_url"] = $system_config["paypal_sandbox_url"];
46 46
 		   $data["paypal_email_id"] = $system_config["paypal_sandbox_id"];
47 47
 	   }
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
 
50 50
 	   $data["from_currency"] = $this->common->get_field_name('currency', 'currency', $account_data["currency_id"]);
51 51
 	   $data["to_currency"] = Common_model::$global_config['system_config']['base_currency'];
52
-	   $this->load->view("user_payment",$data);
52
+	   $this->load->view("user_payment", $data);
53 53
   }
54 54
   
55
-  function convert_amount($amount){
56
-	   $amount = $this->common_model->add_calculate_currency($amount,"","",true,false);
57
-	   echo number_format((float)$amount,2);
55
+  function convert_amount($amount) {
56
+	   $amount = $this->common_model->add_calculate_currency($amount, "", "", true, false);
57
+	   echo number_format((float)$amount, 2);
58 58
   }
59 59
 }
60 60
 ?> 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 	   if($system_config["paypal_mode"]==0){
42 42
 		   $data["paypal_url"] = $system_config["paypal_url"];
43 43
 		   $data["paypal_email_id"] = $system_config["paypal_id"];
44
-	   }else{
44
+	   } else{
45 45
 		   $data["paypal_url"] = $system_config["paypal_sandbox_url"];
46 46
 		   $data["paypal_email_id"] = $system_config["paypal_sandbox_id"];
47 47
 	   }
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/user/controllers/user.php 2 patches
Spacing   +398 added lines, -398 removed lines patch added patch discarded remove patch
@@ -37,31 +37,31 @@  discard block
 block discarded – undo
37 37
 
38 38
 	function index() {
39 39
 		if ($this->session->userdata('user_login') == FALSE)
40
-			redirect(base_url() . 'login/login');
40
+			redirect(base_url().'login/login');
41 41
 		$data['page_title'] = 'Dashboard';
42 42
 		$this->load->view('view_user_dashboard', $data);
43 43
 	}
44 44
 
45 45
 	function user_dashboard_recent_payments() {
46
-		$result=$this->user_model->user_dashboard_recent_recharge_info();
47
-	$gmtoffset=$this->common->get_timezone_offset();
48
-		$i=0;
49
-		$json_data=array();
50
-		if($result->num_rows() > 0)
46
+		$result = $this->user_model->user_dashboard_recent_recharge_info();
47
+	$gmtoffset = $this->common->get_timezone_offset();
48
+		$i = 0;
49
+		$json_data = array();
50
+		if ($result->num_rows() > 0)
51 51
 	{
52
-		 $account_arr = $this->common->get_array('id,number,first_name,last_name', 'accounts','');
53
-		 $json_data[0]['accountid']='Accounts';
54
-		 $json_data[0]['credit']='Amount';
55
-		 $json_data[0]['payment_date']='Date';
56
-		 $json_data[0]['notes']='Notes';
57
-		 foreach($result->result_array() as $key=>$data){
58
-			  $current_timestamp=strtotime($data['payment_date']);
59
-			  $modified_date=$current_timestamp+$gmtoffset;
60
-		  		  $data['accountid'] = ($data['accountid'] != '' && isset($account_arr[$data['accountid']])) ? $account_arr[$data['accountid']] :"Anonymous";
61
-			  $json_data[$i]['accountid']=$data['accountid'];
62
-			  $json_data[$i]['credit']=$this->common_model->calculate_currency($data['credit'],'','',true,false);
63
-			  $json_data[$i]['payment_date']=date('Y-m-d H:i:s',strtotime($data['payment_date'])+$gmtoffset);
64
-			   $json_data[$i]['notes']=$data['notes'];
52
+		 $account_arr = $this->common->get_array('id,number,first_name,last_name', 'accounts', '');
53
+		 $json_data[0]['accountid'] = 'Accounts';
54
+		 $json_data[0]['credit'] = 'Amount';
55
+		 $json_data[0]['payment_date'] = 'Date';
56
+		 $json_data[0]['notes'] = 'Notes';
57
+		 foreach ($result->result_array() as $key=>$data) {
58
+			  $current_timestamp = strtotime($data['payment_date']);
59
+			  $modified_date = $current_timestamp + $gmtoffset;
60
+		  		  $data['accountid'] = ($data['accountid'] != '' && isset($account_arr[$data['accountid']])) ? $account_arr[$data['accountid']] : "Anonymous";
61
+			  $json_data[$i]['accountid'] = $data['accountid'];
62
+			  $json_data[$i]['credit'] = $this->common_model->calculate_currency($data['credit'], '', '', true, false);
63
+			  $json_data[$i]['payment_date'] = date('Y-m-d H:i:s', strtotime($data['payment_date']) + $gmtoffset);
64
+			   $json_data[$i]['notes'] = $data['notes'];
65 65
 			  $i++;
66 66
 		  	}
67 67
 		  }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	}   
92 92
 	function user_dashboard_invoices_data() {
93 93
 		$accountinfo = $this->session->userdata('accountinfo');
94
-		$currency=$this->common->get_field_name('currency','currency',array("id"=>$accountinfo['currency_id']));
94
+		$currency = $this->common->get_field_name('currency', 'currency', array("id"=>$accountinfo['currency_id']));
95 95
 		$this->db->where('accountid', $accountinfo['id']);
96 96
 		$this->db->where('confirm', 1);
97 97
 		$this->db->select('*');
@@ -109,20 +109,20 @@  discard block
 block discarded – undo
109 109
 			$json_data[0]['inv_type'] = 'Recharge Type';
110 110
 			$i = 1;
111 111
 			foreach ($result as $key => $data) {
112
-			$invoice_prefix= $entity_type =$this->common->get_field_name('invoice_prefix','invoices',array('id'=>$data['id']));
112
+			$invoice_prefix = $entity_type = $this->common->get_field_name('invoice_prefix', 'invoices', array('id'=>$data['id']));
113 113
 
114
-			$invoiceid= $entity_type =$this->common->get_field_name('invoiceid','invoices',array('id'=>$data['id']));
115
-			$invoice_num=$invoice_prefix.$invoiceid;
116
-			$inv_type=$this->common->get_invoice_total('item_type', '', $data['id']);
117
-			if($inv_type == ''){
118
-			  $inv_type='Automatically';
114
+			$invoiceid = $entity_type = $this->common->get_field_name('invoiceid', 'invoices', array('id'=>$data['id']));
115
+			$invoice_num = $invoice_prefix.$invoiceid;
116
+			$inv_type = $this->common->get_invoice_total('item_type', '', $data['id']);
117
+			if ($inv_type == '') {
118
+			  $inv_type = 'Automatically';
119 119
 			}
120
-			if($inv_type == 'manual_inv'){
121
-			  $inv_type='Manually';
120
+			if ($inv_type == 'manual_inv') {
121
+			  $inv_type = 'Manually';
122 122
 			}
123
-			$inv_debit=$this->common->get_invoice_total('debit', '', $data['id']);
124
-			if($inv_debit == ''){
125
-			  $inv_debit=$this->common->convert_to_currency('', '',0);
123
+			$inv_debit = $this->common->get_invoice_total('debit', '', $data['id']);
124
+			if ($inv_debit == '') {
125
+			  $inv_debit = $this->common->convert_to_currency('', '', 0);
126 126
 			}
127 127
 			$json_data[$i]['type'] = $data['type'];
128 128
 			$json_data[$i]['id'] = $invoice_num;
@@ -136,54 +136,54 @@  discard block
 block discarded – undo
136 136
 		echo json_encode($json_data);
137 137
 	}
138 138
     
139
-	function user_dashboard_subscription_data(){
140
-		$accountinfo=$this->session->userdata('accountinfo');
141
-		$this->db->where('accountid',$accountinfo['id']);
139
+	function user_dashboard_subscription_data() {
140
+		$accountinfo = $this->session->userdata('accountinfo');
141
+		$this->db->where('accountid', $accountinfo['id']);
142 142
 		$this->db->select('*');
143
-		$this->db->order_by('assign_date','desc');
144
-		$result=$this->db->get('charge_to_account',10);
145
-		$json_data=array();
143
+		$this->db->order_by('assign_date', 'desc');
144
+		$result = $this->db->get('charge_to_account', 10);
145
+		$json_data = array();
146 146
       
147
-		$gmtoffset=$this->common->get_timezone_offset();
148
-		if($result->num_rows()> 0 ){
149
-		$result=$result->result_array();
150
-		$charge_str=null;
151
-		$charges_arr=array();
152
-		foreach($result as $charges_data){
153
-			$charge_str.=$charges_data['charge_id'].",";
154
-		}
155
-		$charge_str=rtrim($charge_str,",");
147
+		$gmtoffset = $this->common->get_timezone_offset();
148
+		if ($result->num_rows() > 0) {
149
+		$result = $result->result_array();
150
+		$charge_str = null;
151
+		$charges_arr = array();
152
+		foreach ($result as $charges_data) {
153
+			$charge_str .= $charges_data['charge_id'].",";
154
+		}
155
+		$charge_str = rtrim($charge_str, ",");
156 156
 		$where = "id IN ($charge_str)";
157 157
 		$this->db->where($where);
158 158
 		$this->db->select('id,description,sweep_id');
159
-		$charge_result=$this->db->get('charges');
160
-		foreach($charge_result->result_array() as $data){
161
-			$charges_arr[$data['id']]['description']=$data['description'];
162
-			$charges_arr[$data['id']]['sweep_id']=$data['sweep_id'];
163
-		}
164
-		$json_data[0]['charge_id']='Charge Name';
165
-		$json_data[0]['assign_date']='Assign Date';
166
-		$json_data[0]['sweep_id']='Billing Cycle';
167
-		$i=1;
168
-		foreach($result as $key=>$data){
169
-		if(isset($charges_arr[$data['charge_id']]['sweep_id'])){
170
-			$sweep_id= $charges_arr[$data['charge_id']]['sweep_id'];
171
-		}
172
-		$data['charge_id'] =isset($charges_arr[$data['charge_id']]['description']) ? $charges_arr[$data['charge_id']]['description'] :"Anonymous";
173
-		$json_data[$i]['charge_id']=$data['charge_id'];
174
-		if($data['assign_date'] != '0000-00-00 00:00:00'){
175
-			$json_data[$i]['assign_date']=date('Y-m-d H:i:s',strtotime($data['assign_date'])+$gmtoffset);
176
-		} else{
177
-			$json_data[$i]['assign_date']=$data['assign_date'];
178
-		}
179
-		if(isset($sweep_id)){
180
-			if($sweep_id ==0){
181
-				$json_data[$i]['sweep_id']='Daily';
182
-			} else{
183
-				$json_data[$i]['sweep_id']='Monthly';			
159
+		$charge_result = $this->db->get('charges');
160
+		foreach ($charge_result->result_array() as $data) {
161
+			$charges_arr[$data['id']]['description'] = $data['description'];
162
+			$charges_arr[$data['id']]['sweep_id'] = $data['sweep_id'];
163
+		}
164
+		$json_data[0]['charge_id'] = 'Charge Name';
165
+		$json_data[0]['assign_date'] = 'Assign Date';
166
+		$json_data[0]['sweep_id'] = 'Billing Cycle';
167
+		$i = 1;
168
+		foreach ($result as $key=>$data) {
169
+		if (isset($charges_arr[$data['charge_id']]['sweep_id'])) {
170
+			$sweep_id = $charges_arr[$data['charge_id']]['sweep_id'];
171
+		}
172
+		$data['charge_id'] = isset($charges_arr[$data['charge_id']]['description']) ? $charges_arr[$data['charge_id']]['description'] : "Anonymous";
173
+		$json_data[$i]['charge_id'] = $data['charge_id'];
174
+		if ($data['assign_date'] != '0000-00-00 00:00:00') {
175
+			$json_data[$i]['assign_date'] = date('Y-m-d H:i:s', strtotime($data['assign_date']) + $gmtoffset);
176
+		} else {
177
+			$json_data[$i]['assign_date'] = $data['assign_date'];
178
+		}
179
+		if (isset($sweep_id)) {
180
+			if ($sweep_id == 0) {
181
+				$json_data[$i]['sweep_id'] = 'Daily';
182
+			} else {
183
+				$json_data[$i]['sweep_id'] = 'Monthly';			
184 184
 			}
185
-		} else{
186
-			$json_data[$i]['sweep_id']='Anonymous';
185
+		} else {
186
+			$json_data[$i]['sweep_id'] = 'Anonymous';
187 187
 		}
188 188
 		$i++;
189 189
 		}
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 	function user_edit_account() {
195 195
 		if ($add_array['id'] != '') {
196 196
 			$data['form'] = $this->form->build_form($this->accounts->accounts_form->get_user_form_fields($add_array['id']), $add_array);
197
-			$data['page_title'] = 'Edit ' . $entity_name;
197
+			$data['page_title'] = 'Edit '.$entity_name;
198 198
 			if ($this->form_validation->run() == FALSE) {
199 199
 				$data['validation_errors'] = validation_errors();
200 200
 			} else {
@@ -203,14 +203,14 @@  discard block
 block discarded – undo
203 203
 				$this->accounts->accounts_model->edit_account($add_array, $add_array['id']);
204 204
 				$accountinfo = $this->session->userdata('accountinfo');
205 205
 				if ($add_array['id'] == $accountinfo['id']) {
206
-					$this->session->set_userdata('accountinfo',(array)$this->db->get_where('accounts', array('id' => $add_array['id']))->first_row());
206
+					$this->session->set_userdata('accountinfo', (array)$this->db->get_where('accounts', array('id' => $add_array['id']))->first_row());
207 207
 				}
208
-				$this->session->set_flashdata('astpp_errormsg', ucfirst($entity_name) . ' updated successfully!');
209
-				redirect(base_url() . 'user/user/');
208
+				$this->session->set_flashdata('astpp_errormsg', ucfirst($entity_name).' updated successfully!');
209
+				redirect(base_url().'user/user/');
210 210
 			}
211 211
 			$this->load->view('view_user_details', $data);
212 212
 		} else {
213
-			$data['page_title'] = 'Edit ' . $entity_name;
213
+			$data['page_title'] = 'Edit '.$entity_name;
214 214
 			$where = array('id' => $account_data["id"]);
215 215
 			$account = $this->db_model->getSelect("*", "accounts", $where);
216 216
 			$data["account_data"] = $account->result_array();
@@ -227,52 +227,52 @@  discard block
 block discarded – undo
227 227
 	function user_did_edit($edit_id = '') {
228 228
 		$data['page_title'] = 'Edit DIDs';
229 229
 		$account_data = $this->session->userdata("accountinfo");
230
-		$this->db->where('id',$edit_id);
230
+		$this->db->where('id', $edit_id);
231 231
 		$this->db->select('id,call_type,extensions,number');
232
-		$did_info=(array)$this->db->get('dids')->first_row();
233
-		$did_info['free_didlist']=$did_info['id'];
234
-		$data['form'] = $this->form->build_form($this->user_form->build_user_did_form(),$did_info);
232
+		$did_info = (array)$this->db->get('dids')->first_row();
233
+		$did_info['free_didlist'] = $did_info['id'];
234
+		$data['form'] = $this->form->build_form($this->user_form->build_user_did_form(), $did_info);
235 235
 		$this->load->view('view_user_did_edit', $data);
236 236
 	}
237 237
 
238
-	function user_dids_action($action,$did_id = "") {
238
+	function user_dids_action($action, $did_id = "") {
239 239
 		$accountinfo = $this->session->userdata('accountinfo');
240 240
 		$reseller_id = $accountinfo['reseller_id'];
241 241
 		$did_id = empty($did_id) ? $this->input->post("free_didlist", true) : $did_id;
242 242
           
243
-		if($did_id !=''){
244
-			$account_query = $this->db_model->getSelect("*", "accounts",array('id' => $accountinfo['id']));
245
-			$account_arr = (array) $account_query->first_row();
243
+		if ($did_id != '') {
244
+			$account_query = $this->db_model->getSelect("*", "accounts", array('id' => $accountinfo['id']));
245
+			$account_arr = (array)$account_query->first_row();
246 246
 			$did_query = $this->db_model->getSelect("*", "dids", array("id" => $did_id));
247
-			$did_arr = (array) $did_query->first_row();
248
-		if ($action == "add"){
249
-			if($did_arr['accountid'] == 0 && $did_arr['parent_id'] == $reseller_id ) {
250
-			 $setup_cost=$did_arr['setup'];
247
+			$did_arr = (array)$did_query->first_row();
248
+		if ($action == "add") {
249
+			if ($did_arr['accountid'] == 0 && $did_arr['parent_id'] == $reseller_id) {
250
+			 $setup_cost = $did_arr['setup'];
251 251
 				if ($accountinfo["reseller_id"] > 0) {
252
-					$reseller_pricing_res = $this->db_model->getSelect("*", "reseller_pricing", array("note" => $did_arr['number'],"reseller_id"=>$accountinfo['reseller_id']));
252
+					$reseller_pricing_res = $this->db_model->getSelect("*", "reseller_pricing", array("note" => $did_arr['number'], "reseller_id"=>$accountinfo['reseller_id']));
253 253
 					$reseller_pricing_arr = (array)$reseller_pricing_res->first_row();
254
-					$setup_cost=$reseller_pricing_arr['setup'];
254
+					$setup_cost = $reseller_pricing_arr['setup'];
255 255
 				}
256 256
 				$available_bal = $this->db_model->get_available_bal($account_arr);
257 257
 				if ($available_bal >= $setup_cost) {
258
-					$available_bal = $this->db_model->update_balance($setup_cost,$accountinfo["id"], "debit");
259
-					$accountinfo=(array)$this->db->get_where('accounts',array("id"=>$accountinfo['id']))->first_row();
260
-					$this->common->add_invoice_details($accountinfo,"DIDCHRG",$setup_cost,$did_arr['number']);
261
-					$this->db_model->update("dids", array("accountid" => $accountinfo["id"],"assign_date" => gmdate('Y-m-d H:i:s')), array("id" => $did_id));
262
-					$this->common->mail_to_users('email_add_did', $account_arr,"",$did_arr['number']);
258
+					$available_bal = $this->db_model->update_balance($setup_cost, $accountinfo["id"], "debit");
259
+					$accountinfo = (array)$this->db->get_where('accounts', array("id"=>$accountinfo['id']))->first_row();
260
+					$this->common->add_invoice_details($accountinfo, "DIDCHRG", $setup_cost, $did_arr['number']);
261
+					$this->db_model->update("dids", array("accountid" => $accountinfo["id"], "assign_date" => gmdate('Y-m-d H:i:s')), array("id" => $did_id));
262
+					$this->common->mail_to_users('email_add_did', $account_arr, "", $did_arr['number']);
263 263
 					$this->session->set_flashdata('astpp_errormsg', 'Did added successfully.');
264
-					redirect(base_url() . "user/user_didlist/");
264
+					redirect(base_url()."user/user_didlist/");
265 265
 				} else {
266 266
 					$this->session->set_flashdata('astpp_notification', 'Insuffiecient fund to purchase this did');
267
-					redirect(base_url() . "user/user_didlist/");
267
+					redirect(base_url()."user/user_didlist/");
268 268
 				}
269
-		}else{
269
+		} else {
270 270
 				$this->session->set_flashdata('astpp_notification', 'This DID already purchased by someone.');
271
-				redirect(base_url() . "user/user_didlist/");
271
+				redirect(base_url()."user/user_didlist/");
272 272
 		}
273 273
 		}
274 274
 		if ($action == "edit") {
275
-			$add_array=$this->input->post();
275
+			$add_array = $this->input->post();
276 276
 		$data['form'] = $this->form->build_form($this->user_form->build_user_did_form($add_array['free_didlist']), $add_array);
277 277
 		if ($this->form_validation->run() == FALSE) {
278 278
 				$data['validation_errors'] = validation_errors();
@@ -280,27 +280,27 @@  discard block
 block discarded – undo
280 280
 				exit;
281 281
 			} else {
282 282
 		  $update_arr = array("call_type" => $add_array['call_type'],
283
-		  "extensions" => $add_array['extensions'],"last_modified_date"=>gmdate("Y-m-d H:i:s")
283
+		  "extensions" => $add_array['extensions'], "last_modified_date"=>gmdate("Y-m-d H:i:s")
284 284
 		  );
285 285
 		  $this->db->update("dids", $update_arr, array("id" => $did_id));
286
-		  if($accountinfo['reseller_id'] > 0 ){
286
+		  if ($accountinfo['reseller_id'] > 0) {
287 287
 		  
288
-		  $this->db->update('reseller_pricing',$update_arr,array('note'=>$did_arr['number']));
288
+		  $this->db->update('reseller_pricing', $update_arr, array('note'=>$did_arr['number']));
289 289
 		  }
290
-		  echo json_encode(array("SUCCESS" => $did_arr['number'] . " DID Updated Successfully!"));
290
+		  echo json_encode(array("SUCCESS" => $did_arr['number']." DID Updated Successfully!"));
291 291
 		  exit;
292 292
 			}
293 293
 			$this->load->view('view_user_did_edit', $data);
294 294
 		}
295 295
 		if ($action == "delete") {
296
-			$this->db->update("dids", array("accountid" =>0,"assign_date" =>"0000-00-00 00:00:00" , 'charge_upto'=>"0000-00-00 00:00:00"),array("id" => $did_id));
297
-			$this->common->mail_to_users('email_remove_did', $account_arr,"",$did_arr['number']);
296
+			$this->db->update("dids", array("accountid" =>0, "assign_date" =>"0000-00-00 00:00:00", 'charge_upto'=>"0000-00-00 00:00:00"), array("id" => $did_id));
297
+			$this->common->mail_to_users('email_remove_did', $account_arr, "", $did_arr['number']);
298 298
 			$this->session->set_flashdata('astpp_notification', 'DID Removed Successfully.');
299
-			redirect(base_url() . "user/user_didlist/");
299
+			redirect(base_url()."user/user_didlist/");
300 300
 		}
301
-		}else{
301
+		} else {
302 302
 	  $this->session->set_flashdata('astpp_notification', 'DID not found.');
303
-	  redirect(base_url() . "user/user_didlist/");
303
+	  redirect(base_url()."user/user_didlist/");
304 304
 		}
305 305
 	}
306 306
 
@@ -326,13 +326,13 @@  discard block
 block discarded – undo
326 326
 		$query = $this->user_model->get_user_rates_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
327 327
 		$grid_fields = json_decode($this->user_form->user_rates_list());
328 328
 		foreach ($query->result_array() as $key => $value) {
329
-			$cost=$account_data['type']!=3 ? ($value['cost'] + (($value['cost']*$markup)/100)) : $value['cost'];
329
+			$cost = $account_data['type'] != 3 ? ($value['cost'] + (($value['cost'] * $markup) / 100)) : $value['cost'];
330 330
 			$json_data['rows'][] = array('cell' => array(
331
-					$this->common->get_only_numeric_val("","",$value["pattern"]),
331
+					$this->common->get_only_numeric_val("", "", $value["pattern"]),
332 332
 					$value['comment'],
333
-					$this->common_model->calculate_currency($value['connectcost'],'','',true,false),
333
+					$this->common_model->calculate_currency($value['connectcost'], '', '', true, false),
334 334
 					$value['includedseconds'],
335
-					$this->common_model->calculate_currency(($cost),'','',true,false),
335
+					$this->common_model->calculate_currency(($cost), '', '', true, false),
336 336
 					$value['init_inc'],
337 337
 					$value['inc']                   
338 338
 			));
@@ -346,22 +346,22 @@  discard block
 block discarded – undo
346 346
 		if ($this->input->post('advance_search', TRUE) == 1) {
347 347
 			$this->session->set_userdata('advance_search', $this->input->post('advance_search'));
348 348
 			$action = $this->input->post();
349
-			unset($action['action'],$action['advance_search']);
349
+			unset($action['action'], $action['advance_search']);
350 350
 			if (isset($action['connectcost']['connectcost']) && $action['connectcost']['connectcost'] != '') {
351 351
 				$action['connectcost']['connectcost'] = $this->common_model->add_calculate_currency($action['connectcost']['connectcost'], "", '', true, false);
352 352
 			}
353 353
 			if (isset($action['cost']['cost']) && $action['cost']['cost'] != '') {
354 354
 				$account_data = $this->session->userdata("accountinfo");
355 355
 				$markup = $this->common->get_field_name('markup', 'pricelists', array('id'=>$account_data["pricelist_id"]));
356
-				$markup = ($markup > 0)?$markup:1;
356
+				$markup = ($markup > 0) ? $markup : 1;
357 357
 				$action['cost']['cost'] = $this->common_model->add_calculate_currency($action['cost']['cost'], "", '', true, false);
358
-				if($account_data['type']!=3)
359
-					$action['cost']['cost']=($action['cost']['cost'] - ($action['cost']['cost']*$markup)/100);
358
+				if ($account_data['type'] != 3)
359
+					$action['cost']['cost'] = ($action['cost']['cost'] - ($action['cost']['cost'] * $markup) / 100);
360 360
 			}
361 361
 			$this->session->set_userdata('user_rates_list_search', $action);
362 362
 		}
363 363
 		if ($ajax_search != 1) {
364
-			redirect(base_url() . 'user/user_rates_list/');
364
+			redirect(base_url().'user/user_rates_list/');
365 365
 		}
366 366
 	}
367 367
 
@@ -371,34 +371,34 @@  discard block
 block discarded – undo
371 371
 	}
372 372
     
373 373
 	function user_rates_list_export() {
374
-	$account_data=$this->session->userdata('accountinfo');
375
-		$currency_id=$account_data['currency_id'];
376
-		$currency=$this->common->get_field_name('currency', 'currency', $currency_id);
374
+	$account_data = $this->session->userdata('accountinfo');
375
+		$currency_id = $account_data['currency_id'];
376
+		$currency = $this->common->get_field_name('currency', 'currency', $currency_id);
377 377
 		$query = $this->user_model->get_user_rates_list(true, '', '', false);
378 378
 		$markup = $this->common->get_field_name('markup', 'pricelists', array('id'=>$account_data["pricelist_id"]));
379 379
 		ob_clean();
380
-		$inbound_array[] = array("Code", "Destination","Connect Cost($currency)","Included Seconds","Per Minute Cost($currency)","Initital Increment","Increment");
380
+		$inbound_array[] = array("Code", "Destination", "Connect Cost($currency)", "Included Seconds", "Per Minute Cost($currency)", "Initital Increment", "Increment");
381 381
 		if ($query->num_rows() > 0) {
382 382
 			foreach ($query->result_array() as $row) {
383
-		$cost=$account_data['type']!=3 ? ($row['cost'] + ($row['cost']*$markup)/100) :$row['cost'];
383
+		$cost = $account_data['type'] != 3 ? ($row['cost'] + ($row['cost'] * $markup) / 100) : $row['cost'];
384 384
 		$inbound_array[] = array(
385
-						$row['pattern']=$this->common->get_only_numeric_val("","",$row["pattern"]),
385
+						$row['pattern'] = $this->common->get_only_numeric_val("", "", $row["pattern"]),
386 386
 						$row['comment'],
387
-						$this->common_model->calculate_currency($row['connectcost'],'','',true,false),
387
+						$this->common_model->calculate_currency($row['connectcost'], '', '', true, false),
388 388
 						$row['includedseconds'],
389
-			$this->common_model->calculate_currency($cost,'','',true,false),
389
+			$this->common_model->calculate_currency($cost, '', '', true, false),
390 390
 			$row['init_inc'],
391 391
 						$row['inc']
392 392
 					);
393 393
 			}
394 394
 		}
395 395
 		$this->load->helper('csv');
396
-		array_to_csv($inbound_array, 'Rates_' . date("Y-m-d") . '.csv');
396
+		array_to_csv($inbound_array, 'Rates_'.date("Y-m-d").'.csv');
397 397
 	} 
398 398
 
399 399
 	function user_refill($action = "") {
400 400
 		if (common_model::$global_config['system_config']['paypal_status'] == 1) {
401
-			redirect(base_url() . 'user/user/');
401
+			redirect(base_url().'user/user/');
402 402
 		}
403 403
 		$this->load->module("user/refill");
404 404
 		if ($action == "GET_AMT") {
@@ -440,14 +440,14 @@  discard block
 block discarded – undo
440 440
 				$this->load->model('user_model');
441 441
 				$this->user_model->change_db_password($update, $id);
442 442
 				$this->session->set_flashdata('astpp_errormsg', "Password changed Sucessfully....!!!");
443
-				redirect(base_url() . 'user/user/changepassword/');
443
+				redirect(base_url().'user/user/changepassword/');
444 444
 			} else {
445 445
 				$this->session->set_flashdata('astpp_notification', "New Password & Conformpassword not match.");
446
-				redirect(base_url() . 'user/user/changepassword/');
446
+				redirect(base_url().'user/user/changepassword/');
447 447
 			}
448 448
 		} else {
449 449
 			$this->session->set_flashdata('astpp_notification', "Invalid old passwword.");
450
-			redirect(base_url() . 'user/user/changepassword/');
450
+			redirect(base_url().'user/user/changepassword/');
451 451
 		}
452 452
 	}
453 453
 
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
 		$acc_data = $this->session->userdata("accountinfo");
474 474
 		$reseller_id = $acc_data['reseller_id'];
475 475
 
476
-		$drp_data = $this->db->query("SELECT id,CONCAT(number,'(',amount,')') as details,number FROM refill_coupon WHERE status = '0' and reseller_id='" . $reseller_id . "'");
476
+		$drp_data = $this->db->query("SELECT id,CONCAT(number,'(',amount,')') as details,number FROM refill_coupon WHERE status = '0' and reseller_id='".$reseller_id."'");
477 477
 		$reseller_data = array();
478 478
 		$data['refill_coupon_list'] = form_dropdown_all('refill_coupon_list', $reseller_data, '');
479 479
 		$this->load->view('view_refill_coupon_list', $data);
@@ -503,11 +503,11 @@  discard block
 block discarded – undo
503 503
 				echo json_encode(2);
504 504
 			} else {
505 505
 				$this->db->select('balance');
506
-				$result = (array)$this->db->get_where('accounts',array('id'=>$customer_id))->first_row();
507
-				$user_balance=$this->db_model->get_available_bal($accountinfo);
508
-				$original_balance=$refill_coupon_result['amount'];
509
-				$refill_coupon_result['amount'] = $this->common_model->to_calculate_currency($original_balance,'','',TRUE,TRUE);
510
-				$refill_coupon_result['new_balance'] = $this->common_model->to_calculate_currency($user_balance+$original_balance,'','',TRUE,TRUE);
506
+				$result = (array)$this->db->get_where('accounts', array('id'=>$customer_id))->first_row();
507
+				$user_balance = $this->db_model->get_available_bal($accountinfo);
508
+				$original_balance = $refill_coupon_result['amount'];
509
+				$refill_coupon_result['amount'] = $this->common_model->to_calculate_currency($original_balance, '', '', TRUE, TRUE);
510
+				$refill_coupon_result['new_balance'] = $this->common_model->to_calculate_currency($user_balance + $original_balance, '', '', TRUE, TRUE);
511 511
 				echo json_encode($refill_coupon_result);
512 512
 			}
513 513
 		} else {
@@ -541,10 +541,10 @@  discard block
 block discarded – undo
541 541
 			$this->db->where('number', $refill_coupon_no);
542 542
 			$refill_coupon_data = array('status' => 2, "account_id" => $customer_id, 'firstused' => $date);
543 543
 			$this->db->update('refill_coupon', $refill_coupon_data);
544
-			$payment_arr = array("accountid" => $customer_id, 'type' => 'refill_coupon', 'credit' => $amount, 'payment_by' => $reseller_id, 'payment_date' => $date, 'refill_coupon_number' => $refill_coupon_no, 'notes' => 'Recharge using Refill coupon,Refill coupon No. ' . $refill_coupon_no . '');
544
+			$payment_arr = array("accountid" => $customer_id, 'type' => 'refill_coupon', 'credit' => $amount, 'payment_by' => $reseller_id, 'payment_date' => $date, 'refill_coupon_number' => $refill_coupon_no, 'notes' => 'Recharge using Refill coupon,Refill coupon No. '.$refill_coupon_no.'');
545 545
 			$this->db->insert('payments', $payment_arr);
546 546
 		}
547
-		redirect(base_url() . "user/user_refill_coupon_list/");
547
+		redirect(base_url()."user/user_refill_coupon_list/");
548 548
 	}
549 549
 
550 550
 	function user_packages() {
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 
556 556
 	function user_packages_json() {
557 557
 		$json_data = array();
558
-		$count_all = $this->user_model->get_user_packages_list(false,'','');
558
+		$count_all = $this->user_model->get_user_packages_list(false, '', '');
559 559
 		$paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
560 560
 		$json_data = $paging_data["json_paging"];
561 561
 		$query = $this->user_model->get_user_packages_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
@@ -598,19 +598,19 @@  discard block
 block discarded – undo
598 598
 		$json_data['rows'] = $this->form->build_grid($query, $grid_fields);
599 599
 		echo json_encode($json_data);
600 600
 	}
601
-	function user_emails_search(){
601
+	function user_emails_search() {
602 602
 		$ajax_search = $this->input->post('ajax_search', 0);
603 603
 		if ($this->input->post('advance_search', TRUE) == 1) {
604 604
 			$this->session->set_userdata('advance_search', $this->input->post('advance_search'));
605 605
 			$action = $this->input->post();
606
-			unset($action['action'],$action['advance_search']);
606
+			unset($action['action'], $action['advance_search']);
607 607
 			$this->session->set_userdata('user_emails_search', $action);
608 608
 		}
609 609
 		if (@$ajax_search != 1) {
610
-			redirect(base_url() . 'user/user_emails/');
610
+			redirect(base_url().'user/user_emails/');
611 611
 		}
612 612
 	}
613
-	function user_emails_clearsearchfilter(){
613
+	function user_emails_clearsearchfilter() {
614 614
 		$this->session->set_userdata('advance_search', 0);
615 615
 		$this->session->set_userdata('user_emails_search', "");
616 616
 	}
@@ -622,30 +622,30 @@  discard block
 block discarded – undo
622 622
 		if (isset($add_array['submit'])) {
623 623
 			if ($_FILES['file']['name'] == '') {
624 624
 				$invoiceconf = $this->user_model->get_invoiceconf();
625
-				$file_name=($invoiceconf['logo'] != '') ? $invoiceconf['logo'] : '';
625
+				$file_name = ($invoiceconf['logo'] != '') ? $invoiceconf['logo'] : '';
626 626
 			}
627 627
 			if (isset($_FILES['file']['name']) && $_FILES['file']['name'] != '') {
628 628
 				$files = $_FILES['file'];
629 629
 				if ($files['size'] < 0) {
630 630
 					$this->session->set_flashdata('astpp_notification', 'PLease upload maximum file');
631
-				redirect(base_url() . "accounts/reseller_invoice_config/". $add_array['accountid']."/");
631
+				redirect(base_url()."accounts/reseller_invoice_config/".$add_array['accountid']."/");
632 632
 				}
633 633
 				$file = $_FILES['file'];
634 634
 				$uploadedFile = $file["tmp_name"];
635 635
 				$file_name = $file['name'];
636 636
 				$file_type = $file['type'];
637 637
 				if ($file_type == 'image/jpg' || $file_type == 'image/png' || $file_type == 'image/jpeg') {
638
-					$dir_path = FCPATH. "upload/";
639
-					$path = $dir_path . $add_array['accountid']."_".$file['name'];
638
+					$dir_path = FCPATH."upload/";
639
+					$path = $dir_path.$add_array['accountid']."_".$file['name'];
640 640
 					if (move_uploaded_file($uploadedFile, $path)) {
641 641
 						$this->session->set_flashdata('astpp_errormsg', gettext('files added successfully!'));
642 642
 					} else {
643 643
 						$this->session->set_flashdata('astpp_notification', "File Uploading Fail Please Try Again");
644
-						redirect(base_url() . 'user/user_invoice_config/');
644
+						redirect(base_url().'user/user_invoice_config/');
645 645
 					}
646 646
 				} else {
647 647
 					$this->session->set_flashdata('astpp_notification', 'Please upload only image!');
648
-					redirect(base_url() . 'user/user_invoice_config/');
648
+					redirect(base_url().'user/user_invoice_config/');
649 649
 				}
650 650
 			}
651 651
 			$add_array['logo'] = $file_name;
@@ -657,24 +657,24 @@  discard block
 block discarded – undo
657 657
 				$this->user_model->edit_invoice_config($add_array, $add_array['id']);
658 658
 			}
659 659
 			$this->session->set_flashdata('astpp_errormsg', 'Invoice config updated successfully!');
660
-			redirect(base_url() . 'user/user_invoice_config/');
660
+			redirect(base_url().'user/user_invoice_config/');
661 661
 		} else {
662
-			$data["account_data"] =(array)$this->db->get_where('invoice_conf',array("accountid"=>$accountinfo['id']))->first_row();
663
-			if(isset($data["account_data"]['logo'])){
664
-				$data["account_data"]['file']=$accountinfo['id']."_".$data["account_data"]['logo'];
662
+			$data["account_data"] = (array)$this->db->get_where('invoice_conf', array("accountid"=>$accountinfo['id']))->first_row();
663
+			if (isset($data["account_data"]['logo'])) {
664
+				$data["account_data"]['file'] = $accountinfo['id']."_".$data["account_data"]['logo'];
665 665
 		}
666 666
 			$this->load->view('view_user_invoices_config', $data);
667 667
 		}
668 668
 	}
669 669
 
670
-	 function user_invoice_logo_delete($accountid){
671
-	$invoiceconf  = $this->db_model->getSelect("*", "invoice_conf", array("accountid"=> $accountid));
672
-	$result=$invoiceconf->result_array();
673
-	$logo=$result[0]['logo'];
674
-	$post_arr=array('logo'=>'');
675
-	$where_arr=array('logo'=>$logo);
670
+	 function user_invoice_logo_delete($accountid) {
671
+	$invoiceconf = $this->db_model->getSelect("*", "invoice_conf", array("accountid"=> $accountid));
672
+	$result = $invoiceconf->result_array();
673
+	$logo = $result[0]['logo'];
674
+	$post_arr = array('logo'=>'');
675
+	$where_arr = array('logo'=>$logo);
676 676
 	$this->db->where($where_arr);
677
-	$this->db->update('invoice_conf',$post_arr);
677
+	$this->db->update('invoice_conf', $post_arr);
678 678
 	 }
679 679
     
680 680
 	function user_myprofile() {
@@ -693,9 +693,9 @@  discard block
 block discarded – undo
693 693
 					$result = $this->db->get_where('accounts', array('id' => $add_array['id']));
694 694
 					$result = $result->result_array();
695 695
 					$this->session->set_userdata('accountinfo', $result[0]);
696
-					$this->session->set_flashdata('astpp_errormsg',' Your profile updated successfully!');
697
-					redirect(base_url() . 'user/user_myprofile/');
698
-				}else{
696
+					$this->session->set_flashdata('astpp_errormsg', ' Your profile updated successfully!');
697
+					redirect(base_url().'user/user_myprofile/');
698
+				} else {
699 699
 					$this->session->set_flashdata('astpp_notification', 'Something wrong.Please contact to administrator.');
700 700
 				}
701 701
 			}
@@ -717,35 +717,35 @@  discard block
 block discarded – undo
717 717
 		$accountinfo = $this->session->userdata("accountinfo");
718 718
 		$data['page_title'] = "Change Password";
719 719
 		$add_array = $this->input->post();    
720
-		if(!empty($add_array)) {
720
+		if ( ! empty($add_array)) {
721 721
 			$data['form'] = $this->form->build_form($this->user_form->get_userprofile_change_password(), $add_array);
722 722
 			if ($this->form_validation->run() == FALSE) {
723 723
 				$data['validation_errors'] = validation_errors();
724 724
 			} else {
725 725
 				$password_encode = $this->common->encode($add_array['new_password']);
726 726
 				$data = array('password' => $password_encode);
727
-				$this->db->where('id',$add_array['id']);
727
+				$this->db->where('id', $add_array['id']);
728 728
 				$this->db->update('accounts', $data);
729 729
 				$this->session->set_flashdata('astpp_errormsg', 'Password updated successfully!');
730
-				redirect(base_url() . 'user/user_change_password/');
730
+				redirect(base_url().'user/user_change_password/');
731 731
 			}
732
-		}else{
733
-			$data_array['id']=$accountinfo['id'];
734
-			$data['form'] = $this->form->build_form($this->user_form->get_userprofile_change_password(),$data_array);
732
+		} else {
733
+			$data_array['id'] = $accountinfo['id'];
734
+			$data['form'] = $this->form->build_form($this->user_form->get_userprofile_change_password(), $data_array);
735 735
 		}
736 736
 		$this->load->view('view_user_change_password', $data);
737 737
 	}
738 738
 
739 739
 	function user_refill_report() {
740
-		$accountinfo=$this->session->userdata('accountinfo');
740
+		$accountinfo = $this->session->userdata('accountinfo');
741 741
 		$data['page_title'] = 'Refill Report';
742 742
 		$data['search_flag'] = true;
743 743
 		$this->session->set_userdata('advance_search', 0);
744 744
 		$data['grid_fields'] = $this->user_form->build_user_refill_report();
745 745
 		$data['form_search'] = $this->form->build_serach_form($this->user_form->build_user_refill_report_search());
746
-		if($accountinfo['type'] == 1){
746
+		if ($accountinfo['type'] == 1) {
747 747
 			$this->load->view('view_reseller_refill_report', $data);
748
-		}else{
748
+		} else {
749 749
 			$this->load->view('view_user_refill_report', $data);
750 750
 		}
751 751
 	}
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
 	function user_refill_report_json() {
754 754
 		$json_data = array();
755 755
 		$count_all = $this->user_model->get_user_refill_list(false);
756
-		$paging_data = $this->form->load_grid_config($count_all,$_GET['rp'], $_GET['page']);
756
+		$paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
757 757
 		$json_data = $paging_data["json_paging"];
758 758
 		$query = $this->user_model->get_user_refill_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
759 759
 		$grid_fields = json_decode($this->user_form->build_user_refill_report());
@@ -766,14 +766,14 @@  discard block
 block discarded – undo
766 766
 		if ($this->input->post('advance_search', TRUE) == 1) {
767 767
 			$this->session->set_userdata('advance_search', $this->input->post('advance_search'));
768 768
 			$action = $this->input->post();
769
-			unset($action['action'],$action['advance_search']);
769
+			unset($action['action'], $action['advance_search']);
770 770
 			if (isset($action['credit']['credit']) && $action['credit']['credit'] != '') {
771 771
 			 $action['credit']['credit'] = $this->common_model->add_calculate_currency($action['credit']['credit'], "", '', true, false);
772 772
 			}
773 773
 			$this->session->set_userdata('user_refill_report_search', $action);
774 774
 		}
775 775
 		if (@$ajax_search != 1) {
776
-			redirect(base_url() . 'user/user_refill_report/');
776
+			redirect(base_url().'user/user_refill_report/');
777 777
 		}
778 778
 	}
779 779
     
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
 		$count_all = $this->user_model->get_user_invoice_list(false, '', '', $where);
797 797
 		$paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
798 798
 		$json_data = $paging_data["json_paging"];
799
-		$user_currency=$this->common->get_field_name('currency','currency',$accountinfo['currency_id']);
799
+		$user_currency = $this->common->get_field_name('currency', 'currency', $accountinfo['currency_id']);
800 800
 		$invoices_query = $this->user_model->get_user_invoice_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"], $where);
801 801
 		$invoices_result = $invoices_query->result_array();
802 802
 		$ountstanding_value = 0;
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
 		$total_credit = (array)$invoice_details_result->first_row();
808 808
 		$total_credit = $total_credit['total_credit'];
809 809
 		foreach ($invoices_result as $key => $value) {
810
-			$total_amount+=$value['amount'];
810
+			$total_amount += $value['amount'];
811 811
 			$invoice_date = date("Y-m-d", strtotime($value['invoice_date']));
812 812
 			$from_date = date("Y-m-d", strtotime($value['from_date']));
813 813
 			$due_date = date("Y-m-d", strtotime($value['due_date']));
@@ -822,23 +822,23 @@  discard block
 block discarded – undo
822 822
 			if ($invoice_total_query->num_rows() > 0) {
823 823
 				$invoice_total_result = $invoice_total_query->result_array();
824 824
 			}
825
-			$download = '<a href="' . base_url() . '/user/user_invoice_download/' . $value['id'] . '/00' . $value['invoice_prefix'] . $value['invoiceid'] . '" class="btn btn-royelblue btn-sm"  title="Download Invoice" ><i class="fa fa-cloud-download fa-fw"></i></a>&nbsp';
826
-		  if($value['type'] == 'I'){
825
+			$download = '<a href="'.base_url().'/user/user_invoice_download/'.$value['id'].'/00'.$value['invoice_prefix'].$value['invoiceid'].'" class="btn btn-royelblue btn-sm"  title="Download Invoice" ><i class="fa fa-cloud-download fa-fw"></i></a>&nbsp';
826
+		  if ($value['type'] == 'I') {
827 827
 			if ($outstanding > 0) {
828
-				$payment = ' <a style="padding: 0 8px;" href="' . base_url() . 'user/user_invoice_payment/' . $value['id'] . '" class="btn btn-warning"  title="Payment">Unpaid</a>';
828
+				$payment = ' <a style="padding: 0 8px;" href="'.base_url().'user/user_invoice_payment/'.$value['id'].'" class="btn btn-warning"  title="Payment">Unpaid</a>';
829 829
 			} else {
830 830
 				$payment = ' <button style="padding: 0 8px;" class="btn btn-success" type="button">Paid</button>';
831 831
 			}
832
-	   }else{
832
+	   } else {
833 833
 				$payment = '';
834 834
 	   }
835
-			if($value['generate_type'] == 1){
836
-		$invoice_type='Manually';
837
-	   }else{
838
-		$invoice_type='Automatically';
835
+			if ($value['generate_type'] == 1) {
836
+		$invoice_type = 'Manually';
837
+	   } else {
838
+		$invoice_type = 'Automatically';
839 839
 	   } 
840 840
 	   
841
-	   if($value['type'] == 'R'){
841
+	   if ($value['type'] == 'R') {
842 842
 		$icon = '<div class="flx_font flx_magenta">R</div>';
843 843
 		}
844 844
 		else
@@ -871,13 +871,13 @@  discard block
 block discarded – undo
871 871
 			print_r($action);
872 872
 			unset($action['action']);
873 873
 			unset($action['advance_search']);
874
-			$action['from_date'][0] = $action['from_date'][0] ? $action['from_date'][0] . " 00:00:00" : '';
875
-			$action['to_date'][1] = $action['to_date'][1] ? $action['to_date'][1] . " 23:59:59" : '';
876
-			$action['invoice_date'][0] = $action['invoice_date'][0] ? $action['invoice_date'][0] . " 00:00:00" : '';
874
+			$action['from_date'][0] = $action['from_date'][0] ? $action['from_date'][0]." 00:00:00" : '';
875
+			$action['to_date'][1] = $action['to_date'][1] ? $action['to_date'][1]." 23:59:59" : '';
876
+			$action['invoice_date'][0] = $action['invoice_date'][0] ? $action['invoice_date'][0]." 00:00:00" : '';
877 877
 			$this->session->set_userdata('user_invoice_list_search', $action);
878 878
 		}
879 879
 		if (@$ajax_search != 1) {
880
-			redirect(base_url() . 'user/user_invoice_list/');
880
+			redirect(base_url().'user/user_invoice_list/');
881 881
 		}
882 882
 	}
883 883
 
@@ -890,25 +890,25 @@  discard block
 block discarded – undo
890 890
 		$this->load->module('invoices/invoices');
891 891
 		$this->invoices->invoice_main_download($invoiceid);
892 892
 	}
893
-	function user_list_responce(){
893
+	function user_list_responce() {
894 894
 	$this->load->module('invoices/invoices');
895 895
 		$this->invoices->invoice_list_responce();
896 896
 	}
897
-	 function user_invoice_payment($invoiceid){
897
+	 function user_invoice_payment($invoiceid) {
898 898
 	$this->load->module('invoices/invoices');
899 899
 		$this->invoices->invoice_summary($invoiceid);
900 900
 	}	
901
-	function user_invoice_payment_pay($action=""){
901
+	function user_invoice_payment_pay($action = "") {
902 902
 		$this->load->module("user/payment");
903
-		if($action=="GET_AMT"){
904
-			$amount = $this->input->post("value",true);
905
-	   $amount = $this->common_model->add_calculate_currency($amount,"","",true,false);
906
-	   echo number_format($amount,2);
907
-		}else{
903
+		if ($action == "GET_AMT") {
904
+			$amount = $this->input->post("value", true);
905
+	   $amount = $this->common_model->add_calculate_currency($amount, "", "", true, false);
906
+	   echo number_format($amount, 2);
907
+		} else {
908 908
 			$this->payment->index();
909 909
 		}
910 910
 	}
911
-	function user_invoice_download($invoiceid){
911
+	function user_invoice_download($invoiceid) {
912 912
 	$this->load->module('invoices/invoices');
913 913
 		$this->invoices->invoice_download($invoiceid);
914 914
 	}    
@@ -927,43 +927,43 @@  discard block
 block discarded – undo
927 927
 		$json_data = $paging_data["json_paging"];
928 928
 		$query = $this->user_model->get_user_charge_history(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
929 929
 
930
-	$result= $query->result_array();
931
-		$query1 = $this->user_model->get_user_charge_history(true,'','');
932
-	$res= $query1->result_array();
933
-	$debit=0;
934
-	$credit=0;
935
-	$before_balance=0;
936
-	$after_balance=0;
937
-	$i=0;
930
+	$result = $query->result_array();
931
+		$query1 = $this->user_model->get_user_charge_history(true, '', '');
932
+	$res = $query1->result_array();
933
+	$debit = 0;
934
+	$credit = 0;
935
+	$before_balance = 0;
936
+	$after_balance = 0;
937
+	$i = 0;
938 938
 		foreach ($result as $key => $value) {
939
-   		 $date=$this->common->convert_GMT_to('','',$value['created_date']);
939
+   		 $date = $this->common->convert_GMT_to('', '', $value['created_date']);
940 940
  		 $cust_type = $this->common->get_field_name('posttoexternal', 'accounts', $value['accountid']);	    
941
-			$invoice_prefix= $entity_type =$this->common->get_field_name('invoice_prefix','invoices',array('id'=>$value['invoiceid']));
942
-			$invoiceid= $entity_type =$this->common->get_field_name('invoiceid','invoices',array('id'=>$value['invoiceid']));
943
-		$invoice_num=$invoice_prefix.$invoiceid;
944
-		$account=$this->common->get_field_name_coma_new('first_name,last_name,number','accounts',$value['accountid']);
945
-		$reseller=$this->common->reseller_select_value('first_name,last_name,number','accounts',$value['reseller_id']);
946
-		$item_type=$value['item_type'];
947
-		if($value['before_balance'] == '-'){
948
-			$before_balance='-';
949
-		} else{		
950
-			$before_balance=$this->common->convert_to_currency('','',$value['before_balance']);
951
-		}
952
-		if($value['debit'] == '-'){
953
-			$debit='-';
954
-		} else{		
955
-			$debit=$this->common->convert_to_currency('','',$value['debit']);
956
-		}
957
-		$credit=$this->common->convert_to_currency('','',$value['credit']);
958
-			 if($cust_type == 0 && $value['item_type'] == 'INVPAY'){
941
+			$invoice_prefix = $entity_type = $this->common->get_field_name('invoice_prefix', 'invoices', array('id'=>$value['invoiceid']));
942
+			$invoiceid = $entity_type = $this->common->get_field_name('invoiceid', 'invoices', array('id'=>$value['invoiceid']));
943
+		$invoice_num = $invoice_prefix.$invoiceid;
944
+		$account = $this->common->get_field_name_coma_new('first_name,last_name,number', 'accounts', $value['accountid']);
945
+		$reseller = $this->common->reseller_select_value('first_name,last_name,number', 'accounts', $value['reseller_id']);
946
+		$item_type = $value['item_type'];
947
+		if ($value['before_balance'] == '-') {
948
+			$before_balance = '-';
949
+		} else {		
950
+			$before_balance = $this->common->convert_to_currency('', '', $value['before_balance']);
951
+		}
952
+		if ($value['debit'] == '-') {
953
+			$debit = '-';
954
+		} else {		
955
+			$debit = $this->common->convert_to_currency('', '', $value['debit']);
956
+		}
957
+		$credit = $this->common->convert_to_currency('', '', $value['credit']);
958
+			 if ($cust_type == 0 && $value['item_type'] == 'INVPAY') {
959 959
 		$credit = '(-) '.$credit;
960 960
 		 }
961
-		if($value['after_balance'] == '-'){
962
-			$after_balance='-';
963
-		} else{		
964
-			$after_balance=$this->common->convert_to_currency('','',$value['after_balance']);
961
+		if ($value['after_balance'] == '-') {
962
+			$after_balance = '-';
963
+		} else {		
964
+			$after_balance = $this->common->convert_to_currency('', '', $value['after_balance']);
965 965
 		}
966
-		$description=$value['description'];
966
+		$description = $value['description'];
967 967
 			$cust_type = $this->common->get_field_name('posttoexternal', 'accounts', $value['accountid']);	    
968 968
 			$json_data['rows'][] = array('cell' => array(
969 969
 							$date,
@@ -979,7 +979,7 @@  discard block
 block discarded – undo
979 979
 		}
980 980
 	$debit_sum = 0;
981 981
 	$credit_sum = 0;
982
-	foreach($res as $value){
982
+	foreach ($res as $value) {
983 983
  		 $cust_type = $this->common->get_field_name('posttoexternal', 'accounts', $value['accountid']);	    
984 984
  		 $cust_type = $this->common->get_field_name('posttoexternal', 'accounts', $value['accountid']);	    
985 985
 		$debit_sum += $value['debit'];
@@ -987,7 +987,7 @@  discard block
 block discarded – undo
987 987
 		$before_balance += $value['before_balance'];
988 988
 		$after_balance += $value['after_balance'];
989 989
 	}
990
-			$json_data['rows'][$count_all]['cell']=array('<b>Total</b>','-','-','-','<b>'.$this->common->convert_to_currency('','',$debit_sum).'</b>','<b>'.$this->common->convert_to_currency('','',$credit_sum).'</b>','-','-');
990
+			$json_data['rows'][$count_all]['cell'] = array('<b>Total</b>', '-', '-', '-', '<b>'.$this->common->convert_to_currency('', '', $debit_sum).'</b>', '<b>'.$this->common->convert_to_currency('', '', $credit_sum).'</b>', '-', '-');
991 991
 	  echo json_encode($json_data);
992 992
 
993 993
 
@@ -999,8 +999,8 @@  discard block
 block discarded – undo
999 999
 			$action = $this->input->post();
1000 1000
 			unset($action['action']);
1001 1001
 			unset($action['advance_search']);
1002
-			$action['created_date'][0] = $action['created_date'][0] ? $action['created_date'][0] . " 00:00:00" : '';
1003
-			$action['created_date'][1] = $action['created_date'][1] ? $action['created_date'][1] . " 23:59:59" : '';
1002
+			$action['created_date'][0] = $action['created_date'][0] ? $action['created_date'][0]." 00:00:00" : '';
1003
+			$action['created_date'][1] = $action['created_date'][1] ? $action['created_date'][1]." 23:59:59" : '';
1004 1004
 			if (isset($action['debit']['debit']) && $action['debit']['debit'] != '') {
1005 1005
 				$action['debit']['debit'] = $this->common_model->add_calculate_currency($action['debit']['debit'], "", '', true, false);
1006 1006
 			}
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
 			$this->session->set_userdata('user_charge_history_search', $action);
1011 1011
 		}
1012 1012
 		if (@$ajax_search != 1) {
1013
-			redirect(base_url() . 'user/user_charges_history/');
1013
+			redirect(base_url().'user/user_charges_history/');
1014 1014
 		}
1015 1015
 	}
1016 1016
 
@@ -1028,7 +1028,7 @@  discard block
 block discarded – undo
1028 1028
 
1029 1029
 	function user_subscriptions_json() {
1030 1030
         
1031
-		$accountinfo=$this->session->userdata('accountinfo');
1031
+		$accountinfo = $this->session->userdata('accountinfo');
1032 1032
 		$json_data = array();
1033 1033
 		$select = "charge_to_account.id,charges.description,charges.charge,charges.sweep_id";
1034 1034
 		$table = "charges";
@@ -1059,14 +1059,14 @@  discard block
 block discarded – undo
1059 1059
 			if (isset($action['charge']['charge']) && $action['charge']['charge'] != '') {
1060 1060
 				$action['charge']['charge'] = $this->common_model->add_calculate_currency($action['charge']['charge'], "", '', true, false);
1061 1061
 			}
1062
-			if(isset($action['sweep_id']) && $action['sweep_id'] != ''){
1063
-				$action['charges.sweep_id']=$action['sweep_id'];
1062
+			if (isset($action['sweep_id']) && $action['sweep_id'] != '') {
1063
+				$action['charges.sweep_id'] = $action['sweep_id'];
1064 1064
 				unset($action['sweep_id']);
1065 1065
 			}
1066 1066
 			$this->session->set_userdata('user_subscription_search', $action);
1067 1067
 		}
1068 1068
 		if (@$ajax_search != 1) {
1069
-			redirect(base_url() . 'user/user_subscriptions/');
1069
+			redirect(base_url().'user/user_subscriptions/');
1070 1070
 		}
1071 1071
 	}
1072 1072
 
@@ -1076,7 +1076,7 @@  discard block
 block discarded – undo
1076 1076
 	}
1077 1077
 
1078 1078
 	function user_didlist() {
1079
-		$accountinfo=$this->session->userdata('accountinfo');
1079
+		$accountinfo = $this->session->userdata('accountinfo');
1080 1080
 		$data['page_title'] = 'Purchase DIDs';
1081 1081
 		$data['search_flag'] = true;
1082 1082
 		$data['grid_fields'] = $this->user_form->build_user_didlist();
@@ -1084,38 +1084,38 @@  discard block
 block discarded – undo
1084 1084
 		$data["grid_buttons"] = array();
1085 1085
 		$acc_data = $this->session->userdata("accountinfo");
1086 1086
 		$data['accountid'] = $acc_data['id'];
1087
-		$data['country_id']=$acc_data['country_id'];
1087
+		$data['country_id'] = $acc_data['country_id'];
1088 1088
 		$result_did_final = array();
1089
-		if($accountinfo['reseller_id'] > 0){
1089
+		if ($accountinfo['reseller_id'] > 0) {
1090 1090
 	  $this->db->select('dids.id, dids.number, reseller_pricing.setup, reseller_pricing.monthlycost');
1091
-	  $this->db->where('dids.accountid',0);
1092
-	  $this->db->where('reseller_pricing.note','dids.number',false);
1093
-	  $this->db->where('reseller_pricing.reseller_id',$accountinfo['reseller_id']);
1091
+	  $this->db->where('dids.accountid', 0);
1092
+	  $this->db->where('reseller_pricing.note', 'dids.number', false);
1093
+	  $this->db->where('reseller_pricing.reseller_id', $accountinfo['reseller_id']);
1094 1094
 	  $this->db->from('dids,reseller_pricing');
1095
-		}else{
1096
-	  $this->db->where('parent_id',0);
1097
-	  $this->db->where('accountid',0);
1095
+		} else {
1096
+	  $this->db->where('parent_id', 0);
1097
+	  $this->db->where('accountid', 0);
1098 1098
 	  $this->db->select('id,number,setup,monthlycost');
1099 1099
 	  $this->db->from('dids');
1100 1100
 		}
1101
-		$dids_array=(array)$this->db->get()->result_array();
1102
-		$drp_list=array();
1103
-		if(!empty($dids_array)){
1101
+		$dids_array = (array)$this->db->get()->result_array();
1102
+		$drp_list = array();
1103
+		if ( ! empty($dids_array)) {
1104 1104
 	  foreach ($dids_array as $drp_value) {
1105
-		if (!empty($drp_value['monthlycost']) && $drp_value['monthlycost'] != 0) {
1106
-		  $did_cost = $this->common_model->to_calculate_currency($drp_value['monthlycost'],'','',true,true);
1105
+		if ( ! empty($drp_value['monthlycost']) && $drp_value['monthlycost'] != 0) {
1106
+		  $did_cost = $this->common_model->to_calculate_currency($drp_value['monthlycost'], '', '', true, true);
1107 1107
 		} else {
1108 1108
 		$did_cost = 0;
1109 1109
 		}
1110
-		if (!empty($drp_value['setup']) && $drp_value['setup'] != 0) {
1111
-		$did_setup = $this->common_model->to_calculate_currency($drp_value['setup'],'','',true,true);
1110
+		if ( ! empty($drp_value['setup']) && $drp_value['setup'] != 0) {
1111
+		$did_setup = $this->common_model->to_calculate_currency($drp_value['setup'], '', '', true, true);
1112 1112
 		} else {
1113 1113
 		$did_setup = 0;
1114 1114
 		}
1115
-		$drp_list[$drp_value['id']] = $drp_value['number'] . ' ( Setup : ' . $did_setup . ')' . '( Monthly : ' . $did_cost . ' )';
1115
+		$drp_list[$drp_value['id']] = $drp_value['number'].' ( Setup : '.$did_setup.')'.'( Monthly : '.$did_cost.' )';
1116 1116
 	  }
1117 1117
 		}
1118
-		$data['didlist'] = form_dropdown_all(array("name"=>"free_didlist","id"=>"free_didlist","class"=>"did_dropdown"), $drp_list, '');
1118
+		$data['didlist'] = form_dropdown_all(array("name"=>"free_didlist", "id"=>"free_didlist", "class"=>"did_dropdown"), $drp_list, '');
1119 1119
 		$this->load->view('view_user_did_list', $data);
1120 1120
 	}
1121 1121
 
@@ -1155,9 +1155,9 @@  discard block
 block discarded – undo
1155 1155
 		if ($this->input->post('advance_search', TRUE) == 1) {
1156 1156
 			$this->session->set_userdata('advance_search', $this->input->post('advance_search'));
1157 1157
 			$action = $this->input->post();
1158
-			$accountinfo=$this->session->userdata('accountinfo');
1159
-			if($accountinfo['reseller_id'] > 0 && $action['call_type'] > 0){
1160
-		  $action['dids.call_type']=$action['call_type'];
1158
+			$accountinfo = $this->session->userdata('accountinfo');
1159
+			if ($accountinfo['reseller_id'] > 0 && $action['call_type'] > 0) {
1160
+		  $action['dids.call_type'] = $action['call_type'];
1161 1161
 		  unset($action['call_type']);
1162 1162
 			}
1163 1163
 			unset($action['action']);
@@ -1165,7 +1165,7 @@  discard block
 block discarded – undo
1165 1165
 			$this->session->set_userdata('user_did_search', $action);
1166 1166
 		}
1167 1167
 		if (@$ajax_search != 1) {
1168
-			redirect(base_url() . 'user/user_didlist/');
1168
+			redirect(base_url().'user/user_didlist/');
1169 1169
 		}
1170 1170
 	}
1171 1171
 
@@ -1174,14 +1174,14 @@  discard block
 block discarded – undo
1174 1174
 		$this->session->set_userdata('user_did_search', "");
1175 1175
 	}
1176 1176
     
1177
-	function user_ipmap(){
1177
+	function user_ipmap() {
1178 1178
 		$this->session->set_userdata('advance_search', 0);
1179 1179
 		$data['grid_fields'] = $this->user_form->build_user_ipmap();
1180 1180
 		$data['form_search'] = $this->form->build_serach_form($this->user_form->build_user_ipmap_search());
1181 1181
 		$this->load->view('view_user_ipmap_list', $data);
1182 1182
 	}
1183 1183
     
1184
-	function user_ipmap_json(){
1184
+	function user_ipmap_json() {
1185 1185
 		$json_data = array();
1186 1186
 		$account_data = $this->session->userdata("accountinfo");
1187 1187
 		$count_all = $this->user_model->user_ipmap_list(false);
@@ -1193,7 +1193,7 @@  discard block
 block discarded – undo
1193 1193
 		echo json_encode($json_data);
1194 1194
 	}
1195 1195
 
1196
-	function user_ipmap_search(){
1196
+	function user_ipmap_search() {
1197 1197
 		$ajax_search = $this->input->post('ajax_search', 0);
1198 1198
 		if ($this->input->post('advance_search', TRUE) == 1) {
1199 1199
 			$this->session->set_userdata('advance_search', $this->input->post('advance_search'));
@@ -1203,24 +1203,24 @@  discard block
 block discarded – undo
1203 1203
 			$this->session->set_userdata('user_ipmap_search', $action);
1204 1204
 		}
1205 1205
 		if (@$ajax_search != 1) {
1206
-			redirect(base_url() . 'user/user_ipmap/');
1206
+			redirect(base_url().'user/user_ipmap/');
1207 1207
 		}
1208 1208
 	}
1209 1209
     
1210
-	function user_ipmap_clearsearchfilter(){
1210
+	function user_ipmap_clearsearchfilter() {
1211 1211
 		$this->session->set_userdata('advance_search', 0);
1212 1212
 		$this->session->set_userdata('user_ipmap_search', "");
1213 1213
 	}
1214 1214
     
1215
-	function user_ipmap_action($action='delete',$id=false){
1216
-		$add_array=$this->input->post();
1217
-		$accountinfo=$this->session->userdata('accountinfo');
1218
-		if($action == 'add'){
1215
+	function user_ipmap_action($action = 'delete', $id = false) {
1216
+		$add_array = $this->input->post();
1217
+		$accountinfo = $this->session->userdata('accountinfo');
1218
+		if ($action == 'add') {
1219 1219
 			  $ip = $add_array['ip'];
1220 1220
 			  if (strpos($ip, '/') !== false) {
1221 1221
 				 $add_array['ip'] = $add_array['ip'];
1222 1222
 			  } else {
1223
-				$add_array['ip'] = $add_array['ip'] . '/32';
1223
+				$add_array['ip'] = $add_array['ip'].'/32';
1224 1224
 			  }
1225 1225
 			  $where = array("ip" => trim($add_array['ip']), "prefix" => trim($add_array['prefix']));
1226 1226
 			  $getdata = $this->db_model->countQuery("*", "ip_map", $where);
@@ -1241,8 +1241,8 @@  discard block
 block discarded – undo
1241 1241
 				$this->session->set_flashdata('astpp_errormsg', 'IP Added Sucessfully.');
1242 1242
 			}
1243 1243
 			}
1244
-		if($action =='delete'){
1245
-			$this->db->delete('ip_map',array('id'=>$id));
1244
+		if ($action == 'delete') {
1245
+			$this->db->delete('ip_map', array('id'=>$id));
1246 1246
 			$this->session->set_flashdata('astpp_notification', 'IP Removed Sucessfully.');
1247 1247
 		}
1248 1248
 		redirect(base_url()."user/user_ipmap/");
@@ -1263,23 +1263,23 @@  discard block
 block discarded – undo
1263 1263
 		$paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
1264 1264
 		$json_data = $paging_data["json_paging"];
1265 1265
 		$devices_result = array();
1266
-		$query = $this->user_model->user_sipdevices_list(true,$account_data['id'], $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
1266
+		$query = $this->user_model->user_sipdevices_list(true, $account_data['id'], $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
1267 1267
 		foreach ($query as $key => $value) {
1268 1268
 	$path_true = base_url().'/assets/images/true.png';
1269 1269
 	$path_false = base_url().'/assets/images/false.png';
1270
-	$voicemail_enabled = $value['voicemail_enabled'] == 'true'? '<img src='.$path_true.' style="height:20px;width:20px;" title="Enable">' : '<img src='.$path_false.' style="height:20px;width:20px;" title="Disable">';
1270
+	$voicemail_enabled = $value['voicemail_enabled'] == 'true' ? '<img src='.$path_true.' style="height:20px;width:20px;" title="Enable">' : '<img src='.$path_false.' style="height:20px;width:20px;" title="Disable">';
1271 1271
 		$json_data['rows'][] = array('cell' => array(
1272
-			'<input type="checkbox" name="chkAll" id="'.$value['id'].'" class="ace chkRefNos" onclick="clickchkbox('.$value['id'].')" value=' .$value['id'].'><lable class="lbl"></lable>',
1272
+			'<input type="checkbox" name="chkAll" id="'.$value['id'].'" class="ace chkRefNos" onclick="clickchkbox('.$value['id'].')" value='.$value['id'].'><lable class="lbl"></lable>',
1273 1273
 					$value['username'],
1274 1274
 					$value['password'],
1275 1275
 					$value['effective_caller_id_name'],
1276 1276
 					$value['effective_caller_id_number'],
1277
-					$this->common->get_status('status', 'sip_devices',$value),
1278
-					$this->common->convert_GMT_to('','',$value['creation_date']),
1279
-					$this->common->convert_GMT_to('','',$value['last_modified_date']),
1277
+					$this->common->get_status('status', 'sip_devices', $value),
1278
+					$this->common->convert_GMT_to('', '', $value['creation_date']),
1279
+					$this->common->convert_GMT_to('', '', $value['last_modified_date']),
1280 1280
 					$voicemail_enabled,
1281
-					'<a href="'. base_url() .'user/user_sipdevices_edit/' . $value['id'] . '/" class="btn btn-royelblue btn-sm"  rel="facebox" title="Edit">&nbsp;<i class="fa fa-pencil-square-o fa-fw"></i></a>&nbsp;'.
1282
-					'<a href="'. base_url() .'user/user_sipdevices_delete/' .$value['id']. '/" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();">&nbsp;<i class="fa fa-trash fa-fw"></i></a>'
1281
+					'<a href="'.base_url().'user/user_sipdevices_edit/'.$value['id'].'/" class="btn btn-royelblue btn-sm"  rel="facebox" title="Edit">&nbsp;<i class="fa fa-pencil-square-o fa-fw"></i></a>&nbsp;'.
1282
+					'<a href="'.base_url().'user/user_sipdevices_delete/'.$value['id'].'/" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();">&nbsp;<i class="fa fa-trash fa-fw"></i></a>'
1283 1283
 					));
1284 1284
 		}
1285 1285
 		echo json_encode($json_data);
@@ -1294,7 +1294,7 @@  discard block
 block discarded – undo
1294 1294
 			$this->session->set_userdata('user_sipdevices_search', $action);
1295 1295
 		}
1296 1296
 		if (@$ajax_search != 1) {
1297
-			redirect(base_url() . 'user/user_sipdevices/');
1297
+			redirect(base_url().'user/user_sipdevices/');
1298 1298
 		}
1299 1299
 	}
1300 1300
     
@@ -1303,12 +1303,12 @@  discard block
 block discarded – undo
1303 1303
 		$this->session->set_userdata('user_sipdevices_search', "");
1304 1304
 	}
1305 1305
         
1306
-	function user_sipdevices_add(){
1306
+	function user_sipdevices_add() {
1307 1307
 		$data['page_title'] = 'Create SIP Device';
1308
-		$data['form'] = $this->form->build_form($this->user_form->build_user_sipdevices_form(),"");
1308
+		$data['form'] = $this->form->build_form($this->user_form->build_user_sipdevices_form(), "");
1309 1309
 		$this->load->view('view_user_sipdevices_add_edit', $data);
1310 1310
 	}
1311
-	function user_sipdevices_edit($edit_id=''){
1311
+	function user_sipdevices_edit($edit_id = '') {
1312 1312
 		$account_data = $this->session->userdata("accountinfo");
1313 1313
 		$data['page_title'] = 'Edit SIP Device';
1314 1314
 		$where = array('id' => $edit_id);
@@ -1316,7 +1316,7 @@  discard block
 block discarded – undo
1316 1316
 		$data['form'] = $this->form->build_form($this->user_form->build_user_sipdevices_form($edit_id), $sipdevice_info);
1317 1317
 		$this->load->view('view_user_sipdevices_add_edit', $data);
1318 1318
 	}
1319
-	function user_sipdevices_save(){
1319
+	function user_sipdevices_save() {
1320 1320
 		$add_array = $this->input->post();
1321 1321
 		$data['form'] = $this->form->build_form($this->user_form->build_user_sipdevices_form($add_array['id']), $add_array);
1322 1322
 		if ($add_array['id'] != '') {
@@ -1344,15 +1344,15 @@  discard block
 block discarded – undo
1344 1344
 		}
1345 1345
 	}
1346 1346
 	function user_sipdevices_delete($id) {
1347
-		$this->db->delete('sip_devices',array('id'=>$id));
1347
+		$this->db->delete('sip_devices', array('id'=>$id));
1348 1348
 		$this->session->set_flashdata('astpp_notification', 'SIP Device Removed Sucessfully!');
1349
-		redirect(base_url() . "user/user_sipdevices/");
1349
+		redirect(base_url()."user/user_sipdevices/");
1350 1350
 	}
1351 1351
     
1352
-	function user_sipdevices_delete_multiple(){
1352
+	function user_sipdevices_delete_multiple() {
1353 1353
 		$ids = $this->input->post("selected_ids", true);
1354 1354
 		$where = "id IN ($ids)";
1355
-		$this->db->delete("sip_devices",$where);
1355
+		$this->db->delete("sip_devices", $where);
1356 1356
 		echo TRUE;    
1357 1357
 	}
1358 1358
     
@@ -1385,7 +1385,7 @@  discard block
 block discarded – undo
1385 1385
 			$cnt_result = $cnt_result->result_array();
1386 1386
 			$count = $cnt_result[0]['count'];
1387 1387
 			if ($count == 0) {
1388
-				if($add_array['number'] != ""){
1388
+				if ($add_array['number'] != "") {
1389 1389
 				$accountinfo = $this->session->userdata("accountinfo");
1390 1390
 				$insert_arr = array("number" => $add_array['number'],
1391 1391
 									"accountid" => $accountinfo['id'],
@@ -1393,7 +1393,7 @@  discard block
 block discarded – undo
1393 1393
 									);
1394 1394
 				$this->db->insert("ani_map", $insert_arr);
1395 1395
 				$this->session->set_flashdata('astpp_errormsg', 'Add Caller ID Sucessfully!');
1396
-				}else{
1396
+				} else {
1397 1397
 					 $this->session->set_flashdata('astpp_notification', 'Please Enter Caller ID value.');
1398 1398
 				}
1399 1399
 			} else {
@@ -1405,28 +1405,28 @@  discard block
 block discarded – undo
1405 1405
 			$this->db_model->delete("ani_map", array("id" => $aniid));
1406 1406
             
1407 1407
 		}
1408
-		redirect(base_url() . "user/user_animap_list/");
1408
+		redirect(base_url()."user/user_animap_list/");
1409 1409
 	}
1410 1410
     
1411 1411
 	function user_alert_threshold() {
1412 1412
 		$data['page_title'] = 'Alert Threshold';
1413 1413
 		$accountinfo = $this->session->userdata("accountinfo");
1414 1414
 		$add_array = $this->input->post();
1415
-		if (!empty($add_array)) {
1416
-			unset($add_array['action'],$add_array['id']);
1415
+		if ( ! empty($add_array)) {
1416
+			unset($add_array['action'], $add_array['id']);
1417 1417
 			$this->user_model->edit_alert_threshold($add_array, $accountinfo['id']);
1418 1418
 			$this->session->set_flashdata('astpp_errormsg', 'Alert Threshold updated successfully!');
1419
-			redirect(base_url() . 'user/user_alert_threshold/');
1419
+			redirect(base_url().'user/user_alert_threshold/');
1420 1420
 		} else {
1421 1421
 			$where = array('id' => $accountinfo["id"]);
1422 1422
 			$account = $this->db_model->getSelect("notify_credit_limit,notify_flag,notify_email", "accounts", $where);
1423
-			$data['form'] = $this->form->build_form($this->user_form->user_alert_threshold(),(array)$account->first_row());
1423
+			$data['form'] = $this->form->build_form($this->user_form->user_alert_threshold(), (array)$account->first_row());
1424 1424
 			$this->load->view('view_user_alert_threshold', $data);
1425 1425
 		}
1426 1426
 	}
1427 1427
     
1428 1428
 	function user_cdrs_report() {
1429
-		$accountinfo=$this->session->userdata('accountinfo');
1429
+		$accountinfo = $this->session->userdata('accountinfo');
1430 1430
 		$data['page_title'] = 'CDRs';
1431 1431
 		$data['search_flag'] = true;
1432 1432
 		$data["grid_buttons"] = $this->user_form->build_cdrs_report_buttons();
@@ -1436,10 +1436,10 @@  discard block
 block discarded – undo
1436 1436
 	}
1437 1437
 
1438 1438
 	function user_cdrs_report_json() {
1439
-		$accountinfo=$this->session->userdata('accountinfo');
1440
-		$variable=$accountinfo['type'] != 3 ?'total_debit':'total_cost';
1439
+		$accountinfo = $this->session->userdata('accountinfo');
1440
+		$variable = $accountinfo['type'] != 3 ? 'total_debit' : 'total_cost';
1441 1441
 		$count_res = $this->user_model->getuser_cdrs_list(false, "", "");
1442
-		$count_all = (array) $count_res->first_row();
1442
+		$count_all = (array)$count_res->first_row();
1443 1443
 		$paging_data = $this->form->load_grid_config($count_all['count'], $_GET['rp'], $_GET['page']);
1444 1444
 		$json_data = $paging_data["json_paging"];
1445 1445
 		$query = $this->user_model->getuser_cdrs_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"], false);
@@ -1447,16 +1447,16 @@  discard block
 block discarded – undo
1447 1447
 		$json_data['rows'] = $this->form->build_grid($query, $grid_fields);
1448 1448
 		if ($count_all['count'] > 0) {
1449 1449
 			$search_arr = $this->session->userdata('user_cdrs_report_search');
1450
-			$show_seconds = (!empty($search_arr['search_in'])) ? $search_arr['search_in'] : 'minutes';
1451
-			$duration = ($show_seconds == 'minutes') ? ($count_all['billseconds'] > 0 ) ?
1452
-			floor($count_all['billseconds'] / 60) . ":" . sprintf("%02d", $count_all['billseconds'] % 60) : "00:00"  : $count_all['billseconds'];
1450
+			$show_seconds = ( ! empty($search_arr['search_in'])) ? $search_arr['search_in'] : 'minutes';
1451
+			$duration = ($show_seconds == 'minutes') ? ($count_all['billseconds'] > 0) ?
1452
+			floor($count_all['billseconds'] / 60).":".sprintf("%02d", $count_all['billseconds'] % 60) : "00:00" : $count_all['billseconds'];
1453 1453
 			$json_data['rows'][] = array("cell" => array(
1454 1454
 					"<b>Grand Total</b>",
1455 1455
 					"",
1456 1456
 					"",
1457 1457
 					"",
1458 1458
 					$duration,
1459
-					"<b>".$this->common_model->calculate_currency($count_all[$variable],"","",true,false)."</b>",
1459
+					"<b>".$this->common_model->calculate_currency($count_all[$variable], "", "", true, false)."</b>",
1460 1460
 					"",
1461 1461
 					"",
1462 1462
 					));
@@ -1477,7 +1477,7 @@  discard block
 block discarded – undo
1477 1477
 			$this->session->set_userdata('user_cdrs_report_search', $action);
1478 1478
 		}
1479 1479
 		if (@$ajax_search != 1) {
1480
-			redirect(base_url() . 'user/user_cdrs_report/');
1480
+			redirect(base_url().'user/user_cdrs_report/');
1481 1481
 		}
1482 1482
 	}
1483 1483
 
@@ -1488,20 +1488,20 @@  discard block
 block discarded – undo
1488 1488
 
1489 1489
 	function user_cdrreport_export() {
1490 1490
 		$account_info = $accountinfo = $this->session->userdata('accountinfo');
1491
-		$currency_id=$account_info['currency_id'];
1492
-		$currency=$this->common->get_field_name('currency', 'currency', $currency_id);
1491
+		$currency_id = $account_info['currency_id'];
1492
+		$currency = $this->common->get_field_name('currency', 'currency', $currency_id);
1493 1493
 		$count_res = $this->user_model->getuser_cdrs_list(false, "", "");
1494
-		$count_all = (array) $count_res->first_row();
1494
+		$count_all = (array)$count_res->first_row();
1495 1495
 		ob_clean();
1496
-		$customer_array[] = array("Date", "CallerID", "Called Number","Code", "Destination", "Duration", "Debit($currency)", "Disposition", "Call Type");
1496
+		$customer_array[] = array("Date", "CallerID", "Called Number", "Code", "Destination", "Duration", "Debit($currency)", "Disposition", "Call Type");
1497 1497
 		if ($count_all['count'] > 0) {
1498 1498
 			$query = $this->user_model->getuser_cdrs_list(true, '', '', true);
1499 1499
 			$currency_info = $this->common->get_currency_info();
1500 1500
 			$search_arr = $this->session->userdata('user_cdrs_report_search');
1501
-			$show_seconds = (!empty($search_arr['search_in'])) ? $search_arr['search_in'] : 'minutes';
1501
+			$show_seconds = ( ! empty($search_arr['search_in'])) ? $search_arr['search_in'] : 'minutes';
1502 1502
 			foreach ($query->result_array() as $value) {
1503
-				$duration = ($show_seconds == 'minutes') ? ($value['billseconds'] > 0 ) ?
1504
-								floor($value['billseconds'] / 60) . ":" . sprintf("%02d", $value['billseconds'] % 60) : "00:00"  : $value['billseconds'];
1503
+				$duration = ($show_seconds == 'minutes') ? ($value['billseconds'] > 0) ?
1504
+								floor($value['billseconds'] / 60).":".sprintf("%02d", $value['billseconds'] % 60) : "00:00" : $value['billseconds'];
1505 1505
 				$customer_array[] = array(
1506 1506
 					$this->common->convert_GMT_to('', '', $value['callstart']),
1507 1507
 					$value['callerid'],
@@ -1509,13 +1509,13 @@  discard block
 block discarded – undo
1509 1509
 					filter_var($value['pattern'], FILTER_SANITIZE_NUMBER_INT),
1510 1510
 					$value['notes'],
1511 1511
 					$duration,
1512
-					$this->common->calculate_currency_manually($currency_info, $value['debit'],false),
1512
+					$this->common->calculate_currency_manually($currency_info, $value['debit'], false),
1513 1513
 					$value['disposition'],
1514 1514
 					$value['calltype']
1515 1515
 				);
1516 1516
 			}
1517
-			$duration = ($show_seconds == 'minutes') ? ($count_all['billseconds'] > 0 ) ?
1518
-							floor($count_all['billseconds'] / 60) . ":" . sprintf("%02d", $count_all['billseconds'] % 60) : "00:00"  : $count_all['billseconds'];
1517
+			$duration = ($show_seconds == 'minutes') ? ($count_all['billseconds'] > 0) ?
1518
+							floor($count_all['billseconds'] / 60).":".sprintf("%02d", $count_all['billseconds'] % 60) : "00:00" : $count_all['billseconds'];
1519 1519
 			$customer_array[] = array("Grand Total",
1520 1520
 				"",
1521 1521
 				"",
@@ -1528,26 +1528,26 @@  discard block
 block discarded – undo
1528 1528
 			);
1529 1529
 		}
1530 1530
 		$this->load->helper('csv');
1531
-		array_to_csv($customer_array, 'Customer_CDR_' . date("Y-m-d") . '.csv');
1531
+		array_to_csv($customer_array, 'Customer_CDR_'.date("Y-m-d").'.csv');
1532 1532
 	}
1533
-	function user_payment($action=""){
1534
-	  if(common_model::$global_config['system_config']['paypal_status'] == 1){
1535
-		redirect(base_url() . 'user/user/');  
1533
+	function user_payment($action = "") {
1534
+	  if (common_model::$global_config['system_config']['paypal_status'] == 1) {
1535
+		redirect(base_url().'user/user/');  
1536 1536
 	  }
1537 1537
 		$this->load->module("user/payment");
1538
-		if($action=="GET_AMT"){
1539
-			$amount = $this->input->post("value",true);
1538
+		if ($action == "GET_AMT") {
1539
+			$amount = $this->input->post("value", true);
1540 1540
 			$this->payment->convert_amount($amount);
1541
-		}else{
1541
+		} else {
1542 1542
 			$this->payment->index();
1543 1543
 		}
1544 1544
 	}
1545 1545
     
1546
-	function user_fund_transfer(){
1546
+	function user_fund_transfer() {
1547 1547
 		$data['page_title'] = 'Fund Transfer';
1548 1548
 		$accountinfo = $this->session->userdata('accountinfo');
1549
-		$account=(array)$this->db->get_where('accounts',array("id"=>$accountinfo['id']))->first_row();
1550
-		$currency = (array)$this->db->get_where('currency',array("id"=>$account['currency_id']))->first_row();
1549
+		$account = (array)$this->db->get_where('accounts', array("id"=>$accountinfo['id']))->first_row();
1550
+		$currency = (array)$this->db->get_where('currency', array("id"=>$account['currency_id']))->first_row();
1551 1551
 		$data['form'] = $this->form->build_form($this->user_form->build_user_fund_transfer_form($account['number'], $currency['currency'], $accountinfo['id']), '');
1552 1552
 		$this->load->view('view_user_fund_transfer', $data);
1553 1553
 	}
@@ -1556,8 +1556,8 @@  discard block
 block discarded – undo
1556 1556
 		$data['page_title'] = 'Fund Transfer';
1557 1557
 		$post_array = $this->input->post();
1558 1558
 		$accountinfo = $this->session->userdata('accountinfo');
1559
-		$account=(array)$this->db->get_where('accounts',array("id"=>$accountinfo['id']))->first_row();
1560
-		$currency = (array)$this->db->get_where('currency',array("id"=>$account['currency_id']))->first_row();
1559
+		$account = (array)$this->db->get_where('accounts', array("id"=>$accountinfo['id']))->first_row();
1560
+		$currency = (array)$this->db->get_where('currency', array("id"=>$account['currency_id']))->first_row();
1561 1561
 		$data['form'] = $this->form->build_form($this->user_form->build_user_fund_transfer_form($account['number'], $currency['currency'], $accountinfo['id']), $post_array);
1562 1562
 		if ($this->form_validation->run() == FALSE) {
1563 1563
 			$data['validation_errors'] = validation_errors();
@@ -1566,11 +1566,11 @@  discard block
 block discarded – undo
1566 1566
 				$account_info = $this->session->userdata('accountinfo');
1567 1567
 				$balance = $this->common->get_field_name('balance', 'accounts', array('id' => $account_info['id'], 'status' => 0, 'type' => 0, 'deleted' => 0));                
1568 1568
 				$toid = $this->common->get_field_name('id', 'accounts', array('number' => $post_array['toaccountid'], 'status' => 0, 'type' => 0, 'deleted' => 0));
1569
-				$toaccountinfo=(array)$this->db->get_where('accounts',array('number' => $post_array['toaccountid'], 'status' => 0, 'type' => 0, 'deleted' => 0),1)->first_row();
1570
-				if($toaccountinfo){
1569
+				$toaccountinfo = (array)$this->db->get_where('accounts', array('number' => $post_array['toaccountid'], 'status' => 0, 'type' => 0, 'deleted' => 0), 1)->first_row();
1570
+				if ($toaccountinfo) {
1571 1571
 				$reseller_id = $toaccountinfo['reseller_id'];
1572 1572
 				$post_array['credit'] = $this->common_model->add_calculate_currency($post_array['credit'], '', '', false, false);
1573
-				$minimum_fund=(array)$this->db->get_where('system',array("name"=>"minimum_fund_transfer"),1)->first_row();
1573
+				$minimum_fund = (array)$this->db->get_where('system', array("name"=>"minimum_fund_transfer"), 1)->first_row();
1574 1574
 				if ($post_array['toaccountid'] == $account_info['number']) {
1575 1575
 					$this->session->set_flashdata('astpp_notification', 'You can not transfer fund in same account.');
1576 1576
 				}
@@ -1586,21 +1586,21 @@  discard block
 block discarded – undo
1586 1586
 				elseif ($post_array['credit'] > $balance) {
1587 1587
 					$this->session->set_flashdata('astpp_notification', 'You have insufficient balance.');
1588 1588
 				}
1589
-				elseif ($toid <= 0 || !isset($post_array['toaccountid'])) {
1589
+				elseif ($toid <= 0 || ! isset($post_array['toaccountid'])) {
1590 1590
 					$this->session->set_flashdata('astpp_notification', 'Please enter valid account number.');
1591 1591
 				}
1592 1592
 				elseif ($post_array['credit'] < 0) {
1593 1593
 					$this->session->set_flashdata('astpp_notification', 'Please enter amount greater then 0.');
1594 1594
 				}
1595 1595
 				elseif ($minimum_fund['value'] >= $post_array['credit']) {
1596
-					$this->session->set_flashdata('astpp_notification', 'You need to enter minimum amount of fund transfer ' . $minimum_fund['value'] . ' .');
1596
+					$this->session->set_flashdata('astpp_notification', 'You need to enter minimum amount of fund transfer '.$minimum_fund['value'].' .');
1597 1597
 				}
1598
-				elseif (!isset($toid) || !isset($post_array['toaccountid'])) {
1598
+				elseif ( ! isset($toid) || ! isset($post_array['toaccountid'])) {
1599 1599
 					$this->session->set_flashdata('astpp_notification', 'Please enter valid account number!');
1600 1600
 				}
1601 1601
 				elseif ($post_array['credit'] < 0 || $post_array['credit'] > $balance) {
1602 1602
 					$this->session->set_flashdata('astpp_notification', 'Insuffiecient amount !');
1603
-				}else{
1603
+				} else {
1604 1604
 					$from['id'] = $post_array['id'];
1605 1605
 					$from['account_currency'] = $post_array['account_currency'];
1606 1606
 					$from['accountid'] = $post_array['fromaccountid'];
@@ -1635,13 +1635,13 @@  discard block
 block discarded – undo
1635 1635
 						$this->session->set_flashdata('astpp_notification', 'Sorry We are not able to process this request.');
1636 1636
 					}
1637 1637
 				}
1638
-			}else{
1638
+			} else {
1639 1639
 		$this->session->set_flashdata('astpp_notification', 'Account number not found.');
1640 1640
 			}
1641 1641
 			} else {
1642 1642
 				$this->session->set_flashdata('astpp_notification', 'You can not transfer fund in same account.');
1643 1643
 			}
1644
-			redirect(base_url() . 'user/user_fund_transfer/');
1644
+			redirect(base_url().'user/user_fund_transfer/');
1645 1645
 		}
1646 1646
 		$this->load->view('view_user_fund_transfer', $data);
1647 1647
 	}
@@ -1659,7 +1659,7 @@  discard block
 block discarded – undo
1659 1659
 		$accountinfo = $this->session->userdata("accountinfo");
1660 1660
 		$json_data = array();
1661 1661
 		$count_all = $this->user_model->get_user_opensips(false, $accountinfo['number']);
1662
-		$paging_data = $this->form->load_grid_config($count_all,$_GET['rp'],$_GET['page']);
1662
+		$paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
1663 1663
 		$json_data = $paging_data["json_paging"];
1664 1664
 		$query = $this->user_model->get_user_opensips(true, $accountinfo['number'], $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
1665 1665
 		$grid_fields = json_decode($this->user_form->build_user_opensips());
@@ -1683,7 +1683,7 @@  discard block
 block discarded – undo
1683 1683
 			$this->session->set_userdata('user_opensips_search', $action);
1684 1684
 		}
1685 1685
 		if ($ajax_search != 1) {
1686
-			redirect(base_url() . 'user/user_opensips/');
1686
+			redirect(base_url().'user/user_opensips/');
1687 1687
 		}
1688 1688
 	}
1689 1689
 
@@ -1696,10 +1696,10 @@  discard block
 block discarded – undo
1696 1696
 		$this->load->view('view_opensips_add_edit', $data);
1697 1697
 	}
1698 1698
     
1699
-	function user_opensips_edit($edit_id){
1699
+	function user_opensips_edit($edit_id) {
1700 1700
 	$data['page_title'] = 'Edit Opensips';
1701 1701
 		$db_config = Common_model::$global_config['system_config'];
1702
-		$opensipdsn = "mysql://" . $db_config['opensips_dbuser'] . ":" . $db_config['opensips_dbpass'] . "@" . $db_config['opensips_dbhost'] . "/" . $db_config['opensips_dbname'] . "?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir=";
1702
+		$opensipdsn = "mysql://".$db_config['opensips_dbuser'].":".$db_config['opensips_dbpass']."@".$db_config['opensips_dbhost']."/".$db_config['opensips_dbname']."?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir=";
1703 1703
 		$this->opensips_db = $this->load->database($opensipdsn, true);
1704 1704
 		$where = array('id' => $edit_id);
1705 1705
 		$this->opensips_db->where($where);
@@ -1712,7 +1712,7 @@  discard block
 block discarded – undo
1712 1712
     
1713 1713
 	}
1714 1714
     
1715
-	function user_opensips_save(){
1715
+	function user_opensips_save() {
1716 1716
 	$add_array = $this->input->post();
1717 1717
 		$data['form'] = $this->form->build_form($this->user_form->build_user_opensips_form(), $add_array);
1718 1718
 		if ($add_array['id'] != '') {
@@ -1723,11 +1723,11 @@  discard block
 block discarded – undo
1723 1723
 				exit;
1724 1724
 			} else {
1725 1725
 				$auth_flag = $this->validate_device_data($add_array);
1726
-				if($auth_flag == "TRUE"){
1726
+				if ($auth_flag == "TRUE") {
1727 1727
 						$this->user_model->user_opensips_edit($add_array, $add_array['id']);
1728 1728
 						echo json_encode(array("SUCCESS"=> " OpenSips updated successfully!"));
1729 1729
 						exit;
1730
-				}else{
1730
+				} else {
1731 1731
 					   echo json_encode($auth_flag);
1732 1732
 					   exit;
1733 1733
 				}
@@ -1740,48 +1740,48 @@  discard block
 block discarded – undo
1740 1740
 				exit;
1741 1741
 			} else {
1742 1742
 				$auth_flag = $this->validate_device_data($add_array);
1743
-				if($auth_flag == "TRUE"){
1743
+				if ($auth_flag == "TRUE") {
1744 1744
 						$this->user_model->user_opensips_add($add_array);
1745 1745
 						echo json_encode(array("SUCCESS"=> "OpenSips added successfully!"));
1746 1746
 						exit;
1747
-				}else{
1747
+				} else {
1748 1748
 					   echo json_encode($auth_flag);
1749 1749
 						exit;
1750 1750
 				}
1751 1751
 			}
1752 1752
 		}
1753 1753
 	}
1754
-	function validate_device_data($data){
1755
-		if(isset($data["username"]) && $data["username"] != ""){
1754
+	function validate_device_data($data) {
1755
+		if (isset($data["username"]) && $data["username"] != "") {
1756 1756
 				$db_config = Common_model::$global_config['system_config'];
1757
-				$opensipdsn = "mysql://" . $db_config['opensips_dbuser'] . ":" . $db_config['opensips_dbpass'] . "@" . $db_config['opensips_dbhost'] . "/" . $db_config['opensips_dbname'] . "?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir=";
1757
+				$opensipdsn = "mysql://".$db_config['opensips_dbuser'].":".$db_config['opensips_dbpass']."@".$db_config['opensips_dbhost']."/".$db_config['opensips_dbname']."?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir=";
1758 1758
 				$this->opensips_db = $this->load->database($opensipdsn, true);
1759 1759
 				$where = array("username"=>$data["username"]);
1760
-				if($data['id'] != ""){
1761
-					$this->opensips_db->where("id <>",$data['id']);
1760
+				if ($data['id'] != "") {
1761
+					$this->opensips_db->where("id <>", $data['id']);
1762 1762
 				}
1763 1763
 				$this->opensips_db->where($where);
1764 1764
 				$auth_flag = $this->opensips_db->get("subscriber");
1765 1765
 				$auth_flag = $auth_flag->num_rows();
1766
-				if($auth_flag == 0){
1766
+				if ($auth_flag == 0) {
1767 1767
 					return "TRUE";
1768
-				}else{
1768
+				} else {
1769 1769
 					return array("username_error"=>"Duplicate Username Found.Username Must be Unique");
1770 1770
 				}
1771
-		}else{
1771
+		} else {
1772 1772
 		  return array("username_error"=>"User name is required field.");
1773 1773
 		}
1774 1774
 		return "0";
1775 1775
 	}
1776 1776
     
1777
-	function user_opensips_delete($id){
1777
+	function user_opensips_delete($id) {
1778 1778
 	  $this->user_model->user_opensips_delete($id);
1779 1779
 	  $this->session->set_flashdata('astpp_errormsg', 'Opensips Device Removed Successfully!.');
1780
-	  redirect(base_url() . "user/user_opensips/");
1780
+	  redirect(base_url()."user/user_opensips/");
1781 1781
 	}
1782
-	function user_opensips_delete_multiple(){
1782
+	function user_opensips_delete_multiple() {
1783 1783
 	  $db_config = Common_model::$global_config['system_config'];
1784
-	  $opensipdsn = "mysql://" . $db_config['opensips_dbuser'] . ":" . $db_config['opensips_dbpass'] . "@" . $db_config['opensips_dbhost'] . "/" . $db_config['opensips_dbname'] . "?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir=";
1784
+	  $opensipdsn = "mysql://".$db_config['opensips_dbuser'].":".$db_config['opensips_dbpass']."@".$db_config['opensips_dbhost']."/".$db_config['opensips_dbname']."?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir=";
1785 1785
 	  $this->opensips_db = $this->load->database($opensipdsn, true);
1786 1786
 	  $ids = $this->input->post("selected_ids", true);
1787 1787
 	  $where = "id IN ($ids)";
@@ -1790,27 +1790,27 @@  discard block
 block discarded – undo
1790 1790
 	  echo TRUE;
1791 1791
 	}
1792 1792
     
1793
-	function user_cdrs(){
1793
+	function user_cdrs() {
1794 1794
 	  $data['username'] = $this->session->userdata('user_name');
1795
-	  $accountinfo=$this->session->userdata('accountinfo');
1795
+	  $accountinfo = $this->session->userdata('accountinfo');
1796 1796
 	  $data['page_title'] = 'CDRs';
1797 1797
 	  $accounttype = strtolower($this->common->get_entity_type('', '', $accountinfo['type']));
1798 1798
 	  $this->load->module('reports/reports');
1799 1799
 	  $data['grid_fields'] = $this->reports->reports_form->build_report_list_for_user($accounttype);
1800 1800
 	  $data['form_search'] = $this->form->build_serach_form($this->user_form->build_user_opensips_search());
1801
-	  $data['accounttype']=$accounttype;
1801
+	  $data['accounttype'] = $accounttype;
1802 1802
 	  $this->load->view('view_user_cdrs', $data);    
1803 1803
 	}
1804
-	function user_cdrs_json(){
1805
-	  $accountinfo=$this->session->userdata('accountinfo');
1804
+	function user_cdrs_json() {
1805
+	  $accountinfo = $this->session->userdata('accountinfo');
1806 1806
 	  $accounttype = strtolower($this->common->get_entity_type('', '', $accountinfo['type']));
1807 1807
 	  $this->load->module('reports/reports');
1808 1808
 	  $this->reports->customer_cdrreport($accountinfo['id'], $accounttype);     
1809 1809
 	}
1810
-	function user_details_search($module_name){
1810
+	function user_details_search($module_name) {
1811 1811
 		$action = $this->input->post();
1812
-		$this->session->set_userdata('left_panel_search_'.$module_name,"");
1813
-		if(!empty($action['left_panel_search'])){
1812
+		$this->session->set_userdata('left_panel_search_'.$module_name, "");
1813
+		if ( ! empty($action['left_panel_search'])) {
1814 1814
 			$this->session->set_userdata('left_panel_search_'.$module_name, $action['left_panel_search']);
1815 1815
 	}
1816 1816
 	}
@@ -1822,7 +1822,7 @@  discard block
 block discarded – undo
1822 1822
     
1823 1823
     
1824 1824
 	function user_provider_cdrs_report() {
1825
-		$accountinfo=$this->session->userdata('accountinfo');
1825
+		$accountinfo = $this->session->userdata('accountinfo');
1826 1826
 		$data['page_title'] = 'Provider CDRs Report';
1827 1827
 		$data['search_flag'] = true;
1828 1828
 		$data["grid_buttons"] = $this->user_form->build_provider_report_buttons();
@@ -1832,10 +1832,10 @@  discard block
 block discarded – undo
1832 1832
 	}
1833 1833
 
1834 1834
 	function user_provider_cdrs_report_json() {
1835
-		$accountinfo=$this->session->userdata('accountinfo');
1836
-		$variable=$accountinfo['type'] != 3 ?'total_debit':'total_cost';
1835
+		$accountinfo = $this->session->userdata('accountinfo');
1836
+		$variable = $accountinfo['type'] != 3 ? 'total_debit' : 'total_cost';
1837 1837
 		$count_res = $this->user_model->getprovider_cdrs_list(false, "", "");
1838
-		$count_all = (array) $count_res->first_row();
1838
+		$count_all = (array)$count_res->first_row();
1839 1839
 		$paging_data = $this->form->load_grid_config($count_all['count'], $_GET['rp'], $_GET['page']);
1840 1840
 		$json_data = $paging_data["json_paging"];
1841 1841
 		$query = $this->user_model->getprovider_cdrs_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"], false);
@@ -1843,16 +1843,16 @@  discard block
 block discarded – undo
1843 1843
 		$json_data['rows'] = $this->form->build_grid($query, $grid_fields);
1844 1844
 		if ($count_all['count'] > 0) {
1845 1845
 			$search_arr = $this->session->userdata('user_provider_cdrs_report_search');
1846
-			$show_seconds = (!empty($search_arr['search_in'])) ? $search_arr['search_in'] : 'minutes';
1847
-			$duration = ($show_seconds == 'minutes') ? ($count_all['billseconds'] > 0 ) ?
1848
-			floor($count_all['billseconds'] / 60) . ":" . sprintf("%02d", $count_all['billseconds'] % 60) : "00:00"  : $count_all['billseconds'];
1846
+			$show_seconds = ( ! empty($search_arr['search_in'])) ? $search_arr['search_in'] : 'minutes';
1847
+			$duration = ($show_seconds == 'minutes') ? ($count_all['billseconds'] > 0) ?
1848
+			floor($count_all['billseconds'] / 60).":".sprintf("%02d", $count_all['billseconds'] % 60) : "00:00" : $count_all['billseconds'];
1849 1849
 			$json_data['rows'][] = array("cell" => array(
1850 1850
 					"<b>Grand Total</b>",
1851 1851
 					"",
1852 1852
 					"",
1853 1853
 					"",
1854 1854
 					$duration,
1855
-					"<b>".$this->common_model->calculate_currency($count_all[$variable],"","",true,false)."</b>",
1855
+					"<b>".$this->common_model->calculate_currency($count_all[$variable], "", "", true, false)."</b>",
1856 1856
 					"",
1857 1857
 					"",
1858 1858
 					));
@@ -1873,7 +1873,7 @@  discard block
 block discarded – undo
1873 1873
 			$this->session->set_userdata('user_provider_cdrs_report_search', $action);
1874 1874
 		}
1875 1875
 		if ($ajax_search != 1) {
1876
-			redirect(base_url() . 'user/user_provider_cdrs_report/');
1876
+			redirect(base_url().'user/user_provider_cdrs_report/');
1877 1877
 		}
1878 1878
 	}
1879 1879
 
@@ -1884,53 +1884,53 @@  discard block
 block discarded – undo
1884 1884
 
1885 1885
 	function user_provider_cdrreport_export() {
1886 1886
 	$account_info = $accountinfo = $this->session->userdata('accountinfo');
1887
-	$currency_id=$account_info['currency_id'];
1888
-	$currency=$this->common->get_field_name('currency', 'currency', $currency_id);
1887
+	$currency_id = $account_info['currency_id'];
1888
+	$currency = $this->common->get_field_name('currency', 'currency', $currency_id);
1889 1889
 		$count_res = $this->user_model->getprovider_cdrs_list(false, "", "");
1890
-		$count_all = (array) $count_res->first_row();
1890
+		$count_all = (array)$count_res->first_row();
1891 1891
 		ob_clean();
1892 1892
 		$customer_array[] = array("Date", "CallerID", "Called Number", "Destination", "Duration", "Cost($currency)", "Disposition", "Call Type");
1893 1893
 		if ($count_all['count'] > 0) {
1894 1894
 			$query = $this->user_model->getuser_cdrs_list(true, '', '', true);
1895 1895
 			$currency_info = $this->common->get_currency_info();
1896 1896
 			$search_arr = $this->session->userdata('user_provider_cdrs_report_search');
1897
-			$show_seconds = (!empty($search_arr['search_in'])) ? $search_arr['search_in'] : 'minutes';
1897
+			$show_seconds = ( ! empty($search_arr['search_in'])) ? $search_arr['search_in'] : 'minutes';
1898 1898
 			foreach ($query->result_array() as $value) {
1899
-				$duration = ($show_seconds == 'minutes') ? ($value['billseconds'] > 0 ) ?
1900
-				floor($value['billseconds'] / 60) . ":" . sprintf("%02d", $value['billseconds'] % 60) : "00:00"  : $value['billseconds'];
1899
+				$duration = ($show_seconds == 'minutes') ? ($value['billseconds'] > 0) ?
1900
+				floor($value['billseconds'] / 60).":".sprintf("%02d", $value['billseconds'] % 60) : "00:00" : $value['billseconds'];
1901 1901
 				$customer_array[] = array(
1902 1902
 					$this->common->convert_GMT_to('', '', $value['callstart']),
1903 1903
 					$value['callerid'],
1904 1904
 					$value['callednum'],
1905 1905
 					filter_var($value['pattern'], FILTER_SANITIZE_NUMBER_INT),
1906 1906
 					$duration,
1907
-					$this->common->calculate_currency_manually($currency_info, $value['cost'],false),
1907
+					$this->common->calculate_currency_manually($currency_info, $value['cost'], false),
1908 1908
 					$value['disposition'],
1909 1909
 					$value['calltype']
1910 1910
 				);
1911 1911
 			}
1912
-			$duration = ($show_seconds == 'minutes') ? ($count_all['billseconds'] > 0 ) ?
1913
-			floor($count_all['billseconds'] / 60) . ":" . sprintf("%02d", $count_all['billseconds'] % 60) : "00:00"  : $count_all['billseconds'];
1912
+			$duration = ($show_seconds == 'minutes') ? ($count_all['billseconds'] > 0) ?
1913
+			floor($count_all['billseconds'] / 60).":".sprintf("%02d", $count_all['billseconds'] % 60) : "00:00" : $count_all['billseconds'];
1914 1914
 			$customer_array[] = array("Grand Total",
1915 1915
 				"",
1916 1916
 				"",
1917 1917
 				"",
1918 1918
 				$duration,
1919
-				$this->common->calculate_currency_manually($currency_info, $count_all['total_cost'],false,true),
1919
+				$this->common->calculate_currency_manually($currency_info, $count_all['total_cost'], false, true),
1920 1920
 				"",
1921 1921
 				""
1922 1922
 			);
1923 1923
 		}
1924 1924
 		$this->load->helper('csv');
1925
-		array_to_csv($customer_array, 'Provider_CDR_' . date("Y-m-d") . '.csv');
1925
+		array_to_csv($customer_array, 'Provider_CDR_'.date("Y-m-d").'.csv');
1926 1926
 	}
1927
-	function user_speeddial(){
1927
+	function user_speeddial() {
1928 1928
 		$data['page_title'] = "Speed Dial";
1929 1929
 		$accountinfo = $this->session->userdata('accountinfo');
1930 1930
 		$where = array('id' => $accountinfo['id'], "reseller_id" => $accountinfo['reseller_id']);
1931 1931
 		$account = $this->db_model->getSelect("*", "accounts", $where);
1932 1932
 	if ($account->num_rows() > 0) {
1933
-	$account_data = (array) $account->first_row();
1933
+	$account_data = (array)$account->first_row();
1934 1934
 	$speeddial_res = $this->db->get_where("speed_dial", array("accountid" => $accountinfo['id']));
1935 1935
 	$speeddial_info = array();
1936 1936
 		if ($speeddial_res->num_rows() > 0) {
@@ -1941,14 +1941,14 @@  discard block
 block discarded – undo
1941 1941
 		}
1942 1942
 		$data['speeddial'] = $speeddial_info;
1943 1943
 	$this->load->view('view_user_speeddial', $data);
1944
-	} else{
1944
+	} else {
1945 1945
 	 redirect(base_url.'user/user/');
1946 1946
 	}
1947 1947
 	  }
1948 1948
       
1949
-	  function user_speeddial_save(){
1950
-		  $add_array= $this->input->post();
1951
-		  $accountinfo=$this->session->userdata('accountinfo');
1949
+	  function user_speeddial_save() {
1950
+		  $add_array = $this->input->post();
1951
+		  $accountinfo = $this->session->userdata('accountinfo');
1952 1952
 		  $where = array("accountid" => $accountinfo['id']);
1953 1953
 	  $this->db->select('count(id) as count');
1954 1954
 	  $this->db->where($where);
@@ -1966,8 +1966,8 @@  discard block
 block discarded – undo
1966 1966
 	  }
1967 1967
 	}
1968 1968
 	function user_speeddial_remove() {
1969
-	$accountinfo=$this->session->userdata('accountinfo');
1970
-	$add_array=$this->input->post();
1969
+	$accountinfo = $this->session->userdata('accountinfo');
1970
+	$add_array = $this->input->post();
1971 1971
 		$updateinfo = array('number' => '');
1972 1972
 		$this->db->where('speed_num', $add_array['number']);
1973 1973
 		$this->db->where('accountid', $accountinfo['id']);
Please login to merge, or discard this patch.
Braces   +33 added lines, -41 removed lines patch added patch discarded remove patch
@@ -36,8 +36,9 @@  discard block
 block discarded – undo
36 36
 	}
37 37
 
38 38
 	function index() {
39
-		if ($this->session->userdata('user_login') == FALSE)
40
-			redirect(base_url() . 'login/login');
39
+		if ($this->session->userdata('user_login') == FALSE) {
40
+					redirect(base_url() . 'login/login');
41
+		}
41 42
 		$data['page_title'] = 'Dashboard';
42 43
 		$this->load->view('view_user_dashboard', $data);
43 44
 	}
@@ -266,7 +267,7 @@  discard block
 block discarded – undo
266 267
 					$this->session->set_flashdata('astpp_notification', 'Insuffiecient fund to purchase this did');
267 268
 					redirect(base_url() . "user/user_didlist/");
268 269
 				}
269
-		}else{
270
+		} else{
270 271
 				$this->session->set_flashdata('astpp_notification', 'This DID already purchased by someone.');
271 272
 				redirect(base_url() . "user/user_didlist/");
272 273
 		}
@@ -298,7 +299,7 @@  discard block
 block discarded – undo
298 299
 			$this->session->set_flashdata('astpp_notification', 'DID Removed Successfully.');
299 300
 			redirect(base_url() . "user/user_didlist/");
300 301
 		}
301
-		}else{
302
+		} else{
302 303
 	  $this->session->set_flashdata('astpp_notification', 'DID not found.');
303 304
 	  redirect(base_url() . "user/user_didlist/");
304 305
 		}
@@ -355,8 +356,9 @@  discard block
 block discarded – undo
355 356
 				$markup = $this->common->get_field_name('markup', 'pricelists', array('id'=>$account_data["pricelist_id"]));
356 357
 				$markup = ($markup > 0)?$markup:1;
357 358
 				$action['cost']['cost'] = $this->common_model->add_calculate_currency($action['cost']['cost'], "", '', true, false);
358
-				if($account_data['type']!=3)
359
-					$action['cost']['cost']=($action['cost']['cost'] - ($action['cost']['cost']*$markup)/100);
359
+				if($account_data['type']!=3) {
360
+									$action['cost']['cost']=($action['cost']['cost'] - ($action['cost']['cost']*$markup)/100);
361
+				}
360 362
 			}
361 363
 			$this->session->set_userdata('user_rates_list_search', $action);
362 364
 		}
@@ -695,7 +697,7 @@  discard block
 block discarded – undo
695 697
 					$this->session->set_userdata('accountinfo', $result[0]);
696 698
 					$this->session->set_flashdata('astpp_errormsg',' Your profile updated successfully!');
697 699
 					redirect(base_url() . 'user/user_myprofile/');
698
-				}else{
700
+				} else{
699 701
 					$this->session->set_flashdata('astpp_notification', 'Something wrong.Please contact to administrator.');
700 702
 				}
701 703
 			}
@@ -729,7 +731,7 @@  discard block
 block discarded – undo
729 731
 				$this->session->set_flashdata('astpp_errormsg', 'Password updated successfully!');
730 732
 				redirect(base_url() . 'user/user_change_password/');
731 733
 			}
732
-		}else{
734
+		} else{
733 735
 			$data_array['id']=$accountinfo['id'];
734 736
 			$data['form'] = $this->form->build_form($this->user_form->get_userprofile_change_password(),$data_array);
735 737
 		}
@@ -745,7 +747,7 @@  discard block
 block discarded – undo
745 747
 		$data['form_search'] = $this->form->build_serach_form($this->user_form->build_user_refill_report_search());
746 748
 		if($accountinfo['type'] == 1){
747 749
 			$this->load->view('view_reseller_refill_report', $data);
748
-		}else{
750
+		} else{
749 751
 			$this->load->view('view_user_refill_report', $data);
750 752
 		}
751 753
 	}
@@ -829,19 +831,18 @@  discard block
 block discarded – undo
829 831
 			} else {
830 832
 				$payment = ' <button style="padding: 0 8px;" class="btn btn-success" type="button">Paid</button>';
831 833
 			}
832
-	   }else{
834
+	   } else{
833 835
 				$payment = '';
834 836
 	   }
835 837
 			if($value['generate_type'] == 1){
836 838
 		$invoice_type='Manually';
837
-	   }else{
839
+	   } else{
838 840
 		$invoice_type='Automatically';
839 841
 	   } 
840 842
 	   
841 843
 	   if($value['type'] == 'R'){
842 844
 		$icon = '<div class="flx_font flx_magenta">R</div>';
843
-		}
844
-		else
845
+		} else
845 846
 		{		
846 847
 			$icon = '<div class="flx_font flx_drk_pink">I</div>';
847 848
 			
@@ -904,7 +905,7 @@  discard block
 block discarded – undo
904 905
 			$amount = $this->input->post("value",true);
905 906
 	   $amount = $this->common_model->add_calculate_currency($amount,"","",true,false);
906 907
 	   echo number_format($amount,2);
907
-		}else{
908
+		} else{
908 909
 			$this->payment->index();
909 910
 		}
910 911
 	}
@@ -1092,7 +1093,7 @@  discard block
 block discarded – undo
1092 1093
 	  $this->db->where('reseller_pricing.note','dids.number',false);
1093 1094
 	  $this->db->where('reseller_pricing.reseller_id',$accountinfo['reseller_id']);
1094 1095
 	  $this->db->from('dids,reseller_pricing');
1095
-		}else{
1096
+		} else{
1096 1097
 	  $this->db->where('parent_id',0);
1097 1098
 	  $this->db->where('accountid',0);
1098 1099
 	  $this->db->select('id,number,setup,monthlycost');
@@ -1393,7 +1394,7 @@  discard block
 block discarded – undo
1393 1394
 									);
1394 1395
 				$this->db->insert("ani_map", $insert_arr);
1395 1396
 				$this->session->set_flashdata('astpp_errormsg', 'Add Caller ID Sucessfully!');
1396
-				}else{
1397
+				} else{
1397 1398
 					 $this->session->set_flashdata('astpp_notification', 'Please Enter Caller ID value.');
1398 1399
 				}
1399 1400
 			} else {
@@ -1538,7 +1539,7 @@  discard block
 block discarded – undo
1538 1539
 		if($action=="GET_AMT"){
1539 1540
 			$amount = $this->input->post("value",true);
1540 1541
 			$this->payment->convert_amount($amount);
1541
-		}else{
1542
+		} else{
1542 1543
 			$this->payment->index();
1543 1544
 		}
1544 1545
 	}
@@ -1573,34 +1574,25 @@  discard block
 block discarded – undo
1573 1574
 				$minimum_fund=(array)$this->db->get_where('system',array("name"=>"minimum_fund_transfer"),1)->first_row();
1574 1575
 				if ($post_array['toaccountid'] == $account_info['number']) {
1575 1576
 					$this->session->set_flashdata('astpp_notification', 'You can not transfer fund in same account.');
1576
-				}
1577
-				elseif ($reseller_id != $account_info['reseller_id']) {
1577
+				} elseif ($reseller_id != $account_info['reseller_id']) {
1578 1578
 					$this->session->set_flashdata('astpp_notification', 'You can only transfer fund in same level account.');
1579
-				}
1580
-				elseif ($post_array['toaccountid'] == '') {
1579
+				} elseif ($post_array['toaccountid'] == '') {
1581 1580
 					$this->session->set_flashdata('astpp_notification', 'Please enter To account number.');
1582
-				}
1583
-				elseif (empty($post_array['credit'])) {
1581
+				} elseif (empty($post_array['credit'])) {
1584 1582
 					$this->session->set_flashdata('astpp_notification', 'Please enter a amount.');
1585
-				}
1586
-				elseif ($post_array['credit'] > $balance) {
1583
+				} elseif ($post_array['credit'] > $balance) {
1587 1584
 					$this->session->set_flashdata('astpp_notification', 'You have insufficient balance.');
1588
-				}
1589
-				elseif ($toid <= 0 || !isset($post_array['toaccountid'])) {
1585
+				} elseif ($toid <= 0 || !isset($post_array['toaccountid'])) {
1590 1586
 					$this->session->set_flashdata('astpp_notification', 'Please enter valid account number.');
1591
-				}
1592
-				elseif ($post_array['credit'] < 0) {
1587
+				} elseif ($post_array['credit'] < 0) {
1593 1588
 					$this->session->set_flashdata('astpp_notification', 'Please enter amount greater then 0.');
1594
-				}
1595
-				elseif ($minimum_fund['value'] >= $post_array['credit']) {
1589
+				} elseif ($minimum_fund['value'] >= $post_array['credit']) {
1596 1590
 					$this->session->set_flashdata('astpp_notification', 'You need to enter minimum amount of fund transfer ' . $minimum_fund['value'] . ' .');
1597
-				}
1598
-				elseif (!isset($toid) || !isset($post_array['toaccountid'])) {
1591
+				} elseif (!isset($toid) || !isset($post_array['toaccountid'])) {
1599 1592
 					$this->session->set_flashdata('astpp_notification', 'Please enter valid account number!');
1600
-				}
1601
-				elseif ($post_array['credit'] < 0 || $post_array['credit'] > $balance) {
1593
+				} elseif ($post_array['credit'] < 0 || $post_array['credit'] > $balance) {
1602 1594
 					$this->session->set_flashdata('astpp_notification', 'Insuffiecient amount !');
1603
-				}else{
1595
+				} else{
1604 1596
 					$from['id'] = $post_array['id'];
1605 1597
 					$from['account_currency'] = $post_array['account_currency'];
1606 1598
 					$from['accountid'] = $post_array['fromaccountid'];
@@ -1635,7 +1627,7 @@  discard block
 block discarded – undo
1635 1627
 						$this->session->set_flashdata('astpp_notification', 'Sorry We are not able to process this request.');
1636 1628
 					}
1637 1629
 				}
1638
-			}else{
1630
+			} else{
1639 1631
 		$this->session->set_flashdata('astpp_notification', 'Account number not found.');
1640 1632
 			}
1641 1633
 			} else {
@@ -1727,7 +1719,7 @@  discard block
 block discarded – undo
1727 1719
 						$this->user_model->user_opensips_edit($add_array, $add_array['id']);
1728 1720
 						echo json_encode(array("SUCCESS"=> " OpenSips updated successfully!"));
1729 1721
 						exit;
1730
-				}else{
1722
+				} else{
1731 1723
 					   echo json_encode($auth_flag);
1732 1724
 					   exit;
1733 1725
 				}
@@ -1744,7 +1736,7 @@  discard block
 block discarded – undo
1744 1736
 						$this->user_model->user_opensips_add($add_array);
1745 1737
 						echo json_encode(array("SUCCESS"=> "OpenSips added successfully!"));
1746 1738
 						exit;
1747
-				}else{
1739
+				} else{
1748 1740
 					   echo json_encode($auth_flag);
1749 1741
 						exit;
1750 1742
 				}
@@ -1765,10 +1757,10 @@  discard block
 block discarded – undo
1765 1757
 				$auth_flag = $auth_flag->num_rows();
1766 1758
 				if($auth_flag == 0){
1767 1759
 					return "TRUE";
1768
-				}else{
1760
+				} else{
1769 1761
 					return array("username_error"=>"Duplicate Username Found.Username Must be Unique");
1770 1762
 				}
1771
-		}else{
1763
+		} else{
1772 1764
 		  return array("username_error"=>"User name is required field.");
1773 1765
 		}
1774 1766
 		return "0";
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/user/libraries/user_form.php 2 patches
Spacing   +173 added lines, -173 removed lines patch added patch discarded remove patch
@@ -24,18 +24,18 @@  discard block
 block discarded – undo
24 24
 if ( ! defined('BASEPATH')) {
25 25
 	exit('No direct script access allowed');
26 26
 }
27
-class User_form{
27
+class User_form {
28 28
 	function __construct($library_name = '') {
29 29
 		$this->CI = & get_instance();
30 30
 	}
31 31
 
32 32
 
33
-function build_packages_list_for_user(){
33
+function build_packages_list_for_user() {
34 34
 		$grid_field_arr = json_encode(array(
35
-			array(gettext("Name"), "310", "package_name", "", "", "","","true","center"),
36
-			array(gettext("Rate Group"), "250", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"),
37
-			array(gettext("Included Seconds"), "260", "includedseconds", "", "", "","","true","center"),
38
-			array(gettext("Status"), "160", "status", "status", "status", "get_status","","true","center"),
35
+			array(gettext("Name"), "310", "package_name", "", "", "", "", "true", "center"),
36
+			array(gettext("Rate Group"), "250", "pricelist_id", "name", "pricelists", "get_field_name", "", "true", "center"),
37
+			array(gettext("Included Seconds"), "260", "includedseconds", "", "", "", "", "true", "center"),
38
+			array(gettext("Status"), "160", "status", "status", "status", "get_status", "", "true", "center"),
39 39
 				));
40 40
 		return $grid_field_arr;
41 41
 }
@@ -53,22 +53,22 @@  discard block
 block discarded – undo
53 53
         
54 54
 	function build_emails_list_for_user() {
55 55
 		$grid_field_arr = json_encode(array(
56
-			array(gettext("Date"), "110", "date", "", "", "","","true","center"),
57
-			array(gettext("From"), "170", "from", "", "", "","","true","center"),
58
-			array(gettext("Body"), "550", "body", "", "", "","","true","center"),
59
-			array(gettext("Attachement"), "100", "attachment", "attachment", "attachment", "attachment_icons","","true","center"),
60
-			array(gettext("Status"), "100", "status", "status", "status", "email_status","","true","center"),
56
+			array(gettext("Date"), "110", "date", "", "", "", "", "true", "center"),
57
+			array(gettext("From"), "170", "from", "", "", "", "", "true", "center"),
58
+			array(gettext("Body"), "550", "body", "", "", "", "", "true", "center"),
59
+			array(gettext("Attachement"), "100", "attachment", "attachment", "attachment", "attachment_icons", "", "true", "center"),
60
+			array(gettext("Status"), "100", "status", "status", "status", "email_status", "", "true", "center"),
61 61
 				));
62 62
 		return $grid_field_arr;
63 63
 	}
64
-	function build_user_emails_search(){
64
+	function build_user_emails_search() {
65 65
 		$form['forms'] = array("", array('id' => "user_emails_search"));
66 66
 		$form['Search'] = array(
67 67
 		array(gettext('From Date'), 'INPUT', array('name' => 'date[]', 'id' => 'customer_cdr_from_date', 'size' => '20',
68 68
  'class' => "text field "), '', 'tOOL TIP', '', 'date[date-date]'),
69 69
 		array(gettext('To Date'), 'INPUT', array('name' => 'date[]', 'id' => 'customer_cdr_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'date[date-date]'),
70
-		array(gettext('From'), 'INPUT', array('name' => 'from[from]', '','id'=>'from', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'from[from-string]', '', '', '', 'search_string_type', ''),
71
-		array(gettext('Body'), 'INPUT', array('name' => 'body[body]', '','id'=>'body', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'body[body-string]', '', '', '', 'search_string_type', ''),  
70
+		array(gettext('From'), 'INPUT', array('name' => 'from[from]', '', 'id'=>'from', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'from[from-string]', '', '', '', 'search_string_type', ''),
71
+		array(gettext('Body'), 'INPUT', array('name' => 'body[body]', '', 'id'=>'body', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'body[body-string]', '', '', '', 'search_string_type', ''),  
72 72
 		array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),         
73 73
 		array('', 'HIDDEN', 'advance_search', '1', '', '', '')
74 74
 		);
@@ -79,28 +79,28 @@  discard block
 block discarded – undo
79 79
    
80 80
 	function get_userprofile_form_fields($dataArr = false) {
81 81
 		if ($dataArr['id'] > 0)
82
-			$val = 'accounts.email.' . $dataArr['id'];
82
+			$val = 'accounts.email.'.$dataArr['id'];
83 83
 		else
84 84
 			$val = 'accounts.email';
85 85
 			$uname = $this->CI->common->find_uniq_rendno(common_model::$global_config['system_config']['cardlength'], 'number', 'accounts');
86 86
 			$password = $this->CI->common->generate_password();
87
-			$logintype=$this->CI->session->userdata('logintype');
88
-			$pin = ($logintype == '0')?array(gettext('Pin'), 'INPUT', array('name' => 'pin', 'size' => '20', 'class' => "text field medium"),  'tOOL TIP', ''):array('', 'HIDDEN', array('name' => 'Pin'), '', '', '', '');
89
-			$form['forms'] = array(base_url() . 'user/user_myprofile/', array("id" => "user_form", "name" => "user_form"));
87
+			$logintype = $this->CI->session->userdata('logintype');
88
+			$pin = ($logintype == '0') ? array(gettext('Pin'), 'INPUT', array('name' => 'pin', 'size' => '20', 'class' => "text field medium"), 'tOOL TIP', '') : array('', 'HIDDEN', array('name' => 'Pin'), '', '', '', '');
89
+			$form['forms'] = array(base_url().'user/user_myprofile/', array("id" => "user_form", "name" => "user_form"));
90 90
 
91 91
 			$form['User Profile'] = array(
92 92
 			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
93 93
 			array('', 'HIDDEN', array('name' => 'type', 'value' => '0'), '', '', ''),
94
-			array(gettext('Account Number'), 'INPUT', array('name' => 'number', 'value' => $uname, 'size' => '20', 'readonly' => true,  'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
94
+			array(gettext('Account Number'), 'INPUT', array('name' => 'number', 'value' => $uname, 'size' => '20', 'readonly' => true, 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
95 95
 			$pin,
96 96
 			array(gettext('Company'), 'INPUT', array('name' => 'company_name', 'size' => '15', 'class' => 'text field medium'), 'trim|xss_clean', 'tOOL TIP', ''),
97
-			array(gettext('First Name'), 'INPUT', array('name' => 'first_name', 'id' => 'first_name', 'size' => '15',  'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
98
-			array(gettext('Last Name'), 'INPUT', array('name' => 'last_name', 'size' => '15',  'class' => "text field medium"), 'trim|alpha_dash|xss_clean', 'tOOL TIP', 'Please Enter Password'),
99
-			array(gettext('Telephone 1'), 'INPUT', array('name' => 'telephone_1', 'size' => '15',  'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
100
-			array(gettext('Telephone 2'), 'INPUT', array('name' => 'telephone_2', 'size' => '15',  'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
101
-			array(gettext('Email'), 'INPUT', array('name' => 'email', 'size' => '50',  'class' => "text field medium"), 'required|valid_email|is_unique[' . $val . ']', 'tOOL TIP', 'Please Enter Password'),
102
-			array(gettext('Address 1'), 'INPUT', array('name' => 'address_1', 'size' => '15',  'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
103
-			array(gettext('Address 2'), 'INPUT', array('name' => 'address_2', 'size' => '15',  'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
97
+			array(gettext('First Name'), 'INPUT', array('name' => 'first_name', 'id' => 'first_name', 'size' => '15', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
98
+			array(gettext('Last Name'), 'INPUT', array('name' => 'last_name', 'size' => '15', 'class' => "text field medium"), 'trim|alpha_dash|xss_clean', 'tOOL TIP', 'Please Enter Password'),
99
+			array(gettext('Telephone 1'), 'INPUT', array('name' => 'telephone_1', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
100
+			array(gettext('Telephone 2'), 'INPUT', array('name' => 'telephone_2', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
101
+			array(gettext('Email'), 'INPUT', array('name' => 'email', 'size' => '50', 'class' => "text field medium"), 'required|valid_email|is_unique['.$val.']', 'tOOL TIP', 'Please Enter Password'),
102
+			array(gettext('Address 1'), 'INPUT', array('name' => 'address_1', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
103
+			array(gettext('Address 2'), 'INPUT', array('name' => 'address_2', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
104 104
 			array(gettext('City'), 'INPUT', array('name' => 'city', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
105 105
 			array(gettext('Province/State'), 'INPUT', array('name' => 'province', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
106 106
 			array(gettext('Zip/Postal Code'), 'INPUT', array('name' => 'postal_code', 'size' => '15', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', 'Please Enter Password'),
@@ -113,63 +113,63 @@  discard block
 block discarded – undo
113 113
 	}
114 114
   
115 115
 	 function get_userprofile_change_password() {
116
-		$form['forms'] = array(base_url() . 'user/user_change_password/', array("id" => "customer_alert_threshold", "name" => "user_change_password"));
116
+		$form['forms'] = array(base_url().'user/user_change_password/', array("id" => "customer_alert_threshold", "name" => "user_change_password"));
117 117
 		$form[gettext('Change Password')] = array(
118 118
 			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
119 119
 			array(gettext('Old Password'), 'INPUT', array('name' => 'password', 'size' => '20', 'class' => "text field medium", 'id' => 'new_password'), 'required|password_check[accounts]', 'tOOL TIP', '', ''),
120 120
 			array(gettext('New Password'), 'INPUT', array('name' => 'new_password', 'size' => '20', 'class' => "text field medium", 'id' => 'new_password'), 'required|', 'tOOL TIP', '', ''),
121
-			array(gettext('Confirm Password'), 'INPUT', array('name' => 'new_confirm_password', 'size' => '20',  'class' => "text field medium", 'id' => 'password'), "required|matches[new_password]", 'tOOL TIP', '', ''),
121
+			array(gettext('Confirm Password'), 'INPUT', array('name' => 'new_confirm_password', 'size' => '20', 'class' => "text field medium", 'id' => 'password'), "required|matches[new_password]", 'tOOL TIP', '', ''),
122 122
 		);
123 123
 		$form['button_save'] = array('name' => 'action', 'content' => gettext('Save'), 'value' => 'save', 'type' => 'submit', 'class' => 'btn btn-line-parrot');
124 124
 		return $form;
125 125
 	}
126 126
 
127
-	function build_user_invoices(){
127
+	function build_user_invoices() {
128 128
 	  $account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
129
-	  $currency_id=$account_info['currency_id'];
130
-	  $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
131
-	  $url=($this->CI->session->userdata('logintype')==0 )?"/user/user_invoice_download/":'/invoices/invoice_main_download/';
132
-	  $grid_field_arr  = json_encode(array(
133
-		  array(gettext("Number"),"110","id","id,'',type","invoices","build_concat_string","","true","center"),
134
-		  array(gettext("Type"),"100","id","id,'',type","invoices","build_concat_string","","true","center"),
135
-		  array(gettext("Generated Date"),"110","invoice_date","invoice_date","","get_invoice_date","","true","center"),
136
-		  array(gettext("From Date"),"100","from_date","from_date","","get_from_date","","true","center"),
137
-		  array(gettext("Due Date"),"100","","","","","","true","center"),
138
-		  array(gettext("Last Pay Date"),"100","","","","","","true","center"),
139
-		  array(gettext("Amount")."($currency)","100","id","id","id","get_invoice_total","","true","right"),
140
-		  array(gettext("Outstanding Amount")."<br>($currency)","150","","","","","","true","right"),
141
-		  array(gettext("Action"),"140","","","",array(
142
-			 "DOWNLOAD"=>array("url"=>$url,"mode"=>"single"),
129
+	  $currency_id = $account_info['currency_id'];
130
+	  $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id);
131
+	  $url = ($this->CI->session->userdata('logintype') == 0) ? "/user/user_invoice_download/" : '/invoices/invoice_main_download/';
132
+	  $grid_field_arr = json_encode(array(
133
+		  array(gettext("Number"), "110", "id", "id,'',type", "invoices", "build_concat_string", "", "true", "center"),
134
+		  array(gettext("Type"), "100", "id", "id,'',type", "invoices", "build_concat_string", "", "true", "center"),
135
+		  array(gettext("Generated Date"), "110", "invoice_date", "invoice_date", "", "get_invoice_date", "", "true", "center"),
136
+		  array(gettext("From Date"), "100", "from_date", "from_date", "", "get_from_date", "", "true", "center"),
137
+		  array(gettext("Due Date"), "100", "", "", "", "", "", "true", "center"),
138
+		  array(gettext("Last Pay Date"), "100", "", "", "", "", "", "true", "center"),
139
+		  array(gettext("Amount")."($currency)", "100", "id", "id", "id", "get_invoice_total", "", "true", "right"),
140
+		  array(gettext("Outstanding Amount")."<br>($currency)", "150", "", "", "", "", "", "true", "right"),
141
+		  array(gettext("Action"), "140", "", "", "", array(
142
+			 "DOWNLOAD"=>array("url"=>$url, "mode"=>"single"),
143 143
 		))
144 144
 	));
145 145
 	  return $grid_field_arr;
146 146
 	}
147 147
 	function build_user_invoices_search()
148 148
 	{
149
-		$form['forms'] = array("",array('id'=>"user_invoice_search"));
149
+		$form['forms'] = array("", array('id'=>"user_invoice_search"));
150 150
 		$form['Search'] = array(
151
-		array(gettext('From Date'), 'INPUT', array('name' => 'from_date[0]','id'=>'invoice_from_date','size' => '20', 'class' => "text field"), '', 'tOOL TIP', '', 'from_date[from_date-date]'),
152
-		array(gettext('To Date'), 'INPUT', array('name' => 'to_date[1]','id'=>'invoice_to_date','size' => '20', 'class' => "text field"), '', 'tOOL TIP', '', 'to_date[to_date-date]'),
151
+		array(gettext('From Date'), 'INPUT', array('name' => 'from_date[0]', 'id'=>'invoice_from_date', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '', 'from_date[from_date-date]'),
152
+		array(gettext('To Date'), 'INPUT', array('name' => 'to_date[1]', 'id'=>'invoice_to_date', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '', 'to_date[to_date-date]'),
153 153
 		array(gettext('Amount'), 'INPUT', array('name' => 'amount[amount]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'amount[amount-string]', '', '', '', 'search_string_type', ''),
154
-		array(gettext('Generated Date'), 'INPUT', array('name' => 'invoice_date[0]','','size' => '20', 'class' => "text field",'id'=>'invoice_date'), '', 'tOOL TIP', '', 'invoice_date[invoice_date-date]'),	
155
-		array('', 'HIDDEN', 'ajax_search','1', '', '', ''),    
156
-		array('', 'HIDDEN', 'advance_search','1', '', '', ''));
157
-		$form['button_search'] = array('name' => 'action', 'id'=>"user_invoice_search_btn",'content' => gettext('Search'), 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right');
158
-		$form['button_reset'] = array('name' => 'action','id'=>"id_reset", 'content' => gettext('Clear'), 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10');
154
+		array(gettext('Generated Date'), 'INPUT', array('name' => 'invoice_date[0]', '', 'size' => '20', 'class' => "text field", 'id'=>'invoice_date'), '', 'tOOL TIP', '', 'invoice_date[invoice_date-date]'),	
155
+		array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),    
156
+		array('', 'HIDDEN', 'advance_search', '1', '', '', ''));
157
+		$form['button_search'] = array('name' => 'action', 'id'=>"user_invoice_search_btn", 'content' => gettext('Search'), 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right');
158
+		$form['button_reset'] = array('name' => 'action', 'id'=>"id_reset", 'content' => gettext('Clear'), 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10');
159 159
 		return $form;
160 160
 	}
161 161
 	function build_user_charge_history() {
162 162
 	$account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
163
-	$currency_id=$account_info['currency_id'];
164
-	$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
163
+	$currency_id = $account_info['currency_id'];
164
+	$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id);
165 165
 		$grid_field_arr = json_encode(array(
166 166
 			array(gettext("Created Date"), "140", "created_date", "", "", ""),
167
-			array(gettext("Invoice Number"), "120", "created_date", "", "", "","","true","center"),
167
+			array(gettext("Invoice Number"), "120", "created_date", "", "", "", "", "true", "center"),
168 168
 			array(gettext("Charge Type"), "100", "item_type", "", "", ""),
169
-			array(gettext("Before Balance")."<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency","","true","right"),
170
-			array(gettext("Debit")."<br/>($currency)", "120", "debit", "debit", "debit", "convert_to_currency","","true","right"),
171
-			array(gettext("Credit")."<br/>($currency)", "120", "credit", "credit", "credit", "convert_to_currency","","true","right"),
172
-			array(gettext("After Balance")."<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency","","true","right"),
169
+			array(gettext("Before Balance")."<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency", "", "true", "right"),
170
+			array(gettext("Debit")."<br/>($currency)", "120", "debit", "debit", "debit", "convert_to_currency", "", "true", "right"),
171
+			array(gettext("Credit")."<br/>($currency)", "120", "credit", "credit", "credit", "convert_to_currency", "", "true", "right"),
172
+			array(gettext("After Balance")."<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency", "", "true", "right"),
173 173
 			array(gettext("Description"), "180", "description", "", "", ""),
174 174
 				));
175 175
 		return $grid_field_arr;
@@ -189,14 +189,14 @@  discard block
 block discarded – undo
189 189
 		return $form;
190 190
 	}
191 191
     
192
-	function build_user_subscription(){
192
+	function build_user_subscription() {
193 193
 		 $account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
194
-		 $currency_id=$account_info['currency_id'];
195
-		 $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
194
+		 $currency_id = $account_info['currency_id'];
195
+		 $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id);
196 196
 		 $grid_field_arr = json_encode(array(
197
-			array(gettext("Name"), "335", "description", "", "", "","","true","center"),
198
-			array(gettext("Amount")."($currency)", "335", "charge", "charge", "charge", "convert_to_currency","","true","right"),
199
-			array(gettext("Billing Cycle"), "335", "sweep_id", "sweep", "sweeplist", "get_field_name","","true","center"),
197
+			array(gettext("Name"), "335", "description", "", "", "", "", "true", "center"),
198
+			array(gettext("Amount")."($currency)", "335", "charge", "charge", "charge", "convert_to_currency", "", "true", "right"),
199
+			array(gettext("Billing Cycle"), "335", "sweep_id", "sweep", "sweeplist", "get_field_name", "", "true", "center"),
200 200
 				));
201 201
 		return $grid_field_arr;
202 202
 	}
@@ -219,20 +219,20 @@  discard block
 block discarded – undo
219 219
     
220 220
 	function build_user_didlist() {
221 221
 		$account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
222
-		$currency_id=$account_info['currency_id'];
223
-		$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
222
+		$currency_id = $account_info['currency_id'];
223
+		$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id);
224 224
 		$grid_field_arr = json_encode(array(
225
-			array(gettext("DID"), "105", "number", "", "", "","","true","center"),
226
-			array(gettext("Country"), "90", "country_id", "country", "countrycode", "get_field_name","","true","center"),
227
-			array(gettext("Per Minute<br/>Cost")."($currency)", "90", "cost", "cost", "cost", "convert_to_currency","","true","right"),
228
-			array(gettext("Initial<br/>Increment"), "100", "init_inc", "", "", "","","true","center"),
229
-			array(gettext("Increment"), "100", "inc", "", "", "","","true","center"),
230
-			array(gettext("Setup<br/>Fee")."($currency)", "100", "setup", "setup", "setup", "convert_to_currency","","true","right"),
231
-			array(gettext("Monthly<br/>Fee")."($currency)", "100", "monthlycost", "monthlycost", "monthlycost", "convert_to_currency","","true","right"),
232
-			array(gettext("Call Type"), "105", "call_type", "call_type", "call_type", "get_call_type","","true","center"),
233
-			array(gettext("Destination"), "153", "extensions", "", "", "","","true","center"),
234
-			array(gettext("Status"), "90", "status", "status", "dids", "get_did_status","","true","center"),
235
-			array(gettext("Modified <br/>Date"), "100", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"),
225
+			array(gettext("DID"), "105", "number", "", "", "", "", "true", "center"),
226
+			array(gettext("Country"), "90", "country_id", "country", "countrycode", "get_field_name", "", "true", "center"),
227
+			array(gettext("Per Minute<br/>Cost")."($currency)", "90", "cost", "cost", "cost", "convert_to_currency", "", "true", "right"),
228
+			array(gettext("Initial<br/>Increment"), "100", "init_inc", "", "", "", "", "true", "center"),
229
+			array(gettext("Increment"), "100", "inc", "", "", "", "", "true", "center"),
230
+			array(gettext("Setup<br/>Fee")."($currency)", "100", "setup", "setup", "setup", "convert_to_currency", "", "true", "right"),
231
+			array(gettext("Monthly<br/>Fee")."($currency)", "100", "monthlycost", "monthlycost", "monthlycost", "convert_to_currency", "", "true", "right"),
232
+			array(gettext("Call Type"), "105", "call_type", "call_type", "call_type", "get_call_type", "", "true", "center"),
233
+			array(gettext("Destination"), "153", "extensions", "", "", "", "", "true", "center"),
234
+			array(gettext("Status"), "90", "status", "status", "dids", "get_did_status", "", "true", "center"),
235
+			array(gettext("Modified <br/>Date"), "100", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to", "", "true", "center"),
236 236
 			array(gettext("Action"), "80", "", "", "", array("EDIT" => array("url" => "/user/user_did_edit/", "mode" => "popup"),
237 237
 					"DELETE" => array("url" => "/user/user_dids_action/delete/", "mode" => "single")))
238 238
 				));
@@ -245,11 +245,11 @@  discard block
 block discarded – undo
245 245
 			array(gettext('DID'), 'INPUT', array('name' => 'number[number]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'number[number-string]', '', '', '', 'search_string_type', ''),
246 246
 			array(gettext('Country'), 'country_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'country', 'countrycode', 'build_dropdown', '', ''),
247 247
 			array(gettext('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', ''),
248
-			array(gettext('Call Type'), 'call_type', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_call_type_search', '',''),
248
+			array(gettext('Call Type'), 'call_type', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_call_type_search', '', ''),
249 249
 			array(gettext('Destination'), 'INPUT', array('name' => 'extensions[extensions]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'extensions[extensions-string]', '', '', '', 'search_string_type', ''),
250 250
 	
251 251
 			array(gettext('Status'), 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status', '', ''),
252
-			array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', '')
252
+			array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), array('', 'HIDDEN', 'advance_search', '1', '', '', '')
253 253
 		  );
254 254
 
255 255
 		$form['button_search'] = array('name' => 'action', 'id' => "user_did_search_btn", 'content' => gettext('Search'), 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right');
@@ -260,10 +260,10 @@  discard block
 block discarded – undo
260 260
     
261 261
 	function build_user_ipmap() {
262 262
 		$grid_field_arr = json_encode(array(
263
-			array(gettext("Name"), "240", "name", "", "", "","","true","center"),
264
-			array(gettext("IP"), "240", "ip", "", "", "","","true","center"),
265
-			array(gettext("Prefix"), "220", "prefix", "", "", "","","true","center"),
266
-			array(gettext("Created Date"), "174", "created_date", "created_date", "created_date", "convert_GMT_to","","true","center"),
263
+			array(gettext("Name"), "240", "name", "", "", "", "", "true", "center"),
264
+			array(gettext("IP"), "240", "ip", "", "", "", "", "true", "center"),
265
+			array(gettext("Prefix"), "220", "prefix", "", "", "", "", "true", "center"),
266
+			array(gettext("Created Date"), "174", "created_date", "created_date", "created_date", "convert_GMT_to", "", "true", "center"),
267 267
 			array(gettext("Action"), "150", "", "", "", array("DELETE" => array("url" => "user/user_ipmap_action/delete/", "mode" => "single")))
268 268
 				));
269 269
 		return $grid_field_arr;
@@ -283,27 +283,27 @@  discard block
 block discarded – undo
283 283
 		return $form;
284 284
 	}
285 285
     
286
-	function build_user_sipdevices(){
286
+	function build_user_sipdevices() {
287 287
 		$grid_field_arr = json_encode(array(
288
-		array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"),
289
-			array(gettext("User Name"), "105", "username", "", "", "","","true","center"),
290
-			array(gettext("Password"), "105", "password", "", "", "","","true","center"),
291
-			array(gettext("Caller Name"), "110", "effective_caller_id_name", "", "", "","","true","center"),
292
-			array(gettext("Caller Number"), "110", "effective_caller_id_number", "", "", "","","true","center"),      
293
-			array(gettext("Status"), "125", "status", "", "", "","","true","center"),
294
-			array(gettext("Created Date"), "110", "creation_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"),
295
-			array(gettext("Modified Date"), "130", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"),
296
-			array(gettext("Voicemail"), "90", "voicemail_enabled", "", "", "","","true","center"),
297
-			array(gettext("Action"), "110", "", "", "", array("EDIT" => array("url" => "/accounts/fssipdevices_action/edit/", "mode" => "single","layout"=>"medium"),
288
+		array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"),
289
+			array(gettext("User Name"), "105", "username", "", "", "", "", "true", "center"),
290
+			array(gettext("Password"), "105", "password", "", "", "", "", "true", "center"),
291
+			array(gettext("Caller Name"), "110", "effective_caller_id_name", "", "", "", "", "true", "center"),
292
+			array(gettext("Caller Number"), "110", "effective_caller_id_number", "", "", "", "", "true", "center"),      
293
+			array(gettext("Status"), "125", "status", "", "", "", "", "true", "center"),
294
+			array(gettext("Created Date"), "110", "creation_date", "creation_date", "creation_date", "convert_GMT_to", "", "true", "center"),
295
+			array(gettext("Modified Date"), "130", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to", "", "true", "center"),
296
+			array(gettext("Voicemail"), "90", "voicemail_enabled", "", "", "", "", "true", "center"),
297
+			array(gettext("Action"), "110", "", "", "", array("EDIT" => array("url" => "/accounts/fssipdevices_action/edit/", "mode" => "single", "layout"=>"medium"),
298 298
 					"DELETE" => array("url" => "/accounts/fssipdevices_action/delete/", "mode" => "single")))
299 299
 				));
300 300
 		return $grid_field_arr;
301 301
 	}
302 302
     
303
-	function build_user_sipdevices_search(){
303
+	function build_user_sipdevices_search() {
304 304
 		$form['forms'] = array("", array('id' => "user_sipdevices_search"));
305 305
 		$form['Search'] = array(
306
-			array(gettext('Username'), 'INPUT', array('name' => 'username[username]', '', 'size' => '20',  'class' => "text field"), '', 'tOOL TIP', '1', 'username[username-string]', '', '', '', 'search_string_type', ''), 
306
+			array(gettext('Username'), 'INPUT', array('name' => 'username[username]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'username[username-string]', '', '', '', 'search_string_type', ''), 
307 307
 			array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
308 308
 			array('', 'HIDDEN', 'advance_search', '1', '', '', ''),
309 309
 		);
@@ -312,17 +312,17 @@  discard block
 block discarded – undo
312 312
 		return $form;
313 313
 	}
314 314
     
315
-	function build_user_sipdevices_form($id=''){
316
-	$val=$id > 0 ? 'sip_devices.username.'.$id : 'sip_devices.username'; 
315
+	function build_user_sipdevices_form($id = '') {
316
+	$val = $id > 0 ? 'sip_devices.username.'.$id : 'sip_devices.username'; 
317 317
 	$uname_user = $this->CI->common->find_uniq_rendno('10', '', '');
318 318
 		$password = $this->CI->common->generate_password();
319
-		$form['forms'] = array(base_url() . 'user/user_sipdevices_save/', array("id" => "user_sipdevices_form", "name" => "user_sipdevices_form"));
319
+		$form['forms'] = array(base_url().'user/user_sipdevices_save/', array("id" => "user_sipdevices_form", "name" => "user_sipdevices_form"));
320 320
 		$form[gettext('Device Information')] = array(
321 321
 			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
322
-			array(gettext('Username'), 'INPUT', array('name' => 'fs_username', 'size' => '20', 'value'=>$uname_user,'id'=>'username', 'class' => "text field medium"), 'trim|required|is_unique['.$val.']|xss_clean', 'tOOL TIP', 'Please Enter account number','<i style="color: #1BCB61;font-size: 14px;padding-left: 5px;padding-top: 8px;float: left;" title="Reset Password" class="change_number  fa fa-refresh"></i>'),
323
-			array(gettext('Password'), 'INPUT', array('name' => 'fs_password', 'size' => '20', 'value'=>$password ,'id'=>'password','class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter Password','<i style="color: #1BCB61;font-size: 14px;padding-left: 5px;padding-top: 8px;float: left;" title="Reset Password" class="change_pass fa fa-refresh"></i>'),
324
-			array(gettext('Caller Name'), 'INPUT', array('name' => 'effective_caller_id_name', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
325
-			array(gettext('Caller Number'), 'INPUT', array('name' => 'effective_caller_id_number', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
322
+			array(gettext('Username'), 'INPUT', array('name' => 'fs_username', 'size' => '20', 'value'=>$uname_user, 'id'=>'username', 'class' => "text field medium"), 'trim|required|is_unique['.$val.']|xss_clean', 'tOOL TIP', 'Please Enter account number', '<i style="color: #1BCB61;font-size: 14px;padding-left: 5px;padding-top: 8px;float: left;" title="Reset Password" class="change_number  fa fa-refresh"></i>'),
323
+			array(gettext('Password'), 'INPUT', array('name' => 'fs_password', 'size' => '20', 'value'=>$password, 'id'=>'password', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter Password', '<i style="color: #1BCB61;font-size: 14px;padding-left: 5px;padding-top: 8px;float: left;" title="Reset Password" class="change_pass fa fa-refresh"></i>'),
324
+			array(gettext('Caller Name'), 'INPUT', array('name' => 'effective_caller_id_name', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
325
+			array(gettext('Caller Number'), 'INPUT', array('name' => 'effective_caller_id_number', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
326 326
 			array(gettext('Status'), 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_status'),
327 327
 		);
328 328
 
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 	}
342 342
     
343 343
 	function build_user_animap() {
344
-		$grid_field_arr = json_encode(array(array(gettext("Caller ID"), "735", "number", "", "", "","","true","center"),
344
+		$grid_field_arr = json_encode(array(array(gettext("Caller ID"), "735", "number", "", "", "", "", "true", "center"),
345 345
 			array(gettext("Action"), "275", "", "", "", array("DELETE" => array("url" => "user/user_animap_action/delete/", "mode" => "single")))
346 346
 				));
347 347
 		return $grid_field_arr;
@@ -349,22 +349,22 @@  discard block
 block discarded – undo
349 349
     
350 350
 	function user_rates_list_buttons() {
351 351
 		$buttons_json = json_encode(array(
352
-			array(gettext("Export CSV"),"btn btn-xing" ,"fa fa-download fa-lg", "button_action", "/user/user_rates_list_export/", 'single')
352
+			array(gettext("Export CSV"), "btn btn-xing", "fa fa-download fa-lg", "button_action", "/user/user_rates_list_export/", 'single')
353 353
 		));
354 354
 		return $buttons_json;
355 355
 	}
356 356
     
357 357
 	function user_rates_list() {
358 358
 		 $account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
359
-		 $currency_id=$account_info['currency_id'];
360
-		 $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
361
-		 $grid_field_arr = json_encode(array(array(gettext("Code"), "155", "pattern", "pattern", "", "get_only_numeric_val","","true","center"),
362
-		  array(gettext("Destination"), "200", "comment", "", "", "","","true","center"),
363
-		  array(gettext("Connect Cost")."($currency)", "200", "connectcost", "", "", "","","true","right"),
364
-		  array(gettext("Included Seconds"), "200", "includedseconds", "", "", "","","true","center"),
365
-		  array(gettext("Per Minute Cost")."($currency)", "200", "cost", "", "", "","","true","right"),
366
-		  array(gettext("Initial Increment"), "130", "init_inc", "", "", "","","true","center"),
367
-		  array(gettext("Increment"), "180", "inc", "", "", "","","true","center")
359
+		 $currency_id = $account_info['currency_id'];
360
+		 $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id);
361
+		 $grid_field_arr = json_encode(array(array(gettext("Code"), "155", "pattern", "pattern", "", "get_only_numeric_val", "", "true", "center"),
362
+		  array(gettext("Destination"), "200", "comment", "", "", "", "", "true", "center"),
363
+		  array(gettext("Connect Cost")."($currency)", "200", "connectcost", "", "", "", "", "true", "right"),
364
+		  array(gettext("Included Seconds"), "200", "includedseconds", "", "", "", "", "true", "center"),
365
+		  array(gettext("Per Minute Cost")."($currency)", "200", "cost", "", "", "", "", "true", "right"),
366
+		  array(gettext("Initial Increment"), "130", "init_inc", "", "", "", "", "true", "center"),
367
+		  array(gettext("Increment"), "180", "inc", "", "", "", "", "true", "center")
368 368
 	));
369 369
 		return $grid_field_arr;
370 370
 	}
@@ -389,8 +389,8 @@  discard block
 block discarded – undo
389 389
 		return $form;
390 390
 	}
391 391
     
392
-	function user_alert_threshold(){
393
-		$form['forms'] = array(base_url() . 'user/user_alert_threshold/', array("id" => "customer_alert_threshold", "name" => "customer_alert_threshold"));
392
+	function user_alert_threshold() {
393
+		$form['forms'] = array(base_url().'user/user_alert_threshold/', array("id" => "customer_alert_threshold", "name" => "customer_alert_threshold"));
394 394
 		$form[gettext('Low Balance Alert Email')] = array(
395 395
 			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
396 396
 			array(gettext('Enable Email Alerts ?'), 'notify_flag', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'custom_status'),
@@ -402,34 +402,34 @@  discard block
 block discarded – undo
402 402
 	}
403 403
 	function build_cdrs_report($type) {
404 404
 		$account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
405
-		$currency_id=$account_info['currency_id'];
406
-		$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);	
405
+		$currency_id = $account_info['currency_id'];
406
+		$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id);	
407 407
         
408
-		if($type == '0' || $type =='1'){
409
-			$cost_array=array(gettext("Debit")."($currency)", "140", "debit", "debit", "debit", "convert_to_currency","","true","right");
408
+		if ($type == '0' || $type == '1') {
409
+			$cost_array = array(gettext("Debit")."($currency)", "140", "debit", "debit", "debit", "convert_to_currency", "", "true", "right");
410 410
 		}
411
-		if($type =='3'){
412
-			$cost_array=array(gettext("Debit")."($currency)", "140", "cost", "cost", "cost", "convert_to_currency","","true","right");
411
+		if ($type == '3') {
412
+			$cost_array = array(gettext("Debit")."($currency)", "140", "cost", "cost", "cost", "convert_to_currency", "", "true", "right");
413 413
 		}
414 414
 		$grid_field_arr = json_encode(array(
415
-			array(gettext("Date"), "170", "callstart", "callstart", "callstart", "convert_GMT_to","","true","center"),
416
-			array(gettext("Caller ID"), "110", "callerid", "", "", "","","true","center"),
417
-			array(gettext("Called Number"), "160", "callednum", "", "", "","","true","center"),
418
-			array(gettext("Destination"), "160", "notes", "", "", "","","true","center"),
419
-			array(gettext("Duration"), "140", "billseconds", "user_cdrs_report_search", "billseconds", "convert_to_show_in","","true","center"),
415
+			array(gettext("Date"), "170", "callstart", "callstart", "callstart", "convert_GMT_to", "", "true", "center"),
416
+			array(gettext("Caller ID"), "110", "callerid", "", "", "", "", "true", "center"),
417
+			array(gettext("Called Number"), "160", "callednum", "", "", "", "", "true", "center"),
418
+			array(gettext("Destination"), "160", "notes", "", "", "", "", "true", "center"),
419
+			array(gettext("Duration"), "140", "billseconds", "user_cdrs_report_search", "billseconds", "convert_to_show_in", "", "true", "center"),
420 420
 			$cost_array,
421
-			array(gettext("Disposition"), "160", "disposition", "", "", "","","true","center"),
422
-			array(gettext("Call Type"), "233", "calltype", "", "", "","","true","center"),
421
+			array(gettext("Disposition"), "160", "disposition", "", "", "", "", "true", "center"),
422
+			array(gettext("Call Type"), "233", "calltype", "", "", "", "", "true", "center"),
423 423
 				));
424 424
 		return $grid_field_arr;
425 425
 	}
426 426
     
427 427
 	function build_cdrs_report_search($type) {
428
-		 if($type == '0' || $type =='1'){
429
-			$cost_array=array(gettext('Debit'), 'INPUT', array('name' => 'debit[debit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'debit[debit-integer]', '', '', '', 'search_int_type', '');
428
+		 if ($type == '0' || $type == '1') {
429
+			$cost_array = array(gettext('Debit'), 'INPUT', array('name' => 'debit[debit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'debit[debit-integer]', '', '', '', 'search_int_type', '');
430 430
 		}
431
-		if($type =='3'){
432
-			$cost_array=array(gettext('Debit'), 'INPUT', array('name' => 'cost[cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'cost[cost-integer]', '', '', '', 'search_int_type', '');
431
+		if ($type == '3') {
432
+			$cost_array = array(gettext('Debit'), 'INPUT', array('name' => 'cost[cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'cost[cost-integer]', '', '', '', 'search_int_type', '');
433 433
 		}
434 434
 		$form['forms'] = array("", array('id' => "user_cdrs_report_search"));
435 435
 		$form['Search'] = array(
@@ -445,25 +445,25 @@  discard block
 block discarded – undo
445 445
 			array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
446 446
 			array('', 'HIDDEN', 'advance_search', '1', '', '', '')       
447 447
 		);
448
-		$form['display_in']=array('name' => 'search_in',"id"=>"search_in","function"=>"search_report_in", "content"=>gettext("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;");
448
+		$form['display_in'] = array('name' => 'search_in', "id"=>"search_in", "function"=>"search_report_in", "content"=>gettext("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;");
449 449
 		$form['button_search'] = array('name' => 'action', 'id' => "user_cdr_search_btn", 'content' => gettext('Search'), 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right');
450 450
 		$form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => gettext('Clear'), 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10');
451 451
 		return $form;
452 452
 	}
453 453
 	function build_cdrs_report_buttons() {
454
-		$buttons_json = json_encode(array(array(gettext("Export"),"btn btn-xing" ," fa fa-download fa-lg", "button_action", "/user/user_report_export/", 'single')));
454
+		$buttons_json = json_encode(array(array(gettext("Export"), "btn btn-xing", " fa fa-download fa-lg", "button_action", "/user/user_report_export/", 'single')));
455 455
 		return $buttons_json;
456 456
 	}
457 457
     
458
-	function build_user_refill_report(){
458
+	function build_user_refill_report() {
459 459
 		$account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
460
-		$currency_id=$account_info['currency_id'];
461
-		$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
460
+		$currency_id = $account_info['currency_id'];
461
+		$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id);
462 462
 		 $grid_field_arr = json_encode(array(
463
-			array(gettext("Date"), "220", "payment_date", "", "", "","","true","center"),
464
-			array(gettext("Amount")."($currency)", "220", "credit", "credit", "credit", "convert_to_currency","","true","right"),
465
-			array(gettext("Refill By"), "270", "payment_by", "payment_by", "payment_by", "get_refill_by","","true","center"),
466
-			array(gettext("Note"), "300", "notes", "", "", "","","true","center")
463
+			array(gettext("Date"), "220", "payment_date", "", "", "", "", "true", "center"),
464
+			array(gettext("Amount")."($currency)", "220", "credit", "credit", "credit", "convert_to_currency", "", "true", "right"),
465
+			array(gettext("Refill By"), "270", "payment_by", "payment_by", "payment_by", "get_refill_by", "", "true", "center"),
466
+			array(gettext("Note"), "300", "notes", "", "", "", "", "true", "center")
467 467
 				));
468 468
 		return $grid_field_arr;
469 469
 	}
@@ -483,14 +483,14 @@  discard block
 block discarded – undo
483 483
 	}
484 484
 
485 485
 	function build_user_fund_transfer_form($number, $currency_id, $id) {
486
-		$form['forms'] = array(base_url() . 'user/user_fund_transfer_save/', array('id' => 'user_fund_transfer_form', 'method' => 'POST','class'=>'build_user_fund_transfer_frm' ,'name' => 'user_fund_transfer_form'));
486
+		$form['forms'] = array(base_url().'user/user_fund_transfer_save/', array('id' => 'user_fund_transfer_form', 'method' => 'POST', 'class'=>'build_user_fund_transfer_frm', 'name' => 'user_fund_transfer_form'));
487 487
 		$form[gettext('Fund Transfer')] = array(
488 488
 			array('', 'HIDDEN', array('name' => 'id', 'value' => $id), '', '', '', ''),
489 489
 			array('', 'HIDDEN', array('name' => 'account_currency', 'value' => $currency_id), '', '', ''),
490 490
 			array(gettext('From Account'), 'INPUT', array('name' => 'fromaccountid', 'size' => '20', 'value' => $number, 'readonly' => true, 'class' => "text field medium"), 'required', 'tOOL TIP', 'Please Enter account number'),
491 491
 			array(gettext('To Account'), 'INPUT', array('name' => 'toaccountid', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric', 'tOOL TIP', 'Please Enter to account number'),
492
-			array(gettext('Amount'), 'INPUT', array('name' => 'credit', 'size' => '20',  'class' => "text field medium"), 'trim|required|numeric', 'tOOL TIP', ''),
493
-			array(gettext('Note'), 'TEXTAREA', array('name' => 'notes', 'size' => '20', 'cols' => '63', 'rows' => '5', 'class' => "form-control col-md-5  text field medium",'style'=>'height: 80px;'), '', 'tOOL TIP', '')
492
+			array(gettext('Amount'), 'INPUT', array('name' => 'credit', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric', 'tOOL TIP', ''),
493
+			array(gettext('Note'), 'TEXTAREA', array('name' => 'notes', 'size' => '20', 'cols' => '63', 'rows' => '5', 'class' => "form-control col-md-5  text field medium", 'style'=>'height: 80px;'), '', 'tOOL TIP', '')
494 494
 		);
495 495
 		$form['button_save'] = array('name' => 'action', 'content' => 'Transfer', 'value' => gettext('save'), 'id' => "submit", 'type' => 'submit', 'class' => 'btn btn-line-parrot');
496 496
 		return $form;
@@ -505,10 +505,10 @@  discard block
 block discarded – undo
505 505
 	}
506 506
 	function build_user_opensips() {
507 507
 		$grid_field_arr = json_encode(array(
508
-		array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"),
509
-			array("Username", "240", "username", "", "", "","","true","center"),
510
-			array("Password", "240", "password", "", "", "","","true","center"),
511
-			array("Domain", "240", "domain", "", "", "","","true","center"),
508
+		array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"),
509
+			array("Username", "240", "username", "", "", "", "", "true", "center"),
510
+			array("Password", "240", "password", "", "", "", "", "true", "center"),
511
+			array("Domain", "240", "domain", "", "", "", "", "true", "center"),
512 512
 			array("Action", "200", "", "", "",
513 513
 				array("EDIT" => array("url" => 'user/user_opensips_edit/', "mode" => "popup"),
514 514
 					"DELETE" => array("url" => 'user/user_opensips_delete/', "mode" => "popup")
@@ -517,17 +517,17 @@  discard block
 block discarded – undo
517 517
 	}
518 518
     
519 519
 	function build_user_opensips_form($id = false) {
520
-		$val = $id > 0 ? 'subscriber.username.' . $id : 'subscriber.username';
520
+		$val = $id > 0 ? 'subscriber.username.'.$id : 'subscriber.username';
521 521
 		$uname_user = $this->CI->common->find_uniq_rendno('10', '', '');
522 522
 		$password = $this->CI->common->generate_password();
523 523
 		$accountinfo = $this->CI->session->userdata('accountinfo');
524
-		$form['forms'] = array(base_url() . 'user/user_opensips_save/', array("id" => "opensips_form", "name" => "opensips_form"));
524
+		$form['forms'] = array(base_url().'user/user_opensips_save/', array("id" => "opensips_form", "name" => "opensips_form"));
525 525
 		$form['Opensips Device'] = array(
526 526
 	  array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
527 527
 	  array('', 'HIDDEN', array('name' => 'accountcode', 'value' =>$accountinfo['number']), '', '', '', ''),
528
-	  array('Username', 'INPUT', array('name' => 'username', 'size' => '20',  'id' => 'username', 'value' => $uname_user, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;" title="Reset Password" class="change_number fa fa-refresh"></i>'),
528
+	  array('Username', 'INPUT', array('name' => 'username', 'size' => '20', 'id' => 'username', 'value' => $uname_user, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;" title="Reset Password" class="change_number fa fa-refresh"></i>'),
529 529
 	  array('Password', 'PASSWORD', array('name' => 'password', 'size' => '20', 'id' => 'password1', 'value' => $password, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter Password', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;" title="Reset Password" class="change_pass fa fa-refresh"></i>'),
530
-	  array('Domain', 'INPUT', array('name' => 'domain', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
530
+	  array('Domain', 'INPUT', array('name' => 'domain', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
531 531
 	  array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_status'),                
532 532
 		);
533 533
 		$form['button_save'] = array('name' => 'action', 'content' => 'Save', 'value' => 'save', 'type' => 'button', 'id' => 'submit', 'class' => 'btn btn-line-parrot');
@@ -547,11 +547,11 @@  discard block
 block discarded – undo
547 547
 
548 548
 		return $form;
549 549
 	}
550
-	function build_user_did_form(){
551
-	$form['forms'] = array(base_url() . 'user/user_dids_action/edit/', array("id" => "user_did_form", "name" => "user_did_form"));
550
+	function build_user_did_form() {
551
+	$form['forms'] = array(base_url().'user/user_dids_action/edit/', array("id" => "user_did_form", "name" => "user_did_form"));
552 552
 		$form['Edit'] = array(
553
-	  array('', 'HIDDEN', array('name' => 'free_didlist'),'', '', '', ''),
554
-	  array(gettext('DID'), 'INPUT', array('name' => 'number', 'size' => '20', 'class' => "text field medium","readonly"=>"true"), 'trim|required|is_numeric|xss_clean|integer', 'tOOL TIP', 'Please Enter account number'),
553
+	  array('', 'HIDDEN', array('name' => 'free_didlist'), '', '', '', ''),
554
+	  array(gettext('DID'), 'INPUT', array('name' => 'number', 'size' => '20', 'class' => "text field medium", "readonly"=>"true"), 'trim|required|is_numeric|xss_clean|integer', 'tOOL TIP', 'Please Enter account number'),
555 555
 	  array(gettext('Call Type'), 'call_type', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_call_type', ''),
556 556
 	  array(gettext('Destination'), 'INPUT', array('name' => 'extensions', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter Password'),
557 557
 		);
@@ -561,31 +561,31 @@  discard block
 block discarded – undo
561 561
 	}
562 562
     
563 563
 	function build_provider_report_buttons() {
564
-		$buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/user/user_provider_cdrreport_export/", 'single')));
564
+		$buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/user/user_provider_cdrreport_export/", 'single')));
565 565
 		return $buttons_json;
566 566
 	}
567 567
     
568 568
     
569 569
 	 function build_provider_report($type) {
570 570
 		$account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
571
-		$currency_id=$account_info['currency_id'];
572
-		$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);	
571
+		$currency_id = $account_info['currency_id'];
572
+		$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id);	
573 573
         
574
-		if($type == '0' || $type =='1'){
575
-			$cost_array=array("Debit($currency)", "140", "debit", "debit", "debit", "convert_to_currency","","true","right");
574
+		if ($type == '0' || $type == '1') {
575
+			$cost_array = array("Debit($currency)", "140", "debit", "debit", "debit", "convert_to_currency", "", "true", "right");
576 576
 		}
577
-		if($type =='3'){
578
-			$cost_array=array("Cost($currency)", "140", "cost", "cost", "cost", "convert_to_currency","","true","right");
577
+		if ($type == '3') {
578
+			$cost_array = array("Cost($currency)", "140", "cost", "cost", "cost", "convert_to_currency", "", "true", "right");
579 579
 		}
580 580
 		$grid_field_arr = json_encode(array(
581
-			array("Date", "170", "callstart", "callstart", "callstart", "convert_GMT_to","","true","center"),
582
-			array("Caller ID", "110", "callerid", "", "", "","","true","center"),
583
-			array("Called Number", "160", "callednum", "", "", "","","true","center"),
584
-			array("Destination", "160", "notes", "", "", "","","true","center"),
585
-			array("Duration", "140", "billseconds", "user_provider_cdrs_report_search", "billseconds", "convert_to_show_in","","true","center"),
581
+			array("Date", "170", "callstart", "callstart", "callstart", "convert_GMT_to", "", "true", "center"),
582
+			array("Caller ID", "110", "callerid", "", "", "", "", "true", "center"),
583
+			array("Called Number", "160", "callednum", "", "", "", "", "true", "center"),
584
+			array("Destination", "160", "notes", "", "", "", "", "true", "center"),
585
+			array("Duration", "140", "billseconds", "user_provider_cdrs_report_search", "billseconds", "convert_to_show_in", "", "true", "center"),
586 586
 			$cost_array,
587
-			array("Disposition", "160", "disposition", "", "", "","","true","center"),
588
-			array("Call Type", "233", "calltype", "", "", "","","true","center"),
587
+			array("Disposition", "160", "disposition", "", "", "", "", "true", "center"),
588
+			array("Call Type", "233", "calltype", "", "", "", "", "true", "center"),
589 589
 				));
590 590
 		return $grid_field_arr;
591 591
 	}
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
     
594 594
 	function build_provider_report_search($type) {
595 595
 
596
-	   $cost_array=array('Cost ', 'INPUT', array('name' => 'cost[cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'cost[cost-integer]', '', '', '', 'search_int_type', '');
596
+	   $cost_array = array('Cost ', 'INPUT', array('name' => 'cost[cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'cost[cost-integer]', '', '', '', 'search_int_type', '');
597 597
 		$form['forms'] = array("", array('id' => "user_provider_cdrs_report_search"));
598 598
 		$form['Search'] = array(
599 599
 		   array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_cdr_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'),
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
 			array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
610 610
 			array('', 'HIDDEN', 'advance_search', '1', '', '', '')       
611 611
 		);
612
-		$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;");
612
+		$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;");
613 613
 		$form['button_search'] = array('name' => 'action', 'id' => "user_provider_cdr_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right');
614 614
 		$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');
615 615
 		return $form;
Please login to merge, or discard this patch.
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -78,10 +78,11 @@
 block discarded – undo
78 78
 	}
79 79
    
80 80
 	function get_userprofile_form_fields($dataArr = false) {
81
-		if ($dataArr['id'] > 0)
82
-			$val = 'accounts.email.' . $dataArr['id'];
83
-		else
84
-			$val = 'accounts.email';
81
+		if ($dataArr['id'] > 0) {
82
+					$val = 'accounts.email.' . $dataArr['id'];
83
+		} else {
84
+					$val = 'accounts.email';
85
+		}
85 86
 			$uname = $this->CI->common->find_uniq_rendno(common_model::$global_config['system_config']['cardlength'], 'number', 'accounts');
86 87
 			$password = $this->CI->common->generate_password();
87 88
 			$logintype=$this->CI->session->userdata('logintype');
Please login to merge, or discard this patch.
astpp/application/modules/user/views/view_user_alert_threshold.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -31,22 +31,22 @@
 block discarded – undo
31 31
             <div class="col-md-12 no-padding color-three border_box"> 
32 32
                 <div class="pull-left">
33 33
                      <ul class="breadcrumb">
34
-                                         <?php $accountinfo=$this->session->userdata('accountinfo');
35
-						  if($accountinfo['type']==1){ ?>
36
-                          <li><a href="<?= base_url() . "user/user_myprofile/"; ?>">My Profile</a></li>
37
-                          <?php } else{ ?>
34
+                                         <?php $accountinfo = $this->session->userdata('accountinfo');
35
+						  if ($accountinfo['type'] == 1) { ?>
36
+                          <li><a href="<?= base_url()."user/user_myprofile/"; ?>">My Profile</a></li>
37
+                          <?php } else { ?>
38 38
 			    <li><a href="#">Configuration</a></li>
39 39
                           <?php } ?>
40 40
 			  <li class='active'>
41
-                             <a href="<?= base_url() . "user/user_alert_threshold/"; ?>">Alert Threshold</a>
41
+                             <a href="<?= base_url()."user/user_alert_threshold/"; ?>">Alert Threshold</a>
42 42
                           </li>
43 43
                     </ul>
44 44
                 </div>
45
-                <?php if($accountinfo['type']==1) { ?>
45
+                <?php if ($accountinfo['type'] == 1) { ?>
46 46
                    <div class="pull-right">
47 47
                     <ul class="breadcrumb">
48 48
 		      <li class="active pull-right">
49
-		      <a href="<?= base_url() . "user/user_myprofile/"; ?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
49
+		      <a href="<?= base_url()."user/user_myprofile/"; ?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
50 50
                     </ul>
51 51
                    </div>
52 52
                 <?php }?>      
Please login to merge, or discard this patch.
astpp/application/modules/user/views/view_user_sipdevices_list.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,24 +27,24 @@
 block discarded – undo
27 27
             <div class="col-md-12 no-padding color-three border_box"> 
28 28
                 <div class="pull-left">
29 29
                     <ul class="breadcrumb">
30
-                         <?php $accountinfo=$this->session->userdata('accountinfo');
31
-						  if($accountinfo['type']==1){ ?>
32
-                          <li><a href="<?= base_url() . "user/user_myprofile/"; ?>">My Profile</a></li>
33
-                          <?php } else{ ?>
30
+                         <?php $accountinfo = $this->session->userdata('accountinfo');
31
+						  if ($accountinfo['type'] == 1) { ?>
32
+                          <li><a href="<?= base_url()."user/user_myprofile/"; ?>">My Profile</a></li>
33
+                          <?php } else { ?>
34 34
 			    <li><a href="#">Configuration</a></li>
35 35
                           <?php }
36 36
 					?>
37 37
                         
38 38
                         <li class='active'>
39
-                           <a href="<?= base_url() . "user/user_sipdevices/"; ?>">SIP Devices</a>
39
+                           <a href="<?= base_url()."user/user_sipdevices/"; ?>">SIP Devices</a>
40 40
                         </li>
41 41
                     </ul>
42 42
                 </div>
43
-                <?php if($accountinfo['type']==1) { ?>
43
+                <?php if ($accountinfo['type'] == 1) { ?>
44 44
                    <div class="pull-right">
45 45
                     <ul class="breadcrumb">
46 46
 		      <li class="active pull-right">
47
-		      <a href="<?= base_url() . "user/user_myprofile/"; ?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
47
+		      <a href="<?= base_url()."user/user_myprofile/"; ?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
48 48
                     </ul>
49 49
                    </div>
50 50
                 <?php }?>
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/user/views/view_user_dashboard.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -3,14 +3,14 @@
 block discarded – undo
3 3
   <?php echo $page_title; ?>
4 4
 <? endblock() ?>
5 5
 <?php
6
-	$accountinfo=$this->session->userdata('accountinfo');
7
-	$currency=$this->common->get_field_name('currency','currency',array("id"=>$accountinfo['currency_id']));
6
+	$accountinfo = $this->session->userdata('accountinfo');
7
+	$currency = $this->common->get_field_name('currency', 'currency', array("id"=>$accountinfo['currency_id']));
8 8
 
9 9
 ?>
10 10
 <? startblock('extra_head') ?>
11
-    <script type="text/javascript" src="<?php echo base_url();?>assets/js/chart/highcharts.js"></script>
12
-    <script type="text/javascript" src="<?php echo base_url();?>assets/js/chart/exporting.js"></script>
13
-    <script type="text/javascript" src="<?php echo base_url();?>assets/js/chart/highcharts-3d.js"></script>
11
+    <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/chart/highcharts.js"></script>
12
+    <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/chart/exporting.js"></script>
13
+    <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/chart/highcharts-3d.js"></script>
14 14
 <style>
15 15
 .second{
16 16
  color: black;
Please login to merge, or discard this patch.
astpp/application/modules/user/views/view_user_fund_transfer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
         <div class="w-section inverse no-padding">
14 14
             <?php echo $form; ?>
15 15
             <?php
16
-			if(isset($validation_errors) && $validation_errors != ''){ ?>
16
+			if (isset($validation_errors) && $validation_errors != '') { ?>
17 17
                 <script>
18 18
                 var ERR_STR = '<?php echo $validation_errors; ?>';
19 19
                 print_error(ERR_STR);
Please login to merge, or discard this patch.
astpp/application/modules/user/views/view_user_subscriptions_list.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -23,24 +23,24 @@
 block discarded – undo
23 23
             <div class="col-md-12 no-padding color-three border_box"> 
24 24
                 <div class="pull-left">
25 25
                     <ul class="breadcrumb">
26
-                   <?php $accountinfo=$this->session->userdata('accountinfo');
27
-						  if($accountinfo['type']==1){ ?>
28
-                          <li><a href="<?= base_url() . "user/user_myprofile/"; ?>">My Profile</a></li>
29
-                          <?php } else{ ?>
26
+                   <?php $accountinfo = $this->session->userdata('accountinfo');
27
+						  if ($accountinfo['type'] == 1) { ?>
28
+                          <li><a href="<?= base_url()."user/user_myprofile/"; ?>">My Profile</a></li>
29
+                          <?php } else { ?>
30 30
 			    <li><a href="#">Billing</a></li>
31 31
                           <?php }
32 32
 					?>
33 33
                         
34 34
                         <li class='active'>
35
-                            <a href="<?= base_url() . "user/user_subscriptions/"; ?>">Subscriptions </a>
35
+                            <a href="<?= base_url()."user/user_subscriptions/"; ?>">Subscriptions </a>
36 36
                         </li>
37 37
                     </ul>
38 38
                 </div>
39
-                <?php if($accountinfo['type']==1) { ?>
39
+                <?php if ($accountinfo['type'] == 1) { ?>
40 40
                    <div class="pull-right">
41 41
                     <ul class="breadcrumb">
42 42
 		      <li class="active pull-right">
43
-		      <a href="<?= base_url() . "user/user_myprofile/"; ?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
43
+		      <a href="<?= base_url()."user/user_myprofile/"; ?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
44 44
                     </ul>
45 45
                    </div>
46 46
                 <?php }?>
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/user/views/view_user_ipmap_list.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,24 +21,24 @@
 block discarded – undo
21 21
             <div class="col-md-12 no-padding color-three border_box"> 
22 22
                 <div class="pull-left">
23 23
                     <ul class="breadcrumb">
24
-                         <?php $accountinfo=$this->session->userdata('accountinfo');
25
-						  if($accountinfo['type']==1){ ?>
26
-                          <li><a href="<?= base_url() . "user/user_myprofile/"; ?>">My Profile</a></li>
27
-                          <?php } else{ ?>
24
+                         <?php $accountinfo = $this->session->userdata('accountinfo');
25
+						  if ($accountinfo['type'] == 1) { ?>
26
+                          <li><a href="<?= base_url()."user/user_myprofile/"; ?>">My Profile</a></li>
27
+                          <?php } else { ?>
28 28
 			    <li><a href="#">Configuration</a></li>
29 29
                           <?php }
30 30
 					?>
31 31
                         
32 32
                         <li class='active'>
33
-                            <a href="<?= base_url() . "user/user_ipmap/"; ?>">IP Settings</a>
33
+                            <a href="<?= base_url()."user/user_ipmap/"; ?>">IP Settings</a>
34 34
                         </li>
35 35
                     </ul>
36 36
                 </div>
37
-                <?php if($accountinfo['type']==1) { ?>
37
+                <?php if ($accountinfo['type'] == 1) { ?>
38 38
                    <div class="pull-right">
39 39
                     <ul class="breadcrumb">
40 40
 		      <li class="active pull-right">
41
-		      <a href="<?= base_url() . "user/user_myprofile/"; ?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
41
+		      <a href="<?= base_url()."user/user_myprofile/"; ?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
42 42
                     </ul>
43 43
                    </div>
44 44
                 <?php }?>
Please login to merge, or discard this patch.