CIR005.php
3.18 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
<?php
//*****************************************************************************
//*
//* プログラム名:回覧板
//* プログラムID:CIR005.php
//* 機能 :回覧板削除処理
//* 作成者 :
//*
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");
include("include/session_start.inc");
include("include/SessionChk.inc");
$strDBinc="include/dbcon.inc";
include($strDBinc);
$strSQL="";
$objRec="null";
//一覧(個人用のみ削除)
if ($kind_flg==1){
$datArry=split("/",$strChkDat);
for ($intCnt=0; $intCnt < count($datArry)-1; $intCnt++){
$strSQLUp = "UPDATE pkairan_tbl SET " .
" del_flg=1 ".
"WHERE seq = $datArry[$intCnt] and syain_cd='$PHP_SYAIN_CD'";
//echo $strSQLUp."<BR>";
$objRecUp = pg_exec($strSQLUp);
if($objRecUp==false){
echo("SQL実行に失敗しました(UPDATE)");
exit;
}
}
$intGmflg=1;
//作成一覧(マスタ、個人用、両方削除)
}else if($kind_flg==2){
$datArry=split("/",$strChkDat);
for ($intCnt=0; $intCnt < count($datArry)-1; $intCnt++){
$strSQL = "Delete FROM pkairan_tbl WHERE seq = $datArry[$intCnt]";
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("SQL実行に失敗しました(Delete)");
exit;
}
$strFilSQL= "Select * from kairan_tbl where seq = $datArry[$intCnt]";
$objRec = pg_exec($strFilSQL);
if($objRec==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if (pg_numrows($objRec)>0){
$objFile = pg_fetch_object($objRec, 0);
$filename1=$objFile->filename;
$filename2=$objFile->filename2;
$filename3=$objFile->filename3;
$strTempPath="temp/".$PHP_FOLDER_NAME."/kairan/";
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);
}
}
}
$strSQL = "Delete FROM kairan_tbl WHERE seq = $datArry[$intCnt]";
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("SQL実行に失敗しました(Delete)");
exit;
}
}
$intGmflg=2;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
<META http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" type="text/css" href="basefont.css">
<TITLE></TITLE>
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
function load_screen(kind_flg){
if (kind_flg==1){
document.e_gru.action = "CIR001.php";
}else{
document.e_gru.action = "CIR007.php";
}
document.e_gru.method="POST";
document.e_gru.submit();
return false;
}
-->
</SCRIPT>
</HEAD>
<BODY onLoad="return load_screen(<?php echo $kind_flg; ?>);">
<form name="e_gru">
<?php
if ($intGmflg==1){
?>
<input type="hidden" name="intPage" value="<?php echo $intPage ?>">
<?php
}elseif ($intGmflg==2){
?>
<input type="hidden" NAME="kind_flg" value="<?php echo $kind_flg ?>">
<input type="hidden" name="intPage" value="<?php echo $intPage ?>">
<?php
}
?>
</form>
</BODY>
</HTML>