\n"); $error_message = getLanguageText('ERRORMSG-ACCESS-DENIED'); include "form.messages.php"; return; } // Set log permissions $permissions = ''; if ($_SESSION['UserInfo']['type'] == 'staff') { $permissions = "and (group_num = '0' or group_num = {$_SESSION['UserInfo']['group_num']})"; } // startLog("email-logs.php"); if (array_key_exists('batch_num', $_GET)) $batch_num = intval($_GET['batch_num']); if (isset($batch_num)) writeLog("batch_num: $batch_num"); // If batch_num set make sure user is permitted to view log details if (isset($batch_num) && $batch_num > 0) { $query = "select * from email_header " . "where school_num = $school_num " . "and record_num = $batch_num {$permissions}"; $results = db_query($query); if (db_num_rows($results) != 1) { echo("
Error: Record Not Found
\n"); exit(); } } // Cancel a batch is requested if (isset($batch_num) && isset($naction)) { switch ($naction) { // Cancel a job case 'cancel': $query = "update email_header set status = 'cancelled' where record_num = $batch_num {$permissions}"; db_query($query); $batch_num = 0; $naction = 'listmine'; echo("" . getLanguageText('TEXT-THE-EMAIL-BROADCAST-HAS-BEEN-CANCELLED') . "
\n"); break; // Flag a job entry as deleted case 'delete': $query = "update email_header set status = 'deleted' where record_num = $batch_num {$permissions}"; db_query($query); $batch_num = 0; $naction = 'listmine'; echo("" . getLanguageText('TEXT-THE-LOG-ENTRY-HAS-BEEN-DELETED') . "
\n"); break; // Undelete a job case 'undelete': $query = "select * from email_header " . "where school_num = $school_num " . "and record_num = $batch_num {$permissions}"; $results = db_query($query); $row = db_fetch_array($results); if ($row['processed_records'] == $row['matching_records']) $new_status = 'completed'; else $new_status = 'cancelled'; $query = "update email_header set status = '$new_status' where record_num = $batch_num {$permissions}"; db_query($query); $batch_num = 0; $naction = 'listmine'; echo("" . getLanguageText('TEXT-THE-LOG-ENTRY-HAS-BEEN-RESTORED') . "
\n"); break; default: if ($naction != 'listmine') $naction = "list"; break; } } // If no batch number then list all batches if (!isset($batch_num) || $batch_num == 0) { $totalLogs = db_getVal("SELECT count(*) FROM email_header WHERE school_num = $school_num"); // // Get list of header records // if ($_SESSION['UserInfo']['type'] == 'SuperUser') { $query = "select * from email_header " . "where school_num = $school_num " . "and status != 'deleted' " . "and status != 'cancelled' " . "order by posted desc limit 0,50"; } else { $query = "select * from email_header " . "where school_num = $school_num " . "and status != 'deleted' " . "and status != 'cancelled' " . "AND category NOT IN ('Hot Lunch Contacts Broadcast','Sales Contacts Broadcast') " . "order by posted desc limit 0,50"; } $headers = db_query($query); $numHeaders = db_num_rows($headers); if ($numHeaders <= 50) $view_all = 'Y'; ?>|
|
|||||||
|
|
|||||||
- : |
|
| : | |
| : | |
| : | |
| : | |
| : | |
| : | |
| : | |
| : | |
| : | |
| : | |
| : | |
| : | |
| TEXT-EMAIL-ADDRESS | ||
|
|