Ejemplo n.º 1
0
$reportdata["headertext"] = $reportHeader;
$reportdata["tableheadings"] = array($aInt->lang('fields', 'client'), $aInt->lang('fields', 'domain'), $aInt->lang('fields', 'dateSent'), $aInt->lang('domains', 'reminder'), $aInt->lang('emails', 'recipients'), $aInt->lang('domains', 'sent'));
$typeMap = array(1 => $aInt->lang('domains', 'firstReminder'), 2 => $aInt->lang('domains', 'secondReminder'), 3 => $aInt->lang('domains', 'thirdReminder'), 4 => $aInt->lang('domains', 'fourthReminder'), 5 => $aInt->lang('domains', 'fifthReminder'));
# Report Footer Text - this gets displayed below the report table of data
$data["footertext"] = "";
$table = "tbldomainreminders";
$fields = "tbldomainreminders.id AS reminder_id,\n           tbldomainreminders.date,\n           tbldomainreminders.type,\n           tbldomainreminders.days_before_expiry,\n           tbldomainreminders.recipients,\n           tblclients.firstname,\n           tblclients.lastname,\n           tblclients.companyname,\n           tbldomains.domain\n";
$sort = "reminder_id";
$sortOrder = "DESC";
$join = "tbldomains ON (tbldomainreminders.domain_id = tbldomains.id) " . "JOIN tblclients ON (tbldomains.userid = tblclients.id)";
$where = array();
if ($userID) {
    $where['tblclients.id'] = (int) $userID;
}
if ($domain) {
    $where['tbldomains.domain'] = Sanitize::encode($domain);
}
if ($dateFrom && !$dateTo) {
    $where['date'] = array('sqltype' => '>=', 'value' => str_replace('-', '', $dateFrom));
}
if ($dateTo && !$dateFrom) {
    $where['date'] = array('sqltype' => '<=', 'value' => str_replace('-', '', $dateTo));
}
if ($registrar) {
    $where['tbldomains.registrar'] = $registrar;
}
$result = select_query($table, $fields, $where, $sort, $sortOrder, '', $join);
while ($data = mysql_fetch_array($result)) {
    if ($dateFrom && $dateFrom != '' && ($dateTo && $dateTo != '')) {
        $from = new DateTime(str_replace('-', '', $dateFrom));
        $to = new DateTime(str_replace('-', '', $dateTo));