SUB0021.php
1.44 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
46
47
48
49
50
51
52
53
<?PHP
//*****************************************************************************
//*
//* プログラム名:め〜るNiポン!V2
//* プログラムID:SUB0021.php
//* 機能 :団体名変更
//*
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");
//***************************
//* インクルードファイル
//***************************
include('./include/smarty.conf');
include("./include/session_start.inc");
include("./include/SessionChk2.inc");
include("./include/jcode.phps");
//********** ヘッダー処理 **********//
include("./include/headr_data.inc");
//********** 接続処理 **********//
include("./include/dbcon2.inc");
//********** メイン処理 **********//
//管理者処理
$strSQL = "SELECT * FROM mst_kanri WHERE user_id = '" . $_SESSION["PHP_POST_SYAIN_ID"]. "' ";
$objRecSet = pg_exec($strSQL);
if($objRecSet==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if (pg_numrows($objRecSet) == 1) {
$Err_Msg="団体名を変更しました";
$strSQL = "UPDATE mst_kanri SET ";
$strSQL .= " user_name= '" . $user_name . "' ";
$strSQL .= "WHERE user_id = '" . $_SESSION["PHP_POST_SYAIN_ID"]."'";
$objRecSet = pg_exec($strSQL);
if($objRecSet==false){
echo("SQL実行に失敗しました(UPDATE)");
exit;
}
$_SESSION["PHP_POST_DB_USER_NAME"] = $user_name;
}else{
$Err_Msg="エラーが発生しました";
}
$o_smarty->assign('Err_Msg' , $Err_Msg);
$o_smarty->display('SUB0021.tpl');
?>