CON007_1_1.php
1.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
<?php
//*****************************************************************************
//*
//* プログラム名:当番担当者情報DB設定処理
//* プログラムID:CON007_1_1
//* 機能 :当番担当者情報をDB設定する
//* 作成者 :
//*
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");
//***************************
//* インクルードファイル
//***************************
include("include/session_start.inc"); //セッション開始
include("include/SessionChk.inc"); //セッションチェック
include("include/dbcon.inc"); //DB接続
//新規登録
if ($_POST["seq"] == "") {
$strSql = "SELECT MAX(seq) as a FROM mst_touban";
$rsResult = pg_exec($pg_con,$strSql);
$intToubanNextValue = pg_result($rsResult,0,"a") + 1;
$strSql = "INSERT INTO mst_touban VALUES(";
$strSql = $strSql . "'$intToubanNextValue','".addslashes($_POST["touban_name"])."')";
$rsResult = pg_exec($pg_con,$strSql);
}else{
//修正
$strSql = "UPDATE mst_touban SET ";
$strSql .= "touban_name='".addslashes($_POST["touban_name"])."' ";
$strSql .= "WHERE seq =".$_POST["seq"] ;
$rsResult = pg_exec($pg_con,$strSql);
}
header("Location: CON007.php");
?>