CON162_1_1.php
1.49 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
<?php
//*****************************************************************************
//*
//* プログラム名:簡易在席情報DB設定処理
//* プログラムID:CON162_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_common_word Where type = 1";
$rsResult = pg_exec($pg_con,$strSql);
$intToubanNextValue = pg_result($rsResult,0,"a") + 1;
$strSql = "INSERT INTO mst_common_word VALUES(";
$strSql .= "1,'$intToubanNextValue','".addslashes($_POST["zaiseki_name"])."','$zaiseki_collar')";
$rsResult = pg_exec($pg_con,$strSql);
//修正
}else{
$strSql = "UPDATE mst_common_word SET ";
$strSql .= "memo1='".addslashes($_POST["zaiseki_name"])."', ";
$strSql .= "memo2='$zaiseki_collar' ";
$strSql .= "WHERE type = 1 ";
$strSql .= "AND seq =".$_POST["seq"] ;
$rsResult = pg_exec($pg_con,$strSql);
if($rsResult==false){
echo("SQL実行に失敗しました(SELECT)");
echo "<br>".$strSql."<br>";
exit;
}
}
header("Location: CON160.php");
?>