@@ -189,6 +189,10 @@ discard block |
||
189 | 189 | } |
190 | 190 | |
191 | 191 | //Insert parent resellers cdr |
192 | +/** |
|
193 | + * @param string $provider_cost |
|
194 | + * @param boolean $flag_parent |
|
195 | + */ |
|
192 | 196 | function insert_parent_data($dataVariable,$actual_calltype,$parentid,$origination_rate,$actual_duration,$provider_cost,$flag_parent,$logger,$db,$decimal_points) |
193 | 197 | { |
194 | 198 | while($parentid > 0 ) |
@@ -250,6 +254,9 @@ discard block |
||
250 | 254 | } |
251 | 255 | |
252 | 256 | //Insert callee cdr entry for DID calls |
257 | +/** |
|
258 | + * @param boolean $flag_parent |
|
259 | + */ |
|
253 | 260 | function insert_extra_receiver_entry($dataVariable,$origination_rate,$termination_rate,$account_type,$actual_duration,$provider_cost,$parentid,$flag_parent,$accountid,$logger,$db,$decimal_points) |
254 | 261 | { |
255 | 262 | $localVariable = $dataVariable; |
@@ -318,6 +325,9 @@ discard block |
||
318 | 325 | } |
319 | 326 | |
320 | 327 | //Update user balance |
328 | +/** |
|
329 | + * @param integer $entity_id |
|
330 | + */ |
|
321 | 331 | function update_balance($user_id, $amount, $entity_id, $logger, $db) { |
322 | 332 | $math_sign = ($entity_id == 0 || $entity_id == 1) ? '-' : '+'; |
323 | 333 | $query = "UPDATE accounts SET balance=balance-" . $amount . " WHERE id=" . $user_id; |
@@ -457,6 +467,9 @@ discard block |
||
457 | 467 | } |
458 | 468 | |
459 | 469 | // String append prefix for checking rates |
470 | +/** |
|
471 | + * @param string $field |
|
472 | + */ |
|
460 | 473 | function number_loop($destination,$field,$db) |
461 | 474 | { |
462 | 475 | $max_len_prefix = strlen($destination); |
@@ -471,6 +484,9 @@ discard block |
||
471 | 484 | } |
472 | 485 | |
473 | 486 | //Convert current time to GMT |
487 | +/** |
|
488 | + * @param string $date |
|
489 | + */ |
|
474 | 490 | function convert_to_gmt($date) |
475 | 491 | { |
476 | 492 | return gmdate('Y-m-d H:i:s', strtotime($date) ); |
@@ -47,6 +47,9 @@ |
||
47 | 47 | echo $this->error; |
48 | 48 | } |
49 | 49 | |
50 | + /** |
|
51 | + * @param string $bind |
|
52 | + */ |
|
50 | 53 | public function cleanup($bind) { |
51 | 54 | if (!is_array($bind)) { |
52 | 55 | if (!empty($bind)) |
@@ -118,6 +118,9 @@ |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | //Update user balance |
121 | +/** |
|
122 | + * @param integer $entity_id |
|
123 | + */ |
|
121 | 124 | function update_balance($user_id, $amount, $entity_id, $logger, $db) { |
122 | 125 | if ($amount > 0) { |
123 | 126 | $math_sign = ($entity_id == 0 || $entity_id == 1) ? '-' : '+'; |
@@ -64,6 +64,10 @@ |
||
64 | 64 | redirect(base_url()."/systems/currency_list/"); |
65 | 65 | exit; |
66 | 66 | } |
67 | + |
|
68 | + /** |
|
69 | + * @param string $url |
|
70 | + */ |
|
67 | 71 | function curl_response($url) |
68 | 72 | { |
69 | 73 | $ch = curl_init(); // Initialising cURL |
@@ -89,6 +89,10 @@ discard block |
||
89 | 89 | return $last_invoice_date; |
90 | 90 | } |
91 | 91 | |
92 | + /** |
|
93 | + * @param string $start_date |
|
94 | + * @param string $end_date |
|
95 | + */ |
|
92 | 96 | function Generate_Daily_invoice($account_value, $start_date, $end_date) { |
93 | 97 | // echo "INVOICE SCRIPT-------start date :".$start_date."-------end date....".$end_date; |
94 | 98 | |
@@ -99,6 +103,10 @@ discard block |
||
99 | 103 | $this->process_invoice($account_value, $start_date, $end_date); |
100 | 104 | } |
101 | 105 | |
106 | + /** |
|
107 | + * @param string $start_date |
|
108 | + * @param string $end_date |
|
109 | + */ |
|
102 | 110 | function Generate_Monthly_invoice($account_value, $start_date, $end_date) { |
103 | 111 | require_once('updateBalance.php'); |
104 | 112 | $updateBalance = new updateBalance(); |
@@ -181,6 +189,9 @@ discard block |
||
181 | 189 | return true; |
182 | 190 | } |
183 | 191 | |
192 | + /** |
|
193 | + * @param string $last_invoice_ID |
|
194 | + */ |
|
184 | 195 | function create_invoice($account, $from_date, $to_date, $last_invoice_ID, $INVprefix, $invoiceconf) { |
185 | 196 | //$due_date = gmdate("Y-m-d H:i:s",strtotime($to_date." +".$invoiceconf['interval']." days")); |
186 | 197 | if ($invoiceconf['interval'] > 0) { |
@@ -234,6 +245,10 @@ discard block |
||
234 | 245 | } |
235 | 246 | } |
236 | 247 | |
248 | + /** |
|
249 | + * @param string $FilePath |
|
250 | + * @param string $Filenm |
|
251 | + */ |
|
237 | 252 | function send_email_notification($FilePath, $Filenm, $AccountData, $invoice_conf, $invData) { |
238 | 253 | $TemplateData = array(); |
239 | 254 | $where = array('name' => 'email_new_invoice'); |
@@ -153,6 +153,10 @@ discard block |
||
153 | 153 | } |
154 | 154 | } |
155 | 155 | |
156 | + /** |
|
157 | + * @param string $fromdate |
|
158 | + * @param string $todate |
|
159 | + */ |
|
156 | 160 | function calculate_charges($AccountDATA, $itemArr, $charge, $fromdate, $todate, $pro_rate = "1") { |
157 | 161 | $lastdate = false; |
158 | 162 | $billing_cycle = ($AccountDATA['sweep_id'] == "0") ? "1 day" : "1 month"; |
@@ -217,6 +221,9 @@ discard block |
||
217 | 221 | return $lastdate; |
218 | 222 | } |
219 | 223 | |
224 | + /** |
|
225 | + * @param string $todate |
|
226 | + */ |
|
220 | 227 | function Manage_invoice_item($AccountData, $description, $item_id, $charge, $type, $fromdate, $todate, $invoicedate) { |
221 | 228 | $invoiceid = 0; |
222 | 229 | $Bal = "0.00"; |
@@ -263,6 +270,10 @@ discard block |
||
263 | 270 | $this->manage_invoice($invoice_item_arr); |
264 | 271 | } |
265 | 272 | |
273 | + /** |
|
274 | + * @param string $select |
|
275 | + * @param string $table |
|
276 | + */ |
|
266 | 277 | function get_table_data($select, $table, $where) { |
267 | 278 | $query = $this->db_model->getSelect($select, $table, $where); |
268 | 279 | if ($query->num_rows > 0) { |
@@ -44,8 +44,6 @@ discard block |
||
44 | 44 | // __construct |
45 | 45 | /** |
46 | 46 | * adds raw html to the field array |
47 | - * @param type $label |
|
48 | - * @param type $field add |
|
49 | 47 | */ |
50 | 48 | function generate_password() { |
51 | 49 | $pass = substr(md5(rand(0, 1000000000)), 0, common_model::$global_config['system_config']['pinlength']); |
@@ -93,6 +91,9 @@ discard block |
||
93 | 91 | return $uname; |
94 | 92 | } |
95 | 93 | |
94 | + /** |
|
95 | + * @param string $length |
|
96 | + */ |
|
96 | 97 | function random_string($length) { |
97 | 98 | $chars = "1234567890"; //length:36 |
98 | 99 | $final_rand = ''; |
@@ -132,6 +133,10 @@ discard block |
||
132 | 133 | return $number; |
133 | 134 | } |
134 | 135 | |
136 | + /** |
|
137 | + * @param string $select |
|
138 | + * @param string $table |
|
139 | + */ |
|
135 | 140 | function get_field_count($select, $table, $where) { |
136 | 141 | // echo $select."=====".$table."===".$where; |
137 | 142 | if (is_array($where)) { |
@@ -147,6 +152,10 @@ discard block |
||
147 | 152 | } |
148 | 153 | } |
149 | 154 | |
155 | + /** |
|
156 | + * @param string $select |
|
157 | + * @param string $table |
|
158 | + */ |
|
150 | 159 | function get_field_name($select, $table, $where) { |
151 | 160 | if (is_array($where)) { |
152 | 161 | $where = $where; |
@@ -162,6 +171,10 @@ discard block |
||
162 | 171 | } |
163 | 172 | } |
164 | 173 | |
174 | + /** |
|
175 | + * @param string $select |
|
176 | + * @param string $table |
|
177 | + */ |
|
165 | 178 | function get_field_name_coma_new($select, $table, $where) { |
166 | 179 | $value = ''; |
167 | 180 | if (is_array($where)) { |
@@ -504,6 +517,9 @@ discard block |
||
504 | 517 | } |
505 | 518 | |
506 | 519 | |
520 | + /** |
|
521 | + * @param string $select |
|
522 | + */ |
|
507 | 523 | function get_invoice_date($select, $accountid = 0, $reseller_id, $order_by = 'id') { |
508 | 524 | $where = array("reseller_id" => $reseller_id); |
509 | 525 | if ($accountid > 0) { |
@@ -1175,6 +1191,9 @@ discard block |
||
1175 | 1191 | |
1176 | 1192 | } |
1177 | 1193 | |
1194 | + /** |
|
1195 | + * @param string $message |
|
1196 | + */ |
|
1178 | 1197 | function emailFunction($from, $to, $subject, $message, $company_name = "", $attachment = "", $account_id, $reseller_id) { |
1179 | 1198 | $send_mail_details = array('from' => $from, |
1180 | 1199 | 'to' => $to, |
@@ -1373,12 +1392,18 @@ discard block |
||
1373 | 1392 | Password encode decode |
1374 | 1393 | * ******* */ |
1375 | 1394 | |
1395 | + /** |
|
1396 | + * @param string $string |
|
1397 | + */ |
|
1376 | 1398 | function encode_params($string) { |
1377 | 1399 | $data = base64_encode($string); |
1378 | 1400 | $data = str_replace(array('+', '/', '='), array('-', '$', ''), $data); |
1379 | 1401 | return $data; |
1380 | 1402 | } |
1381 | 1403 | |
1404 | + /** |
|
1405 | + * @param string $value |
|
1406 | + */ |
|
1382 | 1407 | function encode($value) { |
1383 | 1408 | $text = $value; |
1384 | 1409 | $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); |
@@ -1830,14 +1855,26 @@ discard block |
||
1830 | 1855 | } |
1831 | 1856 | } |
1832 | 1857 | |
1858 | + /** |
|
1859 | + * @param string $table_name |
|
1860 | + */ |
|
1833 | 1861 | function delete_data($table_name,$where_arr){ |
1834 | 1862 | $this->CI->db->where($where_arr); |
1835 | 1863 | $this->CI->db->delete($table_name); |
1836 | 1864 | } |
1865 | + |
|
1866 | + /** |
|
1867 | + * @param string $table_name |
|
1868 | + */ |
|
1837 | 1869 | function update_data($table_name,$where_arr,$update_arr){ |
1838 | 1870 | $this->CI->db->where($where_arr); |
1839 | 1871 | $this->CI->db->update($table_name,$update_arr); |
1840 | 1872 | } |
1873 | + |
|
1874 | + /** |
|
1875 | + * @param string $table_name |
|
1876 | + * @param string $select |
|
1877 | + */ |
|
1841 | 1878 | function select_data($table_name,$where_arr,$select){ |
1842 | 1879 | $this->CI->db->where($where_arr); |
1843 | 1880 | $this->CI->db->select($select); |
@@ -91,6 +91,9 @@ discard block |
||
91 | 91 | return false; |
92 | 92 | } |
93 | 93 | |
94 | + /** |
|
95 | + * @param string $detail_type |
|
96 | + */ |
|
94 | 97 | function get_info($id,$detail_type) |
95 | 98 | { |
96 | 99 | $where = array('id' => $id); |
@@ -183,6 +186,10 @@ discard block |
||
183 | 186 | } |
184 | 187 | } |
185 | 188 | } |
189 | + |
|
190 | + /** |
|
191 | + * @param string $attachment |
|
192 | + */ |
|
186 | 193 | function mail_history($attachment) |
187 | 194 | { |
188 | 195 | $send_mail_details = array('from'=>$this->from, |
@@ -52,8 +52,6 @@ |
||
52 | 52 | // __construct |
53 | 53 | /** |
54 | 54 | * adds raw html to the field array |
55 | - * @param type $label |
|
56 | - * @param type $field add |
|
57 | 55 | */ |
58 | 56 | function check_permissions() { |
59 | 57 | if ($this->CI->session->userdata('user_login') == TRUE) { |