MIL003_m.php
8.66 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
<?php
//*****************************************************************************
//*
//* プログラム名:Webメール(携帯電話)
//* プログラムID:MIL003_m.php
//* 機能 :メール受信一覧画面
//* 作成者 :
//*
//*****************************************************************************
header("Content-type: text/html; charset=Shift_JIS");
include("include_m/STRING.inc");
//*** 広告 ***//
include("include_m/Advertisement.inc");
//*** 共通処理 ***//
include("include_m/CommonProcess.inc");
//*** 関数表示 ***//
require_once "include_m/jcode.phps";
require_once "include_m/MIL001.inc";
require_once "include_m/MIL002.inc";
//*** webメール***
$strMenuSQL = "SELECT name FROM sub_menu_TBL WHERE url = 'MIL001.php'";
$rsRecset = pg_exec($strMenuSQL);
$PHP_TITLE_NAME=mb_convert_encoding(pg_result($rsRecset,0,"name"), "SJIS", "EUC-JP");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<TITLE>E-グルPro(<?php echo $PHP_TITLE_NAME; ?>)</TITLE>
</HEAD>
<BODY>
<form>
<center>
<?php echo $PHP_TITLE_NAME; ?><br>
<?php echo $strName; ?>
<HR width="100%">
<?php echo $koukokuTEL; ?>
</center>
<?php
//メニュー表示
include("include_m/CommonMenuReturn.inc");
?>
<HR width="100%">
<?php
$strMILSQL="Select send_flg8,send_flg9 from sendinfo_tbl Where syain_cd='$PHP_SYAIN_CD'";
$objMILData = pg_exec($strMILSQL);
if($objMILData==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$delmail_flg=0;
$dispmail_flg=10;
if (pg_numrows($objMILData) > 0){
$objchkMail = pg_fetch_object($objMILData, 0);
$delmail_flg = $objchkMail->send_flg9;
if ($objchkMail->send_flg8=="0"){
$dispmail_flg=10;
}else{
$dispmail_flg = $objchkMail->send_flg8;
if ($dispmail_flg==""){
$dispmail_flg=10;
}
}
}else{
$delmail_flg=0;
$dispmail_flg=10;
}
//*** 受信メッセージ取得 ***//
$strSQLall = "Select mail_id,get_date,header,subject,comment,mail_size,kind_flg,temp_flg from mail_get_tbl ".
"Where syain_cd='$PHP_SYAIN_CD' and del_flg=0 Order by get_date Desc";
$objRecall = pg_exec($strSQLall);
if($objRecall==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if (empty($intPage)){
$intPage=0;
}
//次ページ画面へリンク
if (($intPage > 0) && (pg_numrows($objRecall) > ($dispmail_flg * ($intPage+1)))){
$intPt1=$intPage-1;
$intPt2=$intPage+1;
echo '<a href="MIL003_m.php?'.$PHP_Argument.'&intPage='.$intPt1.'" accesskey="3">'.Get_Num("2").'[前'.$dispmail_flg.'件]</a>';
echo '<a href="MIL003_m.php?'.$PHP_Argument.'&intPage='.$intPt2.'" accesskey="3">'.Get_Num("3").'[次'.$dispmail_flg.'件]</a>';
echo '<a href="MIL003_m.php?'.$PHP_Argument.'" accesskey="4">'.Get_Num("4").'[最新]</a>';
}elseif(($intPage > 0) && (pg_numrows($objRecall) <= ($dispmail_flg * ($intPage+1)))){
$intPt1=$intPage-1;
echo '<a href="MIL003_m.php?'.$PHP_Argument.'&intPage='.$intPt1.'" accesskey="2">'.Get_Num("2").'[前'.$dispmail_flg.'件]</a>';
echo '[次'.$dispmail_flg.'件]';
echo '<a href="MIL003_m.php?'.$PHP_Argument.'" accesskey="3">'.Get_Num("3").'[最新]</a>';
}elseif(($intPage == 0) && (pg_numrows($objRecall) > ($dispmail_flg * ($intPage+1)))){
$intPt2=$intPage+1;
echo '[前'.$dispmail_flg.'件]';
echo '<a href="MIL003_m.php?'.$PHP_Argument.'&intPage='.$intPt2.'" accesskey="2">'.Get_Num("2").'[次'.$dispmail_flg.'件]</a>';
echo '<a href="MIL003_m.php?'.$PHP_Argument.'" accesskey="3">'.Get_Num("3").'[最新]</a>';
}else{
echo '[前'.$dispmail_flg.'件]';
echo '[次'.$dispmail_flg.'件]';
echo '<a href="MIL003_m.php?'.$PHP_Argument.'" accesskey="2">'.Get_Num("2").'[最新]</a>';
}
echo '<hr width="100%">';
//終了ページの取得
$intEndCnt=$dispmail_flg * ($intPage+1);
if ($intEndCnt>pg_numrows($objRecall)){
$intEndCnt=pg_numrows($objRecall);
}
if (pg_numrows($objRecall)==0){
echo "メールはありません。";
}
//曜日配列
$youbi=array("日","月","火","水","木","金","土");
$ChkDate=date("Y")."/".date("m")."/".date("d");
for ($intCnt = $dispmail_flg * $intPage; $intCnt < $intEndCnt; $intCnt++) {
$objData = pg_fetch_object($objRecall, $intCnt);
//送信者が空の場合は、解析&UPDATE
if(trim($str_From) == ""){
$header_list = parse_header($objData->header);
//ヘッダー取得
if (isset($header_list['from'])) {
$str_From=decode_mimeheader(get_name($header_list['from']), 1);
$str_From=ereg_replace("[\'\"\;]", "", $str_From);
$str_Addr=decode_mimeheader($header_list['from'], 1);
$str_Addr=ereg_replace("[\'\"\;]", "", $str_Addr);
$str_Addr= str_replace("\"","",$str_Addr);
$intpoint = strlen($str_From);
$str_Addr = trim(substr($str_Addr,$intpoint));
if (substr($str_Addr,0,1)=="@"){
$str_Addr = htmlspecialchars(decode_mimeheader($header_list['from'], 1), ENT_QUOTES);
}
} else {
$str_From = '(Unknown)';
$str_From=mb_convert_encoding( $str_From, "EUC-JP", "SJIS" );
$str_Addr = '';
}
$strSqlTemp = "update mail_get_tbl set from_name = '".$str_From."', from_addr = '".$str_Addr."' where mail_id = '".addslashes($objData->mail_id)."' and get_date = '".$objData->get_date."' and syain_cd='".$PHP_SYAIN_CD."'";
$objRecTemp = pg_exec($strSqlTemp);
if($objRecTemp==false){
echo("SQL実行に失敗しました(UPDATE)");
exit;
}
}
//日付編集
$getDate=mb_convert_encoding( $objData->get_date, "SJIS", "EUC-JP" );
$str_year=substr($getDate,0,4);
$str_mon=substr($getDate,4,2);
$str_day=substr($getDate,6,2);
$str_hour=substr($getDate,8,2);
$str_min=substr($getDate,10,2);
$intYoubi=date("w", mktime (0,0,0,$str_mon,$str_day,$str_year));
$strDate=$str_year."/".$str_mon."/".$str_day;
//件名
if(trim($objData->subject)==""){
$strName="(NoSubject)";
}else{
$strName=LINE_DEL(mb_convert_encoding($objData->subject, "SJIS", "EUC-JP"),20);
}
$str_From=LINE_DEL(mb_convert_encoding($objData->from_name, "SJIS", "EUC-JP" ),14);
$mail_id=mb_convert_encoding($objData->mail_id, "SJIS", "EUC-JP" );
$intDtCnt=$intCnt+1;
if ($ChkDate==$strDate){
echo $str_hour.":".$str_min." ";
echo '<a href="MIL004_m.php?'.$PHP_Argument.'&mail_id='.subRepURI($mail_id).'&intPage='.$intPage.'">';
echo $str_From." ";
echo $strName;
if ($objData->kind_flg==0){
echo "[未読]";
}
echo '</a><hr width="100%">';
}else{
echo $str_mon."/".$str_day." ";
echo "<a href='MIL004_m.php?".$PHP_Argument.'&mail_id='.subRepURI($mail_id).'&intPage='.$intPage."'>";
echo $str_From." ";
echo $strName;
if ($objData->kind_flg==0){
echo "[未読]";
}
echo '</a><hr width="100%">';
}
}
//次ページ画面へリンク
if (($intPage > 0) && (pg_numrows($objRecall) > ($dispmail_flg * ($intPage+1)))){
$intPt1=$intPage-1;
$intPt2=$intPage+1;
echo '<a href="MIL003_m.php?'.$PHP_Argument.'&intPage='.$intPt1.'" accesskey="2">'.Get_Num("2").'[前'.$dispmail_flg.'件]</a>';
echo '<a href="MIL003_m.php?'.$PHP_Argument.'&intPage='.$intPt2.'" accesskey="3">'.Get_Num("3").'[次'.$dispmail_flg.'件]</a>';
echo '<a href="MIL003_m.php?'.$PHP_Argument.'" accesskey="4">'.Get_Num("4").'[最新]</a>';
}elseif(($intPage > 0) && (pg_numrows($objRecall) <= ($dispmail_flg * ($intPage+1)))){
$intPt1=$intPage-1;
echo '<a href="MIL003_m.php?'.$PHP_Argument.'&intPage='.$intPt1.'" accesskey="2">'.Get_Num("2").'[前'.$dispmail_flg.'件]</a>';
echo '[次'.$dispmail_flg.'件]';
echo '<a href="MIL003_m.php?'.$PHP_Argument.'" accesskey="3">'.Get_Num("3").'[最新]</a>';
}elseif(($intPage == 0) && (pg_numrows($objRecall) > ($dispmail_flg * ($intPage+1)))){
$intPt2=$intPage+1;
echo '[前'.$dispmail_flg.'件]';
echo '<a href="MIL003_m.php?'.$PHP_Argument.'&intPage='.$intPt2.'" accesskey="2">'.Get_Num("2").'[次'.$dispmail_flg.'件]</a>';
echo '<a href="MIL003_m.php?'.$PHP_Argument.'" accesskey="3">'.Get_Num("3").'[最新]</a>';
}else{
echo '[前'.$dispmail_flg.'件]';
echo '[次'.$dispmail_flg.'件]';
echo '<a href="MIL003_m.php?'.$PHP_Argument.'" accesskey="2">'.Get_Num("2").'[最新]</a>';
}
function subRepURI($prmStr){
$prmStr = str_replace("+", "EgruProPlus", $prmStr);
$prmStr = str_replace("&", "EgruProAnp", $prmStr);
$prmStr = str_replace("%", "EgruProPer", $prmStr);
$prmStr = str_replace("#", "EgruProNum", $prmStr);
$prmStr = str_replace("'", "EgruProSing", $prmStr);
$prmStr = str_replace('"', "EgruProDoub", $prmStr);
$prmStr = str_replace("$", "EgruProDoll", $prmStr);
$prmStr = str_replace("-", "EgruProhyph", $prmStr);
return $prmStr;
}
?>
<HR width="100%">
<?php
//メニュー表示
include("include_m/CommonMenuReturn.inc");
?>
<?php
//*** 共通変数取得 ***//
include("include_m/CommonHidden.inc");
?>
</form>
<br>
</BODY>
</HTML>