CON012_1_1.php
1.09 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:CON003_1_1
//* 機能 :部門情報をDB設定する
//* 作成者 :石田 英治
//*
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");
include("include/session_start.inc");
include("include/SessionChk.inc");
include("include/dbcon.inc");
//新規登録
if ($siryo_cd=="") {
$strSql = "SELECT MAX(ctg_no) as a,MAX(disp_rank) as b FROM mst_siryo";
$rsResult = pg_exec($pg_con,$strSql);
$intSiryoNextValue = pg_result($rsResult,0,"a") + 1;
$intRankNextValue = pg_result($rsResult,0,"b") + 1;
$strSql = "INSERT INTO mst_siryo VALUES(";
$strSql = $strSql."'$intSiryoNextValue','$siryo_name',$intRankNextValue)";
$rsResult = pg_exec($pg_con,$strSql);
//修正
}else{
$strSql = "UPDATE mst_siryo SET ";
$strSql .= "ctg_name='$siryo_name' ";
$strSql .= "WHERE ctg_no = $siryo_cd";
$rsResult = pg_exec($pg_con,$strSql);
}
// echo $strSql;
header("Location: CON012.php");
?>