@@ -28,7 +28,7 @@ |
||
28 | 28 | <!-- <?php |
29 | 29 | $data_errrors = json_decode($validation_errors); |
30 | 30 | foreach ($data_errrors as $key => $value) { |
31 | - echo $value . "<br/>"; |
|
31 | + echo $value."<br/>"; |
|
32 | 32 | } |
33 | 33 | ?> |
34 | 34 | </div> |
@@ -122,236 +122,236 @@ |
||
122 | 122 | $this->db_model->build_search('origination_rate_list_search'); |
123 | 123 | /***********************/ |
124 | 124 | |
125 | - if ($flag) { |
|
126 | - $query = $this->db_model->select("*", "routes", $where, "id", "ASC", $limit, $start); |
|
127 | - } else { |
|
128 | - $query = $this->db_model->countQuery("*", "routes", $where); |
|
125 | + if ($flag) { |
|
126 | + $query = $this->db_model->select("*", "routes", $where, "id", "ASC", $limit, $start); |
|
127 | + } else { |
|
128 | + $query = $this->db_model->countQuery("*", "routes", $where); |
|
129 | 129 | |
130 | - } |
|
131 | - //echo $this->db->last_query(); |
|
132 | - return $query; |
|
133 | - } |
|
134 | - function getunblocked_pattern_list($accountid, $flag, $start = 0, $limit = 0) { |
|
135 | - $this->db_model->build_search('origination_rate_list_search'); |
|
136 | - if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
137 | - $account_data = $this->session->userdata("accountinfo"); |
|
138 | - $reseller = $account_data['id']; |
|
139 | - $where = array("reseller_id" => $reseller, "status" => "0"); |
|
140 | - } else { |
|
141 | - $where = array("status" => "0", 'reseller_id'=>'0'); |
|
142 | - } |
|
143 | - $where1 = '(pattern NOT IN (select blocked_patterns from block_patterns where accountid = "'.$accountid.'"))'; |
|
144 | - $this->db->where($where1); |
|
145 | - if ($flag) { |
|
146 | - $query = $this->db_model->select("*", "routes", $where, "id", "ASC", $limit, $start); |
|
130 | + } |
|
131 | + //echo $this->db->last_query(); |
|
132 | + return $query; |
|
133 | + } |
|
134 | + function getunblocked_pattern_list($accountid, $flag, $start = 0, $limit = 0) { |
|
135 | + $this->db_model->build_search('origination_rate_list_search'); |
|
136 | + if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
137 | + $account_data = $this->session->userdata("accountinfo"); |
|
138 | + $reseller = $account_data['id']; |
|
139 | + $where = array("reseller_id" => $reseller, "status" => "0"); |
|
140 | + } else { |
|
141 | + $where = array("status" => "0", 'reseller_id'=>'0'); |
|
142 | + } |
|
143 | + $where1 = '(pattern NOT IN (select blocked_patterns from block_patterns where accountid = "'.$accountid.'"))'; |
|
144 | + $this->db->where($where1); |
|
145 | + if ($flag) { |
|
146 | + $query = $this->db_model->select("*", "routes", $where, "id", "ASC", $limit, $start); |
|
147 | 147 | // echo "<pre>"; print_r($query); exit; |
148 | - } else { |
|
149 | - $query = $this->db_model->countQuery("*", "routes", $where); |
|
150 | - } |
|
151 | - return $query; |
|
152 | - } |
|
153 | - function getunblocked_package_pattern($accountid, $flag, $start = 0, $limit = 0) { |
|
154 | - $this->db_model->build_search('origination_rate_list_search'); |
|
155 | - if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
156 | - $account_data = $this->session->userdata("accountinfo"); |
|
157 | - $reseller = $account_data['id']; |
|
158 | - $where = array("reseller_id" => $reseller, "status" => "0"); |
|
159 | - } else { |
|
160 | - $where = array("status" => "0", 'reseller_id'=>'0'); |
|
161 | - } |
|
162 | - $where1 = '(pattern NOT IN (select DISTINCT patterns from package_patterns where package_id = "'.$accountid.'"))'; |
|
163 | - $this->db->where($where1); |
|
164 | - if ($flag) { |
|
165 | - $query = $this->db_model->select("*", "routes", $where, "id", "ASC", $limit, $start); |
|
166 | - } else { |
|
167 | - $query = $this->db_model->countQuery("*", "routes", $where); |
|
168 | - } |
|
169 | - return $query; |
|
170 | - } |
|
148 | + } else { |
|
149 | + $query = $this->db_model->countQuery("*", "routes", $where); |
|
150 | + } |
|
151 | + return $query; |
|
152 | + } |
|
153 | + function getunblocked_package_pattern($accountid, $flag, $start = 0, $limit = 0) { |
|
154 | + $this->db_model->build_search('origination_rate_list_search'); |
|
155 | + if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
156 | + $account_data = $this->session->userdata("accountinfo"); |
|
157 | + $reseller = $account_data['id']; |
|
158 | + $where = array("reseller_id" => $reseller, "status" => "0"); |
|
159 | + } else { |
|
160 | + $where = array("status" => "0", 'reseller_id'=>'0'); |
|
161 | + } |
|
162 | + $where1 = '(pattern NOT IN (select DISTINCT patterns from package_patterns where package_id = "'.$accountid.'"))'; |
|
163 | + $this->db->where($where1); |
|
164 | + if ($flag) { |
|
165 | + $query = $this->db_model->select("*", "routes", $where, "id", "ASC", $limit, $start); |
|
166 | + } else { |
|
167 | + $query = $this->db_model->countQuery("*", "routes", $where); |
|
168 | + } |
|
169 | + return $query; |
|
170 | + } |
|
171 | 171 | |
172 | - function get_origination_rate_list_for_user($flag, $start = 0, $limit = 0) { |
|
173 | - $this->db_model->build_search('user_rates_list_search'); |
|
172 | + function get_origination_rate_list_for_user($flag, $start = 0, $limit = 0) { |
|
173 | + $this->db_model->build_search('user_rates_list_search'); |
|
174 | 174 | |
175 | - $account_data = $this->session->userdata("accountinfo"); |
|
176 | - $where = array("pricelist_id" => $account_data["pricelist_id"], "status" => '0'); |
|
175 | + $account_data = $this->session->userdata("accountinfo"); |
|
176 | + $where = array("pricelist_id" => $account_data["pricelist_id"], "status" => '0'); |
|
177 | 177 | |
178 | - $this->db_model->build_search('origination_rate_list_search'); |
|
179 | - if ($flag) { |
|
180 | - $query = $this->db_model->select("*", "routes", $where, "id", "ASC", $limit, $start); |
|
181 | - } else { |
|
182 | - $query = $this->db_model->countQuery("*", "routes", $where); |
|
183 | - } |
|
184 | - return $query; |
|
185 | - } |
|
178 | + $this->db_model->build_search('origination_rate_list_search'); |
|
179 | + if ($flag) { |
|
180 | + $query = $this->db_model->select("*", "routes", $where, "id", "ASC", $limit, $start); |
|
181 | + } else { |
|
182 | + $query = $this->db_model->countQuery("*", "routes", $where); |
|
183 | + } |
|
184 | + return $query; |
|
185 | + } |
|
186 | 186 | |
187 | 187 | |
188 | - function add_termination_rate($add_array) { |
|
189 | - unset($add_array["action"]); |
|
190 | - if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
191 | - $account_data = $this->session->userdata("accountinfo"); |
|
192 | - $reseller = $account_data['id']; |
|
193 | - $add_array['reseller_id'] = $reseller; |
|
194 | - } |
|
195 | - $add_array['pattern'] = "^".$add_array['pattern'].".*"; |
|
196 | - $add_array['prepend'] = $add_array['prepend']; |
|
197 | - /* |
|
188 | + function add_termination_rate($add_array) { |
|
189 | + unset($add_array["action"]); |
|
190 | + if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
191 | + $account_data = $this->session->userdata("accountinfo"); |
|
192 | + $reseller = $account_data['id']; |
|
193 | + $add_array['reseller_id'] = $reseller; |
|
194 | + } |
|
195 | + $add_array['pattern'] = "^".$add_array['pattern'].".*"; |
|
196 | + $add_array['prepend'] = $add_array['prepend']; |
|
197 | + /* |
|
198 | 198 | ASTPP 3.0 |
199 | 199 | add creation date. |
200 | 200 | */ |
201 | - $add_array['creation_date'] = gmdate('Y-m-d H:i:s'); |
|
202 | - /*******************************************************/ |
|
203 | - $this->insert_if_not_exitst($add_array, "outbound_routes"); |
|
204 | - //$this->db->insert("outbound_routes", $add_array); |
|
205 | - return true; |
|
206 | - } |
|
201 | + $add_array['creation_date'] = gmdate('Y-m-d H:i:s'); |
|
202 | + /*******************************************************/ |
|
203 | + $this->insert_if_not_exitst($add_array, "outbound_routes"); |
|
204 | + //$this->db->insert("outbound_routes", $add_array); |
|
205 | + return true; |
|
206 | + } |
|
207 | 207 | |
208 | - function edit_termination_rate($data, $id) { |
|
209 | - unset($data["action"]); |
|
210 | - /* |
|
208 | + function edit_termination_rate($data, $id) { |
|
209 | + unset($data["action"]); |
|
210 | + /* |
|
211 | 211 | ASTPP 3.0 |
212 | 212 | Edit time last modified date |
213 | 213 | */ |
214 | - $data['last_modified_date'] = gmdate('Y-m-d H:i:s'); |
|
215 | - /***************************************************/ |
|
216 | - $data['pattern'] = "^".$data['pattern'].".*"; |
|
217 | - $this->db->where("id", $id); |
|
218 | - $this->db->update("outbound_routes", $data); |
|
219 | - } |
|
214 | + $data['last_modified_date'] = gmdate('Y-m-d H:i:s'); |
|
215 | + /***************************************************/ |
|
216 | + $data['pattern'] = "^".$data['pattern'].".*"; |
|
217 | + $this->db->where("id", $id); |
|
218 | + $this->db->update("outbound_routes", $data); |
|
219 | + } |
|
220 | 220 | |
221 | - function remove_termination_rate($id) { |
|
222 | - $this->db->where("id", $id); |
|
223 | - $this->db->delete("outbound_routes"); |
|
224 | - return true; |
|
225 | - } |
|
221 | + function remove_termination_rate($id) { |
|
222 | + $this->db->where("id", $id); |
|
223 | + $this->db->delete("outbound_routes"); |
|
224 | + return true; |
|
225 | + } |
|
226 | 226 | |
227 | - function add_origination_rate($add_array) { |
|
227 | + function add_origination_rate($add_array) { |
|
228 | 228 | |
229 | - unset($add_array["action"]); |
|
230 | - /* |
|
229 | + unset($add_array["action"]); |
|
230 | + /* |
|
231 | 231 | ASTPP 3.0 |
232 | 232 | ADD time put creation date in routes table |
233 | 233 | */ |
234 | - $add_array['creation_date'] = gmdate('Y-m-d H:i:s'); |
|
235 | - /**********************************************/ |
|
236 | - if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
237 | - $account_data = $this->session->userdata("accountinfo"); |
|
238 | - $reseller = $account_data['id']; |
|
239 | - $add_array['reseller_id'] = $reseller; |
|
240 | - } |
|
234 | + $add_array['creation_date'] = gmdate('Y-m-d H:i:s'); |
|
235 | + /**********************************************/ |
|
236 | + if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
237 | + $account_data = $this->session->userdata("accountinfo"); |
|
238 | + $reseller = $account_data['id']; |
|
239 | + $add_array['reseller_id'] = $reseller; |
|
240 | + } |
|
241 | 241 | |
242 | - $add_array['pattern'] = "^".$add_array['pattern'].".*"; |
|
242 | + $add_array['pattern'] = "^".$add_array['pattern'].".*"; |
|
243 | 243 | /************* |
244 | 244 | ASTPP 3.0 |
245 | 245 | Rate insert |
246 | 246 | *************/ |
247 | - $this->insert_if_not_exitst($add_array, "routes"); |
|
247 | + $this->insert_if_not_exitst($add_array, "routes"); |
|
248 | 248 | // $this->db->insert("routes", $add_array); |
249 | 249 | /*******************************/ |
250 | - return true; |
|
251 | - } |
|
250 | + return true; |
|
251 | + } |
|
252 | 252 | |
253 | - function edit_origination_rate($data, $id) { |
|
254 | - unset($data["action"]); |
|
255 | - /* |
|
253 | + function edit_origination_rate($data, $id) { |
|
254 | + unset($data["action"]); |
|
255 | + /* |
|
256 | 256 | ASTPP 3.0 |
257 | 257 | Edit tile last modified date update |
258 | 258 | */ |
259 | - $data['last_modified_date'] = gmdate('Y-m-d H:i:s'); |
|
260 | - /********************************************************/ |
|
261 | - $data['pattern'] = "^".$data['pattern'].".*"; |
|
262 | - $this->db->where("id", $id); |
|
263 | - $this->db->update("routes", $data); |
|
264 | - } |
|
259 | + $data['last_modified_date'] = gmdate('Y-m-d H:i:s'); |
|
260 | + /********************************************************/ |
|
261 | + $data['pattern'] = "^".$data['pattern'].".*"; |
|
262 | + $this->db->where("id", $id); |
|
263 | + $this->db->update("routes", $data); |
|
264 | + } |
|
265 | 265 | |
266 | - function remove_origination_rate($id) { |
|
267 | - $this->db->where("id", $id); |
|
268 | - $this->db->delete("routes"); |
|
269 | - return true; |
|
270 | - } |
|
266 | + function remove_origination_rate($id) { |
|
267 | + $this->db->where("id", $id); |
|
268 | + $this->db->delete("routes"); |
|
269 | + return true; |
|
270 | + } |
|
271 | 271 | |
272 | - function get_trunk_name($field_value) { |
|
273 | - $this->db->where("name", $field_value); |
|
274 | - $query = $this->db->get('trunks'); |
|
275 | - $data = $query->result(); |
|
276 | - if ($query->num_rows > 0) { |
|
277 | - return $data[0]->id; |
|
278 | - } else { |
|
279 | - return ''; |
|
280 | - } |
|
281 | - } |
|
272 | + function get_trunk_name($field_value) { |
|
273 | + $this->db->where("name", $field_value); |
|
274 | + $query = $this->db->get('trunks'); |
|
275 | + $data = $query->result(); |
|
276 | + if ($query->num_rows > 0) { |
|
277 | + return $data[0]->id; |
|
278 | + } else { |
|
279 | + return ''; |
|
280 | + } |
|
281 | + } |
|
282 | 282 | |
283 | - function bulk_insert_termination_rate($field_value) { |
|
284 | - //$this->db->insert_batch('outbound_routes', $field_value); |
|
285 | - $this->db->insert_on_duplicate_update_batch('outbound_routes', $field_value); |
|
286 | - $affected_row = $this->db->affected_rows(); |
|
287 | - return $affected_row; |
|
288 | - } |
|
283 | + function bulk_insert_termination_rate($field_value) { |
|
284 | + //$this->db->insert_batch('outbound_routes', $field_value); |
|
285 | + $this->db->insert_on_duplicate_update_batch('outbound_routes', $field_value); |
|
286 | + $affected_row = $this->db->affected_rows(); |
|
287 | + return $affected_row; |
|
288 | + } |
|
289 | 289 | |
290 | - function bulk_insert_origination_rate($inserted_array) { |
|
291 | - //$this->db->insert_batch('routes', $inserted_array); |
|
292 | - $this->db->insert_on_duplicate_update_batch('routes', $inserted_array); |
|
293 | - $affected_row = $this->db->affected_rows(); |
|
294 | - return $affected_row; |
|
295 | - } |
|
296 | - function termination_rate_batch_update($update_array) { |
|
297 | - $this->db_model->build_search('termination_rates_list_search'); |
|
298 | - if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
299 | - $account_data = $this->session->userdata("accountinfo"); |
|
300 | - $this->db->where("reseller_id", $account_data['id']); |
|
301 | - } |
|
290 | + function bulk_insert_origination_rate($inserted_array) { |
|
291 | + //$this->db->insert_batch('routes', $inserted_array); |
|
292 | + $this->db->insert_on_duplicate_update_batch('routes', $inserted_array); |
|
293 | + $affected_row = $this->db->affected_rows(); |
|
294 | + return $affected_row; |
|
295 | + } |
|
296 | + function termination_rate_batch_update($update_array) { |
|
297 | + $this->db_model->build_search('termination_rates_list_search'); |
|
298 | + if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
299 | + $account_data = $this->session->userdata("accountinfo"); |
|
300 | + $this->db->where("reseller_id", $account_data['id']); |
|
301 | + } |
|
302 | 302 | |
303 | - $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; |
|
308 | - } |
|
309 | - function origination_rate_batch_update($update_array) { |
|
310 | - $this->db_model->build_search('origination_rate_list_search'); |
|
311 | - if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
312 | - $account_data = $this->session->userdata("accountinfo"); |
|
313 | - $this->db->where("reseller_id", $account_data['id']); |
|
314 | - } |
|
315 | - $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 | - } |
|
321 | - function getreseller_rates_list($flag, $start = 0, $limit = 0, $export = false) { |
|
322 | - $this->db_model->build_search('resellerrates_list_search'); |
|
323 | - $account_data = $this->session->userdata("accountinfo"); |
|
324 | - $where = array("status"=>"0", "pricelist_id" => $account_data["pricelist_id"]); |
|
325 | - if ($flag) { |
|
326 | - $query = $this->db_model->select("*", "routes", $where, "id", "ASC", $limit, $start); |
|
327 | - } else { |
|
328 | - $query = $this->db_model->countQuery("*", "routes", $where); |
|
329 | - } |
|
330 | - return $query; |
|
331 | - } |
|
303 | + $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; |
|
308 | + } |
|
309 | + function origination_rate_batch_update($update_array) { |
|
310 | + $this->db_model->build_search('origination_rate_list_search'); |
|
311 | + if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
312 | + $account_data = $this->session->userdata("accountinfo"); |
|
313 | + $this->db->where("reseller_id", $account_data['id']); |
|
314 | + } |
|
315 | + $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 | + } |
|
321 | + function getreseller_rates_list($flag, $start = 0, $limit = 0, $export = false) { |
|
322 | + $this->db_model->build_search('resellerrates_list_search'); |
|
323 | + $account_data = $this->session->userdata("accountinfo"); |
|
324 | + $where = array("status"=>"0", "pricelist_id" => $account_data["pricelist_id"]); |
|
325 | + if ($flag) { |
|
326 | + $query = $this->db_model->select("*", "routes", $where, "id", "ASC", $limit, $start); |
|
327 | + } else { |
|
328 | + $query = $this->db_model->countQuery("*", "routes", $where); |
|
329 | + } |
|
330 | + return $query; |
|
331 | + } |
|
332 | 332 | /************* |
333 | 333 | ASTPP 3.0 |
334 | 334 | Rate insert |
335 | 335 | *************/ |
336 | - /** |
|
337 | - * @param string $table_name |
|
338 | - */ |
|
339 | - function insert_if_not_exitst($add_array,$table_name){ |
|
340 | - $insert_str = "Insert into $table_name ("; |
|
341 | - $insert_key = ""; |
|
342 | - $insert_value = ""; |
|
343 | - $update_str = ""; |
|
344 | - foreach($add_array as $key => $value){ |
|
345 | - if($key != 'id'){ |
|
346 | - $insert_key .= $key.","; |
|
347 | - $insert_value .= "'$value',"; |
|
348 | - $update_str .= $key." = '$value',"; |
|
349 | - } |
|
350 | - } |
|
351 | - $insert_key = rtrim($insert_key,","); |
|
352 | - $insert_value = rtrim($insert_value,","); |
|
353 | - $update_str = rtrim($update_str,","); |
|
354 | - $insert_str .= $insert_key.") values"."(".$insert_value.") ON DUPLICATE KEY UPDATE $update_str"; |
|
355 | - $this->db->query($insert_str); |
|
356 | - } |
|
336 | + /** |
|
337 | + * @param string $table_name |
|
338 | + */ |
|
339 | + function insert_if_not_exitst($add_array,$table_name){ |
|
340 | + $insert_str = "Insert into $table_name ("; |
|
341 | + $insert_key = ""; |
|
342 | + $insert_value = ""; |
|
343 | + $update_str = ""; |
|
344 | + foreach($add_array as $key => $value){ |
|
345 | + if($key != 'id'){ |
|
346 | + $insert_key .= $key.","; |
|
347 | + $insert_value .= "'$value',"; |
|
348 | + $update_str .= $key." = '$value',"; |
|
349 | + } |
|
350 | + } |
|
351 | + $insert_key = rtrim($insert_key,","); |
|
352 | + $insert_value = rtrim($insert_value,","); |
|
353 | + $update_str = rtrim($update_str,","); |
|
354 | + $insert_str .= $insert_key.") values"."(".$insert_value.") ON DUPLICATE KEY UPDATE $update_str"; |
|
355 | + $this->db->query($insert_str); |
|
356 | + } |
|
357 | 357 | } |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | ASTPP 3.0 |
33 | 33 | Batch Delete |
34 | 34 | ********/ |
35 | - if($this->session->userdata('advance_batch_delete') == 1){ |
|
35 | + if ($this->session->userdata('advance_batch_delete') == 1) { |
|
36 | 36 | $this->db->where(array("trunk_id >"=>"0")); |
37 | 37 | $this->db->delete("outbound_routes"); |
38 | - $this->session->set_userdata('advance_batch_delete','0'); |
|
38 | + $this->session->set_userdata('advance_batch_delete', '0'); |
|
39 | 39 | $this->session->unset_userdata('advance_batch_delete'); |
40 | 40 | } |
41 | 41 | /**************/ |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | if ($export) |
54 | 54 | $this->db->limit($limit, $start); |
55 | 55 | $result = $this->db->get(); |
56 | - }else { |
|
56 | + } else { |
|
57 | 57 | $result = $this->db->count_all_results(); |
58 | 58 | } |
59 | 59 | return $result; |
@@ -74,14 +74,14 @@ discard block |
||
74 | 74 | if ($export) |
75 | 75 | $this->db->limit($limit, $start); |
76 | 76 | $result = $this->db_model->select("*", "routes", $where, "id", "ASC", $limit, $start); |
77 | - }else { |
|
77 | + } else { |
|
78 | 78 | $result = $this->db_model->countQuery("*", "routes", $where); |
79 | 79 | } |
80 | 80 | // echo "<pre>";print_r($result->result());exit; |
81 | 81 | return $result; |
82 | 82 | } |
83 | 83 | |
84 | - function get_origination_rate_for_user($flag, $start = 0, $limit = 0,$export = true) { |
|
84 | + function get_origination_rate_for_user($flag, $start = 0, $limit = 0, $export = true) { |
|
85 | 85 | $this->db_model->build_search('origination_rate_list_search'); |
86 | 86 | |
87 | 87 | $account_data = $this->session->userdata("accountinfo"); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | if ($export) |
94 | 94 | $this->db->limit($limit, $start); |
95 | 95 | $result = $this->db_model->select("*", "routes", $where, "id", "ASC", $limit, $start); |
96 | - }else { |
|
96 | + } else { |
|
97 | 97 | $result = $this->db_model->countQuery("*", "routes", $where); |
98 | 98 | } |
99 | 99 | return $result; |
@@ -111,11 +111,11 @@ discard block |
||
111 | 111 | ASTPP 3.0 |
112 | 112 | Batch delete |
113 | 113 | ************/ |
114 | - if($this->session->userdata('advance_batch_delete') == 1){ |
|
114 | + if ($this->session->userdata('advance_batch_delete') == 1) { |
|
115 | 115 | $this->db->where($where); |
116 | 116 | $this->db->delete("routes"); |
117 | 117 | //echo $this->db->last_query(); exit; |
118 | - $this->session->set_userdata('advance_batch_delete','0'); |
|
118 | + $this->session->set_userdata('advance_batch_delete', '0'); |
|
119 | 119 | $this->session->unset_userdata('advance_batch_delete'); |
120 | 120 | |
121 | 121 | } |
@@ -336,21 +336,21 @@ discard block |
||
336 | 336 | /** |
337 | 337 | * @param string $table_name |
338 | 338 | */ |
339 | - function insert_if_not_exitst($add_array,$table_name){ |
|
339 | + function insert_if_not_exitst($add_array, $table_name) { |
|
340 | 340 | $insert_str = "Insert into $table_name ("; |
341 | 341 | $insert_key = ""; |
342 | 342 | $insert_value = ""; |
343 | 343 | $update_str = ""; |
344 | - foreach($add_array as $key => $value){ |
|
345 | - if($key != 'id'){ |
|
344 | + foreach ($add_array as $key => $value) { |
|
345 | + if ($key != 'id') { |
|
346 | 346 | $insert_key .= $key.","; |
347 | 347 | $insert_value .= "'$value',"; |
348 | 348 | $update_str .= $key." = '$value',"; |
349 | 349 | } |
350 | 350 | } |
351 | - $insert_key = rtrim($insert_key,","); |
|
352 | - $insert_value = rtrim($insert_value,","); |
|
353 | - $update_str = rtrim($update_str,","); |
|
351 | + $insert_key = rtrim($insert_key, ","); |
|
352 | + $insert_value = rtrim($insert_value, ","); |
|
353 | + $update_str = rtrim($update_str, ","); |
|
354 | 354 | $insert_str .= $insert_key.") values"."(".$insert_value.") ON DUPLICATE KEY UPDATE $update_str"; |
355 | 355 | $this->db->query($insert_str); |
356 | 356 | } |
@@ -50,10 +50,11 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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'); |
@@ -20,8 +20,9 @@ discard block |
||
20 | 20 | # You should have received a copy of the GNU Affero General Public License |
21 | 21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 | 22 | ############################################################################### |
23 | -if (!defined('BASEPATH')) |
|
24 | - exit('No direct script access allowed'); |
|
23 | +if (!defined('BASEPATH')) { |
|
24 | + exit('No direct script access allowed'); |
|
25 | +} |
|
25 | 26 | |
26 | 27 | class rates_form { |
27 | 28 | function __construct($library_name = '') { |
@@ -62,8 +63,9 @@ discard block |
||
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 |
||
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', ''), |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | # You should have received a copy of the GNU Affero General Public License |
21 | 21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 | 22 | ############################################################################### |
23 | -if (!defined('BASEPATH')) |
|
23 | +if ( ! defined('BASEPATH')) |
|
24 | 24 | exit('No direct script access allowed'); |
25 | 25 | |
26 | 26 | class rates_form { |
@@ -28,29 +28,29 @@ discard block |
||
28 | 28 | $this->CI = & get_instance(); |
29 | 29 | } |
30 | 30 | function get_termination_rate_form_fields() { |
31 | - $form['forms'] = array(base_url() . 'rates/termination_rate_save/', array('id' => 'termination_rate_form', 'method' => 'POST', 'name' => 'termination_rate_form')); |
|
31 | + $form['forms'] = array(base_url().'rates/termination_rate_save/', array('id' => 'termination_rate_form', 'method' => 'POST', 'name' => 'termination_rate_form')); |
|
32 | 32 | $form['Rate Information'] = array( |
33 | 33 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
34 | 34 | array('Trunk', 'trunk_id', 'SELECT', '', 'dropdown', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0")), |
35 | - array('Code', 'INPUT', array('name' => 'pattern', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''), |
|
36 | - array('Destination', 'INPUT', array('name' => 'comment', 'size' => '20', 'class' => "text field medium"), 'tOOL TIP', ''), |
|
37 | - array('Strip', 'INPUT', array('name' => 'strip', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
38 | - array('Prepend', 'INPUT', array('name' => 'prepend', 'size' => '20', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''), |
|
35 | + array('Code', 'INPUT', array('name' => 'pattern', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''), |
|
36 | + array('Destination', 'INPUT', array('name' => 'comment', 'size' => '20', 'class' => "text field medium"), 'tOOL TIP', ''), |
|
37 | + array('Strip', 'INPUT', array('name' => 'strip', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
38 | + array('Prepend', 'INPUT', array('name' => 'prepend', 'size' => '20', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''), |
|
39 | 39 | array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_status'), |
40 | 40 | |
41 | 41 | |
42 | 42 | ); |
43 | 43 | $form['Billing Information'] = array( |
44 | - array('Connect Cost', 'INPUT', array('name' => 'connectcost', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|currency_decimal|xss_clean', 'tOOL TIP', ''), |
|
44 | + array('Connect Cost', 'INPUT', array('name' => 'connectcost', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|currency_decimal|xss_clean', 'tOOL TIP', ''), |
|
45 | 45 | array('Included Seconds', 'INPUT', array('name' => 'includedseconds', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''), |
46 | 46 | array('Per Minute Cost', 'INPUT', array('name' => 'cost', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|currency_decimal|xss_clean', 'tOOL TIP', ''), |
47 | 47 | /** |
48 | 48 | ASTPP 3.0 |
49 | 49 | For Add Initial Increment field |
50 | 50 | **/ |
51 | - array('Initial Increment', 'INPUT', array('name' => 'init_inc', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''), |
|
51 | + array('Initial Increment', 'INPUT', array('name' => 'init_inc', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''), |
|
52 | 52 | /*******************************************************/ |
53 | - array('Increment', 'INPUT', array('name' => 'inc', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''), |
|
53 | + array('Increment', 'INPUT', array('name' => 'inc', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''), |
|
54 | 54 | array('Priority', 'INPUT', array('name' => 'precedence', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', '')); |
55 | 55 | |
56 | 56 | $form['button_cancel'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')'); |
@@ -60,14 +60,14 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | function get_origination_rate_form_fields() { |
63 | - $logintype=$this->CI->session->userdata('userlevel_logintype'); |
|
64 | - $trunk=null; |
|
65 | - if($logintype !=1) |
|
63 | + $logintype = $this->CI->session->userdata('userlevel_logintype'); |
|
64 | + $trunk = null; |
|
65 | + if ($logintype != 1) |
|
66 | 66 | $trunk = array('Force Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0")); |
67 | - $form['forms'] = array(base_url() . 'rates/origination_rate_save/', array('id' => 'origination_rate_form', 'method' => 'POST', 'name' => 'origination_rate_form')); |
|
67 | + $form['forms'] = array(base_url().'rates/origination_rate_save/', array('id' => 'origination_rate_form', 'method' => 'POST', 'name' => 'origination_rate_form')); |
|
68 | 68 | $form['Rate Information'] = array( |
69 | 69 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
70 | - array('Rate Group', 'pricelist_id', 'SELECT', '','', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0",'reseller_id'=>0)), |
|
70 | + array('Rate Group', 'pricelist_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0", 'reseller_id'=>0)), |
|
71 | 71 | array('Code', 'INPUT', array('name' => 'pattern', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''), |
72 | 72 | array('Destination', 'INPUT', array('name' => 'comment', 'size' => '20', 'class' => "text field medium"), 'tOOL TIP', ''), |
73 | 73 | //array('Priority', 'INPUT', array('name' => 'precedence', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''), |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | |
76 | 76 | ); |
77 | 77 | $form['Billing Information'] = array( |
78 | - array('Connect Cost', 'INPUT', array('name' => 'connectcost', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|currency_decimal|xss_clean', 'tOOL TIP', ''), |
|
79 | - array('Included Seconds', 'INPUT', array('name' => 'includedseconds', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''), |
|
80 | - array('Per Minute Cost', 'INPUT', array('name' => 'cost', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|currency_decimal|xss_clean', 'tOOL TIP', ''), |
|
78 | + array('Connect Cost', 'INPUT', array('name' => 'connectcost', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|currency_decimal|xss_clean', 'tOOL TIP', ''), |
|
79 | + array('Included Seconds', 'INPUT', array('name' => 'includedseconds', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''), |
|
80 | + array('Per Minute Cost', 'INPUT', array('name' => 'cost', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|currency_decimal|xss_clean', 'tOOL TIP', ''), |
|
81 | 81 | /** |
82 | 82 | ASTPP 3.0 |
83 | 83 | For Add Initial Increment field |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | /***************************************************************/ |
114 | 114 | array('Increment', 'INPUT', array('name' => 'inc[inc]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'inc[inc-integer]', '', '', '', 'search_int_type', ''), |
115 | 115 | array('Priority', 'INPUT', array('name' => 'prepend[prepend]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'prepend[prepend-string]', '', '', '', 'search_string_type', ''), |
116 | - array('Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0")),array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
116 | + array('Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0")), array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
117 | 117 | array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status', '', ''), |
118 | 118 | /****** |
119 | 119 | ASTPP 3.0 |
@@ -129,14 +129,14 @@ discard block |
||
129 | 129 | ASTPP 3.0 |
130 | 130 | Batch Delete |
131 | 131 | ******/ |
132 | - $form['button_search_delete'] = array('name' => 'action', 'id' => "termination_rate_batch_dlt",'onclick'=>"check_btn();", 'content' => 'Delete Search Record','style'=>'display:none;', 'value' => 'submit', 'type' => 'button', 'class' => 'btn pull-right btn btn-line-danger '); |
|
132 | + $form['button_search_delete'] = array('name' => 'action', 'id' => "termination_rate_batch_dlt", 'onclick'=>"check_btn();", 'content' => 'Delete Search Record', 'style'=>'display:none;', 'value' => 'submit', 'type' => 'button', 'class' => 'btn pull-right btn btn-line-danger '); |
|
133 | 133 | |
134 | 134 | /***********************/ |
135 | 135 | /****** |
136 | 136 | ASTPP 3.0 |
137 | 137 | Batch Delete |
138 | 138 | ******/ |
139 | - $form['button_search'] = array('name' => 'action', 'id' => "termination_rate_search_btn",'onclick'=>'search_btn();', 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right margin-x-10'); |
|
139 | + $form['button_search'] = array('name' => 'action', 'id' => "termination_rate_search_btn", 'onclick'=>'search_btn();', 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right margin-x-10'); |
|
140 | 140 | /***********************/ |
141 | 141 | $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
142 | 142 | |
@@ -147,14 +147,14 @@ discard block |
||
147 | 147 | function termination_rate_batch_update_form() { |
148 | 148 | $form['forms'] = array("rates/termination_rate_batch_update/", array('id' => "termination_rate_batch_update")); |
149 | 149 | $form['Batch Update'] = array( |
150 | - array('Connect Cost', 'INPUT', array('name' => 'connectcost[connectcost]','id'=>'connectcost', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'connectcost[operator]','class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
151 | - array('Included Seconds', 'INPUT', array('name' => 'includedseconds[includedseconds]','id'=>'includedseconds', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'includedseconds[operator]','class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
152 | - array('Per Minute Cost', 'INPUT', array('name' => 'cost[cost]','id'=>'cost', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'cost[operator]','class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
150 | + array('Connect Cost', 'INPUT', array('name' => 'connectcost[connectcost]', 'id'=>'connectcost', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'connectcost[operator]', 'class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
151 | + array('Included Seconds', 'INPUT', array('name' => 'includedseconds[includedseconds]', 'id'=>'includedseconds', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'includedseconds[operator]', 'class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
152 | + array('Per Minute Cost', 'INPUT', array('name' => 'cost[cost]', 'id'=>'cost', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'cost[operator]', 'class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
153 | 153 | |
154 | - array('Increment', 'INPUT', array('name' => 'inc[inc]','id'=>'inc', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', array('name'=>'inc[operator]','class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
155 | - array('Priority', 'INPUT', array('name' => 'precedence[precedence]','id'=>'precedence', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', array('name'=>'precedence[operator]','class'=>'update_drp'), '', '', '', 'update_drp_type', ''), |
|
156 | - array('Prepand', 'INPUT', array('name' => 'prepend[prepend]','id'=>'prepend', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', array('name'=>'prepend[operator]','class'=>'update_drp'), '', '', '', 'update_drp_type', ''), |
|
157 | - array('Trunk', array('name'=> 'trunk_id[trunk_id]','id'=>'trunk_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0"),array('name'=>'trunk_id[operator]','class'=>'update_drp'), 'update_drp_type'), |
|
154 | + array('Increment', 'INPUT', array('name' => 'inc[inc]', 'id'=>'inc', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', array('name'=>'inc[operator]', 'class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
155 | + array('Priority', 'INPUT', array('name' => 'precedence[precedence]', 'id'=>'precedence', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', array('name'=>'precedence[operator]', 'class'=>'update_drp'), '', '', '', 'update_drp_type', ''), |
|
156 | + array('Prepand', 'INPUT', array('name' => 'prepend[prepend]', 'id'=>'prepend', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', array('name'=>'prepend[operator]', 'class'=>'update_drp'), '', '', '', 'update_drp_type', ''), |
|
157 | + array('Trunk', array('name'=> 'trunk_id[trunk_id]', 'id'=>'trunk_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0"), array('name'=>'trunk_id[operator]', 'class'=>'update_drp'), 'update_drp_type'), |
|
158 | 158 | ); |
159 | 159 | |
160 | 160 | $form['button_search'] = array('name' => 'action', 'id' => "batch_update_btn", 'content' => 'Update', 'value' => 'save', 'type' => 'button', 'class' =>'btn btn-line-parrot pull-right'); |
@@ -163,17 +163,17 @@ discard block |
||
163 | 163 | return $form; |
164 | 164 | } |
165 | 165 | function origination_rate_batch_update_form() { |
166 | - $logintype=$this->CI->session->userdata('userlevel_logintype'); |
|
167 | - $trunk=null; |
|
168 | - if($logintype !=1) |
|
169 | - $trunk = array('Force Trunk', array('name'=> 'trunk_id[trunk_id]','id'=>'trunk_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0"),array('name'=>'trunk_id[operator]','class'=>'update_drp'), 'update_drp_type'); |
|
170 | - $form['forms'] = array("rates/origination_rate_batch_update/",array('id' => "origination_rate_batch_update")); |
|
166 | + $logintype = $this->CI->session->userdata('userlevel_logintype'); |
|
167 | + $trunk = null; |
|
168 | + if ($logintype != 1) |
|
169 | + $trunk = array('Force Trunk', array('name'=> 'trunk_id[trunk_id]', 'id'=>'trunk_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0"), array('name'=>'trunk_id[operator]', 'class'=>'update_drp'), 'update_drp_type'); |
|
170 | + $form['forms'] = array("rates/origination_rate_batch_update/", array('id' => "origination_rate_batch_update")); |
|
171 | 171 | $form['Batch Update'] = array( |
172 | - array('Connect Cost', 'INPUT', array('name' => 'connectcost[connectcost]','id'=>'connectcost', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'connectcost[operator]','class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
173 | - array('Included Seconds', 'INPUT', array('name' => 'includedseconds[includedseconds]','id'=>'includedseconds', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1',array('name'=>'includedseconds[operator]','class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
174 | - array('Per Minute Cost', 'INPUT', array('name' => 'cost[cost]', 'id'=>'cost', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1',array('name'=>'cost[operator]','class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
175 | - array('Increment', 'INPUT', array('name' => 'inc[inc]', 'id'=>'inc', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', array('name'=>'inc[operator]','class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
176 | - array('Rate Group', array('name'=> 'pricelist_id[pricelist_id]','id'=>'pricelist_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0","reseller_id" => "0"),array('name'=>'pricelist_id[operator]','class'=>'update_drp'), 'update_drp_type'), |
|
172 | + array('Connect Cost', 'INPUT', array('name' => 'connectcost[connectcost]', 'id'=>'connectcost', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'connectcost[operator]', 'class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
173 | + array('Included Seconds', 'INPUT', array('name' => 'includedseconds[includedseconds]', 'id'=>'includedseconds', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'includedseconds[operator]', 'class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
174 | + array('Per Minute Cost', 'INPUT', array('name' => 'cost[cost]', 'id'=>'cost', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'cost[operator]', 'class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
175 | + array('Increment', 'INPUT', array('name' => 'inc[inc]', 'id'=>'inc', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', array('name'=>'inc[operator]', 'class'=>'update_drp'), '', '', '', 'update_int_type', ''), |
|
176 | + array('Rate Group', array('name'=> 'pricelist_id[pricelist_id]', 'id'=>'pricelist_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0", "reseller_id" => "0"), array('name'=>'pricelist_id[operator]', 'class'=>'update_drp'), 'update_drp_type'), |
|
177 | 177 | $trunk, |
178 | 178 | ); |
179 | 179 | |
@@ -186,21 +186,21 @@ discard block |
||
186 | 186 | function build_rates_list_for_reseller() { |
187 | 187 | |
188 | 188 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
189 | -$currency_id=$account_info['currency_id']; |
|
190 | -$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
189 | +$currency_id = $account_info['currency_id']; |
|
190 | +$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
191 | 191 | |
192 | - $grid_field_arr = json_encode(array(array('Code', "140", "pattern", "pattern", "", "get_only_numeric_val","","true","center"), |
|
192 | + $grid_field_arr = json_encode(array(array('Code', "140", "pattern", "pattern", "", "get_only_numeric_val", "", "true", "center"), |
|
193 | 193 | array('Destination', "240", "comment", "", "", ""), |
194 | - array('Connection Cost('.$currency.')', "210", "connectcost", "connectcost", "connectcost", "convert_to_currency","","true","right"), |
|
195 | - array('Included Seconds', "180", "includedseconds", "", "", "","","true","center"), |
|
196 | - array('Per Minute Cost('.$currency.')', "180", "cost", "cost", "cost", "convert_to_currency","","true","right"), |
|
197 | - array('Increment', "140", "inc", "", "", "","","true","center"), |
|
198 | - array('Priority', "155", "precedence", "", "", "","","true","center"), |
|
194 | + array('Connection Cost('.$currency.')', "210", "connectcost", "connectcost", "connectcost", "convert_to_currency", "", "true", "right"), |
|
195 | + array('Included Seconds', "180", "includedseconds", "", "", "", "", "true", "center"), |
|
196 | + array('Per Minute Cost('.$currency.')', "180", "cost", "cost", "cost", "convert_to_currency", "", "true", "right"), |
|
197 | + array('Increment', "140", "inc", "", "", "", "", "true", "center"), |
|
198 | + array('Priority', "155", "precedence", "", "", "", "", "true", "center"), |
|
199 | 199 | )); |
200 | 200 | return $grid_field_arr; |
201 | 201 | } |
202 | 202 | function get_reseller_origination_rate_search_form() { |
203 | - $accountinfo=$this->CI->session->userdata('accountinfo'); |
|
203 | + $accountinfo = $this->CI->session->userdata('accountinfo'); |
|
204 | 204 | |
205 | 205 | $form['forms'] = array("", array('id' => "resellerrates_list_search")); |
206 | 206 | $form['Search My Rates'] = array( |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | array('Initial Increment', 'INPUT', array('name' => 'init_inc[init_inc]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'init_inc[init_inc-integer]', '', '', '', 'search_int_type', ''), |
237 | 237 | /**************************************************************/ |
238 | 238 | array('Increment', 'INPUT', array('name' => 'inc[inc]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'inc[inc-integer]', '', '', '', 'search_int_type', ''), |
239 | - array('Rate Group', 'pricelist_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0","reseller_id"=>"0")), |
|
239 | + array('Rate Group', 'pricelist_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0", "reseller_id"=>"0")), |
|
240 | 240 | array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status', '', ''), |
241 | 241 | array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
242 | 242 | array('', 'HIDDEN', 'advance_search', '1', '', '', ''), |
@@ -245,14 +245,14 @@ discard block |
||
245 | 245 | ASTPP 3.0 |
246 | 246 | Batch Delete |
247 | 247 | ******/ |
248 | - $form['button_search_delete'] = array('name' => 'action', 'id' => "origination_rate_batch_dlt",'onclick'=>"check_btn();", 'content' => 'Delete Search Record','style'=>'display:none;', 'value' => 'save', 'type' => 'button', 'class' => 'btn pull-right btn btn-line-danger '); |
|
248 | + $form['button_search_delete'] = array('name' => 'action', 'id' => "origination_rate_batch_dlt", 'onclick'=>"check_btn();", 'content' => 'Delete Search Record', 'style'=>'display:none;', 'value' => 'save', 'type' => 'button', 'class' => 'btn pull-right btn btn-line-danger '); |
|
249 | 249 | |
250 | 250 | /***********************/ |
251 | 251 | /******** |
252 | 252 | ASTPP 3.0 |
253 | 253 | Batch delete |
254 | 254 | *********/ |
255 | - $form['button_search'] = array('name' => 'action', 'id' => "origination_rate_list_search_btn",'onclick'=>'search_btn();', 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right margin-x-10'); |
|
255 | + $form['button_search'] = array('name' => 'action', 'id' => "origination_rate_list_search_btn", 'onclick'=>'search_btn();', 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right margin-x-10'); |
|
256 | 256 | /**************************/ |
257 | 257 | $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
258 | 258 | |
@@ -268,34 +268,34 @@ discard block |
||
268 | 268 | |
269 | 269 | function build_termination_rate_for_admin() { |
270 | 270 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
271 | -$currency_id=$account_info['currency_id']; |
|
272 | -$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
271 | +$currency_id = $account_info['currency_id']; |
|
272 | +$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
273 | 273 | |
274 | 274 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
275 | - $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"), |
|
275 | + $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"), |
|
276 | 276 | /** |
277 | 277 | ASTPP 3.0 |
278 | 278 | For Termination Rate edit on Code |
279 | 279 | **/ |
280 | - array("Code", "78", "pattern", "pattern", "", "get_only_numeric_val","EDITABLE","true","center"), |
|
280 | + array("Code", "78", "pattern", "pattern", "", "get_only_numeric_val", "EDITABLE", "true", "center"), |
|
281 | 281 | /*********************************/ |
282 | - array("Destination", "80", "comment", "", "", "","","true","center"), |
|
283 | - array("Connect Cost($currency)", "125", "connectcost", "connectcost", "connectcost", "convert_to_currency","","true","right"), |
|
284 | - array("Included<br/> Seconds", "70", "includedseconds", "", "", "","","true","center"), |
|
285 | - array("Per Minute <br/>Cost($currency)", "100", "cost", "cost", "cost", "convert_to_currency","","true","right"), |
|
286 | - array("Initial <br/> Increment", "95", "init_inc", "", "", "","","true","center"), |
|
287 | - array("Increment", "75", "inc", "", "", "","","true","center"), |
|
288 | - array("Priority", "70", "precedence", "", "", "","","true","center"), |
|
289 | - array("Strip","60", "strip", "", "", "","","true","center"), |
|
290 | - array("Prepend", "70", "prepend", "pattern", "", "get_only_numeric_val","","true","center"), |
|
291 | - array("Trunk", "80", "trunk_id", "name", "trunks", "get_field_name","","true","center"), |
|
282 | + array("Destination", "80", "comment", "", "", "", "", "true", "center"), |
|
283 | + array("Connect Cost($currency)", "125", "connectcost", "connectcost", "connectcost", "convert_to_currency", "", "true", "right"), |
|
284 | + array("Included<br/> Seconds", "70", "includedseconds", "", "", "", "", "true", "center"), |
|
285 | + array("Per Minute <br/>Cost($currency)", "100", "cost", "cost", "cost", "convert_to_currency", "", "true", "right"), |
|
286 | + array("Initial <br/> Increment", "95", "init_inc", "", "", "", "", "true", "center"), |
|
287 | + array("Increment", "75", "inc", "", "", "", "", "true", "center"), |
|
288 | + array("Priority", "70", "precedence", "", "", "", "", "true", "center"), |
|
289 | + array("Strip", "60", "strip", "", "", "", "", "true", "center"), |
|
290 | + array("Prepend", "70", "prepend", "pattern", "", "get_only_numeric_val", "", "true", "center"), |
|
291 | + array("Trunk", "80", "trunk_id", "name", "trunks", "get_field_name", "", "true", "center"), |
|
292 | 292 | /* |
293 | 293 | ASTPP 3.0 |
294 | 294 | creation field show in grid |
295 | 295 | */ |
296 | - array("Status", "100", "status", "status", "outbound_routes", "get_status","","true","center"), |
|
296 | + array("Status", "100", "status", "status", "outbound_routes", "get_status", "", "true", "center"), |
|
297 | 297 | // array("Created<br/>Date", "80", "creation_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"), |
298 | - array("Modified Date", "150", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"), |
|
298 | + array("Modified Date", "150", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to", "", "true", "center"), |
|
299 | 299 | /********************************************************************/ |
300 | 300 | /* |
301 | 301 | ASTPP 3.0 |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | |
305 | 305 | /***********************************************************************/ |
306 | 306 | // array("Reseller", "103", "reseller_id", "number", "accounts", "get_field_name"), |
307 | - array("Action", "80", "", "", "", array("EDIT" => array("url" => "rates/termination_rate_edit/", "mode" => "popup","layout"=>"medium"), |
|
307 | + array("Action", "80", "", "", "", array("EDIT" => array("url" => "rates/termination_rate_edit/", "mode" => "popup", "layout"=>"medium"), |
|
308 | 308 | "DELETE" => array("url" => "rates/termination_rate_delete/", "mode" => "single"))) |
309 | 309 | )); |
310 | 310 | return $grid_field_arr; |
@@ -317,36 +317,36 @@ discard block |
||
317 | 317 | */ |
318 | 318 | function build_origination_rate_list_for_admin() { |
319 | 319 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
320 | -$currency_id=$account_info['currency_id']; |
|
321 | -$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
320 | +$currency_id = $account_info['currency_id']; |
|
321 | +$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
322 | 322 | |
323 | 323 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
324 | - $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"), |
|
324 | + $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"), |
|
325 | 325 | /** |
326 | 326 | ASTPP 3.0 |
327 | 327 | For Origination rate edit on code |
328 | 328 | **/ |
329 | - array("Code", "75", "pattern", "pattern", "", "get_only_numeric_val","EDITABLE","true","center"), |
|
329 | + array("Code", "75", "pattern", "pattern", "", "get_only_numeric_val", "EDITABLE", "true", "center"), |
|
330 | 330 | /************************************/ |
331 | - array("Destination", "100", "comment", "", "", "","","true","center"), |
|
332 | - array("Connect Cost($currency)", "130", "connectcost", "connectcost", "connectcost", "convert_to_currency","","true","right"), |
|
333 | - array("Included Seconds", "120", "includedseconds", "", "", "","","true","center"), |
|
334 | - array("Per Minute Cost($currency)", "150", "cost", "cost", "cost", "convert_to_currency","","true","right"), |
|
331 | + array("Destination", "100", "comment", "", "", "", "", "true", "center"), |
|
332 | + array("Connect Cost($currency)", "130", "connectcost", "connectcost", "connectcost", "convert_to_currency", "", "true", "right"), |
|
333 | + array("Included Seconds", "120", "includedseconds", "", "", "", "", "true", "center"), |
|
334 | + array("Per Minute Cost($currency)", "150", "cost", "cost", "cost", "convert_to_currency", "", "true", "right"), |
|
335 | 335 | /** |
336 | 336 | ASTPP 3.0 |
337 | 337 | For Add Initial Increment field |
338 | 338 | **/ |
339 | - array("Initial Increment", "130", "init_inc", "", "", "","","true","center"), |
|
339 | + array("Initial Increment", "130", "init_inc", "", "", "", "", "true", "center"), |
|
340 | 340 | /*******************************************************************/ |
341 | - array("Increment", "90", "inc", "", "", "","","true","center"), |
|
341 | + array("Increment", "90", "inc", "", "", "", "", "true", "center"), |
|
342 | 342 | //array("Priority", "72", "precedence", "", "", "","","true","center"), |
343 | - array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"), |
|
343 | + array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name", "", "true", "center"), |
|
344 | 344 | /* |
345 | 345 | ASTPP 3.0 creation field show in grid |
346 | 346 | */ |
347 | - array("Status", "100", "status", "status", "routes", "get_status","","true","center"), |
|
347 | + array("Status", "100", "status", "status", "routes", "get_status", "", "true", "center"), |
|
348 | 348 | // array("Created<br/>Date", "80", "creation_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"), |
349 | - array("Modified Date", "150", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"), |
|
349 | + array("Modified Date", "150", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to", "", "true", "center"), |
|
350 | 350 | |
351 | 351 | /********************************************************************/ |
352 | 352 | /* |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | chnage in status active or inactive |
355 | 355 | */ |
356 | 356 | |
357 | - array("Action", "95", "", "", "", array("EDIT" => array("url" => "rates/origination_rate_edit/", "mode" => "popup","layout"=>"medium"), |
|
357 | + array("Action", "95", "", "", "", array("EDIT" => array("url" => "rates/origination_rate_edit/", "mode" => "popup", "layout"=>"medium"), |
|
358 | 358 | "DELETE" => array("url" => "/rates/origination_rate_delete/", "mode" => "single"))) |
359 | 359 | )); |
360 | 360 | return $grid_field_arr; |
@@ -362,20 +362,20 @@ discard block |
||
362 | 362 | /****************************************************************************************/ |
363 | 363 | |
364 | 364 | function build_grid_buttons() { |
365 | - $buttons_json = json_encode(array(array("Create","btn btn-line-warning btn","fa fa-plus-circle fa-lg", "button_action", "/rates/termination_rate_add/", "popup","medium"), |
|
366 | - array("Delete", "btn btn-line-danger","fa fa-times-circle fa-lg", "button_action", "/rates/termination_rate_delete_multiple/"), |
|
367 | - array("import","btn btn-line-blue" ,"fa fa-upload fa-lg", "button_action", "/rates/termination_rate_import/", 'single'), |
|
368 | - array("Import with field map","btn btn-line-blue" ,"fa fa-upload fa-lg", "button_action", "/rates/termination_rate_import_mapper/", 'single'), |
|
369 | - array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/rates/termination_rate_export_cdr_xls/", 'single') |
|
365 | + $buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/rates/termination_rate_add/", "popup", "medium"), |
|
366 | + array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/rates/termination_rate_delete_multiple/"), |
|
367 | + array("import", "btn btn-line-blue", "fa fa-upload fa-lg", "button_action", "/rates/termination_rate_import/", 'single'), |
|
368 | + array("Import with field map", "btn btn-line-blue", "fa fa-upload fa-lg", "button_action", "/rates/termination_rate_import_mapper/", 'single'), |
|
369 | + array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/rates/termination_rate_export_cdr_xls/", 'single') |
|
370 | 370 | )); |
371 | 371 | return $buttons_json; |
372 | 372 | } |
373 | 373 | |
374 | 374 | function build_grid_buttons_origination_rate() { |
375 | - $buttons_json = json_encode(array(array("Create","btn btn-line-warning btn","fa fa-plus-circle fa-lg", "button_action", "/rates/origination_rate_add/", "popup","medium"), |
|
376 | - array("Delete", "btn btn-line-danger","fa fa-times-circle fa-lg", "button_action", "/rates/origination_rate_delete_multiple/"), |
|
377 | - array("import", "btn btn-line-blue","fa fa-upload fa-lg", "button_action", "/rates/origination_rate_import/", 'single'), |
|
378 | - array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/rates/origination_rate_export_cdr_xls/", 'single') |
|
375 | + $buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/rates/origination_rate_add/", "popup", "medium"), |
|
376 | + array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/rates/origination_rate_delete_multiple/"), |
|
377 | + array("import", "btn btn-line-blue", "fa fa-upload fa-lg", "button_action", "/rates/origination_rate_import/", 'single'), |
|
378 | + array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/rates/origination_rate_export_cdr_xls/", 'single') |
|
379 | 379 | |
380 | 380 | )); |
381 | 381 | return $buttons_json; |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | function build_termination_rate_list_for_customer() { |
385 | 385 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
386 | 386 | $grid_field_arr = json_encode(array( |
387 | - array("<input type='checkbox' name='chkAll' class='ace checking checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"), |
|
387 | + array("<input type='checkbox' name='chkAll' class='ace checking checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"), |
|
388 | 388 | array("Code", "70", "pattern", "pattern", "", "get_only_numeric_val"), |
389 | 389 | array("Increment", "75", "inc", "", "", ""), |
390 | 390 | array("Connect <br> Charge", "100", "connectcost", "connectcost", "connectcost", "convert_to_currency"), |
@@ -399,16 +399,16 @@ discard block |
||
399 | 399 | function build_block_pattern_list_for_customer() { |
400 | 400 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
401 | 401 | $grid_field_arr = json_encode(array( |
402 | - array("<input type='checkbox' name='chkAll1' class='ace checking'/><label class='lbl'></label>", "30", "", "", "", "","","false","center","PatternChkBox"), |
|
402 | + array("<input type='checkbox' name='chkAll1' class='ace checking'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center", "PatternChkBox"), |
|
403 | 403 | array("Code", "350", "pattern", "pattern", "", "get_only_numeric_val"), |
404 | 404 | array("Destination", "350", "comment", "", "", ""), |
405 | 405 | )); |
406 | 406 | return $grid_field_arr; |
407 | 407 | } |
408 | - function build_pattern_list_for_customer($accountid,$accounttype) { |
|
408 | + function build_pattern_list_for_customer($accountid, $accounttype) { |
|
409 | 409 | |
410 | 410 | $grid_field_arr = json_encode(array( |
411 | - array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"), |
|
411 | + array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"), |
|
412 | 412 | array("Code", "450", "blocked_patterns", "blocked_patterns", "", "get_only_numeric_val"), |
413 | 413 | array("Destination", "450", "destination", "", "", ""), |
414 | 414 | array("Action", "100", "", "", "", array("DELETE" => array("url" => "accounts/".$accounttype."_delete_block_pattern/$accountid/", "mode" => "single"))) |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | } |
418 | 418 | |
419 | 419 | function set_pattern_grid_buttons($accountid) { |
420 | - $buttons_json = json_encode(array(array("Add Prefixes","btn btn-line-warning btn","fa fa-plus-circle fa-lg", "button_action", "/accounts/customer_add_blockpatterns/$accountid", "popup"))); |
|
420 | + $buttons_json = json_encode(array(array("Add Prefixes", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/customer_add_blockpatterns/$accountid", "popup"))); |
|
421 | 421 | return $buttons_json; |
422 | 422 | } |
423 | 423 | |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | |
436 | 436 | |
437 | 437 | function build_grid_buttons_rates() { |
438 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/rates/resellersrates_xls/", 'single'))); |
|
438 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/rates/resellersrates_xls/", 'single'))); |
|
439 | 439 | return $buttons_json; |
440 | 440 | } |
441 | 441 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | <div class="col-md-12"> |
19 | 19 | <div class="w-box"> |
20 | 20 | <span style="margin-left:10px; text-align: center;background-color: none;color:#DD191D;"> |
21 | - <? if(isset($error) && !empty($error)) { |
|
21 | + <? if (isset($error) && ! empty($error)) { |
|
22 | 22 | echo $error; |
23 | 23 | }?> |
24 | 24 | </span> |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | <div class="col-md-12 no-padding"> |
35 | 35 | <label class="col-md-3">Trunk List:</label> |
36 | 36 | <div class=""> |
37 | - <? $trunklist = form_dropdown('trunk_id', $this->db_model->build_dropdown("id,name", "trunks", "where_arr",array("status " => "0")), ''); |
|
37 | + <? $trunklist = form_dropdown('trunk_id', $this->db_model->build_dropdown("id,name", "trunks", "where_arr", array("status " => "0")), ''); |
|
38 | 38 | echo $trunklist; ?></div> |
39 | 39 | </div> |
40 | 40 | <div class="col-md-12 no-padding"> |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | <?}?> |
89 | 89 | |
90 | 90 | <?php |
91 | - if(isset($csv_tmp_data) && !empty($csv_tmp_data)){ ?> |
|
91 | + if (isset($csv_tmp_data) && ! empty($csv_tmp_data)) { ?> |
|
92 | 92 | |
93 | 93 | <section class="slice color-three padding-b-20"> |
94 | 94 | <div class="w-section inverse no-padding"> |
@@ -97,14 +97,14 @@ discard block |
||
97 | 97 | <div class="col-md-12 margin-t-10"> |
98 | 98 | <form id="import_form" name="import_form" action="<?=base_url()?>rates/termination_rate_rates_import/<?= $trunkid?>/<?=$check_header?>/" method="POST"> |
99 | 99 | <table width="100%" border="1" class="details_table table"> |
100 | - <? $cnt =7; |
|
101 | - foreach($csv_tmp_data as $csv_key => $csv_value){ |
|
102 | - if($csv_key < 15){ |
|
100 | + <? $cnt = 7; |
|
101 | + foreach ($csv_tmp_data as $csv_key => $csv_value) { |
|
102 | + if ($csv_key < 15) { |
|
103 | 103 | echo "<tr>"; |
104 | - foreach($csv_value as $field_name => $field_val){ |
|
105 | - if($csv_key == 0){ |
|
104 | + foreach ($csv_value as $field_name => $field_val) { |
|
105 | + if ($csv_key == 0) { |
|
106 | 106 | echo "<th>".ucfirst($field_name)."</th>"; |
107 | - }else{ |
|
107 | + } else { |
|
108 | 108 | echo "<td class='portlet-content'>".$field_val."</td>"; |
109 | 109 | } |
110 | 110 | } |
@@ -104,7 +104,7 @@ |
||
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 | } |
@@ -51,49 +51,49 @@ |
||
51 | 51 | $data['reseller_id'] = $data['key_unique']; |
52 | 52 | unset($data['agreeCheck']); |
53 | 53 | unset($data['key_unique']); |
54 | - $data['creation']=gmdate('Y-m-d H:i:s'); |
|
54 | + $data['creation'] = gmdate('Y-m-d H:i:s'); |
|
55 | 55 | $data['expiry'] = date('Y-m-d H:i:s', strtotime('+10 years')); |
56 | - $this->db->insert("accounts",$data); |
|
56 | + $this->db->insert("accounts", $data); |
|
57 | 57 | return $this->db->insert_id(); |
58 | 58 | } |
59 | 59 | |
60 | - function check_user($accno,$email,$balance) |
|
60 | + function check_user($accno, $email, $balance) |
|
61 | 61 | { |
62 | - $info = array("number"=>$accno,"email"=>$email,"status"=>1); |
|
62 | + $info = array("number"=>$accno, "email"=>$email, "status"=>1); |
|
63 | 63 | $this->db->where($info); |
64 | 64 | $this->db->select('*'); |
65 | - $acc_res=$this->db->get('accounts'); |
|
66 | - if($acc_res->num_rows() > 0) |
|
65 | + $acc_res = $this->db->get('accounts'); |
|
66 | + if ($acc_res->num_rows() > 0) |
|
67 | 67 | { |
68 | - $acc_res=$acc_res->result_array(); |
|
69 | - $acc_res=$acc_res[0]; |
|
70 | - $this->db->where('pricelist_id',$acc_res['pricelist_id']); |
|
68 | + $acc_res = $acc_res->result_array(); |
|
69 | + $acc_res = $acc_res[0]; |
|
70 | + $this->db->where('pricelist_id', $acc_res['pricelist_id']); |
|
71 | 71 | $this->db->select("*"); |
72 | - $charge_res=$this->db->get('charges'); |
|
72 | + $charge_res = $this->db->get('charges'); |
|
73 | 73 | |
74 | - if($charge_res->num_rows() > 0){ |
|
75 | - $charge_res=$charge_res->result_array(); |
|
76 | - $charge_res=$charge_res[0]; |
|
77 | - $charge_acc_arr=array( |
|
74 | + if ($charge_res->num_rows() > 0) { |
|
75 | + $charge_res = $charge_res->result_array(); |
|
76 | + $charge_res = $charge_res[0]; |
|
77 | + $charge_acc_arr = array( |
|
78 | 78 | "charge_id"=>$charge_res['id'], |
79 | 79 | "accountid"=>$acc_res['id'], |
80 | 80 | "status"=>0, |
81 | 81 | "assign_date"=>date('Y-m-d H:i:s') |
82 | 82 | ); |
83 | - }else{ |
|
84 | - $charge_res=$charge_res->result_array(); |
|
83 | + } else { |
|
84 | + $charge_res = $charge_res->result_array(); |
|
85 | 85 | //echo "<pre>"; print_r($charge_res); exit; |
86 | 86 | $charge_acc_arr = array("charge_id"=>'id', |
87 | 87 | "accountid"=>$acc_res['id'], |
88 | 88 | "assign_date"=>date('Y-m-d H:i:s')); |
89 | 89 | } |
90 | - $result=$this->db->insert("charge_to_account",$charge_acc_arr); |
|
91 | - $update = array("status" => 0,"balance" => $balance ); |
|
90 | + $result = $this->db->insert("charge_to_account", $charge_acc_arr); |
|
91 | + $update = array("status" => 0, "balance" => $balance); |
|
92 | 92 | $this->db->where($info); |
93 | 93 | $result = $this->db->update('accounts', $update); |
94 | - $sip_device_update = array('username'=>$accno,"status"=>1); |
|
94 | + $sip_device_update = array('username'=>$accno, "status"=>1); |
|
95 | 95 | return 1; |
96 | - } else{ |
|
96 | + } else { |
|
97 | 97 | return 0; |
98 | 98 | } |
99 | 99 | } |
@@ -80,7 +80,7 @@ |
||
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', |
@@ -39,50 +39,50 @@ discard block |
||
39 | 39 | return $query; |
40 | 40 | } |
41 | 41 | |
42 | - function gettemplate_list($flag="", $start, $limit="") { |
|
42 | + function gettemplate_list($flag = "", $start, $limit = "") { |
|
43 | 43 | |
44 | 44 | |
45 | 45 | if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
46 | 46 | $account_data = $this->session->userdata("accountinfo"); |
47 | 47 | $reseller = $account_data['id']; |
48 | - $this->db->where('reseller_id',$reseller); |
|
49 | - $query = $this->db_model->select("*", "default_templates","","","","",""); |
|
50 | - |
|
51 | - if($query->num_rows() >0){ |
|
52 | - $result =$query->result_array(); |
|
53 | - $match_array =array(); |
|
54 | - $unmatch_array= array(); |
|
55 | - $i=0; |
|
56 | - $str=0; |
|
57 | - foreach($result as $value) |
|
48 | + $this->db->where('reseller_id', $reseller); |
|
49 | + $query = $this->db_model->select("*", "default_templates", "", "", "", "", ""); |
|
50 | + |
|
51 | + if ($query->num_rows() > 0) { |
|
52 | + $result = $query->result_array(); |
|
53 | + $match_array = array(); |
|
54 | + $unmatch_array = array(); |
|
55 | + $i = 0; |
|
56 | + $str = 0; |
|
57 | + foreach ($result as $value) |
|
58 | 58 | { |
59 | - $this->db->where('name',$value['name']); |
|
60 | - $this->db->where('reseller_id',0); |
|
61 | - $query = $this->db_model->select("id", "default_templates","", "id", "ASC", $limit, $start); |
|
62 | - $innerresult =$query->result_array(); |
|
63 | - foreach($innerresult as $value) |
|
59 | + $this->db->where('name', $value['name']); |
|
60 | + $this->db->where('reseller_id', 0); |
|
61 | + $query = $this->db_model->select("id", "default_templates", "", "id", "ASC", $limit, $start); |
|
62 | + $innerresult = $query->result_array(); |
|
63 | + foreach ($innerresult as $value) |
|
64 | 64 | { |
65 | - $str.=$value['id'].","; |
|
65 | + $str .= $value['id'].","; |
|
66 | 66 | } |
67 | 67 | } |
68 | - $str= rtrim($str,','); |
|
68 | + $str = rtrim($str, ','); |
|
69 | 69 | |
70 | 70 | $where = "id NOT IN ($str)"; |
71 | - $this->db->where('reseller_id',$reseller); |
|
72 | - $this->db->or_where('reseller_id',0); |
|
71 | + $this->db->where('reseller_id', $reseller); |
|
72 | + $this->db->or_where('reseller_id', 0); |
|
73 | 73 | $this->db->where($where); |
74 | 74 | } |
75 | 75 | else |
76 | 76 | { |
77 | - $this->db->where('reseller_id',0); |
|
77 | + $this->db->where('reseller_id', 0); |
|
78 | 78 | } |
79 | 79 | |
80 | - if($flag) { |
|
80 | + if ($flag) { |
|
81 | 81 | |
82 | - $query = $this->db_model->select("*", "default_templates","", "id", "ASC", $limit, $start); |
|
83 | - }else { |
|
82 | + $query = $this->db_model->select("*", "default_templates", "", "id", "ASC", $limit, $start); |
|
83 | + } else { |
|
84 | 84 | |
85 | - $query = $this->db_model->countQuery("*", "default_templates",""); |
|
85 | + $query = $this->db_model->countQuery("*", "default_templates", ""); |
|
86 | 86 | |
87 | 87 | } |
88 | 88 | } |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | $this->db->where($where); |
93 | 93 | $this->db_model->build_search('template_search'); |
94 | 94 | if ($flag) { |
95 | - $query = $this->db_model->select("*", "default_templates","", "id", "ASC", $limit, $start); |
|
95 | + $query = $this->db_model->select("*", "default_templates", "", "id", "ASC", $limit, $start); |
|
96 | 96 | } else { |
97 | - $query = $this->db_model->countQuery("*", "default_templates",""); |
|
97 | + $query = $this->db_model->countQuery("*", "default_templates", ""); |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
@@ -106,13 +106,13 @@ discard block |
||
106 | 106 | |
107 | 107 | $this->db->where("name", $name); |
108 | 108 | $this->db->update("system", $add_array); |
109 | - if($name == 'base_currency'){ |
|
109 | + if ($name == 'base_currency') { |
|
110 | 110 | |
111 | - $screen_path = getcwd() . "/cron"; |
|
112 | - $screen_filename = "CurrencyUpdate" . strtotime('now'); |
|
113 | - $command = "cd " . $screen_path . " && /usr/bin/screen -d -m -S $screen_filename php cron.php CurrencyUpdate"; |
|
111 | + $screen_path = getcwd()."/cron"; |
|
112 | + $screen_filename = "CurrencyUpdate".strtotime('now'); |
|
113 | + $command = "cd ".$screen_path." && /usr/bin/screen -d -m -S $screen_filename php cron.php CurrencyUpdate"; |
|
114 | 114 | exec($command); |
115 | - $this->db->update("currency",array("currencyrate"=>'1'),array("currency"=>"INR")); |
|
115 | + $this->db->update("currency", array("currencyrate"=>'1'), array("currency"=>"INR")); |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | function getcurrency_list($flag, $start = 0, $limit = 0) { |
180 | 180 | $this->db_model->build_search('currency_list_search'); |
181 | 181 | |
182 | - $where=array('currency <>' =>Common_model::$global_config['system_config']['base_currency']); |
|
182 | + $where = array('currency <>' =>Common_model::$global_config['system_config']['base_currency']); |
|
183 | 183 | if ($flag) { |
184 | 184 | $query = $this->db_model->select("*", "currency", $where, "id", "ASC", $limit, $start); |
185 | 185 | } else { |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $this->db->delete("currency"); |
206 | 206 | return true; |
207 | 207 | } |
208 | - function backup_insert($add_array='') |
|
208 | + function backup_insert($add_array = '') |
|
209 | 209 | { |
210 | 210 | unset($add_array["action"]); |
211 | 211 | $this->db->insert("backup_database", $add_array); |
@@ -222,13 +222,13 @@ discard block |
||
222 | 222 | } |
223 | 223 | function get_backup_data($id) |
224 | 224 | { |
225 | - $where=array('id'=>$id); |
|
225 | + $where = array('id'=>$id); |
|
226 | 226 | $query = $this->db_model->getSelect("*", "backup_database", $where); |
227 | 227 | return $query; |
228 | 228 | } |
229 | - function import_database($filename,$target_path) |
|
229 | + function import_database($filename, $target_path) |
|
230 | 230 | { |
231 | - $this->db->insert("backup_database", array('backup_name'=>$filename , 'path'=>$target_path)); |
|
231 | + $this->db->insert("backup_database", array('backup_name'=>$filename, 'path'=>$target_path)); |
|
232 | 232 | return true; |
233 | 233 | } |
234 | 234 | } |
@@ -71,8 +71,7 @@ discard block |
||
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 |
||
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); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $this->load->dbutil(); |
35 | 35 | |
36 | 36 | if ($this->session->userdata('user_login') == FALSE) |
37 | - redirect(base_url() . '/astpp/login'); |
|
37 | + redirect(base_url().'/astpp/login'); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | function configuration_edit($edit_id = '') { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $this->session->set_userdata('configuration_search', $action); |
59 | 59 | } |
60 | 60 | if (@$ajax_search != 1) { |
61 | - redirect(base_url() . 'systems/configuration/'); |
|
61 | + redirect(base_url().'systems/configuration/'); |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 | |
@@ -84,29 +84,29 @@ discard block |
||
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
87 | - function configuration($group_title='') { |
|
88 | - if($group_title==""){ |
|
89 | - redirect(base_url() . '/dashboard'); |
|
87 | + function configuration($group_title = '') { |
|
88 | + if ($group_title == "") { |
|
89 | + redirect(base_url().'/dashboard'); |
|
90 | 90 | } |
91 | - if($group_title=="email"){ |
|
91 | + if ($group_title == "email") { |
|
92 | 92 | $data['test_email_flag'] = true; |
93 | 93 | } |
94 | 94 | $data['username'] = $this->session->userdata('user_name'); |
95 | 95 | $data['page_title'] = ucfirst($group_title); |
96 | - $data['group_title']=$group_title; |
|
97 | - $where=array("group_title"=>$group_title); |
|
96 | + $data['group_title'] = $group_title; |
|
97 | + $where = array("group_title"=>$group_title); |
|
98 | 98 | $details = $this->db_model->getSelect("*", "system", $where); |
99 | - $data['details']=$details->result_array(); |
|
99 | + $data['details'] = $details->result_array(); |
|
100 | 100 | $add_array = $this->input->post(); |
101 | - if (!empty($add_array)) { |
|
101 | + if ( ! empty($add_array)) { |
|
102 | 102 | |
103 | - foreach($add_array as $key=>$val){ |
|
104 | - $update_array=array('value'=>$val); |
|
103 | + foreach ($add_array as $key=>$val) { |
|
104 | + $update_array = array('value'=>$val); |
|
105 | 105 | $this->system_model->edit_configuration($update_array, $key); |
106 | 106 | } |
107 | 107 | $this->session->set_flashdata('astpp_errormsg', ucfirst($group_title).' Settings updated sucessfully!'); |
108 | - redirect(base_url() . 'systems/configuration/'.$group_title); |
|
109 | - }else{ |
|
108 | + redirect(base_url().'systems/configuration/'.$group_title); |
|
109 | + } else { |
|
110 | 110 | $this->load->view('view_systemconf', $data); |
111 | 111 | } |
112 | 112 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
167 | 167 | $account_data = $this->session->userdata("accountinfo"); |
168 | 168 | $reseller = $account_data['id']; |
169 | - $this->resellertemplate_save($add_array,$reseller); |
|
169 | + $this->resellertemplate_save($add_array, $reseller); |
|
170 | 170 | } |
171 | 171 | else |
172 | 172 | { |
@@ -174,12 +174,12 @@ discard block |
||
174 | 174 | } |
175 | 175 | } |
176 | 176 | |
177 | - function resellertemplate_save($data,$resellerid) |
|
177 | + function resellertemplate_save($data, $resellerid) |
|
178 | 178 | { |
179 | - $where = array('name' => $data['name'],'reseller_id'=>$resellerid); |
|
179 | + $where = array('name' => $data['name'], 'reseller_id'=>$resellerid); |
|
180 | 180 | $count = $this->db_model->countQuery("*", "default_templates", $where); |
181 | 181 | $data['form'] = $this->form->build_form($this->system_form->get_template_form_fields(), $data); |
182 | - if($count >0) |
|
182 | + if ($count > 0) |
|
183 | 183 | { |
184 | 184 | $data['page_title'] = 'Edit Template'; |
185 | 185 | if ($this->form_validation->run() == FALSE) { |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | |
189 | 189 | $this->system_model->edit_resellertemplate($data, $data['id']); |
190 | 190 | $this->session->set_flashdata('astpp_errormsg', 'Template updated successfully!'); |
191 | - redirect(base_url() . 'systems/template/'); |
|
191 | + redirect(base_url().'systems/template/'); |
|
192 | 192 | exit; |
193 | 193 | } |
194 | 194 | } else { |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $data['reseller_id'] = $resellerid; |
200 | 200 | $this->system_model->add_resellertemplate($data); |
201 | 201 | $this->session->set_flashdata('astpp_errormsg', 'Template added successfully!'); |
202 | - redirect(base_url() . 'systems/template/'); |
|
202 | + redirect(base_url().'systems/template/'); |
|
203 | 203 | exit; |
204 | 204 | } |
205 | 205 | } |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | unset($data['page_title']); |
218 | 218 | $this->system_model->edit_template($data, $data['id']); |
219 | 219 | $this->session->set_flashdata('astpp_errormsg', 'Template updated successfully!'); |
220 | - redirect(base_url() . 'systems/template/'); |
|
220 | + redirect(base_url().'systems/template/'); |
|
221 | 221 | exit; |
222 | 222 | } |
223 | 223 | } else { |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | unset($data['form']); |
229 | 229 | $this->system_model->add_template($data); |
230 | 230 | $this->session->set_flashdata('astpp_errormsg', 'Template added successfully!'); |
231 | - redirect(base_url() . 'systems/template/'); |
|
231 | + redirect(base_url().'systems/template/'); |
|
232 | 232 | exit; |
233 | 233 | } |
234 | 234 | } |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | $this->session->set_userdata('template_search', $action); |
246 | 246 | } |
247 | 247 | if (@$ajax_search != 1) { |
248 | - redirect(base_url() . 'systems/template/'); |
|
248 | + redirect(base_url().'systems/template/'); |
|
249 | 249 | } |
250 | 250 | } |
251 | 251 | |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | $this->session->set_userdata('country_list_search', $action); |
294 | 294 | } |
295 | 295 | if (@$ajax_search != 1) { |
296 | - redirect(base_url() . 'systems/country_list/'); |
|
296 | + redirect(base_url().'systems/country_list/'); |
|
297 | 297 | } |
298 | 298 | } |
299 | 299 | |
@@ -352,9 +352,9 @@ discard block |
||
352 | 352 | |
353 | 353 | function country_remove($id) { |
354 | 354 | $this->system_model->remove_country($id); |
355 | - $country=$this->common->get_field_name('country','countrycode',$id); |
|
355 | + $country = $this->common->get_field_name('country', 'countrycode', $id); |
|
356 | 356 | $this->session->set_flashdata('astpp_notification', $country.'Country removed successfully!'); |
357 | - redirect(base_url() . 'systems/country_list/'); |
|
357 | + redirect(base_url().'systems/country_list/'); |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | function country_delete_multiple() { |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | $this->session->set_userdata('currency_list_search', $action); |
406 | 406 | } |
407 | 407 | if (@$ajax_search != 1) { |
408 | - redirect(base_url() . 'systems/currency_list/'); |
|
408 | + redirect(base_url().'systems/currency_list/'); |
|
409 | 409 | } |
410 | 410 | } |
411 | 411 | |
@@ -464,10 +464,10 @@ discard block |
||
464 | 464 | } |
465 | 465 | |
466 | 466 | function currency_remove($id) { |
467 | - $currencyname=$this->common->get_field_name('currencyname','currency',$id); |
|
467 | + $currencyname = $this->common->get_field_name('currencyname', 'currency', $id); |
|
468 | 468 | $this->system_model->remove_currency($id); |
469 | - $this->session->set_flashdata('astpp_notification',$currencyname. ' Currency removed successfully!'); |
|
470 | - redirect(base_url() . 'systems/currency_list/'); |
|
469 | + $this->session->set_flashdata('astpp_notification', $currencyname.' Currency removed successfully!'); |
|
470 | + redirect(base_url().'systems/currency_list/'); |
|
471 | 471 | } |
472 | 472 | |
473 | 473 | function currency_delete_multiple() { |
@@ -478,53 +478,53 @@ discard block |
||
478 | 478 | } |
479 | 479 | function database_backup() |
480 | 480 | { |
481 | - $data=array(); |
|
481 | + $data = array(); |
|
482 | 482 | $data['username'] = $this->session->userdata('user_name'); |
483 | 483 | $data['page_title'] = 'Database Backup'; |
484 | - $filename=$this->db->database."_".date("YmdHms").".sql.gz"; |
|
484 | + $filename = $this->db->database."_".date("YmdHms").".sql.gz"; |
|
485 | 485 | $data['form'] = $this->form->build_form($this->system_form->get_backup_database_form_fields($filename), ''); |
486 | 486 | $this->load->view('view_database_backup', $data); |
487 | 487 | } |
488 | 488 | function database_backup_save() |
489 | 489 | { |
490 | 490 | |
491 | - $add_array=$this->input->post(); |
|
491 | + $add_array = $this->input->post(); |
|
492 | 492 | |
493 | - $data['form'] = $this->form->build_form($this->system_form->get_backup_database_form_fields($add_array['path'],$add_array['id']),$add_array); |
|
493 | + $data['form'] = $this->form->build_form($this->system_form->get_backup_database_form_fields($add_array['path'], $add_array['id']), $add_array); |
|
494 | 494 | $data['page_title'] = 'Database Backup'; |
495 | - if($add_array['id'] != ''){ |
|
495 | + if ($add_array['id'] != '') { |
|
496 | 496 | |
497 | - }else{ |
|
498 | - if($this->form_validation->run() == FALSE) { |
|
497 | + } else { |
|
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; |
506 | 506 | $db_hostname = $this->db->hostname; |
507 | 507 | $filename = $add_array['path']; |
508 | - $backup_file=DATABASE_DIRECTORY.$filename; |
|
509 | - if (substr($backup_file,-3)=='.gz'){ |
|
510 | - $backup_file = substr($backup_file,0,-3); |
|
511 | - $do_gzip=1; |
|
508 | + $backup_file = DATABASE_DIRECTORY.$filename; |
|
509 | + if (substr($backup_file, -3) == '.gz') { |
|
510 | + $backup_file = substr($backup_file, 0, -3); |
|
511 | + $do_gzip = 1; |
|
512 | 512 | } |
513 | 513 | |
514 | - $run_backup="/usr/bin/mysqldump -all --databases ".$db_name." -u'".$db_username."' -p'".$db_password."' > '$backup_file'"; |
|
515 | - $error_zip=0; |
|
516 | - exec($run_backup,$output,$error); |
|
517 | - if ($do_gzip){ |
|
514 | + $run_backup = "/usr/bin/mysqldump -all --databases ".$db_name." -u'".$db_username."' -p'".$db_password."' > '$backup_file'"; |
|
515 | + $error_zip = 0; |
|
516 | + exec($run_backup, $output, $error); |
|
517 | + if ($do_gzip) { |
|
518 | 518 | $gzip = $this->config->item('gzip-path'); |
519 | 519 | $run_gzip = $gzip." ".$backup_file; |
520 | - exec($run_gzip,$output,$error_zip); |
|
520 | + exec($run_gzip, $output, $error_zip); |
|
521 | 521 | } |
522 | 522 | |
523 | - if($error == 0 && $error_zip == 0 ){ |
|
523 | + if ($error == 0 && $error_zip == 0) { |
|
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 | } |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | { |
542 | 542 | $json_data = array(); |
543 | 543 | $count_all = $this->system_model->getbackup_list(false, "", ""); |
544 | - $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'],$_GET['page']); |
|
544 | + $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']); |
|
545 | 545 | $json_data = $paging_data["json_paging"]; |
546 | 546 | |
547 | 547 | $query = $this->system_model->getbackup_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]); |
@@ -551,56 +551,56 @@ discard block |
||
551 | 551 | echo json_encode($json_data); |
552 | 552 | exit; |
553 | 553 | } |
554 | - function database_restore_one($id='') |
|
554 | + function database_restore_one($id = '') |
|
555 | 555 | { |
556 | 556 | $result = $this->system_model->get_backup_data($id); |
557 | - $result_array=$result->result_array(); |
|
558 | - if($result->num_rows() > 0) |
|
557 | + $result_array = $result->result_array(); |
|
558 | + if ($result->num_rows() > 0) |
|
559 | 559 | { |
560 | 560 | $db_name = $this->db->database; |
561 | 561 | $db_username = $this->db->username; |
562 | 562 | $db_password = $this->db->password; |
563 | 563 | $db_hostname = $this->db->hostname; |
564 | - $path=DATABASE_DIRECTORY.$result_array[0]['path']; |
|
565 | - if(file_exists($path)){ |
|
566 | - if (substr($path,-3)=='.gz') { |
|
564 | + $path = DATABASE_DIRECTORY.$result_array[0]['path']; |
|
565 | + if (file_exists($path)) { |
|
566 | + if (substr($path, -3) == '.gz') { |
|
567 | 567 | $GUNZIP_EXE = $this->config->item('gunzip-path'); |
568 | 568 | $run_gzip = $GUNZIP_EXE." < ".$path." | "; |
569 | 569 | } |
570 | - $MYSQL="/usr/bin/mysql"; |
|
570 | + $MYSQL = "/usr/bin/mysql"; |
|
571 | 571 | $run_restore = $run_gzip.$MYSQL." -h".$db_hostname." -u".$db_username." -p".$db_password." ".$db_name; |
572 | 572 | exec($run_restore); |
573 | 573 | $this->session->set_flashdata('astpp_errormsg', 'Database Restore successfully.'); |
574 | - redirect(base_url() . 'systems/database_restore/'); |
|
575 | - }else{ |
|
574 | + redirect(base_url().'systems/database_restore/'); |
|
575 | + } else { |
|
576 | 576 | $this->session->set_flashdata('astpp_notification', 'File not exists!'); |
577 | - redirect(base_url() . 'systems/database_restore/'); |
|
577 | + redirect(base_url().'systems/database_restore/'); |
|
578 | 578 | } |
579 | 579 | } |
580 | - redirect(base_url() . 'systems/database_restore/'); |
|
580 | + redirect(base_url().'systems/database_restore/'); |
|
581 | 581 | } |
582 | 582 | |
583 | - function database_download($id=''){ |
|
583 | + function database_download($id = '') { |
|
584 | 584 | |
585 | 585 | $result = $this->system_model->get_backup_data($id); |
586 | - $result_array=$result->result_array(); |
|
587 | - if($result->num_rows() > 0) |
|
586 | + $result_array = $result->result_array(); |
|
587 | + if ($result->num_rows() > 0) |
|
588 | 588 | { |
589 | - $path=$result_array[0]['path']; |
|
589 | + $path = $result_array[0]['path']; |
|
590 | 590 | $filename = basename($path); |
591 | 591 | $len = filesize($path); |
592 | 592 | |
593 | 593 | header("Content-Encoding: binary"); |
594 | 594 | header("Content-Type: application/octet-stream"); |
595 | - header( "content-length: " . $len ); |
|
596 | - header( "content-disposition: attachment; filename=" . $filename ); |
|
595 | + header("content-length: ".$len); |
|
596 | + header("content-disposition: attachment; filename=".$filename); |
|
597 | 597 | header("Expires: 0"); |
598 | 598 | header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); |
599 | 599 | header("Cache-Control: private"); |
600 | 600 | header("Pragma: public"); |
601 | 601 | ob_clean(); |
602 | - $fp=fopen( $path, "r" ); |
|
603 | - fpassthru( $fp ); |
|
602 | + $fp = fopen($path, "r"); |
|
603 | + fpassthru($fp); |
|
604 | 604 | exit; |
605 | 605 | } |
606 | 606 | } |
@@ -614,17 +614,17 @@ discard block |
||
614 | 614 | function database_import_file() |
615 | 615 | { |
616 | 616 | $filename = $_POST['fname']; |
617 | - $upload_greeting_file= $_FILES['userfile']['name']; |
|
618 | - $db_file = explode(".",$upload_greeting_file); |
|
619 | - if( $db_file[1] == 'csv' || $db_file[1] == 'tar' || $db_file[1] == 'sql'){ |
|
620 | - $target_path = basename( $_FILES['userfile']['name']); |
|
621 | - move_uploaded_file($_FILES["userfile"]["tmp_name"], $target_path ); |
|
617 | + $upload_greeting_file = $_FILES['userfile']['name']; |
|
618 | + $db_file = explode(".", $upload_greeting_file); |
|
619 | + if ($db_file[1] == 'csv' || $db_file[1] == 'tar' || $db_file[1] == 'sql') { |
|
620 | + $target_path = basename($_FILES['userfile']['name']); |
|
621 | + move_uploaded_file($_FILES["userfile"]["tmp_name"], $target_path); |
|
622 | 622 | |
623 | - $query = $this->system_model->import_database($filename,$_FILES['userfile']['name']); |
|
624 | - $this->session->set_flashdata('astpp_errormsg',"The file ". basename( $_FILES['userfile']['name'])." has been uploaded"); |
|
623 | + $query = $this->system_model->import_database($filename, $_FILES['userfile']['name']); |
|
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{ |
|
627 | - $this->session->set_flashdata('astpp_notification',"There is a some issue or invalid file format."); |
|
626 | + } else { |
|
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 | } |
630 | 630 | } |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | $this->db->where($where); |
635 | 635 | $this->db->delete("backup_database"); |
636 | 636 | $this->session->set_flashdata('astpp_errormsg', 'Database backup deleted successfully.'); |
637 | - redirect(base_url() . 'systems/database_restore/'); |
|
637 | + redirect(base_url().'systems/database_restore/'); |
|
638 | 638 | return true; |
639 | 639 | } |
640 | 640 | function database_backup_delete_multiple() { |
@@ -33,8 +33,9 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -21,8 +21,9 @@ |
||
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 |
@@ -86,17 +86,17 @@ discard block |
||
86 | 86 | return $form; |
87 | 87 | } |
88 | 88 | |
89 | - function build_system_list_for_admin() { |
|
90 | - $grid_field_arr = json_encode(array( |
|
91 | - array("Name", "190", "name", "", "", ""), |
|
92 | - array("Value", "190", "value", "", "", ""), |
|
93 | - array("Description", "320", "comment", "", "", ""), |
|
94 | - array("Group", "120", "group_title", "", "", ""), |
|
95 | - array(gettext("Action"), "442", "", "", "",array("EDIT" => array("url" => "systems/configuration_edit/", "mode" => "popup"), |
|
96 | - )) |
|
97 | - )); |
|
98 | - return $grid_field_arr; |
|
99 | - } |
|
89 | + function build_system_list_for_admin() { |
|
90 | + $grid_field_arr = json_encode(array( |
|
91 | + array("Name", "190", "name", "", "", ""), |
|
92 | + array("Value", "190", "value", "", "", ""), |
|
93 | + array("Description", "320", "comment", "", "", ""), |
|
94 | + array("Group", "120", "group_title", "", "", ""), |
|
95 | + array(gettext("Action"), "442", "", "", "",array("EDIT" => array("url" => "systems/configuration_edit/", "mode" => "popup"), |
|
96 | + )) |
|
97 | + )); |
|
98 | + return $grid_field_arr; |
|
99 | + } |
|
100 | 100 | |
101 | 101 | function build_grid_buttons() { |
102 | 102 | $buttons_json = json_encode(array( |
@@ -104,28 +104,28 @@ discard block |
||
104 | 104 | return $buttons_json; |
105 | 105 | } |
106 | 106 | |
107 | - function build_template_list_for_admin() { |
|
108 | - $grid_field_arr = json_encode(array(array("Name", "425", "name", "", "", "","","true","center"), |
|
109 | - array("Subject", "650", "subject", "", "", "","","true","center"), |
|
110 | - array(gettext("Action"), "200", "", "", "",array("EDIT" => array("url" => "systems/template_edit/", "mode" => "single"), |
|
111 | - )) |
|
112 | - )); |
|
113 | - return $grid_field_arr; |
|
114 | - } |
|
107 | + function build_template_list_for_admin() { |
|
108 | + $grid_field_arr = json_encode(array(array("Name", "425", "name", "", "", "","","true","center"), |
|
109 | + array("Subject", "650", "subject", "", "", "","","true","center"), |
|
110 | + array(gettext("Action"), "200", "", "", "",array("EDIT" => array("url" => "systems/template_edit/", "mode" => "single"), |
|
111 | + )) |
|
112 | + )); |
|
113 | + return $grid_field_arr; |
|
114 | + } |
|
115 | 115 | |
116 | - function build_country_list_for_admin() { |
|
117 | - $action = 'systems/country_list_edit/'; |
|
118 | - $action_remove = 'systems/country_remove/'; |
|
119 | - $mode="popup"; |
|
120 | - $grid_field_arr = json_encode(array( |
|
121 | - array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "50", "", "", "", "","","false","center"), |
|
122 | - array("Name", "705", "country", "", "", "","","true","center"), |
|
123 | - array(gettext("Action"), "100", "", "", "", array("EDIT" => array("url" => "$action", "mode" => "$mode"), |
|
124 | - "DELETE" => array("url" => "$action_remove", "mode" => "single") |
|
125 | - )) |
|
126 | - )); |
|
127 | - return $grid_field_arr; |
|
128 | - } |
|
116 | + function build_country_list_for_admin() { |
|
117 | + $action = 'systems/country_list_edit/'; |
|
118 | + $action_remove = 'systems/country_remove/'; |
|
119 | + $mode="popup"; |
|
120 | + $grid_field_arr = json_encode(array( |
|
121 | + array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "50", "", "", "", "","","false","center"), |
|
122 | + array("Name", "705", "country", "", "", "","","true","center"), |
|
123 | + array(gettext("Action"), "100", "", "", "", array("EDIT" => array("url" => "$action", "mode" => "$mode"), |
|
124 | + "DELETE" => array("url" => "$action_remove", "mode" => "single") |
|
125 | + )) |
|
126 | + )); |
|
127 | + return $grid_field_arr; |
|
128 | + } |
|
129 | 129 | |
130 | 130 | |
131 | 131 | function build_admin_grid_buttons() { |
@@ -170,17 +170,17 @@ discard block |
||
170 | 170 | $action_remove = 'systems/currency_remove/'; |
171 | 171 | $mode="popup"; |
172 | 172 | |
173 | - $grid_field_arr = json_encode(array( |
|
174 | - array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "70", "", "", "", "","","false","center"), |
|
175 | - array("Name", "320", "currencyname", "", "", "","","true","center"), |
|
176 | - array("Code", "290", "currency", "", "", "","","true","center"), |
|
177 | - array(" Rate", "330", "currencyrate", "", "", "","","true","right"), |
|
178 | - array(gettext("Action"), "265", "", "", "", array("EDIT" => array("url" => "$action", "mode" => "$mode"), |
|
179 | - "DELETE" => array("url" => "$action_remove", "mode" => "single") |
|
180 | - )) |
|
181 | - )); |
|
182 | - return $grid_field_arr; |
|
183 | - } |
|
173 | + $grid_field_arr = json_encode(array( |
|
174 | + array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "70", "", "", "", "","","false","center"), |
|
175 | + array("Name", "320", "currencyname", "", "", "","","true","center"), |
|
176 | + array("Code", "290", "currency", "", "", "","","true","center"), |
|
177 | + array(" Rate", "330", "currencyrate", "", "", "","","true","right"), |
|
178 | + array(gettext("Action"), "265", "", "", "", array("EDIT" => array("url" => "$action", "mode" => "$mode"), |
|
179 | + "DELETE" => array("url" => "$action_remove", "mode" => "single") |
|
180 | + )) |
|
181 | + )); |
|
182 | + return $grid_field_arr; |
|
183 | + } |
|
184 | 184 | |
185 | 185 | function get_search_currency_form() { |
186 | 186 |
@@ -21,19 +21,19 @@ discard block |
||
21 | 21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 | 22 | ############################################################################### |
23 | 23 | |
24 | -if (!defined('BASEPATH')) |
|
24 | +if ( ! defined('BASEPATH')) |
|
25 | 25 | exit('No direct script access allowed'); |
26 | 26 | |
27 | 27 | class System_form { |
28 | 28 | |
29 | 29 | function get_template_form_fields() { |
30 | 30 | |
31 | - $form['forms'] = array(base_url() . 'systems/template_save/', array("template_form", "name" => "template_form")); |
|
31 | + $form['forms'] = array(base_url().'systems/template_save/', array("template_form", "name" => "template_form")); |
|
32 | 32 | $form['Email Template'] = array( |
33 | 33 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
34 | - array(' Name', 'INPUT', array('name' => 'name', 'size' => '20', 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
35 | - array('Subject', 'INPUT', array('name' => 'subject', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
36 | - array('Body', 'TEXTAREA', array('name' => 'template', 'id' => 'template', 'size' => '20', 'class' => "textarea medium"), 'trim|required', 'tOOL TIP', ''), |
|
34 | + array(' Name', 'INPUT', array('name' => 'name', 'size' => '20', 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
35 | + array('Subject', 'INPUT', array('name' => 'subject', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
36 | + array('Body', 'TEXTAREA', array('name' => 'template', 'id' => 'template', 'size' => '20', 'class' => "textarea medium"), 'trim|required', 'tOOL TIP', ''), |
|
37 | 37 | ); |
38 | 38 | $form['button_cancel'] = array('name' => 'action', 'content' => 'Cancel', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'systems/template/\')'); |
39 | 39 | $form['button_save'] = array('name' => 'action', 'content' => 'Save', 'value' => 'save', 'type' => 'submit', 'class' => 'btn btn-line-parrot'); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $form['Search'] = array( |
47 | 47 | |
48 | 48 | array(' Name', 'INPUT', array('name' => 'name[name]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'name[name-string]', '', '', '', 'search_string_type', ''), |
49 | - array('Subject', 'INPUT', array('name' => 'subject[subject]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'subject[subject-string]', '', '', '', 'search_string_type', ''),array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
49 | + array('Subject', 'INPUT', array('name' => 'subject[subject]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'subject[subject-string]', '', '', '', 'search_string_type', ''), array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
50 | 50 | array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
51 | 51 | ); |
52 | 52 | $form['button_search'] = array('name' => 'action', 'id' => "template_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
@@ -56,12 +56,12 @@ discard block |
||
56 | 56 | |
57 | 57 | function get_configuration_form_fields() { |
58 | 58 | |
59 | - $form['forms'] = array(base_url() . 'systems/configuration_save/', array("id" => "config_form", "name" => "config_form")); |
|
59 | + $form['forms'] = array(base_url().'systems/configuration_save/', array("id" => "config_form", "name" => "config_form")); |
|
60 | 60 | $form['Edit Settings '] = array( |
61 | 61 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
62 | - array('Name', 'INPUT', array('name' => 'name', 'size' => '20', 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
62 | + array('Name', 'INPUT', array('name' => 'name', 'size' => '20', 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
63 | 63 | array('Value', 'INPUT', array('name' => 'value', 'size' => '20', 'class' => "text field medium"), 'trim|required', 'tOOL TIP', ''), |
64 | - array('Comment', 'INPUT', array('name' => 'comment', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
64 | + array('Comment', 'INPUT', array('name' => 'comment', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
65 | 65 | ); |
66 | 66 | |
67 | 67 | $form['button_cancel'] = array('name' => 'action', 'content' => 'Cancel', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')'); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | array('Name', 'INPUT', array('name' => 'name[name]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'name[name-string]', '', '', '', 'search_string_type', ''), |
78 | 78 | array('Value', 'INPUT', array('name' => 'value[value]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'value[value-string]', '', '', '', 'search_string_type', ''), |
79 | 79 | array('Description', 'INPUT', array('name' => 'comment[comment]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'comment[comment-string]', '', '', '', 'search_string_type', ''), |
80 | - array('Group', 'group_title', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'group_title', 'group_title', 'system', 'build_dropdown','where_arr',"group_title NOT IN ('asterisk','osc','freepbx')", 'group_by', 'group_title'), |
|
80 | + array('Group', 'group_title', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'group_title', 'group_title', 'system', 'build_dropdown', 'where_arr', "group_title NOT IN ('asterisk','osc','freepbx')", 'group_by', 'group_title'), |
|
81 | 81 | array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
82 | 82 | array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
83 | 83 | ); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | array("Value", "190", "value", "", "", ""), |
93 | 93 | array("Description", "320", "comment", "", "", ""), |
94 | 94 | array("Group", "120", "group_title", "", "", ""), |
95 | - array(gettext("Action"), "442", "", "", "",array("EDIT" => array("url" => "systems/configuration_edit/", "mode" => "popup"), |
|
95 | + array(gettext("Action"), "442", "", "", "", array("EDIT" => array("url" => "systems/configuration_edit/", "mode" => "popup"), |
|
96 | 96 | )) |
97 | 97 | )); |
98 | 98 | return $grid_field_arr; |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | } |
106 | 106 | |
107 | 107 | function build_template_list_for_admin() { |
108 | - $grid_field_arr = json_encode(array(array("Name", "425", "name", "", "", "","","true","center"), |
|
109 | - array("Subject", "650", "subject", "", "", "","","true","center"), |
|
110 | - array(gettext("Action"), "200", "", "", "",array("EDIT" => array("url" => "systems/template_edit/", "mode" => "single"), |
|
108 | + $grid_field_arr = json_encode(array(array("Name", "425", "name", "", "", "", "", "true", "center"), |
|
109 | + array("Subject", "650", "subject", "", "", "", "", "true", "center"), |
|
110 | + array(gettext("Action"), "200", "", "", "", array("EDIT" => array("url" => "systems/template_edit/", "mode" => "single"), |
|
111 | 111 | )) |
112 | 112 | )); |
113 | 113 | return $grid_field_arr; |
@@ -116,10 +116,10 @@ discard block |
||
116 | 116 | function build_country_list_for_admin() { |
117 | 117 | $action = 'systems/country_list_edit/'; |
118 | 118 | $action_remove = 'systems/country_remove/'; |
119 | - $mode="popup"; |
|
119 | + $mode = "popup"; |
|
120 | 120 | $grid_field_arr = json_encode(array( |
121 | - array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "50", "", "", "", "","","false","center"), |
|
122 | - array("Name", "705", "country", "", "", "","","true","center"), |
|
121 | + array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "50", "", "", "", "", "", "false", "center"), |
|
122 | + array("Name", "705", "country", "", "", "", "", "true", "center"), |
|
123 | 123 | array(gettext("Action"), "100", "", "", "", array("EDIT" => array("url" => "$action", "mode" => "$mode"), |
124 | 124 | "DELETE" => array("url" => "$action_remove", "mode" => "single") |
125 | 125 | )) |
@@ -129,8 +129,8 @@ discard block |
||
129 | 129 | |
130 | 130 | |
131 | 131 | function build_admin_grid_buttons() { |
132 | - $buttons_json = json_encode(array(array("Create","btn btn-line-warning btn","fa fa-plus-circle fa-lg", "button_action", "systems/country_add/", "popup"), |
|
133 | - array("Delete", "btn btn-line-danger","fa fa-times-circle fa-lg", "button_action", "systems/country_delete_multiple"), |
|
132 | + $buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "systems/country_add/", "popup"), |
|
133 | + array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "systems/country_delete_multiple"), |
|
134 | 134 | )); |
135 | 135 | return $buttons_json; |
136 | 136 | } |
@@ -154,10 +154,10 @@ discard block |
||
154 | 154 | function get_country_form_fields() { |
155 | 155 | |
156 | 156 | |
157 | - $form['forms'] = array(base_url() . 'systems/country_save/', array('id' => 'system_form', 'method' => 'POST', 'name' => 'system_form')); |
|
157 | + $form['forms'] = array(base_url().'systems/country_save/', array('id' => 'system_form', 'method' => 'POST', 'name' => 'system_form')); |
|
158 | 158 | $form['Country List'] = array( |
159 | 159 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
160 | - array('Name', 'INPUT', array('name' => 'country', 'size' => '20', 'class' => "text field medium"), 'trim|required|char|min_length[2]|max_length[20]|xss_clean', 'tOOL TIP', 'Please Enter country'), |
|
160 | + array('Name', 'INPUT', array('name' => 'country', 'size' => '20', 'class' => "text field medium"), 'trim|required|char|min_length[2]|max_length[20]|xss_clean', 'tOOL TIP', 'Please Enter country'), |
|
161 | 161 | |
162 | 162 | ); |
163 | 163 | $form['button_save'] = array('name' => 'action', 'content' => 'Save', 'value' => 'save', 'id' => 'submit', 'type' => 'button', 'class' => 'btn btn-line-parrot'); |
@@ -168,13 +168,13 @@ discard block |
||
168 | 168 | function build_currency_list_for_admin() { |
169 | 169 | $action = 'systems/currency_list_edit/'; |
170 | 170 | $action_remove = 'systems/currency_remove/'; |
171 | - $mode="popup"; |
|
171 | + $mode = "popup"; |
|
172 | 172 | |
173 | 173 | $grid_field_arr = json_encode(array( |
174 | - array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "70", "", "", "", "","","false","center"), |
|
175 | - array("Name", "320", "currencyname", "", "", "","","true","center"), |
|
176 | - array("Code", "290", "currency", "", "", "","","true","center"), |
|
177 | - array(" Rate", "330", "currencyrate", "", "", "","","true","right"), |
|
174 | + array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "70", "", "", "", "", "", "false", "center"), |
|
175 | + array("Name", "320", "currencyname", "", "", "", "", "true", "center"), |
|
176 | + array("Code", "290", "currency", "", "", "", "", "true", "center"), |
|
177 | + array(" Rate", "330", "currencyrate", "", "", "", "", "true", "right"), |
|
178 | 178 | array(gettext("Action"), "265", "", "", "", array("EDIT" => array("url" => "$action", "mode" => "$mode"), |
179 | 179 | "DELETE" => array("url" => "$action_remove", "mode" => "single") |
180 | 180 | )) |
@@ -202,12 +202,12 @@ discard block |
||
202 | 202 | function get_currency_form_fields() { |
203 | 203 | |
204 | 204 | |
205 | - $form['forms'] = array(base_url() . 'systems/currency_save/', array('id' => 'system_form', 'method' => 'POST', 'name' => 'system_form')); |
|
205 | + $form['forms'] = array(base_url().'systems/currency_save/', array('id' => 'system_form', 'method' => 'POST', 'name' => 'system_form')); |
|
206 | 206 | $form['Currency List'] = array( |
207 | 207 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
208 | - array('Name', 'INPUT', array('name' => 'currencyname', 'size' => '20','maxlength' => '40', 'class' => "text field medium"), 'trim|required|char|xss_clean', 'tOOL TIP', 'Please Enter country'), |
|
209 | - array('Code', 'INPUT', array('name' => 'currency', 'size' => '20','maxlength' => '3', 'class' => "text field medium"), 'trim|required|char|xss_clean', 'tOOL TIP', 'Please Enter country'), |
|
210 | - array('Rate', 'INPUT', array('name' => 'currencyrate', 'size' => '20','maxlength' => '7', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter country'), |
|
208 | + array('Name', 'INPUT', array('name' => 'currencyname', 'size' => '20', 'maxlength' => '40', 'class' => "text field medium"), 'trim|required|char|xss_clean', 'tOOL TIP', 'Please Enter country'), |
|
209 | + array('Code', 'INPUT', array('name' => 'currency', 'size' => '20', 'maxlength' => '3', 'class' => "text field medium"), 'trim|required|char|xss_clean', 'tOOL TIP', 'Please Enter country'), |
|
210 | + array('Rate', 'INPUT', array('name' => 'currencyrate', 'size' => '20', 'maxlength' => '7', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter country'), |
|
211 | 211 | |
212 | 212 | ); |
213 | 213 | $form['button_save'] = array('name' => 'action', 'content' => 'Save', 'value' => 'save', 'id' => 'submit', 'type' => 'button', 'class' => 'btn btn-line-parrot'); |
@@ -216,21 +216,21 @@ discard block |
||
216 | 216 | } |
217 | 217 | |
218 | 218 | function build_admin_currency_grid_buttons() { |
219 | - $buttons_json = json_encode(array(array("Create","btn btn-line-warning btn","fa fa-plus-circle fa-lg", "button_action", "systems/currency_add/", "popup"), |
|
220 | - array("Update Currencies","btn btn-line-blue" ,"fa fa-upload fa-lg", "button_action", "currencyupdate/update_currency/", 'single'), |
|
221 | - array("Delete","btn btn-line-danger","fa fa-times-circle fa-lg", "button_action", "systems/currency_delete_multiple"), |
|
219 | + $buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "systems/currency_add/", "popup"), |
|
220 | + array("Update Currencies", "btn btn-line-blue", "fa fa-upload fa-lg", "button_action", "currencyupdate/update_currency/", 'single'), |
|
221 | + array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "systems/currency_delete_multiple"), |
|
222 | 222 | )); |
223 | 223 | return $buttons_json; |
224 | 224 | } |
225 | 225 | |
226 | 226 | |
227 | - function get_backup_database_form_fields($file_name,$id='') { |
|
227 | + function get_backup_database_form_fields($file_name, $id = '') { |
|
228 | 228 | $val = $id > 0 ? "backup_database.path.$id" : 'backup_database.path'; |
229 | - $form['forms'] = array(base_url() . 'systems/database_backup_save/',array('id' => 'backup_form', 'method' => 'POST', 'name' => 'backup_form')); |
|
229 | + $form['forms'] = array(base_url().'systems/database_backup_save/', array('id' => 'backup_form', 'method' => 'POST', 'name' => 'backup_form')); |
|
230 | 230 | $form['Database Information'] = array( |
231 | 231 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
232 | 232 | array('Name', 'INPUT', array('name' => 'backup_name', 'size' => '20', 'class' => "text field medium"), 'required', 'tOOL TIP', ''), |
233 | - array('File Name', 'INPUT', array('name' => 'path', 'size' => '20', 'value'=>$file_name,'class' => "text field medium"), 'trim|required|is_unique[' . $val . ']', 'tOOL TIP', ''), |
|
233 | + array('File Name', 'INPUT', array('name' => 'path', 'size' => '20', 'value'=>$file_name, 'class' => "text field medium"), 'trim|required|is_unique['.$val.']', 'tOOL TIP', ''), |
|
234 | 234 | ); |
235 | 235 | $form['button_cancel'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')'); |
236 | 236 | $form['button_save'] = array('name' => 'action', 'content' => 'Save', 'value' => 'save', 'id' => 'submit', 'type' => 'button', 'class' => 'btn btn-line-parrot'); |
@@ -238,10 +238,10 @@ discard block |
||
238 | 238 | } |
239 | 239 | function build_backupdastabase_list() { |
240 | 240 | $grid_field_arr = json_encode(array( |
241 | - array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "50", "", "", "", "","","false","center"), |
|
242 | - array("Date", "260", "date", "date", "date", "convert_GMT_to","","true","center"), |
|
243 | - array("Name", "295", "backup_name", "", "", "","","true","center"), |
|
244 | - array("File Name", "480", "path", "", "", "","","true","center"), |
|
241 | + array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "50", "", "", "", "", "", "false", "center"), |
|
242 | + array("Date", "260", "date", "date", "date", "convert_GMT_to", "", "true", "center"), |
|
243 | + array("Name", "295", "backup_name", "", "", "", "", "true", "center"), |
|
244 | + array("File Name", "480", "path", "", "", "", "", "true", "center"), |
|
245 | 245 | array(gettext("Action"), "185", "", "", "", |
246 | 246 | array("EDIT_RESTORE" => array("url" => "systems/database_restore_one/", "mode" => ""), |
247 | 247 | "DOWNLOAD_DATABASE" => array("url" => "systems/database_download/", "mode" => ""), |
@@ -250,9 +250,9 @@ discard block |
||
250 | 250 | return $grid_field_arr; |
251 | 251 | } |
252 | 252 | function build_backupdastabase_buttons() { |
253 | - $buttons_json = json_encode(array(array("Create","btn btn-line-warning btn","fa fa-plus-circle fa-lg", "button_action", "systems/database_backup/", "popup"), |
|
254 | - array("import","btn btn-line-blue" ,"fa fa-upload fa-lg", "button_action", "systems/database_import/", "popup"), |
|
255 | - array("Delete","btn btn-line-danger","fa fa-times-circle fa-lg", "button_action", "systems/database_backup_delete_multiple") |
|
253 | + $buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "systems/database_backup/", "popup"), |
|
254 | + array("import", "btn btn-line-blue", "fa fa-upload fa-lg", "button_action", "systems/database_import/", "popup"), |
|
255 | + array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "systems/database_backup_delete_multiple") |
|
256 | 256 | )); |
257 | 257 | return $buttons_json; |
258 | 258 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | /* |
50 | 50 | ASTPP 3.0 Add Rategroup add creation date. |
51 | 51 | */ |
52 | - $add_array['creation_date']=gmdate("Y-m-d H:i:s"); |
|
52 | + $add_array['creation_date'] = gmdate("Y-m-d H:i:s"); |
|
53 | 53 | /************************************/ |
54 | 54 | if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
55 | 55 | $account_data = $this->session->userdata("accountinfo"); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | /* |
68 | 68 | ASTPP 3.0 Edit Rategroup time update last mofied date. |
69 | 69 | */ |
70 | - $data['last_modified_date']=gmdate("Y-m-d H:i:s"); |
|
70 | + $data['last_modified_date'] = gmdate("Y-m-d H:i:s"); |
|
71 | 71 | /*********************************************************/ |
72 | 72 | $this->db->where("id", $id); |
73 | 73 | $this->db->update("pricelists", $data); |