@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | * @return return array of applyable chargelist. |
39 | 39 | */ |
40 | 40 | function list_applyable_charges($accountid = '') { |
41 | - $accountinfo=$this->session->userdata('accountinfo'); |
|
42 | - $reseller_id=$accountinfo['type']==1 ? $accountinfo['id'] : 0; |
|
43 | - $q= " SELECT * FROM `charges` where reseller_id =$reseller_id and id NOT IN(select charge_id from charge_to_account where accountid =$accountid) AND pricelist_id = '0'"; |
|
41 | + $accountinfo = $this->session->userdata('accountinfo'); |
|
42 | + $reseller_id = $accountinfo['type'] == 1 ? $accountinfo['id'] : 0; |
|
43 | + $q = " SELECT * FROM `charges` where reseller_id =$reseller_id and id NOT IN(select charge_id from charge_to_account where accountid =$accountid) AND pricelist_id = '0'"; |
|
44 | 44 | $item_arr = array(); |
45 | 45 | $query = $this->db->query($q); |
46 | 46 | if ($query->num_rows() > 0) { |
@@ -48,13 +48,13 @@ discard block |
||
48 | 48 | if ($row['charge'] > 0) { |
49 | 49 | $row['charge'] = $this->common_model->calculate_currency($row['charge']); |
50 | 50 | } |
51 | - $item_arr[$row['id']] = $row['description'] . ' - ' . $row['charge']; |
|
51 | + $item_arr[$row['id']] = $row['description'].' - '.$row['charge']; |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | return $item_arr; |
55 | 55 | } |
56 | 56 | function quote($inp) { |
57 | - return "'" . $this->db->escape_str($inp) . "'"; |
|
57 | + return "'".$this->db->escape_str($inp)."'"; |
|
58 | 58 | } |
59 | 59 | function db_get_item($q, $colname) { |
60 | 60 | $item_arr = array(); |
@@ -68,27 +68,27 @@ discard block |
||
68 | 68 | // Return the balance for a specific ASTPP account. |
69 | 69 | function accountbalance($account) { |
70 | 70 | $debit = 0; |
71 | - $q = "SELECT SUM(debit) as val1 FROM cdrs WHERE accountid=" . $this->quote($account) . " AND status NOT IN (1, 2)"; |
|
71 | + $q = "SELECT SUM(debit) as val1 FROM cdrs WHERE accountid=".$this->quote($account)." AND status NOT IN (1, 2)"; |
|
72 | 72 | $query = $this->db->query($q); |
73 | 73 | if ($query->num_rows() > 0) { |
74 | 74 | $row = $query->row_array(); |
75 | 75 | $debit = $row['val1']; |
76 | 76 | } |
77 | 77 | $credit = 0; |
78 | - $q = "SELECT SUM(credit) as val1 FROM cdrs WHERE accountid= " . $this->quote($account) . " AND status NOT IN (1, 2)"; |
|
78 | + $q = "SELECT SUM(credit) as val1 FROM cdrs WHERE accountid= ".$this->quote($account)." AND status NOT IN (1, 2)"; |
|
79 | 79 | $query = $this->db->query($q); |
80 | 80 | if ($query->num_rows() > 0) { |
81 | 81 | $row = $query->row_array(); |
82 | 82 | $credit = $row['val1']; |
83 | 83 | } |
84 | 84 | $posted_balance = 0; |
85 | - $q = "SELECT * FROM accounts WHERE id = " . $this->quote($account); |
|
85 | + $q = "SELECT * FROM accounts WHERE id = ".$this->quote($account); |
|
86 | 86 | $query = $this->db->query($q); |
87 | 87 | if ($query->num_rows() > 0) { |
88 | 88 | $row = $query->row_array(); |
89 | 89 | $posted_balance = $row['balance']; |
90 | 90 | } |
91 | - $balance = ( $debit - $credit + $posted_balance ); |
|
91 | + $balance = ($debit - $credit + $posted_balance); |
|
92 | 92 | return $balance; |
93 | 93 | } |
94 | 94 | function accounts_total_balance($reseller) { |
@@ -103,45 +103,45 @@ discard block |
||
103 | 103 | |
104 | 104 | $tmp = "SELECT SUM(balance) as val1 FROM accounts WHERE reseller_id = ''"; |
105 | 105 | } else { |
106 | - $tmp = "SELECT SUM(balance) as val1 FROM accounts WHERE reseller_id = " . $this->quote($reseller); |
|
106 | + $tmp = "SELECT SUM(balance) as val1 FROM accounts WHERE reseller_id = ".$this->quote($reseller); |
|
107 | 107 | } |
108 | 108 | $posted_balance = $this->db_get_item($tmp, "val1"); |
109 | 109 | |
110 | - $balance = ( $debit - $credit + $posted_balance ); |
|
110 | + $balance = ($debit - $credit + $posted_balance); |
|
111 | 111 | return $balance; |
112 | 112 | } |
113 | 113 | function count_dids($test) { |
114 | - $tmp = "SELECT COUNT(*) as val1 FROM dids " . $test; |
|
114 | + $tmp = "SELECT COUNT(*) as val1 FROM dids ".$test; |
|
115 | 115 | return $this->db_get_item($tmp, 'val1'); |
116 | 116 | } |
117 | 117 | |
118 | 118 | function count_callingcards($where, $field = 'COUNT(*)') { |
119 | - $tmp = "SELECT $field as val FROM callingcards " . $where; |
|
119 | + $tmp = "SELECT $field as val FROM callingcards ".$where; |
|
120 | 120 | return $this->db_get_item($tmp, 'val'); |
121 | 121 | } |
122 | 122 | |
123 | 123 | function count_accounts($test) { |
124 | - $tmp = "SELECT COUNT(*) as val1 FROM accounts " . $test; |
|
124 | + $tmp = "SELECT COUNT(*) as val1 FROM accounts ".$test; |
|
125 | 125 | return $this->db_get_item($tmp, 'val1'); |
126 | 126 | } |
127 | 127 | |
128 | - function count_rategroup($test){ |
|
129 | - $tmp = "SELECT COUNT(*) as val1 FROM pricelists " . $test; |
|
128 | + function count_rategroup($test) { |
|
129 | + $tmp = "SELECT COUNT(*) as val1 FROM pricelists ".$test; |
|
130 | 130 | return $this->db_get_item($tmp, 'val1'); |
131 | 131 | } |
132 | 132 | |
133 | - function count_termination($test = ''){ |
|
134 | - $tmp = "SELECT COUNT(*) as val1 FROM outbound_routes " . $test; |
|
133 | + function count_termination($test = '') { |
|
134 | + $tmp = "SELECT COUNT(*) as val1 FROM outbound_routes ".$test; |
|
135 | 135 | return $this->db_get_item($tmp, 'val1'); |
136 | 136 | } |
137 | 137 | |
138 | - function count_trunk($test = ''){ |
|
139 | - $tmp = "SELECT COUNT(*) as val1 FROM trunks " . $test; |
|
138 | + function count_trunk($test = '') { |
|
139 | + $tmp = "SELECT COUNT(*) as val1 FROM trunks ".$test; |
|
140 | 140 | return $this->db_get_item($tmp, 'val1'); |
141 | 141 | } |
142 | 142 | |
143 | - function count_origination($test = ''){ |
|
144 | - $tmp = "SELECT COUNT(*) as val1 FROM routes " . $test; |
|
143 | + function count_origination($test = '') { |
|
144 | + $tmp = "SELECT COUNT(*) as val1 FROM routes ".$test; |
|
145 | 145 | return $this->db_get_item($tmp, 'val1'); |
146 | 146 | } |
147 | 147 |
@@ -35,7 +35,7 @@ |
||
35 | 35 | header('Content-type: text/csv; charset=UTF-8'); |
36 | 36 | header('Content-Encoding: UTF-8'); |
37 | 37 | // header('Content-Type: application/csv'); |
38 | - header('Content-Disposition: attachement; filename="' . $download . '"'); |
|
38 | + header('Content-Disposition: attachement; filename="'.$download.'"'); |
|
39 | 39 | echo "\xEF\xBB\xBF"; // UTF-8 BOM |
40 | 40 | header("Pragma: no-cache"); |
41 | 41 | header("Expires: 0"); |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
2 | 2 | |
3 | 3 | function create_csv_string($data) { |
4 | - if (!$fp = fopen('php://temp', 'w+')) return FALSE; |
|
4 | + if ( ! $fp = fopen('php://temp', 'w+')) return FALSE; |
|
5 | 5 | foreach ($data as $line) fputcsv($fp, $line); |
6 | 6 | rewind($fp); |
7 | 7 | return stream_get_contents($fp); |
8 | 8 | } |
9 | 9 | |
10 | -function send_csv_mail ($csvData, $body, $to, $subject,$file_name) { |
|
10 | +function send_csv_mail($csvData, $body, $to, $subject, $file_name) { |
|
11 | 11 | //print_r($csvData); |
12 | 12 | $where = array('group_title' =>'email'); |
13 | 13 | $query = $this->CI->db_model->getSelect("*", "system", $where); |
14 | 14 | $query = $query->result_array(); |
15 | - foreach($query as $key=>$val){ |
|
16 | - $from=$val['value']; |
|
15 | + foreach ($query as $key=>$val) { |
|
16 | + $from = $val['value']; |
|
17 | 17 | } |
18 | 18 | $multipartSep = '-----'.md5(time()).'-----'; |
19 | 19 | $headers = array( |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | // ------------------------------------------------------------------------ |
4 | 4 | |
@@ -12,29 +12,29 @@ discard block |
||
12 | 12 | * @return string |
13 | 13 | */ |
14 | 14 | |
15 | -if( !function_exists( 'form_countries' ) ) |
|
15 | +if ( ! function_exists('form_countries')) |
|
16 | 16 | { |
17 | - function form_countries( $name, $selected = FALSE, $attributes, $form_name="" ) |
|
17 | + function form_countries($name, $selected = FALSE, $attributes, $form_name = "") |
|
18 | 18 | { |
19 | 19 | $country_list = Common_model::$global_config['country_list']; |
20 | 20 | $form = '<select name="'.$name.'"'; |
21 | 21 | |
22 | - foreach( $attributes as $key => $value ) |
|
22 | + foreach ($attributes as $key => $value) |
|
23 | 23 | { |
24 | 24 | $form .= " ".$key.'="'.$value.'"'; |
25 | 25 | } |
26 | 26 | |
27 | 27 | $form .= ">"; |
28 | 28 | |
29 | - if($form_name!=""){ |
|
29 | + if ($form_name != "") { |
|
30 | 30 | $form .= "\n".'<option value="" selected="selected" >'.$form_name.'</option>'; |
31 | 31 | } |
32 | 32 | |
33 | - foreach( $country_list as $key => $value ) |
|
33 | + foreach ($country_list as $key => $value) |
|
34 | 34 | { |
35 | - $form .= "\n".'<option value="'.ucwords( strtolower( $value ) ).'"'; |
|
35 | + $form .= "\n".'<option value="'.ucwords(strtolower($value)).'"'; |
|
36 | 36 | |
37 | - if(strtolower(trim($value)) == strtolower(trim($selected))) |
|
37 | + if (strtolower(trim($value)) == strtolower(trim($selected))) |
|
38 | 38 | { |
39 | 39 | |
40 | 40 | $form .= ' selected="selected" >'; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $form .= '>'; |
46 | 46 | } |
47 | 47 | |
48 | - $form .= ucwords( strtolower( $value ) ).'</option>'; |
|
48 | + $form .= ucwords(strtolower($value)).'</option>'; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | $form .= "\n</select>"; |
@@ -54,30 +54,30 @@ discard block |
||
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
57 | -if(!function_exists('form_devicetype')) |
|
57 | +if ( ! function_exists('form_devicetype')) |
|
58 | 58 | { |
59 | - function form_devicetype( $name, $selected = FALSE, $attributes ) |
|
59 | + function form_devicetype($name, $selected = FALSE, $attributes) |
|
60 | 60 | { |
61 | - $CI =& get_instance(); |
|
61 | + $CI = & get_instance(); |
|
62 | 62 | |
63 | - $CI->config->load( 'countries' ); |
|
63 | + $CI->config->load('countries'); |
|
64 | 64 | |
65 | - $type_list = $CI->config->item( 'device_types' ); |
|
65 | + $type_list = $CI->config->item('device_types'); |
|
66 | 66 | |
67 | 67 | $form = '<select name="'.$name.'"'; |
68 | 68 | |
69 | - foreach( $attributes as $key => $value ) |
|
69 | + foreach ($attributes as $key => $value) |
|
70 | 70 | { |
71 | 71 | $form .= " ".$key.'="'.$value.'"'; |
72 | 72 | } |
73 | 73 | |
74 | 74 | $form .= ">"; |
75 | 75 | |
76 | - foreach( $type_list as $key => $value ) |
|
76 | + foreach ($type_list as $key => $value) |
|
77 | 77 | { |
78 | 78 | $form .= "\n".'<option value="'.$key.'"'; |
79 | 79 | |
80 | - if( $key == $selected ) |
|
80 | + if ($key == $selected) |
|
81 | 81 | { |
82 | 82 | $form .= ' selected="selected">'; |
83 | 83 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $form .= '>'; |
87 | 87 | } |
88 | 88 | |
89 | - $form .= ucwords( strtolower( $value ) ).'</option>'; |
|
89 | + $form .= ucwords(strtolower($value)).'</option>'; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | $form .= "\n</select>"; |
@@ -96,30 +96,30 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | // ------------------------------------------------------------------------ |
99 | -if( !function_exists( 'form_timezone' ) ) |
|
99 | +if ( ! function_exists('form_timezone')) |
|
100 | 100 | { |
101 | - function form_timezone( $name, $selected = FALSE, $attributes ) |
|
101 | + function form_timezone($name, $selected = FALSE, $attributes) |
|
102 | 102 | { |
103 | - $CI =& get_instance(); |
|
103 | + $CI = & get_instance(); |
|
104 | 104 | |
105 | - $CI->config->load( 'countries' ); |
|
105 | + $CI->config->load('countries'); |
|
106 | 106 | |
107 | - $country_list = $CI->config->item( 'timezone1_list' ); |
|
107 | + $country_list = $CI->config->item('timezone1_list'); |
|
108 | 108 | |
109 | 109 | $form = '<select name="'.$name.'"'; |
110 | 110 | |
111 | - foreach( $attributes as $key => $value ) |
|
111 | + foreach ($attributes as $key => $value) |
|
112 | 112 | { |
113 | 113 | $form .= " ".$key.'="'.$value.'"'; |
114 | 114 | } |
115 | 115 | |
116 | 116 | $form .= ">"; |
117 | 117 | |
118 | - foreach( $country_list as $key => $value ) |
|
118 | + foreach ($country_list as $key => $value) |
|
119 | 119 | { |
120 | - $form .= "\n".'<option value="'.ucwords( strtolower( $value ) ).'"'; |
|
120 | + $form .= "\n".'<option value="'.ucwords(strtolower($value)).'"'; |
|
121 | 121 | |
122 | - if( strtolower($value) == strtolower($selected) ) |
|
122 | + if (strtolower($value) == strtolower($selected)) |
|
123 | 123 | { |
124 | 124 | $form .= ' selected="selected">'; |
125 | 125 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $form .= '>'; |
129 | 129 | } |
130 | 130 | |
131 | - $form .= ucwords( strtolower( $value ) ).'</option>'; |
|
131 | + $form .= ucwords(strtolower($value)).'</option>'; |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | $form .= "\n</select>"; |
@@ -137,26 +137,26 @@ discard block |
||
137 | 137 | } |
138 | 138 | } |
139 | 139 | //========================================= |
140 | -if( !function_exists( 'form_languagelist' ) ) |
|
140 | +if ( ! function_exists('form_languagelist')) |
|
141 | 141 | { |
142 | - function form_languagelist( $name, $selected = FALSE, $attributes ) |
|
142 | + function form_languagelist($name, $selected = FALSE, $attributes) |
|
143 | 143 | { |
144 | 144 | $language_list = Common_model::$global_config['language_list']; |
145 | 145 | |
146 | 146 | $form = '<select name="'.$name.'"'; |
147 | 147 | |
148 | - foreach( $attributes as $key => $value ) |
|
148 | + foreach ($attributes as $key => $value) |
|
149 | 149 | { |
150 | 150 | $form .= " ".$key.'="'.$value.'"'; |
151 | 151 | } |
152 | 152 | |
153 | 153 | $form .= ">"; |
154 | 154 | |
155 | - foreach( $language_list as $key => $value ) |
|
155 | + foreach ($language_list as $key => $value) |
|
156 | 156 | { |
157 | - $form .= "\n".'<option value="'.( strtolower( $key ) ).'"'; |
|
157 | + $form .= "\n".'<option value="'.(strtolower($key)).'"'; |
|
158 | 158 | |
159 | - if( $key == $selected ) |
|
159 | + if ($key == $selected) |
|
160 | 160 | { |
161 | 161 | $form .= ' selected>'; |
162 | 162 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $form .= '>'; |
166 | 166 | } |
167 | 167 | |
168 | - $form .= ucfirst(strtolower($value)).'</option>'; |
|
168 | + $form .= ucfirst(strtolower($value)).'</option>'; |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | $form .= "\n</select>"; |
@@ -175,28 +175,28 @@ discard block |
||
175 | 175 | } |
176 | 176 | |
177 | 177 | //----------------------------------------- |
178 | -if( !function_exists( 'form_select_default' ) ) |
|
178 | +if ( ! function_exists('form_select_default')) |
|
179 | 179 | { |
180 | - function form_select_default( $name,$data, $selected = "", $attributes, $form_name="" ) |
|
180 | + function form_select_default($name, $data, $selected = "", $attributes, $form_name = "") |
|
181 | 181 | { |
182 | 182 | $form = '<select name="'.$name.'"'; |
183 | 183 | |
184 | - foreach( $attributes as $key => $value ) |
|
184 | + foreach ($attributes as $key => $value) |
|
185 | 185 | { |
186 | 186 | $form .= " ".$key.'="'.$value.'"'; |
187 | 187 | } |
188 | 188 | |
189 | 189 | $form .= ">"; |
190 | 190 | |
191 | - if($form_name!=""){ |
|
191 | + if ($form_name != "") { |
|
192 | 192 | $form .= "\n".'<option value="" selected="selected" >'.$form_name.'</option>'; |
193 | 193 | } |
194 | 194 | |
195 | - foreach( $data as $key => $value ) |
|
195 | + foreach ($data as $key => $value) |
|
196 | 196 | { |
197 | 197 | $form .= "\n".'<option value="'.$key.'"'; |
198 | 198 | |
199 | - if( $key == $selected ) |
|
199 | + if ($key == $selected) |
|
200 | 200 | { |
201 | 201 | $form .= ' selected>'; |
202 | 202 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $form .= '>'; |
206 | 206 | } |
207 | 207 | |
208 | - $form .= ucwords( strtolower( $value ) ).'</option>'; |
|
208 | + $form .= ucwords(strtolower($value)).'</option>'; |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | $form .= "\n</select>"; |
@@ -215,30 +215,30 @@ discard block |
||
215 | 215 | } |
216 | 216 | } |
217 | 217 | //----------------------------------------- |
218 | -if(!function_exists('form_disposition')) |
|
218 | +if ( ! function_exists('form_disposition')) |
|
219 | 219 | { |
220 | - function form_disposition( $name, $selected = FALSE, $attributes ) |
|
220 | + function form_disposition($name, $selected = FALSE, $attributes) |
|
221 | 221 | { |
222 | - $CI =& get_instance(); |
|
222 | + $CI = & get_instance(); |
|
223 | 223 | |
224 | - $CI->config->load( 'countries' ); |
|
224 | + $CI->config->load('countries'); |
|
225 | 225 | |
226 | - $type_list = $CI->config->item( 'disposition' ); |
|
226 | + $type_list = $CI->config->item('disposition'); |
|
227 | 227 | |
228 | 228 | $form = '<select name="'.$name.'"'; |
229 | 229 | |
230 | - foreach( $attributes as $key => $value ) |
|
230 | + foreach ($attributes as $key => $value) |
|
231 | 231 | { |
232 | 232 | $form .= " ".$key.'="'.$value.'"'; |
233 | 233 | } |
234 | 234 | |
235 | 235 | $form .= ">"; |
236 | 236 | |
237 | - foreach( $type_list as $key => $value ) |
|
237 | + foreach ($type_list as $key => $value) |
|
238 | 238 | { |
239 | 239 | $form .= "\n".'<option value="'.$key.'"'; |
240 | 240 | |
241 | - if( $key == $selected ) |
|
241 | + if ($key == $selected) |
|
242 | 242 | { |
243 | 243 | $form .= ' selected="selected">'; |
244 | 244 | } |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | $form .= '>'; |
248 | 248 | } |
249 | 249 | |
250 | - $form .= $value .'</option>'; |
|
250 | + $form .= $value.'</option>'; |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | $form .= "\n</select>"; |
@@ -257,27 +257,27 @@ discard block |
||
257 | 257 | } |
258 | 258 | |
259 | 259 | //----------------------------------------- |
260 | -if( !function_exists( 'form_table_row' ) ) |
|
260 | +if ( ! function_exists('form_table_row')) |
|
261 | 261 | { |
262 | - function form_table_row($label,$field,$span){ |
|
262 | + function form_table_row($label, $field, $span) { |
|
263 | 263 | echo '<tr><th width="10%"><label>'.$label.'</label></th><td>'; |
264 | 264 | echo $field; |
265 | 265 | echo '<br/><span class="helptext">'.$span.'</span>'; |
266 | 266 | echo '</td></tr>'; |
267 | 267 | } |
268 | 268 | } |
269 | -if( !function_exists( 'form_table_row1' ) ) |
|
269 | +if ( ! function_exists('form_table_row1')) |
|
270 | 270 | { |
271 | - function form_table_row1($label,$field,$span){ |
|
271 | + function form_table_row1($label, $field, $span) { |
|
272 | 272 | echo '<tr><th width="10%"><label>'.$label.'</label></th><td>'; |
273 | 273 | echo $field; |
274 | 274 | echo '<br/><span class="helptext">'.$span.'</span>'; |
275 | 275 | echo '</td>'; |
276 | 276 | } |
277 | 277 | } |
278 | -if( !function_exists( 'form_table_row2' ) ) |
|
278 | +if ( ! function_exists('form_table_row2')) |
|
279 | 279 | { |
280 | - function form_table_row2($label,$field,$span){ |
|
280 | + function form_table_row2($label, $field, $span) { |
|
281 | 281 | echo '<th width="10%" style="padding-left: 20px"><label>'.$label.'</label></th><td>'; |
282 | 282 | echo $field; |
283 | 283 | echo '<br/><span class="helptext">'.$span.'</span>'; |
@@ -285,37 +285,37 @@ discard block |
||
285 | 285 | } |
286 | 286 | } |
287 | 287 | //------------------------------------- |
288 | -if( !function_exists( 'form_table_row_1' ) ) |
|
288 | +if ( ! function_exists('form_table_row_1')) |
|
289 | 289 | { |
290 | - function form_table_row_1($label,$field,$span,$wh='5',$wd='15'){ |
|
290 | + function form_table_row_1($label, $field, $span, $wh = '5', $wd = '15') { |
|
291 | 291 | echo '<tr><th width="'.$wh.'%"><label>'.$label.'</label></th><td width="'.$wd.'%">'; |
292 | 292 | echo $field; |
293 | 293 | echo '<br/><span class="helptext">'.$span.'</span>'; |
294 | 294 | echo '</td>'; |
295 | 295 | } |
296 | 296 | } |
297 | -if( !function_exists( 'form_table_row_2' ) ) |
|
297 | +if ( ! function_exists('form_table_row_2')) |
|
298 | 298 | { |
299 | - function form_table_row_2($label,$field,$span,$wh='10',$wd='10'){ |
|
299 | + function form_table_row_2($label, $field, $span, $wh = '10', $wd = '10') { |
|
300 | 300 | echo '<th width="'.$wh.'%"><label>'.$label.'</label></th><td width="'.$wd.'%">'; |
301 | 301 | echo $field; |
302 | 302 | echo '<br/><span class="helptext">'.$span.'</span>'; |
303 | 303 | echo '</td>'; |
304 | 304 | } |
305 | 305 | } |
306 | -if( !function_exists( 'form_table_row_3' ) ) |
|
306 | +if ( ! function_exists('form_table_row_3')) |
|
307 | 307 | { |
308 | - function form_table_row_3($label,$field,$span,$wh='10',$wd='15'){ |
|
308 | + function form_table_row_3($label, $field, $span, $wh = '10', $wd = '15') { |
|
309 | 309 | echo '<th width="'.$wh.'%"><label>'.$label.'</label></th><td width="'.$wd.'%">'; |
310 | 310 | echo $field; |
311 | 311 | echo '<br/><span class="helptext">'.$span.'</span>'; |
312 | 312 | echo '</td>'; |
313 | 313 | } |
314 | 314 | } |
315 | -if( !function_exists( 'form_table_row_4' ) ) |
|
315 | +if ( ! function_exists('form_table_row_4')) |
|
316 | 316 | { |
317 | - function form_table_row_4($label,$field,$span,$wh='10',$wd=''){ |
|
318 | - if(wd == '') |
|
317 | + function form_table_row_4($label, $field, $span, $wh = '10', $wd = '') { |
|
318 | + if (wd == '') |
|
319 | 319 | echo '<th width="'.$wh.'%"><label>'.$label.'</label></th><td>'; |
320 | 320 | else |
321 | 321 | echo '<th width="'.$wh.'%"><label>'.$label.'</label></th><td width="'.$wd.'%">'; |
@@ -1,3 +1,3 @@ |
||
1 | -<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); |
|
2 | -$lang['FOOTER.FOOTER']='Copyright © 2003 - 2012. ASTPP - Open Source Solución de Facturación VOIP. Todos los Derechos Reservados.'; |
|
1 | +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
2 | +$lang['FOOTER.FOOTER'] = 'Copyright © 2003 - 2012. ASTPP - Open Source Solución de Facturación VOIP. Todos los Derechos Reservados.'; |
|
3 | 3 | ?> |
@@ -1,97 +1,97 @@ |
||
1 | -<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
2 | 2 | //Main Menu |
3 | -$lang['Home']='Casa'; |
|
4 | -$lang['Global Accounts']='cuentas globales'; |
|
5 | -$lang['Accounting']='contabilidad'; |
|
6 | -$lang['Services']='servicios'; |
|
7 | -$lang['DIDs']='DIDs'; |
|
8 | -$lang['Routing']='Enrutamiento'; |
|
9 | -$lang['Reports']='informes'; |
|
10 | -$lang['System Configuration']='Configuración del sistema'; |
|
3 | +$lang['Home'] = 'Casa'; |
|
4 | +$lang['Global Accounts'] = 'cuentas globales'; |
|
5 | +$lang['Accounting'] = 'contabilidad'; |
|
6 | +$lang['Services'] = 'servicios'; |
|
7 | +$lang['DIDs'] = 'DIDs'; |
|
8 | +$lang['Routing'] = 'Enrutamiento'; |
|
9 | +$lang['Reports'] = 'informes'; |
|
10 | +$lang['System Configuration'] = 'Configuración del sistema'; |
|
11 | 11 | |
12 | 12 | |
13 | 13 | //gloabalAccounts useraccount Menu |
14 | 14 | |
15 | -$lang['User Accounts']='Cuentas de usuario'; |
|
16 | -$lang['Customer List']='Lista de clientes'; |
|
17 | -$lang['Reseller List']='lista distribuidor'; |
|
18 | -$lang['Callshop List']='lista locutorio'; |
|
15 | +$lang['User Accounts'] = 'Cuentas de usuario'; |
|
16 | +$lang['Customer List'] = 'Lista de clientes'; |
|
17 | +$lang['Reseller List'] = 'lista distribuidor'; |
|
18 | +$lang['Callshop List'] = 'lista locutorio'; |
|
19 | 19 | |
20 | 20 | //gloabalAccounts ProviderAccounts Menu |
21 | -$lang['Provider Accounts']='Cuentas de Proveedores'; |
|
22 | -$lang['Provider List']='Lista de Proveedores'; |
|
21 | +$lang['Provider Accounts'] = 'Cuentas de Proveedores'; |
|
22 | +$lang['Provider List'] = 'Lista de Proveedores'; |
|
23 | 23 | //gloabalAccounts System Accounts Menu |
24 | -$lang['System Accounts']='Cuentas del sistema'; |
|
25 | -$lang['Admin List']='Lista de administración'; |
|
26 | -$lang['Subadmin List']='Lista Subadmin'; |
|
24 | +$lang['System Accounts'] = 'Cuentas del sistema'; |
|
25 | +$lang['Admin List'] = 'Lista de administración'; |
|
26 | +$lang['Subadmin List'] = 'Lista Subadmin'; |
|
27 | 27 | |
28 | 28 | //Accounting Manage Invoices Menu |
29 | -$lang['Manage Invoice']='Gestione la factura'; |
|
30 | -$lang['Invoice List']='Lista de facturas'; |
|
31 | -$lang['Invoice Configuration']='Configuración de facturas'; |
|
29 | +$lang['Manage Invoice'] = 'Gestione la factura'; |
|
30 | +$lang['Invoice List'] = 'Lista de facturas'; |
|
31 | +$lang['Invoice Configuration'] = 'Configuración de facturas'; |
|
32 | 32 | |
33 | 33 | //Accounting Subscription Menu |
34 | -$lang['Subscriptions']='Suscripciones'; |
|
35 | -$lang['Periodic Charges']='Cargos periódicos'; |
|
34 | +$lang['Subscriptions'] = 'Suscripciones'; |
|
35 | +$lang['Periodic Charges'] = 'Cargos periódicos'; |
|
36 | 36 | |
37 | 37 | //Accounting Manage Taxes Menu |
38 | -$lang['Manage Taxes']='Gestione impuestos'; |
|
39 | -$lang['Taxes']='Impuestos'; |
|
38 | +$lang['Manage Taxes'] = 'Gestione impuestos'; |
|
39 | +$lang['Taxes'] = 'Impuestos'; |
|
40 | 40 | |
41 | 41 | //Services Calling Cards Menu |
42 | 42 | |
43 | -$lang['Calling Cards']='Tarjetas de llamadas'; |
|
44 | -$lang['List Cards']='Lista de Tarjetas'; |
|
45 | -$lang['CC Brands']='CC Marcas'; |
|
46 | -$lang['Calling Card CDRs']='Llamando CDRs Tarjeta'; |
|
43 | +$lang['Calling Cards'] = 'Tarjetas de llamadas'; |
|
44 | +$lang['List Cards'] = 'Lista de Tarjetas'; |
|
45 | +$lang['CC Brands'] = 'CC Marcas'; |
|
46 | +$lang['Calling Card CDRs'] = 'Llamando CDRs Tarjeta'; |
|
47 | 47 | |
48 | 48 | //DID Menu |
49 | -$lang['Manage DID']='Gestione DID'; |
|
50 | -$lang['Manage DIDs']='Gestione DIDs'; |
|
49 | +$lang['Manage DID'] = 'Gestione DID'; |
|
50 | +$lang['Manage DIDs'] = 'Gestione DIDs'; |
|
51 | 51 | |
52 | 52 | //Routing Providers Menu |
53 | 53 | |
54 | -$lang['Providers']='Proveedores'; |
|
55 | -$lang['Trunks']='Baúles'; |
|
56 | -$lang['Termination Rates']='Las tarifas de terminación'; |
|
57 | -$lang['Gateways']='Entrada'; |
|
58 | -$lang['Sip Profile']='Sip Perfil'; |
|
54 | +$lang['Providers'] = 'Proveedores'; |
|
55 | +$lang['Trunks'] = 'Baúles'; |
|
56 | +$lang['Termination Rates'] = 'Las tarifas de terminación'; |
|
57 | +$lang['Gateways'] = 'Entrada'; |
|
58 | +$lang['Sip Profile'] = 'Sip Perfil'; |
|
59 | 59 | |
60 | 60 | //Routing Clients Menu |
61 | -$lang['Clients']='Clientela'; |
|
62 | -$lang['Rate Group']='Cambio de grupo'; |
|
63 | -$lang['Origination Rates']='Creaciones de Cambio'; |
|
64 | -$lang['Packages']='Paquetes'; |
|
65 | -$lang['Package Usage Report']='Informe de uso del paquete'; |
|
61 | +$lang['Clients'] = 'Clientela'; |
|
62 | +$lang['Rate Group'] = 'Cambio de grupo'; |
|
63 | +$lang['Origination Rates'] = 'Creaciones de Cambio'; |
|
64 | +$lang['Packages'] = 'Paquetes'; |
|
65 | +$lang['Package Usage Report'] = 'Informe de uso del paquete'; |
|
66 | 66 | |
67 | 67 | //Reports->CallDetail Reports |
68 | 68 | |
69 | -$lang['Call Detail Reports']='Llame informes de detalles'; |
|
70 | -$lang['Customer Reports']='Informes Cliente'; |
|
71 | -$lang['Reseller Report']='Informe distribuidor'; |
|
72 | -$lang['Provider Report']='Reporte del Proveedor'; |
|
69 | +$lang['Call Detail Reports'] = 'Llame informes de detalles'; |
|
70 | +$lang['Customer Reports'] = 'Informes Cliente'; |
|
71 | +$lang['Reseller Report'] = 'Informe distribuidor'; |
|
72 | +$lang['Provider Report'] = 'Reporte del Proveedor'; |
|
73 | 73 | |
74 | 74 | //Reports->Switch Reports Menu |
75 | -$lang['Switch Reports']='Informes interruptor'; |
|
76 | -$lang['Live Call Report']='Vivir Informe de llamadas'; |
|
77 | -$lang['Trunk Stats']='Estadísticas del tronco'; |
|
75 | +$lang['Switch Reports'] = 'Informes interruptor'; |
|
76 | +$lang['Live Call Report'] = 'Vivir Informe de llamadas'; |
|
77 | +$lang['Trunk Stats'] = 'Estadísticas del tronco'; |
|
78 | 78 | |
79 | 79 | //Reports->Summary Reports Menu |
80 | -$lang['Summary Reports']='Resumen del informe'; |
|
81 | -$lang['Provider Reports']='Reporte del Proveedor'; |
|
82 | -$lang['User Report']="Informe de usuario"; |
|
80 | +$lang['Summary Reports'] = 'Resumen del informe'; |
|
81 | +$lang['Provider Reports'] = 'Reporte del Proveedor'; |
|
82 | +$lang['User Report'] = "Informe de usuario"; |
|
83 | 83 | |
84 | 84 | //Reports->Payment Reports Menu |
85 | -$lang['Payment Reports']='Informes de pago'; |
|
86 | -$lang['Payment Report']='Informe de Pago'; |
|
85 | +$lang['Payment Reports'] = 'Informes de pago'; |
|
86 | +$lang['Payment Report'] = 'Informe de Pago'; |
|
87 | 87 | |
88 | 88 | |
89 | -$lang['Switch Config']='Cambiar configuración'; |
|
90 | -$lang['System']='sistema'; |
|
91 | -$lang['Freeswitch SIP Devices']='Dispositivos FreeSWITCH Sip'; |
|
92 | -$lang['Freeswitch Server']='Freeswitch servidor'; |
|
93 | -$lang['Configuration']='Configuración'; |
|
94 | -$lang['Email Template']='Plantilla de correo electrónico'; |
|
95 | -$lang['Freeswitch']='Freeswitch'; |
|
89 | +$lang['Switch Config'] = 'Cambiar configuración'; |
|
90 | +$lang['System'] = 'sistema'; |
|
91 | +$lang['Freeswitch SIP Devices'] = 'Dispositivos FreeSWITCH Sip'; |
|
92 | +$lang['Freeswitch Server'] = 'Freeswitch servidor'; |
|
93 | +$lang['Configuration'] = 'Configuración'; |
|
94 | +$lang['Email Template'] = 'Plantilla de correo electrónico'; |
|
95 | +$lang['Freeswitch'] = 'Freeswitch'; |
|
96 | 96 | ?> |
97 | 97 |
@@ -1,3 +1,3 @@ |
||
1 | -<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); |
|
2 | -$lang['FOOTER.FOOTER']='Copyright © 2003 - 2012. ASTPP - Open Source VOIP Billing Solution. All Rights Reserved.'; |
|
1 | +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
2 | +$lang['FOOTER.FOOTER'] = 'Copyright © 2003 - 2012. ASTPP - Open Source VOIP Billing Solution. All Rights Reserved.'; |
|
3 | 3 | ?> |
@@ -1,101 +1,101 @@ |
||
1 | -<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
2 | 2 | //Main Menu |
3 | -$lang['Home']='Home'; |
|
4 | -$lang['Global Accounts']='Global Accounts'; |
|
5 | -$lang['Accounting']='Accounting'; |
|
6 | -$lang['Services']='Services'; |
|
7 | -$lang['DIDs']='DIDs'; |
|
8 | -$lang['Routing']='Routing'; |
|
9 | -$lang['Reports']='Reports'; |
|
10 | -$lang['System Configuration']='System Configuration'; |
|
11 | -$lang['Accounts']='Accounts'; |
|
12 | -$lang['FS Devices']='FS Devices'; |
|
3 | +$lang['Home'] = 'Home'; |
|
4 | +$lang['Global Accounts'] = 'Global Accounts'; |
|
5 | +$lang['Accounting'] = 'Accounting'; |
|
6 | +$lang['Services'] = 'Services'; |
|
7 | +$lang['DIDs'] = 'DIDs'; |
|
8 | +$lang['Routing'] = 'Routing'; |
|
9 | +$lang['Reports'] = 'Reports'; |
|
10 | +$lang['System Configuration'] = 'System Configuration'; |
|
11 | +$lang['Accounts'] = 'Accounts'; |
|
12 | +$lang['FS Devices'] = 'FS Devices'; |
|
13 | 13 | //gloabalAccounts useraccount Menu |
14 | 14 | |
15 | -$lang['User Accounts']='User Accounts'; |
|
16 | -$lang['Customer List']='Customer List'; |
|
17 | -$lang['Reseller List']='Reseller List'; |
|
18 | -$lang['Callshop List']='Callshop List'; |
|
15 | +$lang['User Accounts'] = 'User Accounts'; |
|
16 | +$lang['Customer List'] = 'Customer List'; |
|
17 | +$lang['Reseller List'] = 'Reseller List'; |
|
18 | +$lang['Callshop List'] = 'Callshop List'; |
|
19 | 19 | |
20 | 20 | //gloabalAccounts ProviderAccounts Menu |
21 | -$lang['Provider Accounts']='Provider Accounts'; |
|
22 | -$lang['Provider List']='Provider List'; |
|
21 | +$lang['Provider Accounts'] = 'Provider Accounts'; |
|
22 | +$lang['Provider List'] = 'Provider List'; |
|
23 | 23 | //gloabalAccounts System Accounts Menu |
24 | -$lang['System Accounts']='System Accounts'; |
|
25 | -$lang['Admin List']='Admin List'; |
|
26 | -$lang['Subadmin List']='Subadmin List'; |
|
24 | +$lang['System Accounts'] = 'System Accounts'; |
|
25 | +$lang['Admin List'] = 'Admin List'; |
|
26 | +$lang['Subadmin List'] = 'Subadmin List'; |
|
27 | 27 | |
28 | 28 | //Accounting Manage Invoices Menu |
29 | -$lang['Manage Account']='Manage Account'; |
|
30 | -$lang['Manage Invoice']='Manage Invoice'; |
|
29 | +$lang['Manage Account'] = 'Manage Account'; |
|
30 | +$lang['Manage Invoice'] = 'Manage Invoice'; |
|
31 | 31 | $lang['Invoices'] = 'Invoices'; |
32 | -$lang['Invoice List']='Invoice List'; |
|
33 | -$lang['Invoice Configuration']='Invoice Configuration'; |
|
32 | +$lang['Invoice List'] = 'Invoice List'; |
|
33 | +$lang['Invoice Configuration'] = 'Invoice Configuration'; |
|
34 | 34 | |
35 | 35 | //Accounting Subscription Menu |
36 | -$lang['Subscriptions']='Subscriptions'; |
|
37 | -$lang['Periodic Charges']='Periodic Charges'; |
|
36 | +$lang['Subscriptions'] = 'Subscriptions'; |
|
37 | +$lang['Periodic Charges'] = 'Periodic Charges'; |
|
38 | 38 | |
39 | 39 | //Accounting Manage Taxes Menu |
40 | -$lang['Manage Taxes']='Manage Taxes'; |
|
41 | -$lang['Taxes']='Taxes'; |
|
40 | +$lang['Manage Taxes'] = 'Manage Taxes'; |
|
41 | +$lang['Taxes'] = 'Taxes'; |
|
42 | 42 | |
43 | 43 | //Services Calling Cards Menu |
44 | 44 | |
45 | -$lang['Calling Cards']='Calling Cards'; |
|
46 | -$lang['List Cards']='List Cards'; |
|
47 | -$lang['CC Brands']='CC Brands'; |
|
48 | -$lang['Calling Card CDRs']='Calling Card CDRs'; |
|
45 | +$lang['Calling Cards'] = 'Calling Cards'; |
|
46 | +$lang['List Cards'] = 'List Cards'; |
|
47 | +$lang['CC Brands'] = 'CC Brands'; |
|
48 | +$lang['Calling Card CDRs'] = 'Calling Card CDRs'; |
|
49 | 49 | |
50 | 50 | //DID Menu |
51 | -$lang['Manage DID']='Manage DID'; |
|
52 | -$lang['Manage DIDs']='Manage DIDs'; |
|
51 | +$lang['Manage DID'] = 'Manage DID'; |
|
52 | +$lang['Manage DIDs'] = 'Manage DIDs'; |
|
53 | 53 | |
54 | 54 | //Routing Providers Menu |
55 | 55 | $lang['Freeswitch Devices'] = 'Freeswitch Devices'; |
56 | -$lang['Providers']='Providers'; |
|
57 | -$lang['Trunks']='Trunks'; |
|
58 | -$lang['Termination Rates']='Termination Rates'; |
|
59 | -$lang['Gateways']='Gateways'; |
|
60 | -$lang['Sip Profile']='Sip Profile'; |
|
61 | -$lang['SIP Devices']='SIP Devices'; |
|
56 | +$lang['Providers'] = 'Providers'; |
|
57 | +$lang['Trunks'] = 'Trunks'; |
|
58 | +$lang['Termination Rates'] = 'Termination Rates'; |
|
59 | +$lang['Gateways'] = 'Gateways'; |
|
60 | +$lang['Sip Profile'] = 'Sip Profile'; |
|
61 | +$lang['SIP Devices'] = 'SIP Devices'; |
|
62 | 62 | |
63 | 63 | //Routing Clients Menu |
64 | -$lang['Rates']='Rates'; |
|
65 | -$lang['Clients']='Clients'; |
|
66 | -$lang['Rate Group']='Rate Group'; |
|
67 | -$lang['Origination Rates']='Origination Rates'; |
|
68 | -$lang['Packages']='Packages'; |
|
69 | -$lang['Package Usage Report']='Package Usage Report'; |
|
64 | +$lang['Rates'] = 'Rates'; |
|
65 | +$lang['Clients'] = 'Clients'; |
|
66 | +$lang['Rate Group'] = 'Rate Group'; |
|
67 | +$lang['Origination Rates'] = 'Origination Rates'; |
|
68 | +$lang['Packages'] = 'Packages'; |
|
69 | +$lang['Package Usage Report'] = 'Package Usage Report'; |
|
70 | 70 | |
71 | 71 | //Reports->CallDetail Reports |
72 | -$lang['CDRs Reports']='CDRs Reports'; |
|
73 | -$lang['Call Detail Reports']='Call Detail Reports'; |
|
74 | -$lang['Customer Reports']='Customer Reports'; |
|
75 | -$lang['Reseller Report']='Reseller Report'; |
|
76 | -$lang['Provider Report']='Provider Report'; |
|
72 | +$lang['CDRs Reports'] = 'CDRs Reports'; |
|
73 | +$lang['Call Detail Reports'] = 'Call Detail Reports'; |
|
74 | +$lang['Customer Reports'] = 'Customer Reports'; |
|
75 | +$lang['Reseller Report'] = 'Reseller Report'; |
|
76 | +$lang['Provider Report'] = 'Provider Report'; |
|
77 | 77 | |
78 | 78 | //Reports->Switch Reports Menu |
79 | -$lang['Switch Reports']='Switch Reports'; |
|
80 | -$lang['Live Call Report']='Live Call Report'; |
|
81 | -$lang['Trunk Stats']='Trunk Stats'; |
|
79 | +$lang['Switch Reports'] = 'Switch Reports'; |
|
80 | +$lang['Live Call Report'] = 'Live Call Report'; |
|
81 | +$lang['Trunk Stats'] = 'Trunk Stats'; |
|
82 | 82 | |
83 | 83 | //Reports->Summary Reports Menu |
84 | -$lang['Summary Reports']='Summary Report'; |
|
85 | -$lang['Provider Reports']='Provider Report'; |
|
86 | -$lang['User Report']="User Report"; |
|
84 | +$lang['Summary Reports'] = 'Summary Report'; |
|
85 | +$lang['Provider Reports'] = 'Provider Report'; |
|
86 | +$lang['User Report'] = "User Report"; |
|
87 | 87 | |
88 | 88 | //Reports->Payment Reports Menu |
89 | -$lang['Payment Reports']='Payment Reports'; |
|
90 | -$lang['Payment Report']='Payment Report'; |
|
91 | - |
|
92 | - |
|
93 | -$lang['Switch Config']='Switch Config'; |
|
94 | -$lang['Softswitch']='Softswitch'; |
|
95 | -$lang['System']='System'; |
|
96 | -$lang['Freeswitch SIP Devices']='Freeswitch SIP Devices'; |
|
97 | -$lang['Freeswitch Server']='Freeswitch Server'; |
|
98 | -$lang['Configuration']='Configuration'; |
|
99 | -$lang['Email Template']='Email Template'; |
|
100 | -$lang['Freeswitch']='Freeswitch'; |
|
89 | +$lang['Payment Reports'] = 'Payment Reports'; |
|
90 | +$lang['Payment Report'] = 'Payment Report'; |
|
91 | + |
|
92 | + |
|
93 | +$lang['Switch Config'] = 'Switch Config'; |
|
94 | +$lang['Softswitch'] = 'Softswitch'; |
|
95 | +$lang['System'] = 'System'; |
|
96 | +$lang['Freeswitch SIP Devices'] = 'Freeswitch SIP Devices'; |
|
97 | +$lang['Freeswitch Server'] = 'Freeswitch Server'; |
|
98 | +$lang['Configuration'] = 'Configuration'; |
|
99 | +$lang['Email Template'] = 'Email Template'; |
|
100 | +$lang['Freeswitch'] = 'Freeswitch'; |
|
101 | 101 | ?> |
@@ -53,15 +53,15 @@ discard block |
||
53 | 53 | |
54 | 54 | $userCaptcha = $this->input->post('userCaptcha'); |
55 | 55 | $random_number = substr(number_format(time() * rand(), 0, '', ''), 0, 6); |
56 | - $accountinfo=(array)$this->db->get_where('accounts',array('type'=>-1))->first_row(); |
|
57 | - $data['timezone_id'] = (!$accountinfo['timezone_id']) ? 1 : $accountinfo['timezone_id']; |
|
58 | - $data['currency_id'] = (!$accountinfo['currency_id']) ? 1 : $accountinfo['currency_id']; |
|
59 | - $data['country_id'] = (!$accountinfo['country_id']) ? 1 : $accountinfo['country_id']; |
|
56 | + $accountinfo = (array)$this->db->get_where('accounts', array('type'=>-1))->first_row(); |
|
57 | + $data['timezone_id'] = ( ! $accountinfo['timezone_id']) ? 1 : $accountinfo['timezone_id']; |
|
58 | + $data['currency_id'] = ( ! $accountinfo['currency_id']) ? 1 : $accountinfo['currency_id']; |
|
59 | + $data['country_id'] = ( ! $accountinfo['country_id']) ? 1 : $accountinfo['country_id']; |
|
60 | 60 | |
61 | 61 | $vals = array( |
62 | 62 | 'word' => $random_number, |
63 | - 'img_path' => getcwd() . '/assets/captcha/', |
|
64 | - 'img_url' => base_url() . 'assets/captcha/', |
|
63 | + 'img_path' => getcwd().'/assets/captcha/', |
|
64 | + 'img_url' => base_url().'assets/captcha/', |
|
65 | 65 | //'font_path' => './fonts/impact.ttf', |
66 | 66 | 'img_width' => '243', |
67 | 67 | 'img_height' => '50', |
@@ -81,14 +81,14 @@ discard block |
||
81 | 81 | $unique = $decoded_str; |
82 | 82 | $query = $this->db_model->getSelect("*", 'accounts', array('id' => $unique, "deleted" => "0")); |
83 | 83 | if ($query->num_rows() == 0) { |
84 | - redirect(base_url() . "signup/signup_inactive"); |
|
84 | + redirect(base_url()."signup/signup_inactive"); |
|
85 | 85 | } |
86 | 86 | if ($query->num_rows() > 0) { |
87 | 87 | $query = $query->result_array(); |
88 | 88 | $query = $query[0]; |
89 | 89 | |
90 | 90 | if ($query['status'] != 0) { |
91 | - redirect(base_url() . "signup/signup_inactive"); |
|
91 | + redirect(base_url()."signup/signup_inactive"); |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | } |
@@ -116,14 +116,14 @@ discard block |
||
116 | 116 | |
117 | 117 | function signup_save($id = "") { |
118 | 118 | if (empty($_POST)) { |
119 | - redirect(base_url() . "signup/"); |
|
119 | + redirect(base_url()."signup/"); |
|
120 | 120 | } else { |
121 | 121 | $post_values = $this->input->post(); |
122 | 122 | $userCaptcha = $this->input->post('userCaptcha'); |
123 | 123 | $cnt_result = $this->db_model->countQuery("*", 'accounts', array('email' => $post_values['email'])); |
124 | 124 | |
125 | - if ($userCaptcha != $this->session->userdata('captchaWord') || !filter_var($this->input->post('email'), FILTER_VALIDATE_EMAIL) || $cnt_result > 0) { |
|
126 | - if (!filter_var($this->input->post('email'), FILTER_VALIDATE_EMAIL)) { |
|
125 | + if ($userCaptcha != $this->session->userdata('captchaWord') || ! filter_var($this->input->post('email'), FILTER_VALIDATE_EMAIL) || $cnt_result > 0) { |
|
126 | + if ( ! filter_var($this->input->post('email'), FILTER_VALIDATE_EMAIL)) { |
|
127 | 127 | $data['error']['email'] = "<div style='color: red;'> Please enter proper email </div>"; |
128 | 128 | } |
129 | 129 | if ($userCaptcha != $this->session->userdata('captchaWord')) { |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | $random_number = substr(number_format(time() * rand(), 0, '', ''), 0, 6); |
136 | 136 | $vals = array( |
137 | 137 | 'word' => $random_number, |
138 | - 'img_path' => getcwd() . '/assets/captcha/', |
|
139 | - 'img_url' => base_url() . 'assets/captcha/', |
|
138 | + 'img_path' => getcwd().'/assets/captcha/', |
|
139 | + 'img_url' => base_url().'assets/captcha/', |
|
140 | 140 | //'font_path' => './fonts/impact.ttf', |
141 | 141 | 'img_width' => '243', |
142 | 142 | 'img_height' => '50', |
@@ -147,14 +147,14 @@ discard block |
||
147 | 147 | $data['key_unique'] = $_POST['key_unique']; |
148 | 148 | } |
149 | 149 | |
150 | - $accountinfo=(array)$this->db->get_where('accounts',array('type'=>-1))->first_row(); |
|
151 | - $data['timezone_id'] = (!$accountinfo['timezone_id']) ? 1 : $accountinfo['timezone_id']; |
|
152 | - $data['currency_id'] = (!$accountinfo['currency_id']) ? 1 : $accountinfo['currency_id']; |
|
153 | - $data['country_id'] = (!$accountinfo['country_id']) ? 1 : $accountinfo['country_id']; |
|
150 | + $accountinfo = (array)$this->db->get_where('accounts', array('type'=>-1))->first_row(); |
|
151 | + $data['timezone_id'] = ( ! $accountinfo['timezone_id']) ? 1 : $accountinfo['timezone_id']; |
|
152 | + $data['currency_id'] = ( ! $accountinfo['currency_id']) ? 1 : $accountinfo['currency_id']; |
|
153 | + $data['country_id'] = ( ! $accountinfo['country_id']) ? 1 : $accountinfo['country_id']; |
|
154 | 154 | |
155 | - $data['timezone_id'] = (!$data['timezone_id']) ? 1 : $data['timezone_id']; |
|
156 | - $data['currency_id'] = (!$data['currency_id']) ? 1 : $data['currency_id']; |
|
157 | - $data['country_id'] = (!$data['country_id']) ? 1 : $data['country_id']; |
|
155 | + $data['timezone_id'] = ( ! $data['timezone_id']) ? 1 : $data['timezone_id']; |
|
156 | + $data['currency_id'] = ( ! $data['currency_id']) ? 1 : $data['currency_id']; |
|
157 | + $data['country_id'] = ( ! $data['country_id']) ? 1 : $data['country_id']; |
|
158 | 158 | |
159 | 159 | $data['value'] = $post_values; |
160 | 160 | $data['captcha'] = create_captcha($vals); |
@@ -166,8 +166,8 @@ discard block |
||
166 | 166 | //AVTLATP |
167 | 167 | $user_data = $this->input->post(); |
168 | 168 | |
169 | - if (!isset($_POST['key_unique']) || !isset($_POST['email'])) { |
|
170 | - redirect(base_url() . "signup/"); |
|
169 | + if ( ! isset($_POST['key_unique']) || ! isset($_POST['email'])) { |
|
170 | + redirect(base_url()."signup/"); |
|
171 | 171 | } |
172 | 172 | $reseller_id = 0; |
173 | 173 | if (isset($_POST['key_unique']) && $_POST['key_unique'] != "admin") { |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $result = $this->db_model->getSelect("*", "pricelists", array("reseller_id" => $reseller_id), "ASC"); |
208 | 208 | $result_arr = $result->result_array(); |
209 | 209 | $selection_rategroup_signup = $result_arr[0]['id']; |
210 | - $user_data['pricelist_id'] = (isset($selection_rategroup_signup) && $selection_rategroup_signup > 0 ) ? $selection_rategroup_signup : 0; |
|
210 | + $user_data['pricelist_id'] = (isset($selection_rategroup_signup) && $selection_rategroup_signup > 0) ? $selection_rategroup_signup : 0; |
|
211 | 211 | } else { |
212 | 212 | $pricelist_id = $this->common->get_field_name('id', 'pricelists', array('name' => $selection_rategroup_signup)); |
213 | 213 | /* if($pricelis_id != "") |
@@ -216,19 +216,19 @@ discard block |
||
216 | 216 | $user_data['pricelist_id'] = 0; */ |
217 | 217 | $user_data['pricelist_id'] = ($pricelist_id != "") ? $pricelist_id : 0; |
218 | 218 | } |
219 | - $last_id='0'; |
|
219 | + $last_id = '0'; |
|
220 | 220 | //Insert or Update record |
221 | 221 | $signup_sipdevice_flag = $system_config['create_sipdevice']; |
222 | 222 | $last_id = $this->signup_model->add_user($user_data); |
223 | 223 | if ($last_id == "") { |
224 | - redirect(base_url() . "signup/signup_inactive"); |
|
224 | + redirect(base_url()."signup/signup_inactive"); |
|
225 | 225 | } |
226 | 226 | if ($signup_sipdevice_flag == '0') { |
227 | 227 | $query = $this->db_model->select("*", "sip_profiles", array('name' => "default"), "id", "ASC", '1', '0'); |
228 | 228 | $sip_id = $query->result_array(); |
229 | - if($reseller_id > 0){ |
|
229 | + if ($reseller_id > 0) { |
|
230 | 230 | $reseller_id = $reseller_id; |
231 | - }else{ |
|
231 | + } else { |
|
232 | 232 | $reseller_id = '0'; |
233 | 233 | } |
234 | 234 | $free_switch_array = array('fs_username' => $user_data['number'], |
@@ -248,26 +248,26 @@ discard block |
||
248 | 248 | 'vm_keep_local_after_email'=>true, |
249 | 249 | 'vm_send_all_message'=>true, |
250 | 250 | ); |
251 | - $user_custom_array=array_merge($user_data,$free_switch_array); |
|
252 | - $user_custom_array['id']=$last_id; |
|
253 | - $user_custom_array['email']=$user_data['email']; |
|
251 | + $user_custom_array = array_merge($user_data, $free_switch_array); |
|
252 | + $user_custom_array['id'] = $last_id; |
|
253 | + $user_custom_array['email'] = $user_data['email']; |
|
254 | 254 | |
255 | 255 | $this->load->model('freeswitch/freeswitch_model'); |
256 | 256 | $this->freeswitch_model->add_freeswith($user_custom_array); |
257 | 257 | } |
258 | 258 | // echo "<pre>"; print_r ($user_data); exit; |
259 | 259 | $activation = $this->encrypt->encode($user_data['number']); |
260 | - $message = base_url() . 'signup/signup_confirm?email=' . urlencode($user_data['email']) . "&key=" . urlencode($activation); |
|
260 | + $message = base_url().'signup/signup_confirm?email='.urlencode($user_data['email'])."&key=".urlencode($activation); |
|
261 | 261 | $user_data['confirm'] = $message; |
262 | 262 | |
263 | 263 | $this->send_mail($last_id, 'email_signup_confirmation', $user_data); |
264 | - redirect(base_url() . "signup/signup_success"); |
|
264 | + redirect(base_url()."signup/signup_success"); |
|
265 | 265 | } |
266 | 266 | } |
267 | 267 | } |
268 | 268 | |
269 | 269 | function signup_confirm() { |
270 | - if (!empty($_GET)) { |
|
270 | + if ( ! empty($_GET)) { |
|
271 | 271 | |
272 | 272 | $system_config = common_model::$global_config['system_config']; |
273 | 273 | $balance = $system_config["balance"]; |
@@ -315,14 +315,14 @@ discard block |
||
315 | 315 | unset($_POST['action']); |
316 | 316 | $where = array('email' => $email); |
317 | 317 | $this->db->where($where); |
318 | - $this->db->or_where('number',$email); |
|
318 | + $this->db->or_where('number', $email); |
|
319 | 319 | $cnt_result = $this->db_model->countQuery("*", 'accounts', ""); |
320 | - if (!empty($email)) { |
|
320 | + if ( ! empty($email)) { |
|
321 | 321 | $names = array('0', '1', '3'); |
322 | 322 | $this->db->where_in('type', $names); |
323 | 323 | $where_arr = array("email" => $email); |
324 | 324 | $this->db->where($where_arr); |
325 | - $this->db->or_where('number',$email); |
|
325 | + $this->db->or_where('number', $email); |
|
326 | 326 | $acountdata = $this->db_model->getSelect("*", "accounts", ""); |
327 | 327 | if ($acountdata->num_rows() > 0) { |
328 | 328 | $user_data = $acountdata->result_array(); |
@@ -333,8 +333,8 @@ discard block |
||
333 | 333 | exit; |
334 | 334 | } |
335 | 335 | } |
336 | - if ($acountdata->num_rows() == 0 && !filter_var($email, FILTER_VALIDATE_EMAIL)) { |
|
337 | - if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { |
|
336 | + if ($acountdata->num_rows() == 0 && ! filter_var($email, FILTER_VALIDATE_EMAIL)) { |
|
337 | + if ( ! filter_var($email, FILTER_VALIDATE_EMAIL)) { |
|
338 | 338 | $data['error']['email'] = "<div id='error_mail' style='color: red; margin: 2% 22%; float: left; width:100%;'>Please enter proper Username or Email.</div>"; |
339 | 339 | |
340 | 340 | $this->load->view('view_forgotpassword', $data); |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | |
344 | 344 | $this->load->view('view_forgotpassword', $data); |
345 | 345 | } |
346 | - } else if($acountdata->num_rows() == 0){ |
|
346 | + } else if ($acountdata->num_rows() == 0) { |
|
347 | 347 | $data['error']['email'] = "<div id='error_mail' style='color: red; margin: 2% 22%; float: left; width:100%;'>Please enter proper Username or Email.</div>"; |
348 | 348 | $this->load->view('view_forgotpassword', $data); |
349 | 349 | } else { |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | |
353 | 353 | $email = $this->encrypt->encode($user_data['email']); |
354 | 354 | $activation = $this->encrypt->encode($user_data['number']); |
355 | - $message = base_url() . 'confirm_pass?email=' . urlencode($email) . "&key=" . urlencode($activation); |
|
355 | + $message = base_url().'confirm_pass?email='.urlencode($email)."&key=".urlencode($activation); |
|
356 | 356 | $user_data['confirm'] = $message; |
357 | 357 | $where = array("email" => $user_data['email']); |
358 | 358 | $data = array("pass_link_status" => 1); |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | $balance = ''; |
375 | 375 | $email1 = $this->encrypt->decode($confirm_pass['email']); |
376 | 376 | $success = $this->signup_model->check_user($accno, $email1, $balance); |
377 | - if (!empty($confirm_pass)) { |
|
377 | + if ( ! empty($confirm_pass)) { |
|
378 | 378 | $where_arr = array("email" => $email1, "status" => 0); |
379 | 379 | $acountdata = $this->db_model->getSelect("*", "accounts", $where_arr); |
380 | 380 | if ($acountdata->num_rows() > 0) { |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | function confirmpass() { |
399 | 399 | $passwordconf = $_POST; |
400 | 400 | $email1 = $this->encrypt->decode($passwordconf['email']); |
401 | - if (!empty($passwordconf)) { |
|
401 | + if ( ! empty($passwordconf)) { |
|
402 | 402 | $acountdata = $this->db_model->getSelect("*", "accounts", array("email" => $email1)); |
403 | 403 | //echo $this->db->last_query();exit; |
404 | 404 | if ($acountdata->num_rows() > 0) { |
@@ -440,8 +440,8 @@ discard block |
||
440 | 440 | |
441 | 441 | $where = array('name' => $temp_name); |
442 | 442 | $EmailTemplate = $this->db_model->getSelect("*", "default_templates", $where); |
443 | - $reseller_id = ($user_data['reseller_id'] >0) ? $user_data['reseller_id'] : 1; |
|
444 | - $where="accountid IN ('".$reseller_id."','1')"; |
|
443 | + $reseller_id = ($user_data['reseller_id'] > 0) ? $user_data['reseller_id'] : 1; |
|
444 | + $where = "accountid IN ('".$reseller_id."','1')"; |
|
445 | 445 | $this->db->where($where); |
446 | 446 | $this->db->select('*'); |
447 | 447 | $this->db->order_by('accountid', 'desc'); |
@@ -457,8 +457,8 @@ discard block |
||
457 | 457 | |
458 | 458 | foreach ($EmailTemplate->result_array() as $value) { |
459 | 459 | $TemplateData = $value; |
460 | - $TemplateData['subject'] = str_replace('#NAME#', $user_data['first_name'] . " " . $user_data['last_name'], $TemplateData['subject']); |
|
461 | - $TemplateData['template'] = str_replace('#NAME#', $user_data['first_name'] . " " . $user_data['last_name'], $TemplateData['template']); |
|
460 | + $TemplateData['subject'] = str_replace('#NAME#', $user_data['first_name']." ".$user_data['last_name'], $TemplateData['subject']); |
|
461 | + $TemplateData['template'] = str_replace('#NAME#', $user_data['first_name']." ".$user_data['last_name'], $TemplateData['template']); |
|
462 | 462 | $TemplateData['template'] = str_replace('#NUMBER#', $user_data['number'], $TemplateData['template']); |
463 | 463 | $TemplateData['template'] = str_replace('#PASSWORD#', $user_data['password'], $TemplateData['template']); |
464 | 464 | $TemplateData['template'] = str_replace('#COMPANY_WEBSITE#', $company_website, $TemplateData['template']); |