|
|
|
|
@@ -19,6 +19,7 @@
|
|
|
|
|
require_once "root.php";
|
|
|
|
|
require_once "resources/require.php";
|
|
|
|
|
require_once "resources/check_auth.php";
|
|
|
|
|
require_once "resources/paging.php";
|
|
|
|
|
|
|
|
|
|
//check permissions
|
|
|
|
|
if (permission_exists('email_log_view')) {
|
|
|
|
|
@@ -33,47 +34,54 @@
|
|
|
|
|
$language = new text;
|
|
|
|
|
$text = $language->get();
|
|
|
|
|
|
|
|
|
|
//get variables used to control the order
|
|
|
|
|
$order_by = ($_GET["order_by"] != '') ? $_GET["order_by"] : 'sent_date';
|
|
|
|
|
$order = ($_GET["order"] != '') ? $_GET["order"] : 'desc';
|
|
|
|
|
//get posted data
|
|
|
|
|
if (is_array($_POST['emails'])) {
|
|
|
|
|
$action = $_POST['action'];
|
|
|
|
|
$search = $_POST['search'];
|
|
|
|
|
$emails = $_POST['emails'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//download email
|
|
|
|
|
if ($_REQUEST['a'] == 'download' && permission_exists('email_log_download')) {
|
|
|
|
|
$email_log_uuid = $_REQUEST["id"];
|
|
|
|
|
|
|
|
|
|
$msg_found = false;
|
|
|
|
|
|
|
|
|
|
if (is_uuid($email_log_uuid)) {
|
|
|
|
|
$sql = "select ";
|
|
|
|
|
$sql .= "call_uuid, ";
|
|
|
|
|
$sql .= "email ";
|
|
|
|
|
$sql .= "from v_email_logs ";
|
|
|
|
|
$sql .= "where email_log_uuid = :email_log_uuid ";
|
|
|
|
|
$sql .= "and domain_uuid = :domain_uuid ";
|
|
|
|
|
$parameters['email_log_uuid'] = $email_log_uuid;
|
|
|
|
|
$parameters['domain_uuid'] = $domain_uuid;
|
|
|
|
|
$database = new database;
|
|
|
|
|
$row = $database->select($sql, $parameters, 'row');
|
|
|
|
|
if (is_array($row) && @sizeof($row) != 0) {
|
|
|
|
|
$call_uuid = $row['call_uuid'];
|
|
|
|
|
$email = $row['email'];
|
|
|
|
|
$msg_found = true;
|
|
|
|
|
}
|
|
|
|
|
unset($sql, $parameters, $row);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($msg_found) {
|
|
|
|
|
header("Content-Type: message/rfc822");
|
|
|
|
|
header('Content-Disposition: attachment; filename="'.$call_uuid.'.eml"');
|
|
|
|
|
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
|
|
|
|
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
|
|
|
|
|
header("Content-Length: ".strlen($email));
|
|
|
|
|
echo $email;
|
|
|
|
|
exit;
|
|
|
|
|
//download the emails
|
|
|
|
|
if (permission_exists('email_log_download')) {
|
|
|
|
|
if ($action == 'download' && is_array($emails) && @sizeof($emails) != 0) {
|
|
|
|
|
//download
|
|
|
|
|
$obj = new email_logs;
|
|
|
|
|
$obj->download($emails);
|
|
|
|
|
//set message (download failed)
|
|
|
|
|
message::add($text['message-download_failed'],'negative',7000);
|
|
|
|
|
//redirect
|
|
|
|
|
header('Location: email_logs.php'.($search != '' ? '?search='.urlencode($search) : null));
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//resend email
|
|
|
|
|
//resend the emails
|
|
|
|
|
if (permission_exists('email_log_resend')) {
|
|
|
|
|
if ($action == 'resend' && is_array($emails) && @sizeof($emails) != 0) {
|
|
|
|
|
//resend
|
|
|
|
|
$obj = new email_logs;
|
|
|
|
|
$obj->resend($emails);
|
|
|
|
|
//exit
|
|
|
|
|
header('Location: email_logs.php'.($search != '' ? '?search='.urlencode($search) : null));
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//delete the emails
|
|
|
|
|
if (permission_exists('email_log_delete')) {
|
|
|
|
|
if ($action == 'delete' && is_array($emails) && @sizeof($emails) != 0) {
|
|
|
|
|
//delete
|
|
|
|
|
$obj = new email_logs;
|
|
|
|
|
$obj->delete($emails);
|
|
|
|
|
//redirect
|
|
|
|
|
header('Location: email_logs.php'.($search != '' ? '?search='.urlencode($search) : null));
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//resend email (previous method)
|
|
|
|
|
/*
|
|
|
|
|
if ($_REQUEST['a'] == 'resend' && permission_exists('email_log_resend')) {
|
|
|
|
|
$email_log_uuid = $_REQUEST["id"];
|
|
|
|
|
$resend = true;
|
|
|
|
|
@@ -112,62 +120,85 @@
|
|
|
|
|
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
//get order and order by and sanatize the values
|
|
|
|
|
$order_by = $_GET["order_by"];
|
|
|
|
|
$order = $_GET["order"];
|
|
|
|
|
|
|
|
|
|
//add the search term
|
|
|
|
|
$search = strtolower($_GET["search"]);
|
|
|
|
|
if (strlen($search) > 0) {
|
|
|
|
|
$sql_search = "and (";
|
|
|
|
|
$sql_search .= "lower(type) like :search ";
|
|
|
|
|
$sql_search .= "or lower(email) like :search ";
|
|
|
|
|
$sql_search .= ") ";
|
|
|
|
|
$parameters['search'] = '%'.$search.'%';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//prepare to page the results
|
|
|
|
|
require_once "resources/paging.php";
|
|
|
|
|
$sql = "select count(*) from v_email_logs ";
|
|
|
|
|
if (permission_exists('email_log_all') && $_REQUEST['showall'] != 'true') {
|
|
|
|
|
$sql .= "where domain_uuid = :domain_uuid ";
|
|
|
|
|
$sql .= "where true ";
|
|
|
|
|
if (permission_exists('email_log_all') && $_REQUEST['show'] != 'all') {
|
|
|
|
|
$sql .= "and domain_uuid = :domain_uuid ";
|
|
|
|
|
$parameters['domain_uuid'] = $domain_uuid;
|
|
|
|
|
}
|
|
|
|
|
$sql .= $sql_search;
|
|
|
|
|
$database = new database;
|
|
|
|
|
$num_rows = $database->select($sql, $parameters, 'column');
|
|
|
|
|
unset($sql, $parameters);
|
|
|
|
|
|
|
|
|
|
//prepare to page the results
|
|
|
|
|
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
|
|
|
|
if (permission_exists('email_log_all') && $_REQUEST['showall'] == 'true') {
|
|
|
|
|
$param .= "&showall=true";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$param = "";
|
|
|
|
|
$param = "search=".$search;
|
|
|
|
|
if ($_GET['show'] == "all" && permission_exists('email_log_all')) {
|
|
|
|
|
$param .= "&show=all";
|
|
|
|
|
}
|
|
|
|
|
$page = $_GET['page'];
|
|
|
|
|
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
|
|
|
|
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
|
|
|
|
|
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
|
|
|
|
|
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true);
|
|
|
|
|
$offset = $rows_per_page * $page;
|
|
|
|
|
|
|
|
|
|
//get the list
|
|
|
|
|
$sql = "select * from v_email_logs ";
|
|
|
|
|
if (permission_exists('email_log_all') && $_REQUEST['showall'] == 'true') {
|
|
|
|
|
$sql .= "join v_domains on v_email_logs.domain_uuid = v_domains.domain_uuid ";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$sql .= "where domain_uuid = :domain_uuid ";
|
|
|
|
|
$parameters['domain_uuid'] = $domain_uuid;
|
|
|
|
|
}
|
|
|
|
|
$sql = str_replace('count(*)', '*', $sql);
|
|
|
|
|
$sql .= order_by($order_by, $order, 'sent_date', 'desc');
|
|
|
|
|
$sql .= limit_offset($rows_per_page, $offset);
|
|
|
|
|
$database = new database;
|
|
|
|
|
$result = $database->select($sql, $parameters, 'all');
|
|
|
|
|
unset($sql, $parameters);
|
|
|
|
|
|
|
|
|
|
//set the row style
|
|
|
|
|
$c = 0;
|
|
|
|
|
$row_style["0"] = "row_style0";
|
|
|
|
|
$row_style["1"] = "row_style1";
|
|
|
|
|
//get call details
|
|
|
|
|
if (is_array($result) && @sizeof($result) != 0) {
|
|
|
|
|
foreach ($result as $row) {
|
|
|
|
|
$sql = "select caller_id_name, caller_id_number, destination_number ";
|
|
|
|
|
$sql .= "from v_xml_cdr ";
|
|
|
|
|
$sql .= "where domain_uuid = :domain_uuid ";
|
|
|
|
|
$sql .= "and uuid = :uuid ";
|
|
|
|
|
$parameters['domain_uuid'] = $domain_uuid;
|
|
|
|
|
$parameters['uuid'] = $row['call_uuid'];
|
|
|
|
|
$database = new database;
|
|
|
|
|
$result2 = $database->select($sql, $parameters, 'all');
|
|
|
|
|
if (is_array($result2) && @sizeof($result2) != 0) {
|
|
|
|
|
foreach($result2 as $row2) {
|
|
|
|
|
$call[$row['call_uuid']]['caller_id_name'] = $row2['caller_id_name'];
|
|
|
|
|
$call[$row['call_uuid']]['caller_id_number'] = $row2['caller_id_number'];
|
|
|
|
|
$call[$row['call_uuid']]['destination_number'] = $row2['destination_number'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
unset($sql, $parameters, $result2, $row2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//create token
|
|
|
|
|
$object = new token;
|
|
|
|
|
$token = $object->create('/app/email_logs/email_logs.php');
|
|
|
|
|
|
|
|
|
|
//additional includes
|
|
|
|
|
//include the header
|
|
|
|
|
$document['title'] = $text['title-emails'];
|
|
|
|
|
require_once "resources/header.php";
|
|
|
|
|
|
|
|
|
|
//styles
|
|
|
|
|
//test result layer
|
|
|
|
|
echo "<style>\n";
|
|
|
|
|
|
|
|
|
|
echo " #test_result_layer {\n";
|
|
|
|
|
echo " z-index: 999999;\n";
|
|
|
|
|
echo " position: absolute;\n";
|
|
|
|
|
@@ -177,8 +208,7 @@
|
|
|
|
|
echo " bottom: 0px;\n";
|
|
|
|
|
echo " text-align: center;\n";
|
|
|
|
|
echo " vertical-align: middle;\n";
|
|
|
|
|
echo " }\n";
|
|
|
|
|
|
|
|
|
|
echo " }\n";
|
|
|
|
|
echo " #test_result_container {\n";
|
|
|
|
|
echo " display: block;\n";
|
|
|
|
|
echo " overflow: auto;\n";
|
|
|
|
|
@@ -194,11 +224,9 @@
|
|
|
|
|
echo " -webkit-box-shadow: 0px 1px 20px #888;\n";
|
|
|
|
|
echo " -moz-box-shadow: 0px 1px 20px #888;\n";
|
|
|
|
|
echo " box-shadow: 0px 1px 20px #888;\n";
|
|
|
|
|
echo " }\n";
|
|
|
|
|
|
|
|
|
|
echo " }\n";
|
|
|
|
|
echo "</style>\n";
|
|
|
|
|
|
|
|
|
|
//test result layer
|
|
|
|
|
echo "<div id='test_result_layer' style='display: none;'>\n";
|
|
|
|
|
echo " <table cellpadding='0' cellspacing='0' border='0' width='100%' height='100%'>\n";
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
@@ -210,6 +238,51 @@
|
|
|
|
|
echo "</div>\n";
|
|
|
|
|
|
|
|
|
|
//show the content
|
|
|
|
|
echo "<div class='action_bar' id='action_bar'>\n";
|
|
|
|
|
echo " <div class='heading'><b>".$text['header-emails']." (".$num_rows.")</b></div>\n";
|
|
|
|
|
echo " <div class='actions'>\n";
|
|
|
|
|
echo "<form id='form_test' class='inline' method='post' action='email_test.php' target='_blank'>\n";
|
|
|
|
|
echo button::create(['label'=>$text['button-test'],'icon'=>'tools','type'=>'button','id'=>'test_button','style'=>'margin-right: 15px;','onclick'=>"$(this).fadeOut(400, function(){ $('span#form_test').fadeIn(400); $('#to').trigger('focus'); });"]);
|
|
|
|
|
echo " <span id='form_test' style='display: none;'>\n";
|
|
|
|
|
echo " <input type='text' class='txt' style='width: 150px;' name='to' id='to' placeholder='recipient@domain.com'>";
|
|
|
|
|
echo button::create(['label'=>$text['button-send'],'icon'=>'envelope','type'=>'submit','id'=>'send_button','style'=>'margin-right: 15px;']);
|
|
|
|
|
echo " </span>\n";
|
|
|
|
|
echo " <input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
|
|
|
|
echo " </form>";
|
|
|
|
|
if (permission_exists('email_log_resend') && $result) {
|
|
|
|
|
echo button::create(['type'=>'button','label'=>$text['button-resend'],'icon'=>'paper-plane','onclick'=>"if (confirm('".$text['confirm-resend']."')) { list_action_set('resend'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
|
|
|
|
}
|
|
|
|
|
if (permission_exists('email_log_download') && $result) {
|
|
|
|
|
echo button::create(['type'=>'button','label'=>$text['button-download'],'icon'=>$_SESSION['theme']['button_icon_download'],'onclick'=>"list_action_set('download'); list_form_submit('form_list');"]);
|
|
|
|
|
}
|
|
|
|
|
if (permission_exists('email_log_delete') && $result) {
|
|
|
|
|
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'onclick'=>"if (confirm('".$text['confirm-delete']."')) { list_action_set('delete'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
|
|
|
|
}
|
|
|
|
|
echo "<form id='form_search' class='inline' method='get'>\n";
|
|
|
|
|
if (permission_exists('email_log_all')) {
|
|
|
|
|
if ($_GET['show'] == 'all') {
|
|
|
|
|
echo " <input type='hidden' name='show' value='all'>";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?show=all']);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
echo button::create(['label'=>$text['button-refresh'],'icon'=>$_SESSION['theme']['button_icon_refresh'],'type'=>'button','onclick'=>'document.location.reload();']);
|
|
|
|
|
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown='list_search_reset();'>";
|
|
|
|
|
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','style'=>($search != '' ? 'display: none;' : null)]);
|
|
|
|
|
echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'email_logs.php','style'=>($search == '' ? 'display: none;' : null)]);
|
|
|
|
|
if ($paging_controls_mini != '') {
|
|
|
|
|
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>";
|
|
|
|
|
}
|
|
|
|
|
echo " </form>\n";
|
|
|
|
|
echo " </div>\n";
|
|
|
|
|
echo " <div style='clear: both;'></div>\n";
|
|
|
|
|
echo "</div>\n";
|
|
|
|
|
|
|
|
|
|
echo $text['description-emails']."\n";
|
|
|
|
|
echo "<br /><br />\n";
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
echo "<form id='test_form' method='post' action='email_test.php' target='_blank'>\n";
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
@@ -236,104 +309,88 @@
|
|
|
|
|
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
|
|
|
|
echo "</form>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo "<form id='form_list' method='post'>\n";
|
|
|
|
|
echo "<input type='hidden' id='action' name='action' value=''>\n";
|
|
|
|
|
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
if ($_REQUEST['showall'] == true && permission_exists('email_log_all')) {
|
|
|
|
|
echo "<table class='list'>\n";
|
|
|
|
|
echo "<tr class='list-header'>\n";
|
|
|
|
|
if (permission_exists('email_log_download') || permission_exists('email_log_resend') || permission_exists('email_log_delete')) {
|
|
|
|
|
echo " <th class='checkbox'>\n";
|
|
|
|
|
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle();' ".($result ?: "style='visibility: hidden;'").">\n";
|
|
|
|
|
echo " </th>\n";
|
|
|
|
|
}
|
|
|
|
|
if ($_GET['show'] == "all" && permission_exists('email_log_all')) {
|
|
|
|
|
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, null, null, $param);
|
|
|
|
|
}
|
|
|
|
|
echo th_order_by('sent_date', $text['label-sent'], $order_by, $order, null, null, $param);
|
|
|
|
|
echo th_order_by('type', $text['label-type'], $order_by, $order, null, null, $param);
|
|
|
|
|
echo th_order_by('status', $text['label-status'], $order_by, $order, null, null, $param);
|
|
|
|
|
echo "<th>".$text['label-message']."</th>\n";
|
|
|
|
|
echo "<th>".$text['label-reference']."</th>\n";
|
|
|
|
|
echo "<td class='list_control_icons'> </td>\n";
|
|
|
|
|
echo "<th class='center'>".$text['label-actions']."</th>\n";
|
|
|
|
|
echo "<th class='hide-sm-dn'>".$text['label-reference']."</th>\n";
|
|
|
|
|
if ($_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
|
|
|
|
echo " <td class='action-button'> </td>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
if (is_array($result) && @sizeof($result) != 0) {
|
|
|
|
|
$x = 0;
|
|
|
|
|
foreach($result as $row) {
|
|
|
|
|
|
|
|
|
|
//get call details
|
|
|
|
|
$sql = "select caller_id_name, caller_id_number, destination_number ";
|
|
|
|
|
$sql .= "from v_xml_cdr ";
|
|
|
|
|
$sql .= "where domain_uuid = :domain_uuid ";
|
|
|
|
|
$sql .= "and uuid = :uuid ";
|
|
|
|
|
$parameters['domain_uuid'] = $domain_uuid;
|
|
|
|
|
$parameters['uuid'] = $row['call_uuid'];
|
|
|
|
|
$database = new database;
|
|
|
|
|
$result2 = $database->select($sql, $parameters, 'all');
|
|
|
|
|
if (is_array($result2) && @sizeof($result2) != 0) {
|
|
|
|
|
foreach($result2 as $row2) {
|
|
|
|
|
$caller_id_name = ($row2['caller_id_name'] != '') ? $row2['caller_id_name'] : null;
|
|
|
|
|
$caller_id_number = ($row2['caller_id_number'] != '') ? $row2['caller_id_number'] : null;
|
|
|
|
|
$destination_number = ($row2['destination_number'] != '') ? $row2['destination_number'] : null;
|
|
|
|
|
}
|
|
|
|
|
$list_row_url = "email_log_view.php?id=".urlencode($row['email_log_uuid']);
|
|
|
|
|
echo "<tr class='list-row' href='".$list_row_url."'>\n";
|
|
|
|
|
if (permission_exists('email_log_download') || permission_exists('email_log_resend') || permission_exists('email_log_delete')) {
|
|
|
|
|
echo " <td class='checkbox'>\n";
|
|
|
|
|
echo " <input type='checkbox' name='emails[$x][checked]' id='checkbox_".$x."' value='true' onclick=\"if (!this.checked) { document.getElementById('checkbox_all').checked = false; }\">\n";
|
|
|
|
|
echo " <input type='hidden' name='emails[$x][uuid]' value='".escape($row['email_log_uuid'])."' />\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
}
|
|
|
|
|
unset($sql, $parameters, $result2, $row2);
|
|
|
|
|
|
|
|
|
|
$tr_link = "href='email_log_view.php?id=".$row['email_log_uuid']."'";
|
|
|
|
|
echo "<tr ".$tr_link.">\n";
|
|
|
|
|
if ($_REQUEST['showall'] == true && permission_exists('email_log_all')) {
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['domain_name'])."</td>\n";
|
|
|
|
|
if ($_GET['show'] == "all" && permission_exists('email_log_all')) {
|
|
|
|
|
echo " <td>".escape($_SESSION['domains'][$row['domain_uuid']]['domain_name'])."</td>\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>";
|
|
|
|
|
$sent_date = explode('.', $row['sent_date']);
|
|
|
|
|
echo $sent_date[0];
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".$text['label-type_'.escape($row['type'])]."</td>\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".$text['label-status_'.escape($row['status'])]."</td>\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]." tr_link_void'>";
|
|
|
|
|
echo " <a href='email_log_view.php?id=".escape($row['email_log_uuid'])."'>".$text['label-message_view']."</a> ";
|
|
|
|
|
if (permission_exists('email_log_download')) {
|
|
|
|
|
echo " <a href='?id=".escape($row['email_log_uuid'])."&a=download'>".$text['label-download']."</a> ";
|
|
|
|
|
}
|
|
|
|
|
echo " <td><a href='".$list_row_url."' title=\"".$text['label-message_view']."\">".$sent_date[0]."</td>\n";
|
|
|
|
|
echo " <td>".$text['label-type_'.escape($row['type'])]."</td>\n";
|
|
|
|
|
echo " <td>".$text['label-status_'.escape($row['status'])]."</td>\n";
|
|
|
|
|
echo " <td class='middle button center no-link no-wrap'>";
|
|
|
|
|
if (permission_exists('email_log_resend')) {
|
|
|
|
|
echo " <a href='?id=".$row['email_log_uuid']."&a=resend";
|
|
|
|
|
if ($_REQUEST['showall'] == true && permission_exists('email_log_all')) {
|
|
|
|
|
echo "&showall=true";
|
|
|
|
|
}
|
|
|
|
|
echo "'>" . $text['label-resend']."</a>";
|
|
|
|
|
echo button::create(['type'=>'button','title'=>$text['button-resend'],'icon'=>'paper-plane','onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('resend'); list_form_submit('form_list')"]);
|
|
|
|
|
}
|
|
|
|
|
if (permission_exists('email_log_download')) {
|
|
|
|
|
echo button::create(['type'=>'button','title'=>$text['button-download'],'icon'=>$_SESSION['theme']['button_icon_download'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('download'); list_form_submit('form_list')"]);
|
|
|
|
|
}
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td valign='top' class='row_stylebg tr_link_void' style='white-space: nowrap; vertical-align: top;'>";
|
|
|
|
|
echo " <a href='".PROJECT_PATH."/app/xml_cdr/xml_cdr_details.php?id=".escape($row['call_uuid'])."'>".$text['label-reference_cdr']."</a>";
|
|
|
|
|
echo " ".($caller_id_name != '') ? " ".$caller_id_name." (".format_phone($caller_id_number).")" : $caller_id_number;
|
|
|
|
|
echo " <span style='font-size: 150%; line-height: 10px;'>⇢</span> ".$destination_number;
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td class='list_control_icons'>";
|
|
|
|
|
echo "<a href='email_log_view.php?id=".escape($row['email_log_uuid'])."' alt='".$text['label-message_view']."'>$v_link_label_view</a>";
|
|
|
|
|
if (permission_exists('email_log_delete')) {
|
|
|
|
|
echo "<a href='email_log_delete.php?id=".escape($row['email_log_uuid']).($_REQUEST['showall'] == true ? '&showall=true' : null)."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
|
|
|
|
|
echo " <td class='description overflow hide-sm-dn no-link'>";
|
|
|
|
|
echo button::create(['type'=>'button','class'=>'link','label'=>$text['label-reference_cdr'],'link'=>PROJECT_PATH.'/app/xml_cdr/xml_cdr_details.php?id='.urlencode($row['call_uuid'])]);
|
|
|
|
|
echo " ".($call[$row['call_uuid']]['caller_id_name'] != '' ? " ".$call[$row['call_uuid']]['caller_id_name'].(is_numeric($call[$row['call_uuid']]['caller_id_number']) ? ' ('.format_phone($call[$row['call_uuid']]['caller_id_number']).')' : null) : $call[$row['call_uuid']]['caller_id_number']);
|
|
|
|
|
if ($call[$row['call_uuid']]['destination_number']) {
|
|
|
|
|
echo " <span style='font-size: 150%; line-height: 10px;'>⇢</span> ".$call[$row['call_uuid']]['destination_number'];
|
|
|
|
|
}
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
if ($_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
|
|
|
|
echo " <td class='action-button'>";
|
|
|
|
|
echo button::create(['type'=>'button','title'=>$text['label-message_view'],'icon'=>$_SESSION['theme']['button_icon_view'],'link'=>$list_row_url]);
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
if ($c==0) { $c=1; } else { $c=0; }
|
|
|
|
|
$x++;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
unset($result, $row);
|
|
|
|
|
unset($result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td colspan='21' align='left'>\n";
|
|
|
|
|
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td width='33.3%' nowrap='nowrap'> </td>\n";
|
|
|
|
|
echo " <td width='33.3%' align='center' nowrap='nowrap'>$paging_controls</td>\n";
|
|
|
|
|
echo " <td width='33.3%' nowrap='nowrap'> </td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo " </table>\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo "<div align='center'>".$paging_controls."</div>\n";
|
|
|
|
|
|
|
|
|
|
echo "</table>";
|
|
|
|
|
echo "<br /><br />";
|
|
|
|
|
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
|
|
|
|
|
|
|
|
|
echo "</form>\n";
|
|
|
|
|
|
|
|
|
|
//test script
|
|
|
|
|
echo "<script>\n";
|
|
|
|
|
|
|
|
|
|
echo " $('#test_form').submit(function(event) {\n";
|
|
|
|
|
echo " $('#form_test').submit(function(event) {\n";
|
|
|
|
|
echo " event.preventDefault();\n";
|
|
|
|
|
echo " $.ajax({\n";
|
|
|
|
|
echo " url: $(this).attr('action'),\n";
|
|
|
|
|
@@ -345,16 +402,16 @@
|
|
|
|
|
echo " success: function(response){\n";
|
|
|
|
|
echo " $('#test_result_container').html(response);\n";
|
|
|
|
|
echo " $('#test_result_layer').fadeIn(400);\n";
|
|
|
|
|
echo " $('span#test_form').fadeOut(400);\n";
|
|
|
|
|
echo " $('#test_button').fadeIn(400);\n";
|
|
|
|
|
echo " $('#to').val('');\n";
|
|
|
|
|
echo " $('span#form_test').fadeOut(400, function(){\n";
|
|
|
|
|
echo " $('#test_button').fadeIn(400);\n";
|
|
|
|
|
echo " $('#to').val('');\n";
|
|
|
|
|
echo " });\n";
|
|
|
|
|
echo " }\n";
|
|
|
|
|
echo " });\n";
|
|
|
|
|
echo " });\n";
|
|
|
|
|
|
|
|
|
|
echo "</script>\n";
|
|
|
|
|
|
|
|
|
|
//include the footer
|
|
|
|
|
require_once "resources/footer.php";
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
?>
|