Passed
Push — v3.0 ( ee545b...afe0c2 )
by Samir
152:57 queued 117:51
created
freeswitch/fs/lib/astpp.cdr.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -256,6 +256,7 @@
 block discarded – undo
256 256
 //Insert callee cdr entry for DID calls
257 257
 /**
258 258
  * @param boolean $flag_parent
259
+ * @param string $provider_cost
259 260
  */
260 261
 function insert_extra_receiver_entry($dataVariable,$origination_rate,$termination_rate,$account_type,$actual_duration,$provider_cost,$parentid,$flag_parent,$accountid,$logger,$db,$decimal_points)
261 262
 {
Please login to merge, or discard this patch.
Spacing   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -46,15 +46,15 @@  discard block
 block discarded – undo
46 46
 
47 47
 	if ($dataVariable['billsec'] == 0 && $dataVariable['hangup_cause'] == 'NORMAL_CLEARING')
48 48
 	{
49
-		$hangup_cause = isset($dataVariable['last_bridge_hangup_cause'])?$dataVariable['last_bridge_hangup_cause']:$dataVariable['hangup_cause'];
50
-	}else{
49
+		$hangup_cause = isset($dataVariable['last_bridge_hangup_cause']) ? $dataVariable['last_bridge_hangup_cause'] : $dataVariable['hangup_cause'];
50
+	} else {
51 51
 		$hangup_cause = $dataVariable['hangup_cause'];
52 52
 	}   
53 53
 
54 54
 	if ($dataVariable['error_cdr'] == '1')
55 55
 	{
56 56
 		//Get actual hangup cause 
57
-		$hangup_cause= (isset($dataVariable['error_cdr'])) ? $dataVariable['last_bridge_hangup_cause'] : (isset($dataVariable['last_bridge_hangup_cause'])?$dataVariable['last_bridge_hangup_cause']:$dataVariable['hangup_cause']); 
57
+		$hangup_cause = (isset($dataVariable['error_cdr'])) ? $dataVariable['last_bridge_hangup_cause'] : (isset($dataVariable['last_bridge_hangup_cause']) ? $dataVariable['last_bridge_hangup_cause'] : $dataVariable['hangup_cause']); 
58 58
 	}
59 59
 
60 60
 	/*#### PATCH FOR ONE WAY AUDIO ####*/
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	/*#### ************* END *************####*/
66 66
 
67 67
 	//Don't thing this will be useful anytime. Need to remove it after testing. 
68
-	if($hangup_cause == "NONE")
68
+	if ($hangup_cause == "NONE")
69 69
 	{
70 70
 		$hangup_cause = $dataVariable['current_application_data'];
71 71
 	}
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
 	$actual_calltype = $dataVariable['calltype'];
87 87
 	
88 88
 	//Normalize origination and termination rates array 		   
89
-	if(isset($dataVariable['origination_rates']))
89
+	if (isset($dataVariable['origination_rates']))
90 90
 	   $origination_rate = normalize_origination_rate($dataVariable['origination_rates']);
91
-	if(isset($dataVariable['termination_rates']))
91
+	if (isset($dataVariable['termination_rates']))
92 92
 	   $termination_rate = normalize_rate($dataVariable['termination_rates']);
93 93
 
94 94
 	//If receiver account id found then explicitly set call direction and call type 
95
-	if(isset($dataVariable['receiver_accid']))
95
+	if (isset($dataVariable['receiver_accid']))
96 96
 	{
97 97
 		$dataVariable['call_direction'] = "outbound";
98 98
 		$dataVariable['calltype'] = "STANDARD";
@@ -101,23 +101,23 @@  discard block
 block discarded – undo
101 101
 	//Check if cusotmer have any package seconds left to use
102 102
 	if ($actual_duration > 0)			
103 103
 	{
104
-			$package_array = package_calculation( $dataVariable['effective_destination_number'],$origination_rate[$accountid]['RATEGROUP'],$actual_duration,$dataVariable['call_direction'],$accountid,$db,$logger);
105
-			if(!empty($package_array))
104
+			$package_array = package_calculation($dataVariable['effective_destination_number'], $origination_rate[$accountid]['RATEGROUP'], $actual_duration, $dataVariable['call_direction'], $accountid, $db, $logger);
105
+			if ( ! empty($package_array))
106 106
 			{
107 107
 				$dataVariable['calltype'] = "FREE";
108
-				$dataVariable['package_id']= $package_array['package_id'];
108
+				$dataVariable['package_id'] = $package_array['package_id'];
109 109
 			}
110 110
 	}
111 111
 	
112 112
 	//Calculate debit of customer call 			
113
-	$debit = calc_cost($dataVariable,$origination_rate[$accountid],$logger,$decimal_points);
113
+	$debit = calc_cost($dataVariable, $origination_rate[$accountid], $logger, $decimal_points);
114 114
 
115 115
 	//Calculate cost for customer call for provider
116
-	$provider_cost = calc_cost($dataVariable,$termination_rate,$logger,$decimal_points);
116
+	$provider_cost = calc_cost($dataVariable, $termination_rate, $logger, $decimal_points);
117 117
 
118 118
 	//Calculate parent cost if customer have any parent 
119
-	$parent_cost = ($parentid > 0) ? calc_cost($dataVariable,$origination_rate[$parentid],$logger,$decimal_points) : $provider_cost;
120
-	$logger->log("Debit :".$debit ." Cost : ".$cost ." Provider Cost : ".$parent_cost);
119
+	$parent_cost = ($parentid > 0) ? calc_cost($dataVariable, $origination_rate[$parentid], $logger, $decimal_points) : $provider_cost;
120
+	$logger->log("Debit :".$debit." Cost : ".$cost." Provider Cost : ".$parent_cost);
121 121
     
122 122
 	//Initialize final cost variable to use for billing
123 123
 	$cost = ($parent_cost > 0) ? $parent_cost : $provider_cost;    
@@ -125,33 +125,33 @@  discard block
 block discarded – undo
125 125
 	//Outbound call entry for all type of calls 
126 126
 	$logger->log("*********************** OUTBOUND CALL ENTRY START *************");
127 127
 
128
-	$cdr_string = get_cdr_string($dataVariable,$accountid,$account_type,$actual_duration,$termination_rate,$origination_rate,$provider_cost,$parentid,$debit,$cost,$logger);
128
+	$cdr_string = get_cdr_string($dataVariable, $accountid, $account_type, $actual_duration, $termination_rate, $origination_rate, $provider_cost, $parentid, $debit, $cost, $logger);
129 129
 
130 130
 	$query = "INSERT INTO cdrs (uniqueid,accountid,type,callerid,callednum,billseconds,trunk_id,trunkip,callerip,disposition,callstart,debit,cost,provider_id,pricelist_id,package_id,pattern,notes,rate_cost,reseller_id,reseller_code,reseller_code_destination,reseller_cost,provider_code,provider_code_destination,provider_cost,provider_call_cost,call_direction,calltype,profile_start_stamp,answer_stamp,bridge_stamp,progress_stamp,progress_media_stamp,end_stamp,billmsec,answermsec,waitmsec,progress_mediamsec,flow_billmsec)  values ($cdr_string)";
131 131
 	$logger->log($query);
132 132
 	$db->run($query);
133 133
 	
134 134
 	//Update customer balance
135
-	if($debit > 0 && $dataVariable['calltype'] != "FREE")
135
+	if ($debit > 0 && $dataVariable['calltype'] != "FREE")
136 136
 	{
137 137
 		update_balance($accountid, $debit, 0, $logger, $db);
138 138
 	}
139 139
 
140 140
 	//Update parent or provider balance
141
-	if($parent_cost > 0){
141
+	if ($parent_cost > 0) {
142 142
 		update_balance($termination_rate['PROVIDER'], ($parent_cost * -1), 3, $logger, $db);
143 143
 	}
144 144
 
145 145
 	//Resellers CDR entry
146 146
 	$flag_parent = false;
147
-	insert_parent_data($dataVariable,$actual_calltype,$parentid,$origination_rate,$actual_duration,$provider_cost,$flag_parent,$logger,$db,$decimal_points);
147
+	insert_parent_data($dataVariable, $actual_calltype, $parentid, $origination_rate, $actual_duration, $provider_cost, $flag_parent, $logger, $db, $decimal_points);
148 148
 
149 149
 	$logger->log("*********************** OUTBOUND CALL ENTRY END *************");
150 150
 
151 151
    
152 152
 	//************ ADDING EXTRA ENTRY For local/DID Inbound call ****************************
153
-	$receiver_parentid=0;
154
-	if(isset($dataVariable['receiver_accid']) && $dataVariable['receiver_accid'] != "")
153
+	$receiver_parentid = 0;
154
+	if (isset($dataVariable['receiver_accid']) && $dataVariable['receiver_accid'] != "")
155 155
 	{
156 156
 		$logger->log("*********************** EXTRA ENTRY SECTION FOR BILLING START *************");            
157 157
 
@@ -160,12 +160,12 @@  discard block
 block discarded – undo
160 160
 		$dataVariable['calltype'] = "DID";
161 161
 
162 162
     //Override variables if call for DID PSTN
163
-    if(isset($dataVariable['caller_did_account_id']))
163
+    if (isset($dataVariable['caller_did_account_id']))
164 164
     {
165 165
         $dataVariable['receiver_accid'] = $dataVariable['caller_did_account_id'];
166 166
     		$dataVariable['call_direction'] = "outbound";
167 167
         $dataVariable['calltype'] = "STANDARD";
168
-	      $dataVariable['effective_destination_number']=$dataVariable['sip_to_user'];
168
+	      $dataVariable['effective_destination_number'] = $dataVariable['sip_to_user'];
169 169
         unset($termination_rate);
170 170
         unset($provider_cost);
171 171
      }
@@ -173,17 +173,17 @@  discard block
 block discarded – undo
173 173
         
174 174
 
175 175
 		//Get call receiver account information 
176
-		$receiver_carddata = get_accounts($dataVariable['receiver_accid'],$logger,$db);
176
+		$receiver_carddata = get_accounts($dataVariable['receiver_accid'], $logger, $db);
177 177
 		$receiver_parentid = $receiver_carddata['reseller_id'];
178 178
 
179 179
 		//For additional cdr entry of receiver
180
-		insert_extra_receiver_entry($dataVariable,$origination_rate,$termination_rate,$account_type,$actual_duration,$provider_cost,$receiver_parentid,$flag_parent,$dataVariable['receiver_accid'],$logger,$db,$decimal_points);
180
+		insert_extra_receiver_entry($dataVariable, $origination_rate, $termination_rate, $account_type, $actual_duration, $provider_cost, $receiver_parentid, $flag_parent, $dataVariable['receiver_accid'], $logger, $db, $decimal_points);
181 181
 
182 182
 		$flag_parent = true;
183 183
 		$dataVariable['uuid'] = $dataVariable['uuid'].$dataVariable['calltype']."_".$receiver_parentid;
184 184
 
185 185
 		//Insert parent reseller cdr
186
-		insert_parent_data($dataVariable,$actual_calltype,$receiver_parentid,$origination_rate,$actual_duration,$provider_cost,$flag_parent,$logger,$db,$decimal_points);
186
+		insert_parent_data($dataVariable, $actual_calltype, $receiver_parentid, $origination_rate, $actual_duration, $provider_cost, $flag_parent, $logger, $db, $decimal_points);
187 187
 		$logger->log("*********************** EXTRA ENTRY SECTION FOR BILLING END *************");            
188 188
 	}
189 189
 	//*****************************************************************************************
@@ -195,16 +195,16 @@  discard block
 block discarded – undo
195 195
  * @param string $provider_cost
196 196
  * @param boolean $flag_parent
197 197
  */
198
-function insert_parent_data($dataVariable,$actual_calltype,$parentid,$origination_rate,$actual_duration,$provider_cost,$flag_parent,$logger,$db,$decimal_points)
198
+function insert_parent_data($dataVariable, $actual_calltype, $parentid, $origination_rate, $actual_duration, $provider_cost, $flag_parent, $logger, $db, $decimal_points)
199 199
 {
200
-	while($parentid > 0 )
200
+	while ($parentid > 0)
201 201
 	{
202 202
 		$logger->log("*************** IN PARENT DATA SECTION ********");
203 203
 		$dataVariable['calltype'] = $actual_calltype;
204
-		$carddata = get_accounts($parentid,$logger,$db);
204
+		$carddata = get_accounts($parentid, $logger, $db);
205 205
 		$accountid = $carddata['id'];
206 206
 
207
-		$debit = calc_cost($dataVariable,$origination_rate[$accountid],$logger,$decimal_points);
207
+		$debit = calc_cost($dataVariable, $origination_rate[$accountid], $logger, $decimal_points);
208 208
 
209 209
 		//If receiver account id found then explicitly set call direction and call type
210 210
 		/*if(isset($dataVariable['receiver_accid']))
@@ -214,31 +214,31 @@  discard block
 block discarded – undo
214 214
         }*/
215 215
 
216 216
 		//Check if reseller have any package seconds left to use        
217
-		if ($actual_duration > 0)		{
218
-			$package_array = package_calculation( $dataVariable['effective_destination_number'],$origination_rate[$accountid]['RATEGROUP'],$actual_duration,$dataVariable['call_direction'],$accountid,$db,$logger);
219
-			if(!empty($package_array))
217
+		if ($actual_duration > 0) {
218
+			$package_array = package_calculation($dataVariable['effective_destination_number'], $origination_rate[$accountid]['RATEGROUP'], $actual_duration, $dataVariable['call_direction'], $accountid, $db, $logger);
219
+			if ( ! empty($package_array))
220 220
 			{
221 221
 				$dataVariable['calltype'] = "FREE";
222
-				$dataVariable['package_id']= $package_array['package_id'];
222
+				$dataVariable['package_id'] = $package_array['package_id'];
223 223
 			}
224 224
 		}	
225 225
 
226 226
 		//Get parent id for cost calculation 
227 227
 		$parentid = $carddata['reseller_id'];
228
-		$parent_cost = ($parentid > 0) ? calc_cost($dataVariable,$origination_rate[$parentid],$logger,$decimal_points) : $provider_cost;
228
+		$parent_cost = ($parentid > 0) ? calc_cost($dataVariable, $origination_rate[$parentid], $logger, $decimal_points) : $provider_cost;
229 229
 		$cost = ($parent_cost > 0) ? $parent_cost : $provider_cost;
230 230
 	
231
-		if(isset($dataVariable['receiver_accid']) && $dataVariable['receiver_accid'] != "" && $flag_parent == true)
231
+		if (isset($dataVariable['receiver_accid']) && $dataVariable['receiver_accid'] != "" && $flag_parent == true)
232 232
 		{
233 233
 			$logger->log("********* IN RESELLER FOR RECEIVER ENTRY START ******");
234 234
 			$flag_parent = true;
235
-			insert_extra_receiver_entry($dataVariable,$origination_rate,$termination_rate,$account_type,$actual_duration,$provider_cost,$parentid,$flag_parent,$accountid,$logger,$db,$decimal_points);
235
+			insert_extra_receiver_entry($dataVariable, $origination_rate, $termination_rate, $account_type, $actual_duration, $provider_cost, $parentid, $flag_parent, $accountid, $logger, $db, $decimal_points);
236 236
 			$logger->log("********* IN RESELLER FOR RECEIVER ENTRY END ******");
237 237
 			//return true;	
238 238
 
239
-		} else{
239
+		} else {
240 240
 
241
-			$cdr_string = get_reseller_cdr_string($dataVariable,$accountid,$account_type,$actual_duration,$termination_rate,$origination_rate,$provider_cost,$parentid,$debit,$cost);	
241
+			$cdr_string = get_reseller_cdr_string($dataVariable, $accountid, $account_type, $actual_duration, $termination_rate, $origination_rate, $provider_cost, $parentid, $debit, $cost);	
242 242
 
243 243
  			$query = "INSERT INTO reseller_cdrs (uniqueid,accountid,callerid,callednum,billseconds,disposition,callstart,debit,cost,pricelist_id,package_id,pattern,notes,rate_cost,
244 244
 		reseller_id,reseller_code,reseller_code_destination,reseller_cost,call_direction,calltype) values ($cdr_string)";
@@ -259,38 +259,38 @@  discard block
 block discarded – undo
259 259
 /**
260 260
  * @param boolean $flag_parent
261 261
  */
262
-function insert_extra_receiver_entry($dataVariable,$origination_rate,$termination_rate,$account_type,$actual_duration,$provider_cost,$parentid,$flag_parent,$accountid,$logger,$db,$decimal_points)
262
+function insert_extra_receiver_entry($dataVariable, $origination_rate, $termination_rate, $account_type, $actual_duration, $provider_cost, $parentid, $flag_parent, $accountid, $logger, $db, $decimal_points)
263 263
 {
264 264
 		$localVariable = $dataVariable;
265 265
 		$localVariable['call_direction'] = "inbound";
266 266
 		$localVariable['uuid'] = $localVariable['uuid'].$dataVariable['calltype']."_".$accountid;
267 267
 		
268
-		if($dataVariable['calltype'] == "LOCAL")
268
+		if ($dataVariable['calltype'] == "LOCAL")
269 269
 		{
270 270
 			$origination_rate[$accountid]['CODE'] = $dataVariable['effective_destination_number'];
271 271
 			$origination_rate[$accountid]['DESTINATION'] = $dataVariable['calltype'];
272
-			if($flag_parent == false){
273
-				$cdr_string = get_cdr_string($localVariable,$accountid,$account_type,$actual_duration,$termination_rate,$origination_rate,$provider_cost,$parentid,0,0,$logger);
274
-			} else{
275
-				$cdr_string = get_reseller_cdr_string($dataVariable,$accountid,$account_type,$actual_duration,$termination_rate,$origination_rate,$provider_cost,$parentid,$debit,$cost);
272
+			if ($flag_parent == false) {
273
+				$cdr_string = get_cdr_string($localVariable, $accountid, $account_type, $actual_duration, $termination_rate, $origination_rate, $provider_cost, $parentid, 0, 0, $logger);
274
+			} else {
275
+				$cdr_string = get_reseller_cdr_string($dataVariable, $accountid, $account_type, $actual_duration, $termination_rate, $origination_rate, $provider_cost, $parentid, $debit, $cost);
276 276
 			}
277
-		} else{
277
+		} else {
278 278
 
279 279
 			$origination_rate_did = normalize_origination_rate($dataVariable['origination_rates_did']);
280
-			$debit = calc_cost($dataVariable,$origination_rate_did[$accountid],$logger,$decimal_points);
280
+			$debit = calc_cost($dataVariable, $origination_rate_did[$accountid], $logger, $decimal_points);
281 281
 
282
-			if($flag_parent == false){
282
+			if ($flag_parent == false) {
283 283
 				
284
-				$cdr_string = get_cdr_string($localVariable,$accountid,$account_type,$actual_duration,$termination_rate,$origination_rate_did,$provider_cost,$parentid,$debit,0,$logger);
285
-			} else{
286
-				$cdr_string = get_reseller_cdr_string($dataVariable,$accountid,$account_type,$actual_duration,$termination_rate,$origination_rate,$provider_cost,$parentid,$debit,$cost);
284
+				$cdr_string = get_cdr_string($localVariable, $accountid, $account_type, $actual_duration, $termination_rate, $origination_rate_did, $provider_cost, $parentid, $debit, 0, $logger);
285
+			} else {
286
+				$cdr_string = get_reseller_cdr_string($dataVariable, $accountid, $account_type, $actual_duration, $termination_rate, $origination_rate, $provider_cost, $parentid, $debit, $cost);
287 287
 			}
288 288
 		}
289 289
 	  
290
-		if($flag_parent == false)
290
+		if ($flag_parent == false)
291 291
 		{
292 292
 			$query = "INSERT INTO cdrs(uniqueid,accountid,type,callerid,callednum,billseconds,trunk_id,trunkip,callerip,disposition,callstart,debit,cost,provider_id,pricelist_id,package_id,pattern,notes,rate_cost,reseller_id,reseller_code,reseller_code_destination,reseller_cost,provider_code,provider_code_destination,provider_cost,provider_call_cost,call_direction,calltype,profile_start_stamp,answer_stamp,bridge_stamp,progress_stamp,progress_media_stamp,end_stamp,billmsec,answermsec,waitmsec,progress_mediamsec,flow_billmsec) values ($cdr_string)";
293
-		} else{
293
+		} else {
294 294
 			$query = "INSERT INTO reseller_cdrs (uniqueid,accountid,callerid,callednum,billseconds,disposition,callstart,debit,cost,pricelist_id,package_id,pattern,notes,rate_cost,
295 295
 	reseller_id,reseller_code,reseller_code_destination,reseller_cost,call_direction,calltype) values ($cdr_string)";
296 296
 		}
@@ -306,20 +306,20 @@  discard block
 block discarded – undo
306 306
 }
307 307
 
308 308
 //Generate CDR string for insert query for customer.
309
-function get_cdr_string($dataVariable,$accountid,$account_type,$actual_duration,$termination_rate,$origination_rate,$provider_cost,$parentid,$debit,$cost,$logger)
309
+function get_cdr_string($dataVariable, $accountid, $account_type, $actual_duration, $termination_rate, $origination_rate, $provider_cost, $parentid, $debit, $cost, $logger)
310 310
 {
311
-   	$dataVariable['calltype'] = ($dataVariable['calltype'] == 'DID-LOCAL' || $dataVariable['calltype'] == 'SIP-DID' || $dataVariable['calltype'] == 'OTHER')?"DID":$dataVariable['calltype'];
312
-		$callerIdNumber = isset($dataVariable['effective_caller_id_number']) && !empty($dataVariable['effective_caller_id_number'])? $dataVariable['effective_caller_id_number'] :$dataVariable['caller_id'];
313
-		return  $cdr_string = "'".($dataVariable['uuid'])."','".$accountid."','".$account_type."','".(urldecode($callerIdNumber))."','".($dataVariable['effective_destination_number'])."','".$actual_duration."',".(($termination_rate['TRUNK']) ? $termination_rate['TRUNK'] : '0').",".(($dataVariable['sip_via_host']) ? "'".$dataVariable['sip_via_host']."'" : '""').",".(($dataVariable['sip_contact_host']) ? "'".$dataVariable['sip_contact_host']."'" : '""').",'".($dataVariable['hangup_cause'])."','".urldecode($dataVariable['callstart'])."','".$debit."','".$cost."',".(($termination_rate['PROVIDER']) ? $termination_rate['PROVIDER'] : '0').",'".$origination_rate[$accountid]['RATEGROUP']."','".$dataVariable['package_id']."','".($origination_rate[$accountid]['CODE'])."',".(($origination_rate[$accountid]['DESTINATION']) ? "'".htmlentities($origination_rate[$accountid]['DESTINATION'],ENT_COMPAT, 'UTF-8')."'" : "'".''."'").",".(($origination_rate[$accountid]['COST']) ? "'".$origination_rate[$accountid]['COST']."'" : "'".'0'."'").",'".$parentid."',".(($origination_rate[$parentid]['CODE'] ) ? "'".$origination_rate[$parentid]['CODE']."'" : "'".'0'."'").",".(($origination_rate[$parentid]['DESTINATION']) ?  "'".$origination_rate[$parentid]['DESTINATION']."'" : "'".''."'").",".(($origination_rate[$parentid]['COST']) ?  "'".$origination_rate[$parentid]['COST']."'" :  '0').",".(($termination_rate['CODE']) ? "'".$termination_rate['CODE']."'" : "'".''."'" ).",".(($termination_rate['DESTINATION']) ? "'".$termination_rate['DESTINATION']."'" : "'".''."'").",".(($termination_rate['COST']) ? "'".$termination_rate['COST']."'" : '0').",'".$provider_cost."',".(($dataVariable['call_direction']) ? "'".$dataVariable['call_direction']."'" : "'internal'").",'".($dataVariable['calltype'])."','".convert_to_gmt(urldecode($dataVariable['profile_start_stamp']))."','".convert_to_gmt(urldecode($dataVariable['answer_stamp']))."','".convert_to_gmt(urldecode($dataVariable['bridge_stamp']))."','".convert_to_gmt(urldecode(@$dataVariable['progress_stamp']))."','".convert_to_gmt(urldecode(@$dataVariable['progress_media_stamp']))."','".convert_to_gmt(urldecode($dataVariable['end_stamp']))."',".$dataVariable['billmsec'].",'".$dataVariable['answermsec']."','".$dataVariable['waitmsec']."','".$dataVariable['progress_mediamsec']."','".$dataVariable['flow_billmsec']."'";
311
+   	$dataVariable['calltype'] = ($dataVariable['calltype'] == 'DID-LOCAL' || $dataVariable['calltype'] == 'SIP-DID' || $dataVariable['calltype'] == 'OTHER') ? "DID" : $dataVariable['calltype'];
312
+		$callerIdNumber = isset($dataVariable['effective_caller_id_number']) && ! empty($dataVariable['effective_caller_id_number']) ? $dataVariable['effective_caller_id_number'] : $dataVariable['caller_id'];
313
+		return  $cdr_string = "'".($dataVariable['uuid'])."','".$accountid."','".$account_type."','".(urldecode($callerIdNumber))."','".($dataVariable['effective_destination_number'])."','".$actual_duration."',".(($termination_rate['TRUNK']) ? $termination_rate['TRUNK'] : '0').",".(($dataVariable['sip_via_host']) ? "'".$dataVariable['sip_via_host']."'" : '""').",".(($dataVariable['sip_contact_host']) ? "'".$dataVariable['sip_contact_host']."'" : '""').",'".($dataVariable['hangup_cause'])."','".urldecode($dataVariable['callstart'])."','".$debit."','".$cost."',".(($termination_rate['PROVIDER']) ? $termination_rate['PROVIDER'] : '0').",'".$origination_rate[$accountid]['RATEGROUP']."','".$dataVariable['package_id']."','".($origination_rate[$accountid]['CODE'])."',".(($origination_rate[$accountid]['DESTINATION']) ? "'".htmlentities($origination_rate[$accountid]['DESTINATION'], ENT_COMPAT, 'UTF-8')."'" : "'".''."'").",".(($origination_rate[$accountid]['COST']) ? "'".$origination_rate[$accountid]['COST']."'" : "'".'0'."'").",'".$parentid."',".(($origination_rate[$parentid]['CODE']) ? "'".$origination_rate[$parentid]['CODE']."'" : "'".'0'."'").",".(($origination_rate[$parentid]['DESTINATION']) ? "'".$origination_rate[$parentid]['DESTINATION']."'" : "'".''."'").",".(($origination_rate[$parentid]['COST']) ? "'".$origination_rate[$parentid]['COST']."'" : '0').",".(($termination_rate['CODE']) ? "'".$termination_rate['CODE']."'" : "'".''."'").",".(($termination_rate['DESTINATION']) ? "'".$termination_rate['DESTINATION']."'" : "'".''."'").",".(($termination_rate['COST']) ? "'".$termination_rate['COST']."'" : '0').",'".$provider_cost."',".(($dataVariable['call_direction']) ? "'".$dataVariable['call_direction']."'" : "'internal'").",'".($dataVariable['calltype'])."','".convert_to_gmt(urldecode($dataVariable['profile_start_stamp']))."','".convert_to_gmt(urldecode($dataVariable['answer_stamp']))."','".convert_to_gmt(urldecode($dataVariable['bridge_stamp']))."','".convert_to_gmt(urldecode(@$dataVariable['progress_stamp']))."','".convert_to_gmt(urldecode(@$dataVariable['progress_media_stamp']))."','".convert_to_gmt(urldecode($dataVariable['end_stamp']))."',".$dataVariable['billmsec'].",'".$dataVariable['answermsec']."','".$dataVariable['waitmsec']."','".$dataVariable['progress_mediamsec']."','".$dataVariable['flow_billmsec']."'";
314 314
 }
315 315
 
316 316
 //Generate CDR string for insert query for reseller
317
-function get_reseller_cdr_string($dataVariable,$accountid,$account_type,$actual_duration,$termination_rate,$origination_rate,$provider_cost,$parentid,$debit,$cost)
317
+function get_reseller_cdr_string($dataVariable, $accountid, $account_type, $actual_duration, $termination_rate, $origination_rate, $provider_cost, $parentid, $debit, $cost)
318 318
 {
319
-        $dataVariable['calltype'] = ($dataVariable['calltype'] == 'DID-LOCAL' || $dataVariable['calltype'] == 'SIP-DID' || $dataVariable['calltype'] == 'OTHER')?"DID":$dataVariable['calltype'];
320
-	$callerIdNumber = isset($dataVariable['effective_caller_id_number']) && !empty($dataVariable['effective_caller_id_number'])? $dataVariable['effective_caller_id_number'] :$dataVariable['caller_id'];
319
+        $dataVariable['calltype'] = ($dataVariable['calltype'] == 'DID-LOCAL' || $dataVariable['calltype'] == 'SIP-DID' || $dataVariable['calltype'] == 'OTHER') ? "DID" : $dataVariable['calltype'];
320
+	$callerIdNumber = isset($dataVariable['effective_caller_id_number']) && ! empty($dataVariable['effective_caller_id_number']) ? $dataVariable['effective_caller_id_number'] : $dataVariable['caller_id'];
321 321
 	
322
-	return $cdr_string = "'".($dataVariable['uuid'])."','".$accountid."','".(urldecode($callerIdNumber))."','".($dataVariable['effective_destination_number'])."','".$actual_duration."','".($dataVariable['hangup_cause'])."','".convert_to_gmt(urldecode($dataVariable['callstart']))."','".$debit."','".$cost."','".$origination_rate[$accountid]['RATEGROUP']."','".$dataVariable['package_id']."','".($origination_rate[$accountid]['CODE'])."',".(($origination_rate[$accountid]['DESTINATION']) ? "'".$origination_rate[$accountid]['DESTINATION']."'" : "'".''."'").",".(($origination_rate[$accountid]['COST']) ? "'".$origination_rate[$accountid]['COST']."'" : "'".'0'."'").",'".$parentid."',".(($origination_rate[$parentid]['CODE'] ) ? "'".$origination_rate[$parentid]['CODE']."'" : "'".'0'."'").",".(($origination_rate[$parentid]['DESTINATION']) ?  "'".$origination_rate[$parentid]['DESTINATION']."'" : "'".''."'").",".(($origination_rate[$parentid]['COST']) ?  "'".$origination_rate[$parentid]['COST']."'" :  '0').",".(($dataVariable['call_direction']) ? "'".$dataVariable['call_direction']."'" : "'internal'").",'".($dataVariable['calltype'])."'";
322
+	return $cdr_string = "'".($dataVariable['uuid'])."','".$accountid."','".(urldecode($callerIdNumber))."','".($dataVariable['effective_destination_number'])."','".$actual_duration."','".($dataVariable['hangup_cause'])."','".convert_to_gmt(urldecode($dataVariable['callstart']))."','".$debit."','".$cost."','".$origination_rate[$accountid]['RATEGROUP']."','".$dataVariable['package_id']."','".($origination_rate[$accountid]['CODE'])."',".(($origination_rate[$accountid]['DESTINATION']) ? "'".$origination_rate[$accountid]['DESTINATION']."'" : "'".''."'").",".(($origination_rate[$accountid]['COST']) ? "'".$origination_rate[$accountid]['COST']."'" : "'".'0'."'").",'".$parentid."',".(($origination_rate[$parentid]['CODE']) ? "'".$origination_rate[$parentid]['CODE']."'" : "'".'0'."'").",".(($origination_rate[$parentid]['DESTINATION']) ? "'".$origination_rate[$parentid]['DESTINATION']."'" : "'".''."'").",".(($origination_rate[$parentid]['COST']) ? "'".$origination_rate[$parentid]['COST']."'" : '0').",".(($dataVariable['call_direction']) ? "'".$dataVariable['call_direction']."'" : "'internal'").",'".($dataVariable['calltype'])."'";
323 323
 }
324 324
 
325 325
 //Update user balance
@@ -328,8 +328,8 @@  discard block
 block discarded – undo
328 328
  */
329 329
 function update_balance($user_id, $amount, $entity_id, $logger, $db) {
330 330
     $math_sign = ($entity_id == 0 || $entity_id == 1) ? '-' : '+';
331
-    $query = "UPDATE accounts SET balance=balance-" . $amount . " WHERE id=" . $user_id;
332
-    $logger->log("Balance update : " . $query);
331
+    $query = "UPDATE accounts SET balance=balance-".$amount." WHERE id=".$user_id;
332
+    $logger->log("Balance update : ".$query);
333 333
     $db->run($query);
334 334
 }
335 335
 
@@ -388,46 +388,46 @@  discard block
 block discarded – undo
388 388
     
389 389
 			if ($billseconds > 0)
390 390
 			{
391
-				$call_cost += (ceil($billseconds/$rates['INC'])*$rates['INC'])*($rates['COST']/60);
391
+				$call_cost += (ceil($billseconds / $rates['INC']) * $rates['INC']) * ($rates['COST'] / 60);
392 392
 			}
393 393
 	}
394
-	$call_cost = number_format($call_cost,$decimal_points);
394
+	$call_cost = number_format($call_cost, $decimal_points);
395 395
 	$logger->log("Return cost ".$call_cost);
396 396
 	return $call_cost;
397 397
 }
398 398
 
399 399
 // get intial package information
400
-function package_calculation($destination_number,$pricelist_id,$duration,$call_direction,$accountid,$db,$logger)
400
+function package_calculation($destination_number, $pricelist_id, $duration, $call_direction, $accountid, $db, $logger)
401 401
 {
402 402
 	$package_array = array();
403
-	$custom_destination = number_loop($destination_number,"patterns",$db);
403
+	$custom_destination = number_loop($destination_number, "patterns", $db);
404 404
 
405 405
 	$query = "SELECT * FROM packages  as P inner join package_patterns as PKGPTR on P.id = PKGPTR.package_id WHERE ".$custom_destination." AND status = 0 AND pricelist_id = ".$pricelist_id." ORDER BY LENGTH(PKGPTR.patterns) DESC LIMIT 1";
406 406
 
407 407
 	$package_info = $db->run($query);
408
-	if($package_info){
408
+	if ($package_info) {
409 409
 		$package_info = $package_info[0];
410 410
 
411
-		if( ($package_info['applicable_for'] == "0" && $call_direction == "outbound") || ($package_info['applicable_for'] == "1" && $call_direction == "inbound") || ($package_info['applicable_for'] == "2") ) {
411
+		if (($package_info['applicable_for'] == "0" && $call_direction == "outbound") || ($package_info['applicable_for'] == "1" && $call_direction == "inbound") || ($package_info['applicable_for'] == "2")) {
412 412
 	
413
-			$counter_info =  get_counters($accountid,$package_info['package_id'],$db,$logger);
413
+			$counter_info = get_counters($accountid, $package_info['package_id'], $db, $logger);
414 414
 
415
-			if(!$counter_info) {
415
+			if ( ! $counter_info) {
416 416
 				$Insert_Query = "INSERT INTO counters (package_id,accountid) VALUES (".$package_info['package_id'].",".$accountid.")";		
417
-				$logger->log("Insert Counters  : " . $Insert_query);
417
+				$logger->log("Insert Counters  : ".$Insert_query);
418 418
 				$db->run($Insert_Query);
419
-				$counter_info =  get_counters($accountid,$package_info['package_id'],$db,$logger);
419
+				$counter_info = get_counters($accountid, $package_info['package_id'], $db, $logger);
420 420
 				
421 421
 			}	
422 422
 			//print_r($counter_info);
423
-			if ( $package_info['includedseconds'] > ($counter_info['seconds'] )) {
423
+			if ($package_info['includedseconds'] > ($counter_info['seconds'])) {
424 424
 				$availableseconds = $package_info['includedseconds'] - $counter_info['seconds'];
425 425
 				$freeseconds = ($availableseconds >= $duration) ? $duration : $availableseconds;
426 426
 				$duration = ($availableseconds >= $duration) ? $duration : $availableseconds;
427
-				$update_query = "UPDATE counters SET seconds = ".($counter_info['seconds'] + $freeseconds ). " WHERE id = ". $counter_info['id'];
428
-				$logger->log("Update Counters  : " . $update_query);
427
+				$update_query = "UPDATE counters SET seconds = ".($counter_info['seconds'] + $freeseconds)." WHERE id = ".$counter_info['id'];
428
+				$logger->log("Update Counters  : ".$update_query);
429 429
 				$db->run($update_query);
430
-				$package_array['package_id']= $package_info['package_id'];
430
+				$package_array['package_id'] = $package_info['package_id'];
431 431
 				$package_array['calltype'] = "FREE";
432 432
 			}						
433 433
 		} 
@@ -436,21 +436,21 @@  discard block
 block discarded – undo
436 436
 } 
437 437
 
438 438
 // Getting used package minutes in counter table
439
-function get_counters($accountid,$package_id,$db,$logger)
439
+function get_counters($accountid, $package_id, $db, $logger)
440 440
 {
441 441
 	$query_counter = "SELECT id,seconds FROM counters  WHERE  accountid = ".$accountid." AND package_id = ".$package_id." AND status=1 LIMIT 1";
442 442
 	$counter = $db->run($query_counter);
443
-	$logger->log("GET Counters  : " . $query_counter);
444
-	if($counter)
443
+	$logger->log("GET Counters  : ".$query_counter);
444
+	if ($counter)
445 445
 		return $counter[0];	
446 446
 	else
447 447
 		return "";
448 448
 }
449 449
 
450 450
 //Get user info
451
-function get_accounts($parent_id,$logger, $db) {
452
-	$query = "SELECT * FROM accounts WHERE id=" . $parent_id;
453
-	$logger->log("GET configuration  : " . $query);
451
+function get_accounts($parent_id, $logger, $db) {
452
+	$query = "SELECT * FROM accounts WHERE id=".$parent_id;
453
+	$logger->log("GET configuration  : ".$query);
454 454
 	$res_user = $db->run($query);
455 455
 	return $res_user[0];
456 456
 }
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 {
461 461
 	$query = "SELECT name,value FROM system WHERE name='decimal_points' and group_title = 'global'";
462 462
 	$config = $db->run($query);
463
-	$logger->log("GET configuration  : " . $query);
463
+	$logger->log("GET configuration  : ".$query);
464 464
 	return $config[0];
465 465
 }
466 466
 
@@ -468,16 +468,16 @@  discard block
 block discarded – undo
468 468
 /**
469 469
  * @param string $field
470 470
  */
471
-function number_loop($destination,$field,$db)
471
+function number_loop($destination, $field, $db)
472 472
 {
473
-	$max_len_prefix  = strlen($destination);
473
+	$max_len_prefix = strlen($destination);
474 474
 	$number_prefix = '(';
475
-	while ($max_len_prefix  > 0)
475
+	while ($max_len_prefix > 0)
476 476
 	{
477
-		$number_prefix .= "$field='^".substr($destination,0,$max_len_prefix).".*' OR ";
477
+		$number_prefix .= "$field='^".substr($destination, 0, $max_len_prefix).".*' OR ";
478 478
 		$max_len_prefix--;
479 479
 	}
480
-	$number_prefix .= "$field='^defaultprefix.*')";//echo $number_prefix;exit;
480
+	$number_prefix .= "$field='^defaultprefix.*')"; //echo $number_prefix;exit;
481 481
 	return $number_prefix;
482 482
 }
483 483
 
@@ -487,6 +487,6 @@  discard block
 block discarded – undo
487 487
  */
488 488
 function convert_to_gmt($date)
489 489
 {
490
-	return gmdate('Y-m-d H:i:s', strtotime($date) );
490
+	return gmdate('Y-m-d H:i:s', strtotime($date));
491 491
 }
492 492
 ?>
Please login to merge, or discard this patch.
web_interface/astpp/application/controllers/generateInvoice.php 1 patch
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -115,6 +115,10 @@
 block discarded – undo
115 115
         $this->process_invoice($account_value, $start_date, $end_date);
116 116
     }
117 117
 
118
+    /**
119
+     * @param string $start_date
120
+     * @param string $end_date
121
+     */
118 122
     function process_invoice($accountdata, $start_date, $end_date) {
119 123
         //Get Invoice configuration using single query instead of multiple queries.
120 124
         $invoice_conf = array();
Please login to merge, or discard this patch.
web_interface/astpp/application/controllers/updateBalance.php 1 patch
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -43,6 +43,10 @@  discard block
 block discarded – undo
43 43
         }
44 44
     }
45 45
 
46
+    /**
47
+     * @param string $startdate
48
+     * @param string $enddate
49
+     */
46 50
     function process_subscriptions($accountinfo, $startdate, $enddate, $Manualflg = false) {
47 51
 //        Defined Original Sweep it for calculation start date for first time.
48 52
         $accountinfo['original_sweep_id'] = $accountinfo['sweep_id'];
@@ -101,6 +105,10 @@  discard block
 block discarded – undo
101 105
         }
102 106
     }
103 107
 
108
+    /**
109
+     * @param string $startdate
110
+     * @param string $enddate
111
+     */
104 112
     function process_DID_charges($AccountDATA, $startdate, $enddate, $Manualflg = false) {
105 113
         $dids_data = $this->get_table_data("*", "dids", array("status" => "0", "accountid " => $AccountDATA["id"]));
106 114
         $AccountDATA['original_sweep_id'] = $AccountDATA['sweep_id'];
@@ -225,6 +233,7 @@  discard block
 block discarded – undo
225 233
 
226 234
     /**
227 235
      * @param string $todate
236
+     * @param string $invoicedate
228 237
      */
229 238
     function Manage_invoice_item($AccountData, $description, $item_id, $charge, $type, $fromdate, $todate, $invoicedate) {
230 239
         $invoiceid = 0;
Please login to merge, or discard this patch.
web_interface/astpp/application/libraries/html2pdf/_class/myPdf.class.php 1 patch
Doc Comments   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      *
31 31
      * @param string  $orientation page orientation, same as TCPDF
32 32
      * @param string  $unit        User measure unit, same as TCPDF
33
-     * @param mixed   $format      The format used for pages, same as TCPDF
33
+     * @param string   $format      The format used for pages, same as TCPDF
34 34
      * @param boolean $unicode     TRUE means that the input text is unicode (default = true)
35 35
      * @param String  $encoding    charset encoding; default is UTF-8
36 36
      * @param boolean $diskcache   if TRUE reduce the RAM memory usage by caching temporary data on filesystem (slower).
@@ -1407,7 +1407,6 @@  discard block
 block discarded – undo
1407 1407
      * set $_myLastPageGroup;
1408 1408
      *
1409 1409
      * @access public
1410
-     * @param integer $myLastPageGroup;
1411 1410
      * @param integer $myLastPageGroup
1412 1411
      */
1413 1412
     public function setMyLastPageGroup($myLastPageGroup)
@@ -1430,7 +1429,6 @@  discard block
 block discarded – undo
1430 1429
      * set $_myLastPageGroupNb;
1431 1430
      *
1432 1431
      * @access public
1433
-     * @param integer $myLastPageGroupNb;
1434 1432
      * @param integer $myLastPageGroupNb
1435 1433
      */
1436 1434
     public function setMyLastPageGroupNb($myLastPageGroupNb)
Please login to merge, or discard this patch.
astpp/application/libraries/html2pdf/_class/parsingCss.class.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -43,6 +43,7 @@
 block discarded – undo
43 43
      * Set the HTML2PDF parent object
44 44
      *
45 45
      * @param  &HTML2PDF reference to the HTML2PDF parent $object
46
+     * @param HTML2PDF_myPdf|null $pdf
46 47
      * @access public
47 48
      */
48 49
     public function setPdfParent(&$pdf)
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
     {
485 485
         // prepare
486 486
         $tagName = strtolower($tagName);
487
-        $id   = isset($param['id']) ? strtolower(trim($param['id'])) : null; if ( ! $id)   $id   = null;
487
+        $id   = isset($param['id']) ? strtolower(trim($param['id'])) : null; if ( ! $id)   $id = null;
488 488
         $name = isset($param['name']) ? strtolower(trim($param['name'])) : null; if ( ! $name) $name = null;
489 489
 
490 490
         // read the class attribute
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
     {
555 555
         // prepare the informations
556 556
         $tagName = strtolower($tagName);
557
-        $id   = isset($param['id']) ? strtolower(trim($param['id'])) : null; if ( ! $id)   $id   = null;
557
+        $id   = isset($param['id']) ? strtolower(trim($param['id'])) : null; if ( ! $id)   $id = null;
558 558
         $name = isset($param['name']) ? strtolower(trim($param['name'])) : null; if ( ! $name) $name = null;
559 559
 
560 560
         // get the class names to use
Please login to merge, or discard this patch.
astpp/application/libraries/html2pdf/_class/parsingHtml.class.php 1 patch
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -50,6 +50,7 @@
 block discarded – undo
50 50
      * Define the HTML code to parse
51 51
      *
52 52
      * @param   string HTML code
53
+     * @param string $html
53 54
      * @access  public
54 55
      */
55 56
     public function setHTML($html)
Please login to merge, or discard this patch.
astpp/application/libraries/html2pdf/_tcpdf_5.0.002/qrcode.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1123,7 +1123,7 @@  discard block
 block discarded – undo
1123 1123
 		 * @param array $frame
1124 1124
 		 * @param int $maskNo
1125 1125
 		 * @param int $level
1126
-		 * @return array mask
1126
+		 * @return integer mask
1127 1127
 		 */
1128 1128
 		 protected function makeMask($width, $frame, $maskNo, $level) {
1129 1129
 			$masked = array_fill(0, $width, str_repeat("\0", $width));
@@ -1165,7 +1165,7 @@  discard block
 block discarded – undo
1165 1165
 		/**
1166 1166
 		 * evaluateSymbol
1167 1167
 		 * @param int $width
1168
-		 * @param array $frame
1168
+		 * @param integer $frame
1169 1169
 		 * @return int demerit
1170 1170
 		 */
1171 1171
 		 protected function evaluateSymbol($width, $frame) {
@@ -2035,7 +2035,7 @@  discard block
 block discarded – undo
2035 2035
 
2036 2036
 		/**
2037 2037
 		 * convertData
2038
-		 * @param array $items
2038
+		 * @param integer $items
2039 2039
 		 * @return array items
2040 2040
 		 */
2041 2041
 		 protected function convertData($items) {
@@ -2490,7 +2490,7 @@  discard block
 block discarded – undo
2490 2490
 
2491 2491
 		/**
2492 2492
 		 * Return BCH encoded format information pattern.
2493
-		 * @param array $mask
2493
+		 * @param integer $mask
2494 2494
 		 * @param int $level error correction level
2495 2495
 		 * @return BCH encoded format information pattern
2496 2496
 		 */
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -180,12 +180,12 @@  discard block
 block discarded – undo
180 180
 	/**
181 181
 	 * Matrix index to get width from $capacity array.
182 182
 	 */
183
-	define('QRCAP_WIDTH',    0);
183
+	define('QRCAP_WIDTH', 0);
184 184
 
185 185
 	/**
186 186
 	 * Matrix index to get number of words from $capacity array.
187 187
 	 */
188
-	define('QRCAP_WORDS',    1);
188
+	define('QRCAP_WORDS', 1);
189 189
 
190 190
 	/**
191 191
 	 * Matrix index to get remainder from $capacity array.
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	/**
196 196
 	 * Matrix index to get error correction level from $capacity array.
197 197
 	 */
198
-	define('QRCAP_EC',       3);
198
+	define('QRCAP_EC', 3);
199 199
 
200 200
 	// -----------------------------------------------------
201 201
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	/**
205 205
 	 * Number of header bits for structured mode
206 206
 	 */
207
-	define('STRUCTURE_HEADER_BITS',  20);
207
+	define('STRUCTURE_HEADER_BITS', 20);
208 208
 
209 209
 	/**
210 210
 	 * Max number of symbols for structured mode
@@ -218,12 +218,12 @@  discard block
 block discarded – undo
218 218
 	/**
219 219
 	 * Down point base value for case 1 mask pattern (concatenation of same color in a line or a column)
220 220
 	 */
221
-	define('N1',  3);
221
+	define('N1', 3);
222 222
 
223 223
 	/**
224 224
 	 * Down point base value for case 2 mask pattern (module block of same color)
225 225
 	 */
226
-	define('N2',  3);
226
+	define('N2', 3);
227 227
 
228 228
 	/**
229 229
 	 * Down point base value for case 3 mask pattern (1:1:3:1:1(dark:bright:dark:bright:dark)pattern in a line or a column)
@@ -260,18 +260,18 @@  discard block
 block discarded – undo
260 260
 
261 261
 // #*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
262 262
 
263
-if (!class_exists('QRcode', false)) {
263
+if ( ! class_exists('QRcode', false)) {
264 264
 
265 265
 	// for compaibility with PHP4
266
-	if (!function_exists('str_split')) {
266
+	if ( ! function_exists('str_split')) {
267 267
     	/**
268 268
     	 * Convert a string to an array (needed for PHP4 compatibility)
269 269
     	 * @param string $string The input string.
270 270
     	 * @param int $split_length Maximum length of the chunk.
271 271
     	 * @return  string[] the optional split_length  parameter is specified, the returned array will be broken down into chunks with each being split_length  in length, otherwise each chunk will be one character in length. FALSE is returned if split_length is less than 1. If the split_length length exceeds the length of string , the entire string is returned as the first (and only) array element.
272 272
     	 */
273
-		function str_split($string, $split_length=1) {
274
-			if ((strlen($string) > $split_length) OR (!$split_length)) {
273
+		function str_split($string, $split_length = 1) {
274
+			if ((strlen($string) > $split_length) OR ( ! $split_length)) {
275 275
 				do {
276 276
 					$c = strlen($string);
277 277
 					$parts[] = substr($string, 0, $split_length);
Please login to merge, or discard this patch.
web_interface/astpp/system/database/DB_result.php 1 patch
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -64,6 +64,7 @@
 block discarded – undo
64 64
 	 * Custom query result.
65 65
 	 *
66 66
 	 * @param class_name A string that represents the type of object you want back
67
+	 * @param string $class_name
67 68
 	 * @return array of objects
68 69
 	 */
69 70
 	public function custom_result_object($class_name)
Please login to merge, or discard this patch.
web_interface/astpp/system/database/drivers/sqlsrv/sqlsrv_driver.php 1 patch
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -164,6 +164,7 @@
 block discarded – undo
164 164
 	 *
165 165
 	 * @access	private called by execute()
166 166
 	 * @param	string	an SQL query
167
+	 * @param string $sql
167 168
 	 * @return	string
168 169
 	 */
169 170
 	function _prep_query($sql)
Please login to merge, or discard this patch.