kensu.php
7.37 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
<?PHP
//*****************************************************************************
//*
//* プログラム名:ログイン/個人設定機能 個人設定画面
//* プログラムID:kensu.php
//* 機能 :
//* 作成者 :Y-ogawa(MTC)
//*
//*****************************************************************************
header("Content-type: text/html; charset=Shift_JIS");
//***************************
//* インクルードファイル
//***************************
include("../include/dbset.inc");
include("../include/dbcon.inc");
include("../include/jcode.phps");
include("../include/getWeekDay.inc");
include("../../include/mtcnews.inc");
//***************************
//* 内部変数
//***************************
$objRecSet = null; //レコードセットオブジェクト
$strSQL = "";
$Mcnt = 0; //未読者のカウント
$Kcnt = 0; //既読者のカウント
$Ncnt = 0; //未送信者のカウント
$Cnt = array(); //カウント
//***************************
//* メイン処理
//***************************
//配信情報を取得
$objRecSet = null; //レコードセットオブジェクト(配信情報)
$strSQL = ""; //SQL文
$strSQL = "SELECT * FROM Mail_data WHERE Mail_id = " . $key;
$objRecSet = pg_exec($strSQL);
if($objRecSet==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$intDataCount = pg_numrows($objRecSet);
$Mail_date = pg_result($objRecSet,0,"Message_date");
$Subject_name = jcodeconvert(pg_result($objRecSet,0,"Subject_name"),1,2);
//開催日時
$date_yyyy = substr($Mail_date,0,4);
$date_mm = substr($Mail_date,4,2);
if("0" == substr($date_mm, 0, 1)){
$date_mm=substr($date_mm, 1, 1);
}
$date_dd = substr($Mail_date,6,2);
if("0" == substr($date_dd, 0, 1)){
$date_dd=substr($date_dd, 1, 1);
}
if(trim($date_mm)!=""){
$strKaisai_date = $date_yyyy . "年" . $date_mm . "月" . $date_dd . "日(" .
jcodeconvert(getWeekDay($date_yyyy , $date_mm , $date_dd), 1, 2) . ")";
}else{
$strKaisai_date = "";
}
//***** 回答文言を取得 *****//
$strSQL = "SELECT * FROM answer_data WHERE mail_id = " . $key;
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("SQL実行に失敗しました(SELECT)d");
exit;
}
if(pg_numrows($objRec)!=0){
$objData = pg_fetch_object($objRec,0);
$SYORI_MODE = $objData->name50_nm;
for($intI = 1; $intI <= $objData->select_nm; $intI++){
$idx = $intI-1;
$ANS_LIST[$idx][0] =pg_result($objRec, 0, "name" . $intI . "_id");
if ($SYORI_MODE=="SC"){
$ANS_LIST[$idx][1] = JcodeConvert(pg_result($objRec, 0, "name" . $intI . "_nm"),1,2);
if ($intI!=1){
$Mst_STDate = trim(substr($ANS_LIST[$idx][1], 0,8));
$Mst_STTime = trim(substr($ANS_LIST[$idx][1], 8,4));
$Mst_EDDate = trim(substr($ANS_LIST[$idx][1],12,8));
$Mst_EDTime = trim(substr($ANS_LIST[$idx][1],20,4));
$ANS_LIST[$idx][1] = "";
$ANS_LIST[$idx][1] .= (int)substr($Mst_STDate,0,4)."年";
$ANS_LIST[$idx][1] .= (int)substr($Mst_STDate,4,2)."月";
$ANS_LIST[$idx][1] .= (int)substr($Mst_STDate,6,2)."日";
if ($Mst_STTime!=""){
$ANS_LIST[$idx][1] .= (int)substr($Mst_STTime,0,2).":";
$ANS_LIST[$idx][1] .= substr($Mst_STTime,2,2);
}
if ($Mst_EDDate!=""){
$ANS_LIST[$idx][1] .= "〜";
$ANS_LIST[$idx][1] .= (int)substr($Mst_EDDate,0,4)."年";
$ANS_LIST[$idx][1] .= (int)substr($Mst_EDDate,4,2)."月";
$ANS_LIST[$idx][1] .= (int)substr($Mst_EDDate,6,2)."日";
}
if ($Mst_EDTime!=""){
$ANS_LIST[$idx][1] .= (int)substr($Mst_EDTime,0,2).":";
$ANS_LIST[$idx][1] .= substr($Mst_EDTime,2,2);
}
}
$strSQL = "SELECT ";
$strSQL .= " COUNT(*) AS dt_cnt ";
$strSQL .= "FROM ";
$strSQL .= " mail_info2 ";
$strSQL .= "WHERE";
$strSQL .= " mail_id = ".$key." AND ";
$strSQL .= " check_flg = ".$ANS_LIST[$idx][0];
//echo $strSQL."<hr>";
$objCntRec = pg_exec($strSQL);
if($objCntRec==false){
echo("SQL実行に失敗しました(SELECT)c");
exit;
}
$objCntData = pg_fetch_object($objCntRec, 0);
$ANS_LIST[$idx][3] = $objCntData->dt_cnt;
}else{
$ANS_LIST[$idx][1] =JcodeConvert(pg_result($objRec, 0, "name" . $intI . "_nm"),1,2);
if ($flg==$ANS_LIST[$idx][0]){
$ANS_LIST[$idx][2] = "checked";
}
$strSQL = "SELECT ";
$strSQL .= " COUNT(*) AS dt_cnt ";
$strSQL .= "FROM ";
$strSQL .= " mail_info ";
$strSQL .= "WHERE";
$strSQL .= " mail_id = ".$key." AND ";
$strSQL .= " check_flg = ".$ANS_LIST[$idx][0];
//echo $strSQL."<hr>";
$objCntRec = pg_exec($strSQL);
if($objCntRec==false){
echo("SQL実行に失敗しました(SELECT)c");
exit;
}
$objCntData = pg_fetch_object($objCntRec, 0);
$ANS_LIST[$idx][3] = $objCntData->dt_cnt;
}
}
}else{
$ANS_LIST=array();
}
//***** 閲覧数集計 *****//
$strSQL = "SELECT ";
$strSQL .= " (SELECT COUNT(*) FROM mail_info AS chk1 WHERE chk1.mail_id=M.mail_id AND chk1.check_flg = 100) AS not_cnt ,";
$strSQL .= " (SELECT COUNT(*) FROM mail_info AS chk1 WHERE chk1.mail_id=M.mail_id AND chk1.check_flg = 0) AS n_read_cnt,";
$strSQL .= " (SELECT COUNT(*) FROM mail_info AS chk1 WHERE chk1.mail_id=M.mail_id AND chk1.check_flg = 99) AS read_cnt ";
$strSQL .= "FROM ";
$strSQL .= " mail_info AS M ";
$strSQL .= "WHERE";
$strSQL .= " M.mail_id=".$key." ";
$strSQL .= "GROUP BY ";
$strSQL .= " M.mail_id";
//echo $strSQL."<hr>";
$objCntRec = pg_exec($strSQL);
if($objCntRec==false){
echo("SQL実行に失敗しました(SELECT)b");
exit;
}
$objCntData = pg_fetch_object($objCntRec, 0);
$NOT_CNT = $objCntData->not_cnt;
$N_READ_CNT = $objCntData->n_read_cnt;
$READ_CNT = $objCntData->read_cnt;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<TITLE>配信情報</TITLE>
</HEAD>
<BODY>
<FORM>
<center>
<FONT color=blue size=5>め〜るNiポン(携帯版)</FONT><br>
<HR width="100%">
</center>
【件名】<BR>
<?PHP echo $Subject_name; ?><BR>
【開催日時】<BR>
<?PHP echo $strKaisai_date; ?><BR>
【回答件数】<BR>
<?PHP
$Get_Key = "&key=".$key;
$Get_Key .= "&dkey=".$dkey;
$Get_Key .= "&PHP_SYAIN_CD=".$PHP_SYAIN_CD;
$Get_Key .= "&PHP_DB_NAME=".$PHP_DB_NAME;
$Get_Key .= "&PHP_POST_DB_FLG=".$PHP_POST_DB_FLG;
$Get_Key .= "&PHP_POST_DB_USER_NAME=".$PHP_POST_DB_USER_NAME;
?>
<a HREF="userlist.php?ans=100<?PHP echo $Get_Key; ?>">未送</a> <?PHP echo $NOT_CNT; ?> 件<br />
<a HREF="userlist.php?ans=0<?PHP echo $Get_Key; ?>">未読</a> <?PHP echo $N_READ_CNT; ?> 件<br />
<a HREF="userlist.php?ans=99<?PHP echo $Get_Key; ?>">既読</a> <?PHP echo $READ_CNT; ?> 件<br />
<?PHP for($idx = 0; $idx < count($ANS_LIST); $idx++){ ?>
<a HREF="userlist.php?ans=<?PHP echo $ANS_LIST[$idx][0]; ?><?PHP echo $Get_Key; ?>"><?PHP echo $ANS_LIST[$idx][1] ?></a> <?PHP echo $ANS_LIST[$idx][3] ?> 件<br />
<?PHP } ?>
<BR>
<HR width="100%">
<A HREF="itiran.php?dkey=<?PHP echo $dkey ?>&PHP_SYAIN_CD=<?PHP echo $PHP_SYAIN_CD ?>&PHP_DB_NAME=<?PHP echo $PHP_DB_NAME ?>&PHP_POST_DB_FLG=<?PHP echo $PHP_POST_DB_FLG ?>&PHP_POST_DB_USER_NAME=<?PHP echo $PHP_POST_DB_USER_NAME ?>">戻る</A><BR>
<A HREF="../index.php">ログインに戻る</A>
</A>
</FORM>
<HR width="100%">
<?PHP
echo "<font size=\"2\">[ASP / SaaS 製品情報]<br />".jcodeconvert($Mail_Keitai_news,1,2)."</font>";
?>
<HR width="100%">
<CENTER>
<font color="#666666">Copyright (C) 2004 Media Tech Inc. All rights reserved.</font>
</CENTER>
</BODY>
</HTML>