CON121.php 2.18 KB
<?php 
//*****************************************************************************
//* 
//* プログラム名:メニュー名称変更
//* プログラムID:CON121.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/CON121.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);
	$strMainOrg[$i] = $objftc->org_name;
	$keyMain[$i] = $objftc->index_no;
	//使用中サブ取得
	$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][$j] =  htmlspecialchars($objftc2->name);
			$strSubOrg[$i][$j] =  $objftc2->org_name;
			$keySub[$i][$j] = $objftc2->main_index."/".$objftc2->index_no;
		}
	}
	
	
}

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

$o_smarty->assign('strSub',$strSub);
$o_smarty->assign('strSubOrg',$strSubOrg);
$o_smarty->assign('keySub',$keySub);

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