KST014_1.php
1.66 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
<?php
//*****************************************************************************
//*
//* プログラム名:個人設定
//* プログラムID:KST014_1.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";
$strSQLIns="";
$objRecIns="null";
$strSQLUp="";
$objRecUp="null";
$strSQLDel="";
$objRecDel="null";
$strSQL= "SELECT e_mail FROM tel_trans_TBL WHERE syain_cd='$PHP_SYAIN_CD' ";
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if(pg_numrows($objRec)==0){
$strMail=$email1."@".$email2;
if (trim($strMail)!="@"){
$strSQLIns = "Insert Into tel_trans_tbl " .
"(syain_cd,e_mail) " .
"values (" .
"'$PHP_SYAIN_CD','$strMail')";
//echo("strSQL[" . $strSQLIns . "]<BR>");
$objRecIns = pg_exec($strSQLIns);
if($objRecIns==false){
echo("SQL実行に失敗しました(Insert)");
exit;
}
}
}else{
$strMail=$email1."@".$email2;
if (trim($strMail)=="@"){
$strSQLDel = "Delete from tel_trans_tbl WHERE syain_cd = '$PHP_SYAIN_CD'";
$objRecDel = pg_exec($strSQLDel);
if($objRecDel==false){
echo("SQL実行に失敗しました(Delete)");
exit;
}
}else{
$strSQLUp = "UPDATE tel_trans_tbl SET e_mail = '$strMail' WHERE syain_cd = '$PHP_SYAIN_CD'";
$objRecUp = pg_exec($strSQLUp);
if($objRecUp==false){
echo("SQL実行に失敗しました(UPDATE)");
exit;
}
}
}
header("Location:KST001.php");
?>