MST1421.php 1.29 KB
<?PHP 
//*****************************************************************************
//* 
//* プログラム名:め〜るNiポン!V2
//* プログラムID:MST1410.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/dbcon.inc");

for ($i = 1; $i <= $select_nm; $i++){
	if($name_nm[$i] == ""){
		include("MST1423.php");
		exit;
	}
}
$sql = "INSERT INTO mst_answer (pattern_id, pattern_nm, select_nm";
for ($i = 1; $i <= $select_nm; $i++){
	$sql .= ", name" . $i . "_id, name" . $i . "_nm";
}
$sql .= ", default_flg, del_flg) ";
$sql .= "VALUES ($pattern_id, '$pattern_nm', $select_nm";
for ($i = 1; $i <= $select_nm; $i++){
	$sql .= ", $i, '$name_nm[$i]'";
}
$sql .= ", 0, 0)";

$rtn = pg_exec($sql);
if($rtn == false){
	echo "SQLの実行に失敗しました。(INSERT)";
	exit;
}

header("Location:MST1410.php");

?>