WML023.php
2.45 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
<?php
//*****************************************************************************
//*
//* プログラム名:Webメール
//* プログラムID:WML023.php
//* 機能 :メール削除
//* 作成者 :
//*
//*****************************************************************************
header('Content-Type: text/html; charset=EUC-JP');
include("include/session_start.inc");
include("include/SessionChk.inc");
include("include/STRING.inc");
include('./include/smarty.conf');
//**** DB接続 ****//
$strDBinc="./include/dbcon.inc";
include($strDBinc);
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;
}
$arry_del_seq=split("#",$strChkDat);
$strTempPath="temp/".$PHP_FOLDER_NAME."/mail/";
//メールの削除
for ($intCnt=0; $intCnt < count($arry_del_seq)-1; $intCnt++){
//添付ファイル名取得
$strSQLtemp= "Select * from mail_temp_tbl where syain_cd = '".$PHP_SYAIN_CD."' and mail_id='".str_replace("'", "''", subRetURI($arry_del_seq[$intCnt]))."'";
$objRectemp = pg_exec($strSQLtemp);
if($objRectemp==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
for ($inttmpCnt=0; $inttmpCnt < pg_numrows($objRectemp); $inttmpCnt++){
$objTemp = pg_fetch_object($objRectemp, $inttmpCnt);
$del_file=$PHP_SYAIN_CD."-".$objTemp->temp_index."-".$objTemp->mail_id;
if(file_exists($strTempPath.$del_file)){
unlink($strTempPath.$del_file);
}
}
//添付メールテーブル削除
$strSQLtmpdel= "delete from mail_temp_tbl where syain_cd='".$PHP_SYAIN_CD."' and mail_id='".str_replace("'", "''", subRetURI($arry_del_seq[$intCnt]))."'";
$objRectmpdel = pg_exec($strSQLtmpdel);
if($objRectmpdel==false){
echo("SQL実行に失敗しました(delete)");
exit;
}
$strSQLdel="UPDATE mail_get_tbl SET " .
"del_flg=1,header='',subject='',comment='',mail_size='0' ".
"Where syain_cd='".$PHP_SYAIN_CD."' and mail_id ='".str_replace("'", "''", subRetURI($arry_del_seq[$intCnt]))."'";
$objRecdel = pg_exec($strSQLdel);
if($objRecdel==false){
echo("SQL実行に失敗しました(UPDATE)");
exit;
}
}
header("Location:WML020.php");
?>