MST1410.php 1.82 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");


$sql = "SELECT * FROM mst_answer";
$sql .= " WHERE del_flg = 0";
$sql .= " ORDER BY pattern_id";
$rtn = pg_exec($sql);
if($rtn == false){
	echo("SQL実行に失敗しました(SELECT)");
	exit;
}

$num = pg_numrows($rtn);

if($num >= 0){
	$count = 1;
	for ($i = 0; $i < $num; $i++){
		$data = pg_fetch_object($rtn, $i);

		$kaito_ptn[$i] = "<TD ALIGN=\"LEFT\"><FONT size=\"2\"><a href=\"MST1420.php?e=1&p=".$data->pattern_id."\">".$data->pattern_nm."</a></FONT></TD>";
		$kaito_ptn[$i] = $kaito_ptn[$i]."<TD ALIGN=\"CENTER\"><FONT size=\"2\">".$data->select_nm."</FONT></TD>";
		$kaito_ptn[$i] = $kaito_ptn[$i]."<TD ALIGN=\"CENTER\"><input type=\"radio\" name=\"default_flg[]\" value=\"".$data->pattern_id."\" ";
		if ($data->default_flg == 1){
			$kaito_ptn[$i] = $kaito_ptn[$i]." checked ></td>";
		}else{
			$kaito_ptn[$i] = $kaito_ptn[$i]." ></td>";
		}
		$kaito_ptn[$i] = $kaito_ptn[$i]."<TD ALIGN=\"CENTER\"><input type=\"checkbox\" name=\"del_flg[]\" value=\"".$data->pattern_id."\"></TD>";
	}
}



$o_smarty->assign('num' , $num);
$o_smarty->assign('kaito_ptn' , $kaito_ptn);

$o_smarty->display('MST1410.tpl');

?>