CON120.php 3.12 KB
<?php 
//*****************************************************************************
//* 
//* プログラム名:メニュー設定
//* プログラムID:CON120.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("inc/CON120.inc");
//メニューセット
include("menu_opacity.php");

$strDBinc="include/dbcon.inc";
include($strDBinc);

if ($PHP_BIT[0]!=1){
	echo "<br><br><br>";
	echo "<a href='TOP000.php'><span class='Normalfont'>マスタ変更権限がありません</span></a>";
	echo "<br><br><br>";
	echo "<form name='e_gru'></form>";	
	include("include/copyright.inc");
	exit;
}

$strSQL = "select index_no, name, org_name, sub_menu_num from main_menu_tbl order by index_no asc";
$objRec = pg_exec($strSQL);
if($objRec == false){
	echo("SQL実行に失敗しました(SELECT)");
	exit;
}

for($i=0;$i<pg_numrows($objRec);$i++){
	$objftc = pg_fetch_object($objRec, $i);
	$strMain[$i] = htmlspecialchars($objftc->name);
	$keyMain[$i] = $i + 1;
	if($i==2){
		$strTR[$i] ="</tr><tr>";
	}
	//使用中サブ
	$strSQL2 = "select main_index, index_no, name, org_name, url, img, disp_flg from sub_menu_tbl where main_index = ".$objftc->index_no." and disp_flg = 1 order by index_no asc";
	$objRec2 = pg_exec($strSQL2);
	if($objRec2 == false){
		echo("SQL実行に失敗しました(SELECT)");
		exit;
	}
	if(pg_numrows($objRec2)>0){
		for($j=0;$j<pg_numrows($objRec2);$j++){
			$objftc2 = pg_fetch_object($objRec2, $j);
			$strSub[$i] .=  "<option value='".$objftc2->main_index."/".$objftc2->index_no."'>".htmlspecialchars($objftc2->name)."</option>";
//			$strSubOrg[$i][$j] =  $objftc2->org_name;
//			$keySub[$i][$j] = $objftc2->main_index."/".$objftc2->index_no;
			//トップのインデックス退避
			if ($objftc2->url == "TOP000.php"){
				$top_main_no = $keyMain[$i];
				$top_sub_no = $objftc2->index_no;
			}
		}
	}

	
}

//未使用サブ
$strSQL2 = "select main_index, index_no, name, org_name, url, img, disp_flg from sub_menu_tbl where disp_flg = 0";
$objRec2 = pg_exec($strSQL2);
if($objRec2 == false){
	echo("SQL実行に失敗しました(SELECT)");
	exit;
}
if(pg_numrows($objRec2)>0){
	for($j=0;$j<pg_numrows($objRec2);$j++){
		$objftc2 = pg_fetch_object($objRec2, $j);
		$strSubNo .=  "<option value='".$objftc2->main_index."/".$objftc2->index_no."'>".htmlspecialchars($objftc2->name)."</option>";
//			$strSubOrg[$i][$j] =  $objftc2->org_name;
//			$keySub[$i][$j] = $objftc2->main_index."/".$objftc2->index_no;
		if($objftc2->url == "TOP000.php"){
			$top_main_no = $objftc2->main_index;
			$top_sub_no = $objftc2->index_no;
		}
	}
}


	
$o_smarty->assign('strMain',$strMain);
$o_smarty->assign('keyMain',$keyMain);
$o_smarty->assign('strTR',$strTR);

$o_smarty->assign('strSub',$strSub);
$o_smarty->assign('strSubNo',$strSubNo);

$o_smarty->assign('top_main_no',$top_main_no);
$o_smarty->assign('top_sub_no',$top_sub_no);

if ($PHP_BIT[0]==1){
		$o_smarty->display('CON120.tpl');
}else{
		$o_smarty->display('CON999.tpl');
}


?>