MIL004_m.php
5.65 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
<?php
//*****************************************************************************
//*
//* プログラム名:Webメール(携帯電話)
//* プログラムID:MIL004_m.php
//* 機能 :メール受信詳細画面
//* 作成者 :
//*
//*****************************************************************************
header("Content-type: text/html; charset=Shift_JIS");
function mime_split($data) {
$part = split("\r\n\r\n", $data, 2);
$part[1] = ereg_replace("\r\n[\t ]+", " ", $part[1]);
return $part;
}
/* 文字コードコンバートJIS→SJIS */
function convert($str) {
if (function_exists('mb_convert_encoding')) {
return mb_convert_encoding($str, "SJIS", "JIS,SJIS");
} elseif (function_exists('JcodeConvert')) {
return JcodeConvert($str, 0, 2);
}
return true;
}
include("include_m/STRING.inc");
//*** 広告 ***//
include("include_m/Advertisement.inc");
//*** 共通処理 ***//
include("include_m/CommonProcess.inc");
$mail_id=subRetURI($_GET['mail_id']);
function subRetURI($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;
}
//*** 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");
?>
<br><a href="MIL003_m.php?<?php echo $PHP_Argument ?>&intPage=<?php echo $intPage ?>"accesskey="1"><?php echo Get_Num("1"); ?>受信メール一覧へ</a>
<HR width="100%">
<?php
//*** 関数表示 ***//
require_once "include_m/jcode.phps";
require_once "include_m/MIL001_m.inc";
require_once "include_m/MIL002_m.inc";
//*** 既読フラグ更新 ***//
$strSQLall = "Update mail_get_tbl SET kind_flg=1 ".
"Where syain_cd='$PHP_SYAIN_CD' and mail_id='".str_replace("'", "''", $mail_id)."'";
$objRecall = pg_exec($strSQLall);
if($objRecall==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
//*** 受信メッセージ取得 ***//
$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 mail_id='".str_replace("'", "''", $mail_id)."'";
$objRecall = pg_exec($strSQLall);
if($objRecall==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
//曜日配列
$youbi=array("日","月","火","水","木","金","土");
$objData = pg_fetch_object($objRecall, 0);
echo "<input type=hidden value=".$strSQLall.">";
// echo "【受信日】";
$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."(".$youbi[$intYoubi].")".$str_hour.":".$str_min;
echo $strDate."<br>";
echo '<HR width="100%">';
//ヘッダー取得
$header_list = parse_header(mb_convert_encoding($objData->header, "SJIS", "EUC-JP" ));
// $header_view[] = array('subject', '件名');
// $header_view[] = array('from', '送信者');
// $header_view[] = array('to', '宛先');
// $header_view[] = array('cc', 'Cc');
// $header_view_num = count($header_view);
$header_view[] = array('subject', '');
$header_view[] = array('from', '');
$header_view[] = array('to', '');
$header_view[] = array('cc', '');
$header_view_num = count($header_view);
//*** 件名・送信者・宛先・CC表示 ***//
for ($i = 0; $i < $header_view_num; ++$i) {
if (!isset($header_list[$header_view[$i][0]])) {
continue;
}
//echo "【".$header_view[$i][1]."】";
if (($header_view[$i][0]!="to") && ($header_view[$i][0]!="cc")){
if ($header_list[$header_view[$i][0]]==''){
echo '(no subject)';
}else{
if($i==0){
echo mb_convert_encoding($objData->subject, "SJIS", "EUC-JP");
}else{
echo mb_convert_encoding(link_url(htmlspecialchars(decode_mimeheader($header_list[$header_view[$i][0]], 1), ENT_QUOTES)), "SJIS", "EUC-JP");
}
}
echo '<HR width="100%">';
}
}
// echo "【本文】<br>";
echo mb_convert_encoding(str_replace("\n","<br>",link_url(strip_tags($objData->comment))), "SJIS", "EUC-JP");
$strSQLtemp="Select * from mail_temp_tbl Where syain_cd='$PHP_SYAIN_CD' and mail_id='".str_replace("'", "''", $mail_id)."' Order by temp_index ";
$objRectemp = pg_exec($strSQLtemp);
if (pg_numrows($objRectemp)>0){
echo "【添付ファイル】<br>";
}
for ($inttempCnt = 0; $inttempCnt < pg_numrows($objRectemp); $inttempCnt++) {
$objTempfile = pg_fetch_object($objRectemp, $inttempCnt);
echo mb_convert_encoding($objTempfile->temp_name, "SJIS", "EUC-JP")."<br>";
}
?>
<a href="MIL003_m.php?<?php echo $PHP_Argument ?>&intPage=<?php echo $intPage ?>"accesskey="1"><?php echo Get_Num("1"); ?>受信メール一覧へ</a>
<HR width="100%">
<?php
//メニュー表示
include("include_m/CommonMenuReturn.inc");
?>
<?php
//*** 共通変数取得 ***//
include("include_m/CommonHidden.inc");
?>
</form>
</BODY>
</HTML>