if (!ifSqlHasZeroNums($result)) {
// Fetch all entries
while ($row = sqlFetchArray($result)) {
- // Init click rate
- $row['click_rate'] = '0';
-
- // Does he have received some mails?
- if ($row['emails_received'] > 0) {
- // Calculate click rate
- $row['click_rate'] = ($row['mails_confirmed'] / $row['emails_received'] * 100);
- } // END - if
+ // Calculate click rate
+ $row['click_rate'] = calculatePercentageRate($row['mails_confirmed'], $row['emails_received']);
// Add row
$refs[$row['id']] = $row;
$content = getArrayFromUserRefbackData($id);
// Is this valid?
- if (count($content) == 0) {
+ if (!isFilledArray($content)) {
// id does not belong to user!
$status['message'] = 'MEMBER_REFBACK_ERROR_ID_MISMATCH';
return $status;