ZIS9900.php 3.48 KB
<?PHP 
//*****************************************************************************
//* プログラム名:実績 初期設定画面
//* プログラムID:ZIS9900.php
//* 機能        :
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");
include("./inc/session_start.inc");
include("./inc/SessionChk.inc");
include("./inc/dbcon.inc");
include('./inc/smarty.conf');
include("./inc/const.inc");
include("./inc/pagetitle.inc");
include("./inc/pagefooter.inc");

$strSQL = "SELECT * FROM z_mst_base";
$objRec = pg_exec($strSQL);
if($objRec==false){
	echo("SQL実行に失敗しました(SELECT)");
	exit;
}
if(pg_numrows($objRec)>0){
	$objData = pg_fetch_object($objRec, 0);
	$kessan_m = $objData->kessan_month;
	$jisseki_unit = $objData->unit_flg;
}else{
	$kessan_m = 12;
	$jisseki_unit = 0;
	$strSQL = "DELETE FROM z_mst_base";
	$objRec = pg_exec($strSQL);
	if($objRec==false){
		echo("SQL実行に失敗しました(DELETE)");
		exit;
	}
	$strSQL = "INSERT INTO z_mst_base (kessan_month, unit_flg) VALUES(".$kessan_m.", ".$jisseki_unit.")";
	$objRec = pg_exec($strSQL);
	if($objRec==false){
		echo("SQL実行に失敗しました(INSERT)");
		exit;
	}
}
$lstM = month_lst($kessan_m);


//セッション再格納
include("./inc/dbcon_group.inc");

$strSQLGroup="SELECT * From group_inf where group_id='".$PHP_GROUP_ID."' ";
$objRecGroup = pg_exec($strSQLGroup);
if($objRecGroup==false){
	echo("SQL実行に失敗しました(SELECT)");
	exit;
}
session_unregister("PHP_USE_FUNC");

if(pg_numrows($objRecGroup) > 0){
	$objGroup = pg_fetch_object($objRecGroup, 0);
	$PHP_USE_FUNC = $objGroup->use_func; //20100510 use_func判定
	session_register("PHP_USE_FUNC");
}

//DB繋ぎなおし
include("./inc/dbcon.inc");

//HTMLヘッダの書き出し
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 

<html>
<head>
	<meta http-equiv="content-type" content="text/html; cahrset=euc-jp">
	<meta http-equiv="content-style-type" content="text/css">
	<meta name="robots" content="noindex, nofollow">
	<title><?PHP  echo($PHP_SYSNAME); ?></title>
	<script type="text/javascript" src="./js/ZIS9900.js"></script>
	<link rel="stylesheet" href="./templates/SIMmain.css" type="text/css" />
</head>
<?PHP 

//タイトル部分の表示
dspTitle($PHP_SYSNAME, $PHP_GROUP_NAME, $PHP_BUMON_NAME, $PHP_USER_NAME, "http://www.f-mtclab.net/article/149574816.html#help0");

//メインHTML部分の表示
//[0]システムURL、[1]HP URL、[2]マニュアルURL、[3]MTC HP URL、[4]マスタメールアドレス、
//[5]期間区分名、[6]大区分名、[7]小区分名、[8]支出名、[9]収入名、[10]消費税率(文字型)
$o_smarty->assign('DEFARR',$DEFARR);

$o_smarty->assign('PHP_SYSNAME',$PHP_SYSNAME);
$o_smarty->assign('PHP_GROUP_NAME',$PHP_GROUP_NAME);
$o_smarty->assign('PHP_BUMON_NAME',$PHP_BUMON_NAME);
$o_smarty->assign('PHP_USER_NAME',$PHP_USER_NAME);
$o_smarty->assign('PHP_USER_ADMIN',$PHP_USER_ADMIN);
$o_smarty->assign('PHP_USER_NYUKIN',$PHP_USER_NYUKIN);
$o_smarty->assign('PHP_USER_SHIKIN',$PHP_USER_SHIKIN);
$o_smarty->assign('PHP_USE_FUNC',$PHP_USE_FUNC);

$o_smarty->assign('kessan_m' ,$kessan_m);
$o_smarty->assign('jisseki_unit',$jisseki_unit);
$o_smarty->assign('lstM',$lstM);

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

//フッタ部分の表示
dspFooter($DEFARR[1], $DEFARR[3], "http://www.f-mtclab.net/article/149574816.html#help0");

//関数
function month_lst($prm){
	$ret = "";
	for($i=1;$i<=12;$i++){
		if($i==$prm){
			$ret .= "<option value='".$i."' selected>".$i."</option>";
		}else{
			$ret .= "<option value='".$i."'>".$i."</option>";
		}
	}
	return $ret;
}
?>