- $content['timestamp_ordered'] = generateDateTime($content['timestamp_ordered'], 2);
- $content['timestamp_sent'] = generateDateTime($content['timestamp_send'], 2);
- $content['percents'] = ($content['clicks'] / $content['max_rec'] * 100);
+ $content['timestamp_ordered'] = generateDateTime($content['timestamp_ordered'], '2');
+ $content['timestamp_sent'] = generateDateTime($content['timestamp_send'], '2');
+
+ // Click rate
+ $content['click_rate'] = '0';
+
+ // Better protection against 'divison-by-zero'
+ if ($content['max_rec'] > 0) {
+ $content['click_rate'] = ($content['clicks'] / $content['max_rec'] * 100);
+ } // END - if