Passed
Pull Request — v3.0 (#189)
by
unknown
10:51
created
web_interface/astpp/application/modules/rates/models/rates_model.php 1 patch
Braces   +22 added lines, -17 removed lines patch added patch discarded remove patch
@@ -50,10 +50,11 @@  discard block
 block discarded – undo
50 50
 		$this->db_model->build_search('termination_rates_list_search');
51 51
 		$this->db->from('outbound_routes');
52 52
 		if ($flag) {
53
-			if ($export)
54
-				$this->db->limit($limit, $start);
53
+			if ($export) {
54
+							$this->db->limit($limit, $start);
55
+			}
55 56
 			$result = $this->db->get();
56
-		}else {
57
+		} else {
57 58
 			$result = $this->db->count_all_results();
58 59
 		}
59 60
 		return $result;
@@ -71,10 +72,11 @@  discard block
 block discarded – undo
71 72
        
72 73
 		$this->db_model->build_search('origination_rate_list_search');
73 74
 		if ($flag) {
74
-			if ($export)
75
-				$this->db->limit($limit, $start);
75
+			if ($export) {
76
+							$this->db->limit($limit, $start);
77
+			}
76 78
 			$result = $this->db_model->select("*", "routes", $where, "id", "ASC", $limit, $start);
77
-		}else {
79
+		} else {
78 80
 			$result = $this->db_model->countQuery("*", "routes", $where);
79 81
 		}
80 82
 // 	echo "<pre>";print_r($result->result());exit;
@@ -90,10 +92,11 @@  discard block
 block discarded – undo
90 92
 
91 93
 		$this->db_model->build_search('origination_rate_list_search');
92 94
 		if ($flag) {
93
-			if ($export)
94
-				$this->db->limit($limit, $start);
95
+			if ($export) {
96
+							$this->db->limit($limit, $start);
97
+			}
95 98
 			$result = $this->db_model->select("*", "routes", $where, "id", "ASC", $limit, $start);
96
-		}else {
99
+		} else {
97 100
 			$result = $this->db_model->countQuery("*", "routes", $where);
98 101
 		}
99 102
 		return $result;
@@ -301,10 +304,11 @@  discard block
 block discarded – undo
301 304
         }
302 305
         
303 306
         $updateflg = $this->db_model->build_batch_update_array($update_array);
304
-        if ($updateflg)
305
-            return $this->db->update("outbound_routes");
306
-        else
307
-            return false;
307
+        if ($updateflg) {
308
+                    return $this->db->update("outbound_routes");
309
+        } else {
310
+                    return false;
311
+        }
308 312
     }
309 313
     function origination_rate_batch_update($update_array) {
310 314
         $this->db_model->build_search('origination_rate_list_search');
@@ -313,10 +317,11 @@  discard block
 block discarded – undo
313 317
             $this->db->where("reseller_id", $account_data['id']);
314 318
         }
315 319
         $updateflg = $this->db_model->build_batch_update_array($update_array);
316
-        if ($updateflg)
317
-            return $this->db->update("routes");
318
-        else
319
-            return false;
320
+        if ($updateflg) {
321
+                    return $this->db->update("routes");
322
+        } else {
323
+                    return false;
324
+        }
320 325
     }
321 326
     function getreseller_rates_list($flag, $start = 0, $limit = 0, $export = false) {
322 327
         $this->db_model->build_search('resellerrates_list_search');
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/rates/libraries/rates_form.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,8 +20,9 @@  discard block
 block discarded – undo
20 20
 # You should have received a copy of the GNU Affero General Public License
21 21
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
22 22
 ###############################################################################
23
-if (!defined('BASEPATH'))
24
-	exit('No direct script access allowed');
23
+if (!defined('BASEPATH')) {
24
+	exit('No direct script access allowed');
25
+}
25 26
 
26 27
 class rates_form {
27 28
 	function __construct($library_name = '') {
@@ -62,8 +63,9 @@  discard block
 block discarded – undo
62 63
 	function get_origination_rate_form_fields() {
63 64
 	 $logintype=$this->CI->session->userdata('userlevel_logintype');
64 65
 		$trunk=null;
65
-		if($logintype !=1)
66
-	  $trunk = array('Force Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0"));
66
+		if($logintype !=1) {
67
+			  $trunk = array('Force Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0"));
68
+		}
67 69
 		$form['forms'] = array(base_url() . 'rates/origination_rate_save/', array('id' => 'origination_rate_form', 'method' => 'POST', 'name' => 'origination_rate_form'));
68 70
 		$form['Rate Information'] = array(
69 71
 			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
@@ -165,8 +167,9 @@  discard block
 block discarded – undo
165 167
 	function origination_rate_batch_update_form() {
166 168
 	$logintype=$this->CI->session->userdata('userlevel_logintype');
167 169
 			$trunk=null;
168
-		if($logintype !=1)
169
-	  $trunk = array('Force Trunk', array('name'=> 'trunk_id[trunk_id]','id'=>'trunk_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0"),array('name'=>'trunk_id[operator]','class'=>'update_drp'), 'update_drp_type');
170
+		if($logintype !=1) {
171
+			  $trunk = array('Force Trunk', array('name'=> 'trunk_id[trunk_id]','id'=>'trunk_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0"),array('name'=>'trunk_id[operator]','class'=>'update_drp'), 'update_drp_type');
172
+		}
170 173
 		$form['forms'] = array("rates/origination_rate_batch_update/",array('id' => "origination_rate_batch_update"));        
171 174
 		$form['Batch Update'] = array(
172 175
 			array('Connect Cost', 'INPUT', array('name' => 'connectcost[connectcost]','id'=>'connectcost', 'value' => '', 'size' => '20',  'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'connectcost[operator]','class'=>'update_drp'), '', '', '', 'update_int_type', ''),
Please login to merge, or discard this patch.
astpp/application/modules/rates/views/view_import_termination_rate.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@
 block discarded – undo
104 104
 							foreach($csv_value as $field_name => $field_val){
105 105
 								if($csv_key == 0){
106 106
 									echo "<th>".ucfirst($field_name)."</th>";
107
-								}else{
107
+								} else{
108 108
 									echo "<td class='portlet-content'>".$field_val."</td>";   
109 109
 								}
110 110
 							}
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/signup/models/signup_model.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
 						"status"=>0,
81 81
 						"assign_date"=>date('Y-m-d H:i:s')
82 82
 						 );
83
-			}else{
83
+			} else{
84 84
 			$charge_res=$charge_res->result_array();
85 85
 			//echo "<pre>"; print_r($charge_res); exit;
86 86
 			$charge_acc_arr = array("charge_id"=>'id',
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/systems/models/system_model.php 1 patch
Braces   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -71,8 +71,7 @@  discard block
 block discarded – undo
71 71
 		$this->db->where('reseller_id',$reseller);
72 72
 		$this->db->or_where('reseller_id',0);
73 73
 		$this->db->where($where);
74
-			}
75
-			else
74
+			} else
76 75
 			{
77 76
 			   $this->db->where('reseller_id',0);
78 77
 			}
@@ -80,13 +79,12 @@  discard block
 block discarded – undo
80 79
 			if($flag) {
81 80
 
82 81
 		$query = $this->db_model->select("*", "default_templates","", "id", "ASC", $limit, $start);
83
-		 }else {
82
+		 } else {
84 83
 
85 84
 		$query = $this->db_model->countQuery("*", "default_templates","");
86 85
 		
87 86
 		 }
88
-	  } 
89
-	  else {
87
+	  } else {
90 88
           
91 89
 			$where = array('reseller_id' => 0);
92 90
 			$this->db->where($where);
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/systems/controllers/systems.php 1 patch
Braces   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -33,8 +33,9 @@  discard block
 block discarded – undo
33 33
 		$this->load->model('system_model');
34 34
 		$this->load->dbutil();
35 35
 
36
-		if ($this->session->userdata('user_login') == FALSE)
37
-			redirect(base_url() . '/astpp/login');
36
+		if ($this->session->userdata('user_login') == FALSE) {
37
+					redirect(base_url() . '/astpp/login');
38
+		}
38 39
 	}
39 40
 
40 41
 	function configuration_edit($edit_id = '') {
@@ -106,7 +107,7 @@  discard block
 block discarded – undo
106 107
 		}
107 108
 				$this->session->set_flashdata('astpp_errormsg', ucfirst($group_title).' Settings updated sucessfully!');
108 109
 			redirect(base_url() . 'systems/configuration/'.$group_title);
109
-		}else{
110
+		} else{
110 111
 	 	$this->load->view('view_systemconf', $data);
111 112
 	}
112 113
 	}
@@ -167,8 +168,7 @@  discard block
 block discarded – undo
167 168
 			 $account_data = $this->session->userdata("accountinfo");
168 169
 			 $reseller = $account_data['id'];
169 170
 			 $this->resellertemplate_save($add_array,$reseller);
170
-		}
171
-		else
171
+		} else
172 172
 		{
173 173
 			$this->admintemplate_save($add_array);
174 174
 		}
@@ -494,12 +494,12 @@  discard block
 block discarded – undo
494 494
 	  $data['page_title'] = 'Database Backup';
495 495
 	  if($add_array['id'] != ''){
496 496
       
497
-	  }else{
497
+	  } else{
498 498
 		   if($this->form_validation->run() == FALSE) {
499 499
 				$data['validation_errors'] = validation_errors();
500 500
 				echo $data['validation_errors'];
501 501
 				exit;
502
-		  }else{
502
+		  } else{
503 503
 			 $db_name     = $this->db->database;
504 504
 			 $db_username = $this->db->username;
505 505
 			 $db_password = $this->db->password;
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 			  $this->system_model->backup_insert($add_array);
525 525
 			  echo json_encode(array("SUCCESS"=> $add_array['backup_name']." backup exported successfully!"));
526 526
 			  exit;
527
-		   }else{
527
+		   } else{
528 528
 				echo 'An error occur when the system tried to backup of the database. Please check yours system settings for the backup section';
529 529
 				exit;
530 530
 		   }
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
 			  exec($run_restore);
573 573
 			  $this->session->set_flashdata('astpp_errormsg', 'Database Restore successfully.');
574 574
 			  redirect(base_url() . 'systems/database_restore/');
575
-			}else{
575
+			} else{
576 576
 			  $this->session->set_flashdata('astpp_notification', 'File not exists!');
577 577
 			  redirect(base_url() . 'systems/database_restore/');
578 578
 			}
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
 			$query = $this->system_model->import_database($filename,$_FILES['userfile']['name']);
624 624
 			$this->session->set_flashdata('astpp_errormsg',"The file ".  basename( $_FILES['userfile']['name'])." has been uploaded");
625 625
 			redirect(base_url()."systems/database_restore/");            
626
-		}else{
626
+		} else{
627 627
 			$this->session->set_flashdata('astpp_notification',"There is a some issue or invalid file format.");
628 628
 			redirect(base_url()."systems/database_restore/");            
629 629
 		}
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/systems/libraries/system_form.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,9 @@
 block discarded – undo
21 21
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
22 22
 ###############################################################################
23 23
 
24
-if (!defined('BASEPATH'))
25
-	exit('No direct script access allowed');
24
+if (!defined('BASEPATH')) {
25
+	exit('No direct script access allowed');
26
+}
26 27
 
27 28
 class System_form {
28 29
 
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/pricing/controllers/pricing.php 1 patch
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,8 +32,9 @@  discard block
 block discarded – undo
32 32
 		$this->load->library('astpp/form');
33 33
 		$this->load->model('pricing_model');
34 34
 
35
-		if ($this->session->userdata('user_login') == FALSE)
36
-			redirect(base_url() . '/astpp/login');
35
+		if ($this->session->userdata('user_login') == FALSE) {
36
+					redirect(base_url() . '/astpp/login');
37
+		}
37 38
 	}
38 39
 
39 40
 	function price_add($type = "") {
@@ -84,15 +85,16 @@  discard block
 block discarded – undo
84 85
 				exit;
85 86
 			}
86 87
 			$this->load->view('view_price_add_edit', $data);
87
-	   }else {
88
+	   } else {
88 89
 			$data['page_title'] = 'Create Price Details';
89 90
 			if ($this->form_validation->run() == FALSE) {
90 91
 				$data['validation_errors'] = validation_errors();
91 92
 				echo $data['validation_errors'];
92 93
 				exit;
93 94
 			} else {
94
-		if(isset($add_array['trunk_id']) && !empty($add_array['trunk_id']))
95
-				$trunk_id=$add_array['trunk_id'];
95
+		if(isset($add_array['trunk_id']) && !empty($add_array['trunk_id'])) {
96
+						$trunk_id=$add_array['trunk_id'];
97
+		}
96 98
 				unset($add_array['trunk_id']);
97 99
 				$priceid=$this->pricing_model->add_price($add_array);
98 100
 		if(isset($trunk_id) && $trunk_id != ''){
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/pricing/libraries/pricing_form.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,8 +21,9 @@  discard block
 block discarded – undo
21 21
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
22 22
 ###############################################################################
23 23
 
24
-if (!defined('BASEPATH'))
25
-	exit('No direct script access allowed');
24
+if (!defined('BASEPATH')) {
25
+	exit('No direct script access allowed');
26
+}
26 27
 
27 28
 class pricing_form {
28 29
 	function __construct($library_name = '') {
@@ -41,8 +42,7 @@  discard block
 block discarded – undo
41 42
 		array('Markup(%)', 'INPUT', array('name' => 'markup', 'value' => "0" ,  'size' => '20',  'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
42 43
 		array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_status'),
43 44
 		);
44
-	}
45
-	else{
45
+	} else{
46 46
 	  $form['Rate Group Information'] = array(
47 47
 		array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
48 48
 		array('', 'HIDDEN', array('name' => 'status', 'value' => '1'), '', '', ''),
Please login to merge, or discard this patch.