WML032.php 1.77 KB
<?php 
//*****************************************************************************
//* 
//* プログラム名:Webメール
//* プログラムID:WML032.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);

$arry_del_seq=split("#",$strChkDat);

//削除
for ($intCnt=0; $intCnt < count($arry_del_seq)-1; $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:WML030.php");

?>