MNP900.php 3.67 KB
<?php 
//*****************************************************************************
//* 
//* プログラム名:アンケート機能
//* プログラムID:MNP900.php
//* 機能        :アンケート作成画面
//* 
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");

//***************************
//* インクルードファイル
//***************************
include("./include/session_start.inc");
include("./include/SessionChk.inc");
include("./inc/input_chk.inc");

//***************************
//* 画面制御
//***************************
include('./include/smarty.conf');
include("./inc/header.inc");
include("./menu_opacity.php");								//メニュー
include("./inc/MNP000.inc");
include("./include/dbcon.inc");

$o_smarty->assign('Send_User_Name',  $Send_User_Name);
$o_smarty->assign('Send_User',       $_REQUEST["Send_User"]);

//***********************************//
//*      メイン処理      //
//***********************************//
//***** 個人orグループ *****//
$radSend = "";
if($_REQUEST["radSendPtn"] == "2"){
		$radSend[1] = "checked";
}else{
		$radSend[0] = "checked";
}
$o_smarty->assign('radSend',     $radSend);


//***** 個人 *****//
$strSQL="SELECT * FROM syain_tbl WHERE syain_tbl.del_flg=true ORDER BY disp_rank";
$objRec = pg_exec($strSQL);
if($objRec==false){
		echo("SQL実行に失敗しました(SELECT)");
		exit;
}
for ($intI = 0; $intI < pg_numrows($objRec); $intI++) {
		$objData = pg_fetch_object($objRec, $intI);

		$syain_list .= "<OPTION value= ".$objData->syain_cd.">".$objData->name_kj_sei.$objData->name_kj_mei."</OPTION>";
}
$syain_list .= '<OPTION value="" >          </OPTION>';
$syain_add   = '<OPTION value="" >          </OPTION>';
$o_smarty->assign('syain_list',$syain_list);
$o_smarty->assign('syain_add' ,$syain_add);


//***** グループ *****//
$Group_List = "";
$strSQL = "SELECT syozoku_cd,bumon_name FROM mst_bumon WHERE del_flg=0 ORDER BY disp_rank";
$objRec = pg_exec($strSQL);
if($objRec==false){
		echo("SQL実行に失敗しました1(SELECT)");
		exit;
}
for($intI = 0; $intI < pg_numrows($objRec); $intI++){
		$objData = pg_fetch_object($objRec, $intI);

		$Group_List .= " <input type=checkbox name=group_dat value=".$objData->syozoku_cd;
		if (strchr($_REQUEST["group_id"],"/".$objData->syozoku_cd."/")!=false){
				$Group_List .= " checked";
		}
		$Group_List .= ">".$objData->bumon_name."<BR>";
}
$o_smarty->assign('Group_List',     $Group_List);

//***** 件名・本文 *****//
$o_smarty->assign('Mail_Subject',stripslashes($_REQUEST["Mail_Subject"]));	//件名
$o_smarty->assign('Mail_Body'   ,stripslashes($_REQUEST["Mail_Body"]));			//本文

//***** 選択肢数 *****//
$kouhoMax = 10;
$optKouho = "";
for($intI=1;$intI<=$kouhoMax;$intI++){
	if($intI == $_REQUEST["kouho"]){
			$optKouho .= "<option value='".($intI)."' selected>".$intI."</option>";
	}else{
			$optKouho .= "<option value='".($intI)."'>".$intI."</option>";
	}
}
$o_smarty->assign('optKouho',   $optKouho);

//***** 選択肢数 *****//
$kouhoData = "";
for($intI=0;$intI<$kouhoMax;$intI++){
		//番号
		$kouhoData[$intI][0]  = $intI + 1;
		//開始年
		$kouhoData[$intI][1]  = $_REQUEST["Ans_Data".$kouhoData[$intI][0]];
}
$o_smarty->assign('kouhoData',  $kouhoData);

//***** 複数選択 *****//
$rad_fuku_flg = "";
if($rad_fuku_flg==0){
		$rad_fuku_flg[0] = "checked";
}
if($rad_fuku_flg==1){
		$rad_fuku_flg[1] = "checked";
}
$o_smarty->assign('rad_fuku_flg', $rad_fuku_flg);

//***** 公開 *****//
$rad_view_flg = "";
if($view_flg==0){
		$rad_view_flg[0] = "checked";
}
if($view_flg==1){
		$rad_view_flg[1] = "checked";
}
$o_smarty->assign('rad_view_flg', $rad_view_flg);



$o_smarty->assign('PHP_TITLE_NAME',$PHP_TITLE_NAME[20]);

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

?>