@@ -21,8 +21,9 @@ discard block |
||
21 | 21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 | 22 | ############################################################################### |
23 | 23 | |
24 | -if (!defined('BASEPATH')) |
|
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 |
||
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'), '', '', ''), |
@@ -33,10 +33,11 @@ |
||
33 | 33 | $reseller_id=$accountinfo['type']==1 ? $accountinfo['id'] : 0; |
34 | 34 | $where=array('reseller_id'=>$reseller_id); |
35 | 35 | if ($flag) { |
36 | - if($export) |
|
37 | - $query = $this->db_model->select("*", "refill_coupon",$where, "id", "ASC",'',''); |
|
38 | - else |
|
39 | - $query = $this->db_model->select("*", "refill_coupon",$where, "id", "ASC", $limit, $start); |
|
36 | + if($export) { |
|
37 | + $query = $this->db_model->select("*", "refill_coupon",$where, "id", "ASC",'',''); |
|
38 | + } else { |
|
39 | + $query = $this->db_model->select("*", "refill_coupon",$where, "id", "ASC", $limit, $start); |
|
40 | + } |
|
40 | 41 | } else { |
41 | 42 | $query = $this->db_model->countQuery("*", "refill_coupon",$where); |
42 | 43 | } |
@@ -32,8 +32,9 @@ discard block |
||
32 | 32 | $this->load->library("refill_coupon_form"); |
33 | 33 | $this->load->library("astpp/form"); |
34 | 34 | $this->load->library("session"); |
35 | - if ($this->session->userdata('user_login') == FALSE) |
|
36 | - redirect(base_url() . 'login/login'); |
|
35 | + if ($this->session->userdata('user_login') == FALSE) { |
|
36 | + redirect(base_url() . 'login/login'); |
|
37 | + } |
|
37 | 38 | } |
38 | 39 | function refill_coupon_list(){ |
39 | 40 | if($this->session->userdata('logintype') == 0 || $this->session->userdata('logintype') == 3){ |
@@ -120,8 +121,7 @@ discard block |
||
120 | 121 | $data['validation_errors'] = validation_errors(); |
121 | 122 | echo $data['validation_errors']; |
122 | 123 | exit; |
123 | - } |
|
124 | - else { |
|
124 | + } else { |
|
125 | 125 | if($account_length<=strlen($add_array['prefix'])){ |
126 | 126 | echo json_encode(array("count_error"=>"You Can Not Create ".$add_array['count']." Accounts with ".$add_array['prefix']." prefix.")); |
127 | 127 | exit; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | if($currentlength > 0 && $add_array['count'] > $currentlength){ |
134 | 134 | echo json_encode(array("count_error"=>"You Can Create Maximum ".$currentlength." accounts with ".$add_array['prefix']." prefix")); |
135 | 135 | exit; |
136 | - }else{ |
|
136 | + } else{ |
|
137 | 137 | $this->refill_coupon_model->add_refill_coupon($add_array); |
138 | 138 | echo json_encode(array("SUCCESS"=> "Refill coupon created successfully!")); |
139 | 139 | exit; |
@@ -32,8 +32,9 @@ |
||
32 | 32 | $this->load->library('astpp/form'); |
33 | 33 | $this->load->model('animap_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 animap_add() { |
@@ -22,8 +22,9 @@ |
||
22 | 22 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
23 | 23 | ############################################################################### |
24 | 24 | |
25 | -if (!defined('BASEPATH')) |
|
26 | - exit('No direct script access allowed'); |
|
25 | +if (!defined('BASEPATH')) { |
|
26 | + exit('No direct script access allowed'); |
|
27 | +} |
|
27 | 28 | |
28 | 29 | class Animap_form { |
29 | 30 | function __construct($library_name = '') { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $this->db_model->build_search('taxes_list_search'); |
31 | 31 | if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
32 | 32 | $where = array("reseller_id"=>$this->session->userdata["accountinfo"]['id']); |
33 | - }else{ |
|
33 | + } else{ |
|
34 | 34 | $where =array("reseller_id"=>0); |
35 | 35 | } |
36 | 36 | if ($flag) { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $data["creation_date"] = date("Y-m-d H:i:s"); |
47 | 47 | if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
48 | 48 | $data['reseller_id'] = $this->session->userdata["accountinfo"]['id']; |
49 | - }else{ |
|
49 | + } else{ |
|
50 | 50 | $data['reseller_id'] =0; |
51 | 51 | } |
52 | 52 | $this->db->insert("taxes", $data); |
@@ -32,8 +32,9 @@ |
||
32 | 32 | $this->load->library('astpp/form'); |
33 | 33 | $this->load->model('taxes_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 taxes_add() { |
@@ -20,8 +20,9 @@ |
||
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 Taxes_form { |
27 | 28 | function __construct() { |
@@ -50,11 +50,12 @@ discard block |
||
50 | 50 | $this->db->select('pricelist_id'); |
51 | 51 | $account_info=(array)$this->db->get('accounts')->first_row(); |
52 | 52 | $where=array('pricelist_id'=>$account_info['pricelist_id']); |
53 | - if(!empty($like_str)) |
|
54 | - $this->db->where($like_str); |
|
53 | + if(!empty($like_str)) { |
|
54 | + $this->db->where($like_str); |
|
55 | + } |
|
55 | 56 | if ($flag) { |
56 | 57 | $query = $this->db_model->select("*", "packages", $where, "id", "ASC", $limit, $start); |
57 | - }else { |
|
58 | + } else { |
|
58 | 59 | $query = $this->db_model->countQuery("*", "packages", $where); |
59 | 60 | } |
60 | 61 | return $query; |
@@ -120,8 +121,7 @@ discard block |
||
120 | 121 | $this->db->where_in('accountid',$acc_arr); |
121 | 122 | if($flag){ |
122 | 123 | $this->db->select('*'); |
123 | - } |
|
124 | - else{ |
|
124 | + } else{ |
|
125 | 125 | $this->db->select('count(id) as count'); |
126 | 126 | } |
127 | 127 | if($flag){ |
@@ -129,27 +129,26 @@ discard block |
||
129 | 129 | } |
130 | 130 | if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
131 | 131 | $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
132 | - }else{ |
|
132 | + } else{ |
|
133 | 133 | $this->db->order_by('seconds','desc'); |
134 | 134 | } |
135 | 135 | $result=$this->db->get('counters'); |
136 | 136 | // echo $this->db->last_query();exit; |
137 | 137 | if($flag){ |
138 | 138 | return $result; |
139 | - }else{ |
|
139 | + } else{ |
|
140 | 140 | $result=$result->result_array(); |
141 | 141 | return $result[0]['count']; |
142 | 142 | } |
143 | - }else{ |
|
143 | + } else{ |
|
144 | 144 | if($flag){ |
145 | 145 | $query=(object)array('num_rows'=>0); |
146 | - } |
|
147 | - else{ |
|
146 | + } else{ |
|
148 | 147 | $query=0; |
149 | 148 | } |
150 | 149 | return $query; |
151 | 150 | } |
152 | - }else{ |
|
151 | + } else{ |
|
153 | 152 | |
154 | 153 | if($result->num_rows() >0){ |
155 | 154 | $acc_arr=array(); |
@@ -162,8 +161,7 @@ discard block |
||
162 | 161 | |
163 | 162 | if($flag){ |
164 | 163 | $this->db->select('*'); |
165 | - } |
|
166 | - else{ |
|
164 | + } else{ |
|
167 | 165 | $this->db->select('count(id) as count'); |
168 | 166 | } |
169 | 167 | if($flag){ |
@@ -176,17 +174,16 @@ discard block |
||
176 | 174 | if($flag){ |
177 | 175 | |
178 | 176 | return $result; |
179 | - }else{ |
|
177 | + } else{ |
|
180 | 178 | $result=$result->result_array(); |
181 | 179 | |
182 | 180 | return $result[0]['count']; |
183 | 181 | } |
184 | - }else{ |
|
182 | + } else{ |
|
185 | 183 | if($flag){ |
186 | 184 | |
187 | 185 | $query=(object)array('num_rows'=>0); |
188 | - } |
|
189 | - else{ |
|
186 | + } else{ |
|
190 | 187 | $query=0; |
191 | 188 | } |
192 | 189 | // echo $this->db->last_query();exit; |