Files
code-cegled/_include/include_emails.php
2018-10-23 21:56:06 +02:00

38 lines
1.0 KiB
PHP

<?php
if ($this->is_id()) {
# EMAIL LISTA (50 / oldal)
$all_emails_query = "SELECT count(DISTINCT el_id) FROM email_log";
$emails_query = "SELECT * FROM email_log ORDER BY el_sent_date DESC LIMIT ".($this->is_id()?($this->get_id()-1) * 50:"0").",50";
$el_assoc_array = $sql->assoc_array($emails_query);
$el_count = $sql->single_variable($all_emails_query);
$next_link = true;
$el_array = array();
foreach ($el_assoc_array as $key => $el) {
$new_el = new email_log();
$new_el->set_el_data_by_id($el['el_id']);
$el_array[] = $new_el;
}
$fold = $el_count > 50;
if ($el_count <= $this->get_id()*50) {
$next_link = false;
}
$smarty->assign('el_array', $el_array);
$smarty->assign('fold', $fold);
$smarty->assign('next_id', $next_link?$this->get_id()+1:false);
$smarty->assign('previous_id', ($this->get_id()>1?$this->get_id()-1:false));
$smarty->display('emails.tpl');
}
else {
header("Location: /admin/emails/1");
}
?>