MIL030.php
11.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
<?php
//*****************************************************************************
//*
//* プログラム名:Webメール
//* プログラムID:MIL030.php
//* 機能 :送信済み一覧画面
//* 作成者 :T.Yamamoto
//*
//*****************************************************************************
header('Content-Type: text/html; charset=EUC-JP');
include("include/session_start.inc");
include("include/SessionChk.inc");
include("inc/header.inc");
$strDBinc="include/dbcon.inc";
include($strDBinc);
$syain_cd = $PHP_SYAIN_CD;
$strSQLseq="Select * from mail_TBL Where syain_cd='$syain_cd'";
//メール情報取得
$objRecseq = pg_exec($strSQLseq);
if($objRecseq==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if (pg_numrows($objRecseq) > 0){
$objmail = pg_fetch_object($objRecseq, 0);
$strMailAdd=$objmail->mail_add;
$intSrvadd=$objmail->pop3_add;
$strUserName=$objmail->mail_name;
$strPASSWORD=$objmail->mail_pass;
// 登録サーバー名取得
$strSQLseq="Select * from mailAdmin_TBL Where srv_id=".$intSrvadd." and srv_flg=2";
$objRecseq = pg_exec($strSQLseq);
if($objRecseq==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if (pg_numrows($objRecseq) > 0){
$objmail = pg_fetch_object($objRecseq, 0);
$strSrvName=$objmail->srv_add;
}
}
$strMailAdd = $strMailAdd;
// ソート処理 (2013/02/13)
$sort_item = $_POST["sort_item"] ? $_POST["sort_item"] : "send_date";
$sort_pattern = $_POST["sort_pattern"] ? $_POST["sort_pattern"] : "desc";
$header_subject = create_sort_item($sort_item, "subject", "件名", $sort_pattern);
$header_mail_to = create_sort_item($sort_item, "mail_to", "宛先", $sort_pattern);
$header_date = create_sort_item($sort_item, "send_date", "送信日時", $sort_pattern);
function sort_reverse($sort) {
if ("asc" == $sort) {
return "desc";
} else {
return "asc";
}
}
// ヘッダーリンクを作る関数
function create_sort_item($current, $item, $item_text, $pattern) {
$icon_str = "";
$pattern_str = "";
if ($current == $item) {
if ($pattern == "asc") {
$icon_str = "▲";
$pattern_str = "desc"; // 次の動作は降順
} else {
$icon_str = "▼";
$pattern_str = "asc"; // 次の動作は昇順
}
}
$link_str = "<a href=\"javascript:Sort_Data('".$item."', '".$pattern_str."');\">";
$link_str .= "<span class=\"Normalfont\">" . $item_text . $icon_str;
$link_str .= "</span></a>";
return $link_str;
}
/* 使ってない
$strSQLseq="Select * From mail_send_tbl Where syain_cd='".$syain_cd."' order by send_date";
$objRecseq = pg_exec($strSQLseq);
if($objRecseq==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$total_num=pg_numrows($objRecseq);
*/
//**** メニュー ****//
include("menu_opacity.php");
include("inc/MIL001.inc");
include("inc/MIL002.inc");
include("inc/MIL030.inc");
// Options
$show_header = FALSE; // show all headers
$use_apop = FALSE; // use APOP for authentication
$list_num = 10; // listing messages per a page
$strSQLseq="Select * From mail_send_tbl Where syain_cd='".$PHP_SYAIN_CD."' order by $sort_item ".sort_reverse($sort_pattern);
//echo $strSQLseq;
$objRecseq = pg_exec($strSQLseq);
if($objRecseq==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$total_num=pg_numrows($objRecseq);
//文字化け対策
if (function_exists("mb_internal_encoding")) {
mb_internal_encoding("SJIS");
}
$sub_len = 30;
if (isset($_GET['start_from']) && $_GET['start_from'] < $total_num && $_GET['start_from'] > 0) {
$init_num = $_GET['start_from'];
} else {
$init_num = $total_num;
}
//未読メッセージ取得
$strSQLmi="Select mail_id from mail_get_tbl Where syain_cd='$PHP_SYAIN_CD' and kind_flg=0 and del_flg=0";
$objRecmi = pg_exec($strSQLmi);
if($objRecmi==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
?>
<table width="100%" border="0" cellspacing="0">
<tr>
<td class="midashi">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="50%" scope="col"><div align="left"><img src="image/mail.gif" border="0"><span class="MiddleBold"><?php echo $PHP_TITLE_NAME[13] ?></span></div></th>
<th width="50%" scope="col"><div align="right"><a href='javascript:Disp_Help("MILHLP.htm")'><img src="image/help.gif" border="0"></a> <a href='javascript:Disp_Help("MILHLP.htm")'>ヘルプ</a></div></th>
</tr>
</table><div align="right"></div>
</td>
</tr>
</table><br>
<TABLE border=0 width=100%>
<TR>
<TD align="left">
<span class="Normalfont">
[<a href="MIL001.php">新着メールの確認</a>]
[<a href="MIL010.php?from=&to=<?php echo $strMailAdd ?>&strSubject=&strBody=">新規作成</a>]
[<a href="MIL020.php">受信ボックス(未読<?php echo pg_numrows($objRecmi) ?>件)</a>]
[<a href="MIL030.php">送信ボックス</a>]
[<a href="MIL040.php">個人アドレス帳</a>]
</span>
</TD>
<TD align="right">
<span class="Normalfont">
[<a href="MIL050.php">署名設定</a>]
[<a href="MIL002.php">アカウント設定</a>]
</span>
</TD>
</TR>
</TABLE>
<BR>
<TABLE border=0 width=100%>
<TR>
<TD align="left">
<img src="image/folder.gif" border="0"><strong><span class="Normalfont">送信ボックス(<?php echo $total_num ?>件)</span></strong>
<?php echo $strMsg; ?>
</TD>
<TD align="right">
<input type="button" value="全送信メール一括削除" style="FONT-WEIGHT: bold;COLOR: #FF0000;" onclick="Delete_AllMail();">
</TD>
</TR>
</TABLE>
<form name="e_gru">
<?php if ($total_num > 0){ ?>
<TABLE border=0 width=100%>
<TR>
<TD align="right">
<span class="Normalfont">
<?php if ($total_num > $init_num) {
$intCnt=$init_num + $list_num;
echo '<input type="button" value="前の10件" onclick="Page('.$intCnt.');">';
}
echo '<input type="button" value="先頭へ戻る" onclick="Top();">';
if ($init_num > $list_num) {
$intCnt=$init_num - $list_num;
echo '<input type="button" value="次の10件" onclick="Page('.$intCnt.');">';
}
?>
</span>
</TD>
</TR>
</TABLE>
<TABLE cellSpacing=1 cellPadding=1 width=100% class="mainColor" border=0>
<TR>
<TD>
<TABLE cellSpacing=1 cellPadding=1 width=100% align=center class="mainColor" border=0>
<TR class="toneDown">
<!--
<TD height="25" width="50%" align="center"><span class="Normalfont">件名</span></TD>
<TD height="25" width="50" align="center"><span class="Normalfont">添付</span></TD>
<TD height="25" width="200" align="center"><span class="Normalfont">宛先</span></TD>
<TD height="25" width="200" align="center"><span class="Normalfont">送信日付</span></TD>
-->
<TD height="25" width="50%" align="center"><?php echo $header_subject; ?></TD>
<TD height="25" width="50" align="center"><span class="Normalfont">添付</span></TD>
<TD height="25" width="200" align="center"><?php echo $header_mail_to; ?></TD>
<TD height="25" width="200" align="center"><?php echo $header_date; ?></TD>
<TD height="25" width="50" align="center">
<INPUT type="button" onclick="All_chk();" value="チェック">
<input type="button" value="削除" onclick="Delete_Mail()">
</TD>
</TR>
<?php
//曜日配列
$youbi=array("日","月","火","水","木","金","土");
for ($num = $init_num; $num > 0; --$num) {
if ($init_num - $list_num >= $num) break;
$objmail = pg_fetch_object($objRecseq, ($num-1));
?>
<tr BGCOLOR=#FFFFFF>
<td align="left">
<span class="Normalfont">
<?php
if ($objmail->subject!="") {
echo '<a href="MIL031.php?view_uid='.$objmail->send_date.'">';
$sub = decode_mimeheader($objmail->subject, 1);
if($sub==""){
$sub='(no subject)';
}
echo htmlspecialchars($sub, ENT_QUOTES);
echo '</a>';
} else {
echo '<a href="MIL031.php?view_uid='.$objmail->send_date.'">';
echo '(no subject)';
echo '</a>';
}
?>
</span>
</TD>
<TD height="25" width="50" align="center">
<?php
//添付ファイル
if ($objmail->filename1 != "" || $objmail->filename2 != "" || $objmail->filename3 != "") {
echo '<span class="Normalfont">◎</span>';
}
?>
</td>
<td><span class="Normalfont">
<?php
if ($objmail->mail_to!="") {
$strMailto = split(",",$objmail->mail_to);
for($ii=0;$ii<count($strMailto);$ii++){
if (trim(get_name($strMailto[$ii]), 1)==" "){
echo htmlspecialchars(decode_mimeheader($strMailto[$ii], 1), ENT_QUOTES);
}else{
echo htmlspecialchars(decode_mimeheader(get_name($strMailto[$ii]), 1), ENT_QUOTES);
}
if($ii<count($strMailto)-1){
echo ",";
}
}
}else{
echo '(Unknown)';
}
echo '</span></td>';
echo '<td align="center" nowrap><span class="Normalfont">';
if ($objmail->send_date!="") {
$str_year=substr($objmail->send_date,0,4);
$str_mon=substr($objmail->send_date,4,2);
$str_day=substr($objmail->send_date,6,2);
$str_hour=substr($objmail->send_date,8,2);
$str_min=substr($objmail->send_date,10,2);
$intYoubi=date("w", mktime (0,0,0,$str_mon,$str_day,$str_year));
$strDate=$str_year." ".$str_mon."/".$str_day."(".$youbi[$intYoubi].")"." ".$str_hour.":".$str_min;
echo $strDate;
} else {
echo '(Unknown)';
}
echo '</span></td>';
echo '<td align="center">';
echo '<INPUT type="checkbox" name="del_seq" value="'.$objmail->send_date.'">';
echo '</td>';
echo "</tr>\n";
}
?>
<TR class="toneDown">
<TD height="25" width="50%" align="center"><span class="Normalfont">件名<?php echo $sort_subject; ?></span></TD>
<TD height="25" width="50" align="center"><span class="Normalfont">添付</span></TD>
<TD height="25" width="200" align="center"><span class="Normalfont">宛先<?php echo $sort_destination; ?></span></TD>
<TD height="25" width="200" align="center"><span class="Normalfont">送信日付<?php echo $sort_date; ?></span> </TD>
<TD height="25" width="50" align="center">
<INPUT type="button" onclick="All_chk();" value="チェック">
<input type="button" value="削除" onclick="Delete_Mail()">
</TD>
</TR>
</table>
</tr></td>
</table>
<TABLE border=0 width=100%>
<TR>
<TD align="right">
<span class="Normalfont">
<?php if ($total_num > $init_num) {
$intCnt=$init_num + $list_num;
echo '<input type="button" value="前の10件" onclick="Page('.$intCnt.');">';
}
echo '<input type="button" value="先頭へ戻る" onclick="Top();">';
if ($init_num > $list_num) {
$intCnt=$init_num - $list_num;
echo '<input type="button" value="次の10件" onclick="Page('.$intCnt.');">';
}
?>
</span>
</TD>
</TR>
</TABLE>
<BR>
<input name="dele_uid" type="hidden" value="">
<input name="start_from" type="hidden" value="<?php echo $init_num; ?>">
<input name="strChkDat" type="hidden" value="">
<input name="sort_item" type="hidden" value="">
<input name="sort_pattern" type="hidden" value="">
<?php }else{ ?>
<BR><BR><span class="Normalfont"> 送信ボックスにはメールはありません</span>
<?php }
?>
</form>
<?php
//コピーライト
include("include/copyright.inc");
?>