CON172.php
1.5 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
<?php
//*****************************************************************************
//*
//* プログラム名:進捗情報DB設定処理
//* プログラムID:CON172
//* 機能 :進捗情報を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["unit_seq"] =="") {
$strSql = "SELECT MAX(unit_seq) as a FROM mst_prj_tbl";
$rsResult = pg_exec($pg_con,$strSql);
$intSyozokuNextValue = pg_result($rsResult,0,"a") + 1;
$strSql = "SELECT MAX(disp_rank) as b FROM mst_prj_tbl";
$rsResult = pg_exec($pg_con,$strSql);
$intRankNextValue = pg_result($rsResult,0,"b") + 1;
$strSql = "INSERT INTO mst_prj_tbl (unit_seq, progress_unit, disp_rank) VALUES(";
$strSql = $strSql . "'$intSyozokuNextValue','".addslashes($_POST["unit_name"])."',$intRankNextValue)";
$rsResult = pg_exec($pg_con,$strSql);
//修正
}else{
$strSql = "UPDATE mst_prj_tbl SET ";
$strSql .= "progress_unit='".addslashes($_POST["unit_name"])."' ";
$strSql .= "WHERE unit_seq =".$_POST["unit_seq"] ;
$rsResult = pg_exec($pg_con,$strSql);
}
header("Location: CON170.php");
?>