Files
2026-06-11 18:47:38 +09:00

96 lines
4.1 KiB
PHP

<?php
if (!defined('_GNUBOARD_')) exit;
?>
<div class="local_ov01 local_ov">
<strong><?= $g5['title'] ?></strong>
<p>시스템에서 발송된 모든 이메일의 성공 및 실패 기록을 확인할 수 있습니다.</p>
</div>
<form name="fmaillog" id="fmaillog" method="post">
<input type="hidden" name="token" value="<?php echo get_admin_token(); ?>">
<div class="tbl_head01 tbl_wrap">
<table>
<caption>메일 발송 이력 목록</caption>
<colgroup>
<col class="grid_1"> <!-- Checkbox -->
<col class="grid_1"> <!-- ID -->
<col class="grid_2"> <!-- 받는사람 -->
<col class="grid_2"> <!-- 참조 -->
<col class="grid_2"> <!-- 숨은참조 -->
<col> <!-- 제목 -->
<col class="grid_1"> <!-- 상태 -->
<col class="grid_3"> <!-- 관리 -->
<col class="grid_4"> <!-- 상세 정보 -->
<col class="grid_2"> <!-- 발송 시간 -->
</colgroup>
<thead>
<tr>
<th scope="col"><input type="checkbox" name="chkall" value="1" id="chkall"></th>
<th scope="col">ID</th>
<th scope="col">받는사람</th>
<th scope="col">참조</th>
<th scope="col">숨은참조</th>
<th scope="col">제목</th>
<th scope="col">상태</th>
<th scope="col">관리</th>
<th scope="col">발송에러 상세 정보</th>
<th scope="col">발송 시간</th>
</tr>
</thead>
<tbody>
<?php
$is_empty = empty($list);
if (!$is_empty) {
foreach ($list as $row) {
// 상태에 따라 다른 CSS 클래스 적용 (성공: 파란색, 실패: 빨간색)
$status_class = $row['status'] === 'success' ? 'txt_true' : 'txt_done';
?>
<tr>
<td class="td_chk">
<input type="checkbox" name="chk[]" value="<?= $row['id'] ?>" id="chk_<?= $row['id'] ?>">
</td>
<td class="td_num"><?= $row['id'] ?></td>
<td class="td_left" title="<?= htmlspecialchars($row['to_email']) ?>"><?= htmlspecialchars($row['to_email']) ?></td>
<td class="td_left" title="<?= htmlspecialchars($row['cc_email']) ?>"><?= htmlspecialchars($row['cc_email']) ?></td>
<td class="td_left" title="<?= htmlspecialchars($row['bcc_email']) ?>"><?= htmlspecialchars($row['bcc_email']) ?></td>
<td class="td_left"><?= htmlspecialchars($row['subject']) ?></td>
<td class="td_state"><strong class="<?= $status_class ?>"><?= htmlspecialchars(ucfirst($row['status'])) ?></strong></td>
<td class="td_mng td_mng_s">
<button type="button" class="btn btn_03 preview-btn" data-content="<?php echo base64_encode(htmlspecialchars_decode(stripslashes($row['body']))); ?>">본문보기</button>
<button type="button" class="btn btn_01 resend-btn" data-id="<?= $row['id'] ?>">재발송</button>
</td>
<td class="td_left" style="color: #666;"><?= htmlspecialchars($row['error_msg']) ?: '-' ?></td>
<td class="td_datetime"><?= $row['send_time'] ?: 'N/A' ?></td>
</tr>
<?php
}
}
if ($is_empty) {
echo '<tr><td colspan="10" class="empty_table">발송된 이력이 없습니다.</td></tr>';
}
?>
</tbody>
</table>
</div>
<div class="btn_list01 btn_list">
<button type="button" id="bulk-resend-btn" class="btn btn_02">선택 재발송</button>
</div>
</form>
<?php echo $paging; ?>
<?php
// [추가] AJAX 재발송 요청을 위한 URL을 자바스크립트에 전달합니다.
?>
<script>
const ajax_resend_url = "<?php echo G5_ADMIN_URL; ?>/mail_manage/ajax_resend_mail.php";
</script>
<?php
// 이 페이지에서 사용할 자바스크립트 파일을 로드합니다.
add_javascript('<script src="'.G5_ADMIN_URL.'/mail_manage/assets/js/send_log_list.js?ver='.G5_JS_VER.'"></script>', 10);
?>