@@ -1,3 +1,5 @@ |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | $lang['FOOTER.FOOTER'] = 'Copyright © 2003 - 2012. ASTPP - Open Source VOIP Billing Solution. All Rights Reserved.'; |
3 | 5 | ?> |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | //Main Menu |
3 | 5 | $lang['Home'] = 'Casa'; |
4 | 6 | $lang['Global Accounts'] = 'cuentas globales'; |
@@ -1,3 +1,5 @@ |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | $lang['FOOTER.FOOTER'] = 'Copyright © 2003 - 2012. ASTPP - Open Source Solución de Facturación VOIP. Todos los Derechos Reservados.'; |
3 | 5 | ?> |
@@ -21,13 +21,13 @@ 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 | /** |
28 | 28 | * Dynamically build forms for display |
29 | 29 | */ |
30 | -class locale_Menu{ |
|
30 | +class locale_Menu { |
|
31 | 31 | |
32 | 32 | function __construct($library_name = '') { |
33 | 33 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $this->CI->load->model('db_model'); |
36 | 36 | $this->CI->load->library('email'); |
37 | 37 | $this->CI->load->library('session'); |
38 | - $current_locale=$this->CI->session->userdata('user_language'); |
|
38 | + $current_locale = $this->CI->session->userdata('user_language'); |
|
39 | 39 | putenv("LC_ALL=$current_locale"); |
40 | 40 | setlocale(LC_ALL, $current_locale); |
41 | 41 | bindtextdomain(WEBSITE_DOMAIN, FCPATH.'/application/modules/dashboard/language'); |
@@ -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')) |
|
24 | +if (!defined('BASEPATH')) { |
|
25 | 25 | exit('No direct script access allowed'); |
26 | +} |
|
26 | 27 | |
27 | 28 | /** |
28 | 29 | * Dynamically build forms for display |
@@ -21,19 +21,19 @@ |
||
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 | /** |
28 | 28 | * Dynamically build forms for display |
29 | 29 | */ |
30 | -class Global_locale{ |
|
30 | +class Global_locale { |
|
31 | 31 | |
32 | 32 | function __construct($library_name = '') { |
33 | 33 | |
34 | 34 | $this->CI = & get_instance(); |
35 | 35 | header("Expires: Tue, 01 Jan 2000 00:00:00 GMT"); |
36 | - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
|
36 | + header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); |
|
37 | 37 | header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); |
38 | 38 | header("Cache-Control: post-check=0, pre-check=0", false); |
39 | 39 | header("Pragma: no-cache"); |
@@ -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')) |
|
24 | +if (!defined('BASEPATH')) { |
|
25 | 25 | exit('No direct script access allowed'); |
26 | +} |
|
26 | 27 | |
27 | 28 | /** |
28 | 29 | * Dynamically build forms for display |
@@ -12,7 +12,7 @@ |
||
12 | 12 | if($result->num_rows() > 0){ |
13 | 13 | $result=$result->result_array(); |
14 | 14 | $footer = $result[0]['website_footer']; |
15 | - }else{ |
|
15 | + } else{ |
|
16 | 16 | $footer = ''; |
17 | 17 | } |
18 | 18 | if($footer != ''){ ?> |
@@ -6,19 +6,19 @@ |
||
6 | 6 | <div class="padding-b-10 col-md-12 no-padding"> |
7 | 7 | |
8 | 8 | <?php |
9 | - $str = isset($_SERVER['HTTPS'])&& $_SERVER['HTTPS'] == 'on' ? 'https://' :'http://'; |
|
9 | + $str = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://'; |
|
10 | 10 | $this->db->select('*'); |
11 | - $this->db->where('domain',$_SERVER['HTTP_HOST']); |
|
12 | - $this->db->or_where('domain','http://'.$_SERVER['HTTP_HOST']); |
|
13 | - $this->db->or_where('domain','https://'.$_SERVER['HTTP_HOST']); |
|
14 | - $result=$this->db->get('invoice_conf'); |
|
15 | - if($result->num_rows() > 0){ |
|
16 | - $result=$result->result_array(); |
|
11 | + $this->db->where('domain', $_SERVER['HTTP_HOST']); |
|
12 | + $this->db->or_where('domain', 'http://'.$_SERVER['HTTP_HOST']); |
|
13 | + $this->db->or_where('domain', 'https://'.$_SERVER['HTTP_HOST']); |
|
14 | + $result = $this->db->get('invoice_conf'); |
|
15 | + if ($result->num_rows() > 0) { |
|
16 | + $result = $result->result_array(); |
|
17 | 17 | $footer = $result[0]['website_footer']; |
18 | - }else{ |
|
18 | + } else { |
|
19 | 19 | $footer = ''; |
20 | 20 | } |
21 | - if($footer != ''){ ?> |
|
21 | + if ($footer != '') { ?> |
|
22 | 22 | <div style="margin-left:470px; "><?=$footer ?> |
23 | 23 | |
24 | 24 | <div style="" class="pull-left"> |
@@ -295,15 +295,15 @@ |
||
295 | 295 | // -------------------------------------------------------------------- |
296 | 296 | |
297 | 297 | /** |
298 | - * Parse major version |
|
299 | - * |
|
300 | - * Grabs the major version number from the |
|
301 | - * database server version string passed in. |
|
302 | - * |
|
303 | - * @access private |
|
304 | - * @param string $version |
|
305 | - * @return string major version number |
|
306 | - */ |
|
298 | + * Parse major version |
|
299 | + * |
|
300 | + * Grabs the major version number from the |
|
301 | + * database server version string passed in. |
|
302 | + * |
|
303 | + * @access private |
|
304 | + * @param string $version |
|
305 | + * @return string major version number |
|
306 | + */ |
|
307 | 307 | function _parse_major_version($version) |
308 | 308 | { |
309 | 309 | preg_match('/([0-9]+)\.([0-9]+)\.([0-9]+)/', $version, $ver_info); |
@@ -67,13 +67,13 @@ |
||
67 | 67 | //error_log(print_r($data,true)); |
68 | 68 | $logger->log(print_r($data,true)); |
69 | 69 | if($data['variables']['calltype']== "CALLINGCARD"){ |
70 | - if(isset($data['variables']['originating_leg_uuid'])) |
|
71 | - { |
|
72 | - process_cdr($data,$db,$logger,$decimal_points); |
|
73 | - } |
|
74 | - }else{ |
|
75 | - process_cdr($data,$db,$logger,$decimal_points); |
|
76 | - } |
|
70 | + if(isset($data['variables']['originating_leg_uuid'])) |
|
71 | + { |
|
72 | + process_cdr($data,$db,$logger,$decimal_points); |
|
73 | + } |
|
74 | + }else{ |
|
75 | + process_cdr($data,$db,$logger,$decimal_points); |
|
76 | + } |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | //$db->cleanup(); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | { |
29 | 29 | case 'development': |
30 | 30 | // error_reporting(E_ALL); |
31 | - error_reporting(E_ERROR|E_WARNING|E_PARSE); |
|
31 | + error_reporting(E_ERROR | E_WARNING | E_PARSE); |
|
32 | 32 | break; |
33 | 33 | |
34 | 34 | case 'testing': |
@@ -55,24 +55,24 @@ discard block |
||
55 | 55 | $config = $lib->get_configurations($db); |
56 | 56 | |
57 | 57 | //Set default decimal points |
58 | -$decimal_points = ($config['decimal_points'] <= 0)?4:$config['decimal_points']; |
|
58 | +$decimal_points = ($config['decimal_points'] <= 0) ? 4 : $config['decimal_points']; |
|
59 | 59 | |
60 | 60 | //Define logger object |
61 | 61 | $logger = new logger($lib); |
62 | 62 | |
63 | -if(isset($_SERVER["CONTENT_TYPE"]) && $_SERVER["CONTENT_TYPE"] == "application/json") { |
|
63 | +if (isset($_SERVER["CONTENT_TYPE"]) && $_SERVER["CONTENT_TYPE"] == "application/json") { |
|
64 | 64 | |
65 | 65 | $db->run("SET NAMES utf8"); |
66 | - $data = json_decode(file_get_contents("php://input"),true); |
|
66 | + $data = json_decode(file_get_contents("php://input"), true); |
|
67 | 67 | //error_log(print_r($data,true)); |
68 | - $logger->log(print_r($data,true)); |
|
69 | - if($data['variables']['calltype']== "CALLINGCARD"){ |
|
70 | - if(isset($data['variables']['originating_leg_uuid'])) |
|
68 | + $logger->log(print_r($data, true)); |
|
69 | + if ($data['variables']['calltype'] == "CALLINGCARD") { |
|
70 | + if (isset($data['variables']['originating_leg_uuid'])) |
|
71 | 71 | { |
72 | - process_cdr($data,$db,$logger,$decimal_points); |
|
72 | + process_cdr($data, $db, $logger, $decimal_points); |
|
73 | 73 | } |
74 | - }else{ |
|
75 | - process_cdr($data,$db,$logger,$decimal_points); |
|
74 | + } else { |
|
75 | + process_cdr($data, $db, $logger, $decimal_points); |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 |
@@ -71,7 +71,7 @@ |
||
71 | 71 | { |
72 | 72 | process_cdr($data,$db,$logger,$decimal_points); |
73 | 73 | } |
74 | - }else{ |
|
74 | + } else{ |
|
75 | 75 | process_cdr($data,$db,$logger,$decimal_points); |
76 | 76 | } |
77 | 77 | } |
@@ -176,35 +176,35 @@ |
||
176 | 176 | <fieldset> |
177 | 177 | <legend> <?=ucfirst($group_title)?></legend> |
178 | 178 | <div style="width:50%;float:left;"> |
179 | - <?php $currency = Common_model::$global_config['system_config']['base_currency'];?> |
|
180 | - <?php $count=ceil(sizeof($details)/2); $i=0; $class="tleft";?> |
|
181 | - <?php foreach($details as$key=>$val){ ?> |
|
182 | - <?php if($count==$i){ |
|
179 | + <?php $currency = Common_model::$global_config['system_config']['base_currency']; ?> |
|
180 | + <?php $count = ceil(sizeof($details) / 2); $i = 0; $class = "tleft"; ?> |
|
181 | + <?php foreach ($details as$key=>$val) { ?> |
|
182 | + <?php if ($count == $i) { |
|
183 | 183 | echo '</div><div style="width:50%;float:left;">'; |
184 | - $class="tright"; |
|
184 | + $class = "tright"; |
|
185 | 185 | } ?> |
186 | 186 | <div class="col-md-12"> |
187 | 187 | <div class="<?=$class?>" href='#'> |
188 | - <label class="col-md-5 no-padding"><?php echo $val['display_name'];?> * </label> |
|
189 | - <?php if(method_exists($this->common,$val['field_type'])){ |
|
190 | - $option_array = $this->common->$val['field_type'](); |
|
188 | + <label class="col-md-5 no-padding"><?php echo $val['display_name']; ?> * </label> |
|
189 | + <?php if (method_exists($this->common, $val['field_type'])) { |
|
190 | + $option_array = $this->common->$val['field_type'](); |
|
191 | 191 | $drpstr = '<select name="'.$val['name'].'" class="col-md-5 form-control selectpicker" data-live-search="true">'; |
192 | - foreach($option_array as $option_key=>$option_val){ |
|
193 | - $selected = ($val['value'] == $option_key)? "selected='selected'":""; |
|
192 | + foreach ($option_array as $option_key=>$option_val) { |
|
193 | + $selected = ($val['value'] == $option_key) ? "selected='selected'" : ""; |
|
194 | 194 | $drpstr .= '<option value="'.$option_key.'"'.$selected.'>'.$option_val.'</option>'; |
195 | 195 | } |
196 | 196 | $drpstr .= '</select>'; |
197 | 197 | echo $drpstr; |
198 | 198 | unset($drpstr); |
199 | - } else{ ?> |
|
200 | - <input name="<?php echo $val['name'] ?>" value='<?php echo isset($val['value'])?$val['value']:''; ?>' size="20" maxlength="100" class="col-md-5 form-control" type="text"> |
|
199 | + } else { ?> |
|
200 | + <input name="<?php echo $val['name'] ?>" value='<?php echo isset($val['value']) ? $val['value'] : ''; ?>' size="20" maxlength="100" class="col-md-5 form-control" type="text"> |
|
201 | 201 | <?php }?> |
202 | - <span class="demo"><?php echo str_replace('smtp',"SMTP",$val['comment']);?></span> |
|
202 | + <span class="demo"><?php echo str_replace('smtp', "SMTP", $val['comment']); ?></span> |
|
203 | 203 | |
204 | 204 | </div> |
205 | 205 | </div> |
206 | 206 | |
207 | - <?php $i++;?> |
|
207 | + <?php $i++; ?> |
|
208 | 208 | <?php }?> |
209 | 209 | </div> |
210 | 210 | </fieldset> |