Execute("select * from " . TABLE_EMAIL_ARCHIVE . " where archive_id = " . $_GET['archive_id']); $email = new objectInfo($email_sql->fields); // resend the message // we use 'cc_middle_digs' as the module because that is not archived (don't want to achive the same message twice) zen_mail($email->email_to_name, $email->email_to_address, $email->email_subject, $email->email_text, $email->email_from_name, $email->email_from_address, $email->email_html, 'cc_middle_digs'); $messageStack->add_session(sprintf(SUCCESS_EMAIL_RESENT, $email->archive_id, $email->email_to_address), 'success'); zen_redirect(zen_href_link(FILENAME_EMAIL_HISTORY)); } if ($action == 'delete') { $db->Execute("delete from " . TABLE_EMAIL_ARCHIVE . " where archive_id = '" . (int)$_GET['archive_id'] . "'"); zen_redirect(zen_href_link(FILENAME_EMAIL_HISTORY)); } if ($action == 'trim_confirm') { $age = $_GET['email_age']; if ($age == '1_months') { $cutoff_date = '1 MONTH'; } if ($age == '6_months') { $cutoff_date = '6 MONTH'; } elseif ($age == '1_year') { $cutoff_date = '12 MONTH'; } $db->Execute("DELETE FROM " . TABLE_EMAIL_ARCHIVE . " WHERE date_sent <= DATE_SUB(NOW(), INTERVAL " . $cutoff_date . ")"); $db->Execute("OPTIMIZE TABLE " . TABLE_EMAIL_ARCHIVE); $messageStack->add_session(sprintf(SUCCESS_TRIM_ARCHIVE, $cutoff_date), 'success'); zen_redirect(zen_href_link(FILENAME_EMAIL_HISTORY, '', 'NONSSL')); } $email_module = $db->Execute("SELECT DISTINCT module FROM " . TABLE_EMAIL_ARCHIVE . " ORDER BY module ASC"); $email_module_array[] = array('id' => 1, 'text' => TEXT_ALL_MODULES); while (!$email_module->EOF) { $email_module_array[] = array('id' => $email_module->fields['module'], 'text' => $email_module->fields['module']); $email_module->MoveNext(); } $search_sd = ((isset($_GET['start_date']) && zen_not_null($_GET['start_date'])) ? true : false); $search_ed = ((isset($_GET['end_date']) && zen_not_null($_GET['end_date'])) ? true : false); $search_text = ((isset($_GET['text']) && zen_not_null($_GET['text'])) ? true : false); $search_module = ((isset($_GET['module']) && zen_not_null($_GET['module']) && $_GET['module'] != 1) ? true : false); $sd_raw = zen_date_raw($_GET['start_date']); $ed_raw = zen_date_raw($_GET['end_date']); ?> > <?php echo TITLE; ?>
Execute("select * from " . TABLE_EMAIL_ARCHIVE . " where archive_id = '" . $_GET['archive_id'] . "'"); if ($action=='prev_html') { $html_content = $this_email->fields['email_html']; $html_content = str_replace('__','><',$html_content); $html_content = str_replace('_html','',$html_content); $html_content = str_replace('_table ','
'),'',$html_content); $html_content = str_replace(array('_/tr_','_/tr>'),'',$html_content); $html_content = str_replace(array('_td_','',$html_content); $html_content = str_replace('_td ','
','',$html_content); $html_content = str_replace('"_','">',$html_content); $html_content = str_replace('_ ','> ',$html_content); $html_content = str_replace('_li>','
  • ',$html_content); $html_content = str_replace('_div ','
    ',$html_content); $html_content = str_replace('_/div','',$html_content); $html_content = str_replace('_/strong_','',$html_content); $html_content = str_replace('strong_','strong>',$html_content); $html_content = str_replace('_/strong',''),'
    ',$html_content); $html_content = str_replace('_/style','',$html_content); $html_content = str_replace('_/em',''),'',$html_content); $html_content = str_replace(array('','','',''),'',$html_content); $html_content = str_replace(array('',''),'',$html_content); $html_content = str_replace('"_','">',$html_content); $html_content = str_replace('_nobr','
  • ' . '' . zen_image(DIR_WS_IMAGES . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT); ?> fields['archive_id']; ?>
    fields['email_to_name'] . ' [' . $this_email->fields['email_to_address'] . ']'; ?>
    fields['email_from_name'] . ' [' . $this_email->fields['email_from_address'] . ']'; ?>
    fields['date_sent']); ?>
    fields['email_subject']; ?>
    fields['email_text']); } ?>

    ' . HEADING_TITLE . ''; ?>

     
    ' . TEXT_TRIM_ARCHIVE . ''; ?>
    '; ?>
    '; ?>
    '; echo zen_draw_input_field('text'); if (isset($_GET['text']) && zen_not_null($_GET['text'])) { $keywords = zen_db_input(zen_db_prepare_input($_GET['text'])); echo '
    ' . HEADING_SEARCH_TEXT_FILTER . $keywords; } ?>
    '; echo zen_draw_pull_down_menu('module', $email_module_array, $_GET['module']); ?>
    Execute("select customers_id from " . TABLE_CUSTOMERS . " where customers_email_address like '" . $archive->email_to_address . "'"); if ($customer->RecordCount() == 1) { $mail_button = '' . zen_image_button('button_email.gif', IMAGE_EMAIL) . ''; } else { $mail_button = '' . zen_image_button('button_email.gif', IMAGE_EMAIL) . ''; } $heading[] = array('text' => '' . TEXT_ARCHIVE_ID . $archive->archive_id . '  -  ' . zen_datetime_short($archive->date_sent) . ''); $contents[] = array('align' => 'center', 'text' => $mail_button . ' ' . zen_image_button('button_resend.gif', IMAGE_ICON_RESEND) . ''); // Delete button $contents[] = array('align' => 'center', 'text' => '' . zen_image_button('button_delete.gif', IMAGE_ICON_DELETE) . '' . $html_button); $contents[] = array('align' => 'center', 'text' => '' . zen_image_button('button_prev_text.gif', IMAGE_ICON_TEXT) . '' . $html_button); if ($archive->email_html != '') { $contents[] = array('align' => 'center', 'text' => '' . zen_image_button('button_prev_html.gif', IMAGE_ICON_HTML) . ''); } $contents[] = array('text' => '
    ' . zen_draw_separator()); $contents[] = array('text' => '
    ' . TEXT_EMAIL_MODULE . ''. $archive->module); $contents[] = array('text' => '
    ' . TEXT_EMAIL_TO . ''. $archive->email_to_name . ' [' . $archive->email_to_address . ']'); $contents[] = array('text' => '' . TEXT_EMAIL_FROM . '' . $archive->email_from_name . ' [' . $archive->email_from_address . ']'); $contents[] = array('text' => '' . TEXT_EMAIL_DATE_SENT . '' . $archive->date_sent); $contents[] = array('text' => '' . TEXT_EMAIL_SUBJECT . '' . $archive->email_subject); $contents[] = array('text' => '
    ' . TEXT_EMAIL_EXCERPT . ''); $contents[] = array('text' => '
    ' . nl2br(substr($archive->email_text, 0, MESSAGE_SIZE_LIMIT)) . MESSAGE_LIMIT_BREAK); } // display sidebox if (zen_not_null($heading) && zen_not_null($contents) && $isForDisplay) { ?>
    = '" . $sd_raw . "' "; if ($search_ed) { if ($search_sd) $archive_search .= "and "; $archive_search .= "date_sent <= DATE_ADD('" . $ed_raw . "', INTERVAL 1 DAY) "; } if ($search_text) { if ($search_sd || $search_ed) $archive_search .= "and "; $keywords = zen_db_input(zen_db_prepare_input($_GET['text'])); $archive_search .= "(email_to_address like '%" . $keywords . "%' or email_subject like '%" . $keywords . "%' or email_html like '%" . $keywords . "%' or email_text like '%" . $keywords . "%' or email_to_name like '%" . $keywords . "%') "; } if ($search_module) { if ($search_sd || $search_ed || $search_text) { $archive_search .= "and "; } $archive_search .= "module = '" . $_GET['module'] . "' "; } $archive_search .= "order by archive_id desc"; $email_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS_ORDERS, $archive_search, $email_query_numrows); // DEBUG //echo '
    ' . $archive_search . '
    '; $email_archive = $db->Execute($archive_search); while (!$email_archive->EOF) { if ((!isset($_GET['archive_id']) || (isset($_GET['archive_id']) && ($_GET['archive_id'] == $email_archive->fields['archive_id']))) && !isset($archive)) { $archive = new objectInfo($email_archive->fields); } if (isset($archive) && is_object($archive) && ($email_archive->fields['archive_id'] == $archive->archive_id) && $isForDisplay) { echo ' ' . "\n"; } else { echo ' ' . "\n"; } ?> MoveNext(); } ?>
    fields['date_sent']); ?> fields['email_to_name']; ?> fields['email_to_address']; ?> fields['email_subject'], 0, SUBJECT_SIZE_LIMIT) . MESSAGE_LIMIT_BREAK; ?> fields['archive_id'] == $archive->archive_id) && $isForDisplay) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { if ($email_archive->fields['email_html'] != '') { echo TABLE_FORMAT_HTML; } else { echo TABLE_FORMAT_TEXT; } } ?>
    display_count($email_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_ORDERS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_EMAILS); ?> display_links($email_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_ORDERS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], zen_get_all_get_params(array('archive_id', 'page'))); ?>
    infoBox($heading, $contents); ?>