@@ -1,4 +1,6 @@ discard block |
||
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 | /** |
3 | 5 | * CodeIgniter |
4 | 6 | * |
@@ -45,23 +47,19 @@ discard block |
||
45 | 47 | { |
46 | 48 | $num = round($num / 1099511627776, $precision); |
47 | 49 | $unit = $CI->lang->line('terabyte_abbr'); |
48 | - } |
|
49 | - elseif ($num >= 1000000000) |
|
50 | + } elseif ($num >= 1000000000) |
|
50 | 51 | { |
51 | 52 | $num = round($num / 1073741824, $precision); |
52 | 53 | $unit = $CI->lang->line('gigabyte_abbr'); |
53 | - } |
|
54 | - elseif ($num >= 1000000) |
|
54 | + } elseif ($num >= 1000000) |
|
55 | 55 | { |
56 | 56 | $num = round($num / 1048576, $precision); |
57 | 57 | $unit = $CI->lang->line('megabyte_abbr'); |
58 | - } |
|
59 | - elseif ($num >= 1000) |
|
58 | + } elseif ($num >= 1000) |
|
60 | 59 | { |
61 | 60 | $num = round($num / 1024, $precision); |
62 | 61 | $unit = $CI->lang->line('kilobyte_abbr'); |
63 | - } |
|
64 | - else |
|
62 | + } else |
|
65 | 63 | { |
66 | 64 | $unit = $CI->lang->line('bytes'); |
67 | 65 | return number_format($num).' '.$unit; |
@@ -11,21 +11,24 @@ discard block |
||
11 | 11 | define('CRON_BETA_MODE', $config['CRON_BETA_MODE']); |
12 | 12 | |
13 | 13 | // Set index.php location |
14 | -if (isset($config['CRON_CI_INDEX']) && $config['CRON_CI_INDEX']) |
|
14 | +if (isset($config['CRON_CI_INDEX']) && $config['CRON_CI_INDEX']) { |
|
15 | 15 | define('CRON_CI_INDEX', $config['CRON_CI_INDEX']); |
16 | -else |
|
16 | +} else { |
|
17 | 17 | define('CRON_CI_INDEX', '../index.php'); |
18 | +} |
|
18 | 19 | |
19 | -if (count($argv) <= 2) |
|
20 | +if (count($argv) <= 2) { |
|
20 | 21 | if (count($config['argv'])) { |
21 | 22 | $path = $argv[1]; |
23 | +} |
|
22 | 24 | unset($argv[1]); |
23 | 25 | // $argv = array_merge($argv, $config["argv"][$path]); |
24 | 26 | $argv[0] = $argv[0]; |
25 | 27 | $argv[1] =$config["argv"][$path]; |
26 | 28 | $_SERVER['argv'] = $argv; |
27 | - } else |
|
28 | - die('Use: php cron.php controller/method'); |
|
29 | + } else { |
|
30 | + die('Use: php cron.php controller/method'); |
|
31 | + } |
|
29 | 32 | |
30 | 33 | // Simulate an HTTP request |
31 | 34 | $_SERVER['PATH_INFO'] = $argv[1]; |
@@ -44,10 +47,13 @@ discard block |
||
44 | 47 | require( CRON_CI_INDEX ); // main CI index.php file |
45 | 48 | $output = ob_get_contents(); |
46 | 49 | |
47 | -if (CRON_FLUSH_BUFFERS === TRUE) |
|
48 | - while (@ob_end_flush()); // display buffer contents |
|
49 | - else |
|
50 | - ob_end_clean(); |
|
50 | +if (CRON_FLUSH_BUFFERS === TRUE) { |
|
51 | + while (@ob_end_flush()); |
|
52 | +} |
|
53 | +// display buffer contents |
|
54 | + else { |
|
55 | + ob_end_clean(); |
|
56 | + } |
|
51 | 57 | |
52 | 58 | echo "\n"; |
53 | 59 | ?> |
@@ -41,8 +41,9 @@ discard block |
||
41 | 41 | function __construct() |
42 | 42 | { |
43 | 43 | parent::__construct(); |
44 | - if(!defined( 'CRON' ) ) |
|
45 | - exit(); |
|
44 | + if(!defined( 'CRON' ) ) { |
|
45 | + exit(); |
|
46 | + } |
|
46 | 47 | } |
47 | 48 | |
48 | 49 | |
@@ -76,8 +77,9 @@ discard block |
||
76 | 77 | function generate_sitemap() |
77 | 78 | { |
78 | 79 | // Live Mode: |
79 | - if( ! CRON_BETA_MODE ) |
|
80 | - $cron_id = $this->cron->create('Sitemap (Google|Bing|Ask|Yahoo!)'); |
|
80 | + if( ! CRON_BETA_MODE ) { |
|
81 | + $cron_id = $this->cron->create('Sitemap (Google|Bing|Ask|Yahoo!)'); |
|
82 | + } |
|
81 | 83 | |
82 | 84 | // Example Code |
83 | 85 | |
@@ -89,8 +91,9 @@ discard block |
||
89 | 91 | // ... |
90 | 92 | |
91 | 93 | // Sandbox Mode: |
92 | - if( CRON_BETA_MODE ) |
|
93 | - $this->sitemap->generate_xml(null, false); |
|
94 | + if( CRON_BETA_MODE ) { |
|
95 | + $this->sitemap->generate_xml(null, false); |
|
96 | + } |
|
94 | 97 | |
95 | 98 | // Live Mode: |
96 | 99 | else { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | $data=array("name"=>"Admin","company_name"=>$company_name,"address"=>$address,"city"=>$city,"province"=>$province,"country"=>$country,"zipcode"=>$zipcode,"telephone"=>$telephone,"fax"=>$fax,"emailaddress"=>$emailaddress,"website"=>$website,"serverip"=>$_SERVER['SERVER_NAME'],"FLAG"=>"TRUE"); |
58 | 58 | } |
59 | - }else{ |
|
59 | + } else{ |
|
60 | 60 | $account_info = array(); |
61 | 61 | $this->db->where("type","-1"); |
62 | 62 | $res = $this->db->get('accounts'); |
@@ -96,8 +96,9 @@ discard block |
||
96 | 96 | curl_setopt($ch, CURLOPT_POSTFIELDS, $data); |
97 | 97 | |
98 | 98 | $response = curl_exec($ch); |
99 | - if(!$flag) |
|
100 | - redirect(base_url() . 'feedback/thanks'); |
|
99 | + if(!$flag) { |
|
100 | + redirect(base_url() . 'feedback/thanks'); |
|
101 | + } |
|
101 | 102 | |
102 | 103 | |
103 | 104 | } |
@@ -92,8 +92,9 @@ discard block |
||
92 | 92 | "charge_upto"=>$accharges['charge_upto']); |
93 | 93 | //Add a new arguement ($accharges) which have all information of charges. |
94 | 94 | $lastdate = $this->calculate_charges($accountinfo, $itemArr, $charge_data["charge"], $fromdate, $todate, $charge_data["pro_rate"]); |
95 | - if ($lastdate) |
|
96 | - $this->db->update("charge_to_account", array("charge_upto" => $lastdate), array("charge_id" => $charge_data["id"], "accountid" => $accountinfo["id"])); |
|
95 | + if ($lastdate) { |
|
96 | + $this->db->update("charge_to_account", array("charge_upto" => $lastdate), array("charge_id" => $charge_data["id"], "accountid" => $accountinfo["id"])); |
|
97 | + } |
|
97 | 98 | } |
98 | 99 | } |
99 | 100 | } |
@@ -132,22 +133,25 @@ discard block |
||
132 | 133 | if (($parent_id == $reseller_dids['reseller_id'] && $did_value['accountid'] > 0) || $reseller_dids['parent_id'] == 0) { |
133 | 134 | //Apply charges to resellers customers. |
134 | 135 | $lastdate = $this->calculate_charges($reseller_acc_data, $itemArr, $reseller_dids["monthlycost"], $fromdate, $todate, "1"); |
135 | - if ($lastdate) |
|
136 | - $this->db->update("reseller_pricing", array("charge_upto" => $lastdate), array("note" => $did_value["number"], "reseller_id" => $reseller_acc_data["id"])); |
|
137 | - }else { |
|
136 | + if ($lastdate) { |
|
137 | + $this->db->update("reseller_pricing", array("charge_upto" => $lastdate), array("note" => $did_value["number"], "reseller_id" => $reseller_acc_data["id"])); |
|
138 | + } |
|
139 | + } else { |
|
138 | 140 | //Apply charges to Resellers. |
139 | 141 | $lastdate = $this->calculate_charges($reseller_acc_data, $itemArr, $reseller_dids["monthlycost"], $fromdate, $todate, "1"); |
140 | - if ($lastdate) |
|
141 | - $this->db->update("reseller_pricing", array("charge_upto" => $lastdate), array("note" => $did_value["number"], "reseller_id" => $reseller_acc_data["id"])); |
|
142 | + if ($lastdate) { |
|
143 | + $this->db->update("reseller_pricing", array("charge_upto" => $lastdate), array("note" => $did_value["number"], "reseller_id" => $reseller_acc_data["id"])); |
|
144 | + } |
|
142 | 145 | } |
143 | 146 | $parent_id = $reseller_dids['parent_id']; |
144 | 147 | } |
145 | 148 | } |
146 | 149 | // else{ |
147 | 150 | $lastdate = $this->calculate_charges($AccountDATA, $itemArr, $did_value["monthlycost"], $fromdate, $todate, "1"); |
148 | - if ($lastdate) |
|
149 | - $this->db->update("dids", array("charge_upto" => $lastdate), array("id" => $did_value["id"], "accountid" => $AccountDATA["id"])); |
|
150 | -// } |
|
151 | + if ($lastdate) { |
|
152 | + $this->db->update("dids", array("charge_upto" => $lastdate), array("id" => $did_value["id"], "accountid" => $AccountDATA["id"])); |
|
153 | + } |
|
154 | + // } |
|
151 | 155 | } |
152 | 156 | } |
153 | 157 | } |
@@ -209,9 +213,10 @@ discard block |
||
209 | 213 | $temp_charge = ($chrg_per_day * $days_diff); |
210 | 214 | } |
211 | 215 | |
212 | - if (strtotime($ChargeVal['start_date']) < strtotime($ChargeVal['end_date'])) |
|
213 | - $this->Manage_invoice_item($AccountDATA, $itemArr['description'], $itemArr['item_id'], $temp_charge, $itemArr['type'], $start_date, $lastdate, $todate); |
|
214 | -// echo "<br/> ORG CHARG : " . $charge . " Charges : " . $temp_charge . "<br/>"; |
|
216 | + if (strtotime($ChargeVal['start_date']) < strtotime($ChargeVal['end_date'])) { |
|
217 | + $this->Manage_invoice_item($AccountDATA, $itemArr['description'], $itemArr['item_id'], $temp_charge, $itemArr['type'], $start_date, $lastdate, $todate); |
|
218 | + } |
|
219 | + // echo "<br/> ORG CHARG : " . $charge . " Charges : " . $temp_charge . "<br/>"; |
|
215 | 220 | } |
216 | 221 | } |
217 | 222 | return $lastdate; |
@@ -37,8 +37,7 @@ discard block |
||
37 | 37 | if($opensips_flag == '1'){ |
38 | 38 | $where=array('username'=>$sipnumber); |
39 | 39 | $accountid_arr=$this->db_model->getSelect('accountid','sip_devices',$where); |
40 | - } |
|
41 | - else{ |
|
40 | + } else{ |
|
42 | 41 | $db_config = Common_model::$global_config['system_config']; |
43 | 42 | $opensipdsn = "mysql://" . $db_config['opensips_dbuser'] . ":" . $db_config['opensips_dbpass'] . "@" . $db_config['opensips_dbhost'] . "/" . $db_config['opensips_dbname'] . "?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir="; |
44 | 43 | $this->opensips_db = $this->load->database($opensipdsn, true); |
@@ -63,12 +62,10 @@ discard block |
||
63 | 62 | } |
64 | 63 | if($key== 'id'){ |
65 | 64 | $accountid=$accountid_arr[0]['id']; |
66 | - } |
|
67 | - else{ |
|
65 | + } else{ |
|
68 | 66 | $accountid=$accountid_arr[0]['accountid']; |
69 | 67 | } |
70 | - } |
|
71 | - else{ |
|
68 | + } else{ |
|
72 | 69 | $accountid=$accountid_arr[0]['id']; |
73 | 70 | } |
74 | 71 | $to_currency = common_model::$global_config['system_config']['base_currency']; |
@@ -97,8 +94,7 @@ discard block |
||
97 | 94 | $user_currency_info=$user_currency_info->result_array(); |
98 | 95 | $user_currency=$user_currency_info['0']['currencyrate']; |
99 | 96 | $user_currency_name=$user_currency_info['0']['currency']; |
100 | - } |
|
101 | - else{ |
|
97 | + } else{ |
|
102 | 98 | $user_currency=$base_currency_rate; |
103 | 99 | $user_currency_name=$base_currency_name; |
104 | 100 | } |
@@ -107,12 +103,10 @@ discard block |
||
107 | 103 | $convert_balance=sprintf("%.2f", $convert_balance).' '.$user_currency_name; |
108 | 104 | echo "Balance : ".$convert_balance; |
109 | 105 | } |
110 | - } |
|
111 | - else{ |
|
106 | + } else{ |
|
112 | 107 | echo "0.00 ".$to_currency; |
113 | 108 | } |
114 | - } |
|
115 | - else{ |
|
109 | + } else{ |
|
116 | 110 | echo "Please enter proper username of SIP Account"; |
117 | 111 | } |
118 | 112 | } |
@@ -25,8 +25,9 @@ |
||
25 | 25 | function __construct() |
26 | 26 | { |
27 | 27 | parent::__construct(); |
28 | - if(!defined( 'CRON' ) ) |
|
29 | - exit(); |
|
28 | + if(!defined( 'CRON' ) ) { |
|
29 | + exit(); |
|
30 | + } |
|
30 | 31 | $this->load->model("db_model"); |
31 | 32 | $this->load->library("astpp/common"); |
32 | 33 | } |
@@ -20,7 +20,9 @@ |
||
20 | 20 | # You should have received a copy of the GNU Affero General Public License |
21 | 21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 | 22 | ############################################################################### |
23 | -if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
23 | +if ( ! defined('BASEPATH')) { |
|
24 | + exit('No direct script access allowed'); |
|
25 | +} |
|
24 | 26 | class Timezone { |
25 | 27 | function __construct(){ |
26 | 28 | $this->CI =& get_instance(); |
@@ -1,4 +1,6 @@ discard block |
||
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 | /** |
3 | 5 | * CSVReader Class |
4 | 6 | * |
@@ -94,8 +96,9 @@ discard block |
||
94 | 96 | $field_key_value =$config_variable[$field_name_arr[$j]]; |
95 | 97 | $value= strip_slashes(trim($value)); |
96 | 98 | $value = preg_replace('#<script.*</script>#is', '', $value); |
97 | - if(isset($field_key_value) && !empty($field_key_value)) |
|
98 | - $content[$field_key_value] = strip_tags(filter_var($value, FILTER_SANITIZE_STRING)); |
|
99 | + if(isset($field_key_value) && !empty($field_key_value)) { |
|
100 | + $content[$field_key_value] = strip_tags(filter_var($value, FILTER_SANITIZE_STRING)); |
|
101 | + } |
|
99 | 102 | $j++; |
100 | 103 | } |
101 | 104 | } |