mail_body_edit.php
1.65 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
<?PHP
//*****************************************************************************
//*
//* プログラム名:め〜るNiポン
//* プログラムID:menu.php
//* 機能 :ASP管理用メニュー(ユーザー一覧)
//* 作成者 :Y.Hamaya(MTC)
//*
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");
include("include/allinc.inc");
if($flg==2){
//更新
$strSQL="Update mail_body_tbl SET name='".$name."'".
",title='".$title."'".
",body='".$body."'".
" where seq = ".$seq;
$objRecSet = pg_exec($strSQL);
if($objRecSet==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
}elseif($flg==1){
$strSQL = "select seq from mail_body_tbl order by seq DESC";
$objRecSet = pg_exec($strSQL);
if($objRecSet==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$objData = pg_fetch_object($objRecSet, 0);
$seq=($objData->seq)+1;
$strSQL = "INSERT INTO mail_body_tbl (" .
"seq, " .
"name, " .
"title, " .
"body) " .
"VALUES (" .
$seq . ", " .
"'" . $name . "', " .
"'" . $title . "', " .
"'" . $body . "') ";
$objRecSet = pg_exec($strSQL);
if($objRecSet==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
}else{
$strSQL = "DELETE from mail_body_tbl where seq =".$seq;
$objRecSet = pg_exec($strSQL);
if($objRecSet==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
}
header("Location:send_mail.php");
?>