MIL035.php
2.04 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
<?php
//*****************************************************************************
//*
//* プログラム名:Webメール
//* プログラムID:MIL035.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');
$strDBinc="include/dbcon.inc";
include($strDBinc);
//メールデータ取得
$strSQL = "SELECT * FROM mail_send_tbl WHERE syain_cd = '".$PHP_SYAIN_CD."'";
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if (pg_numrows($objRec) > 0){
for ($intI=0; $intI < pg_numrows($objRec); $intI++){
$objData = pg_fetch_object($objRec, $intI);
$arry_del_seq[$intI] = $objData->send_date;
}
}
//削除
for ($intCnt=0; $intCnt < count($arry_del_seq); $intCnt++){
$strSQLseq= "SELECT * FROM mail_send_tbl WHERE syain_cd = '".$PHP_SYAIN_CD."' AND send_date='".$arry_del_seq[$intCnt]."'";
$objRecseq = pg_exec($strSQLseq);
if($objRecseq==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if (pg_numrows($objRecseq)>0){
$objmail = pg_fetch_object($objRecseq, 0);
$filename1=$objmail->filename1;
$filename2=$objmail->filename2;
$filename3=$objmail->filename3;
$strSQLseq= "DELETE FROM mail_send_tbl WHERE syain_cd='".$PHP_SYAIN_CD."' AND send_date='".$arry_del_seq[$intCnt]."'";
$objRecseq = pg_exec($strSQLseq);
if($objRecseq==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$strTempPath="temp/".$PHP_FOLDER_NAME."/mail_send/";
if ($filename1!=""){
if(file_exists($strTempPath.$filename1)){
unlink($strTempPath.$filename1);
}
}
if ($filename2!=""){
if(file_exists($strTempPath.$filename2)){
unlink($strTempPath.$filename2);
}
}
if ($filename3!=""){
if(file_exists($strTempPath.$filename3)){
unlink($strTempPath.$filename3);
}
}
}
}
header("Location:MIL030.php");
?>