KST015_1.php 1.49 KB
<?php 
//*****************************************************************************
//* 
//* プログラム名:個人設定
//* プログラムID:KST014_1.php
//* 機能        :電話メモメール転送設定処理
//* 作成者      :K.Yoshimura
//* 
//*****************************************************************************

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";


	//**** DB接続 ****//
	$strDBinc="include/dbcon.inc";
	include($strDBinc);

$strSQL= "SELECT * FROM sendinfo_tbl " .
	          "WHERE syain_cd='$PHP_SYAIN_CD' ";

$objRec = pg_exec($strSQL);
if($objRec==false){
	echo("SQL実行に失敗しました(SELECT)");
	exit;
}

if(pg_numrows($objRec)==0){

	$strSQLIns = "Insert Into sendinfo_tbl " .
		 	"(syain_cd,send_flg10) " .
		 	"values (" .
				 "'$PHP_SYAIN_CD',$b_size_flg)";

			//echo("strSQL[" . $strSQLIns . "]<BR>");

	$objRecIns = pg_exec($strSQLIns);
	if($objRecIns==false){
		echo("SQL実行に失敗しました(Insert)");
	exit;
	}
}else{

	$strSQLUp = "UPDATE sendinfo_tbl SET " .
							"send_flg10 = $b_size_flg ".
							"WHERE syain_cd = '$PHP_SYAIN_CD'";
	echo $strSQLup;
	$objRecUp = pg_exec($strSQLUp);
	if($objRecUp==false){
 		echo("SQL実行に失敗しました(UPDATE)");
 	exit;
	}
}
	header("Location:KST001.php");
	//header("Location:KST015_2.php");
?>