<?php /*SVN-1324(5.0.09)*/
include_once("../../includes/var.php");
include_once("../../libs/utils.php");
include_once("../../libs/functions.php");

header("Content-Type: text/html;charset=".CS_ENCODING);

$sid = (isset($_GET["sid"])) ? $_GET["sid"] : "";
$mode = (isset($_GET["mode"])) ? $_GET["mode"] : "";
$ERI = (isset($_GET["ERI"])) ? $_GET["ERI"] : "";
$COPYERI = (isset($_GET["COPYERI"])) ? $_GET["COPYERI"] : "";
$SERI = (isset($_GET["SERI"])) ? $_GET["SERI"] : "";
$ZERI = (isset($_GET["ZERI"])) ? $_GET["ZERI"] : "";
$act = (isset($_GET["act"])) ? $_GET["act"] : "";
$view = (isset($_GET["view"])) ? $_GET["view"] : "";
$exec = (isset($_POST["exec"])) ? $_POST["exec"] : "";
$qwe = (isset($_POST["qwe"])) ? $_POST["qwe"] : "";
$sor = (isset($_POST["sor"])) ? $_POST["sor"] : "";
$fow = (isset($_GET["fow"])) ? $_GET["fow"] : "";
$FSAVE = (isset($_GET["FLOWSAVE"]) && $_GET["FLOWSAVE"] == "1") ? "1" : "0";
$mutp = (isset($_GET["mutp"])) ? $_GET["mutp"] : "";
switch ($mutp) {
	case "R": $mdir = "manage"; break;
	case "B": $mdir = "modules"; break;
	default: echo "System path error!"; return; break;
}

$parary = createsidobject($sid);
if (empty($parary)) {
	echo "System session error!";
	return;
}
$dbo = $parary["dbo"];$ln = $parary["ln"];$user = $parary["user"];
include_once("../../classes/class.Locale_DB.php");
$lo = new Locale($ln, $dbo, 1, $mode);

$data = array();$output = array();
$para = array("sid"=>$sid,"parent"=>"","mode"=>$mode,"act"=>$act,"view"=>$view,
			  "fow"=>$fow,"fsave"=>$FSAVE,"addr"=>$_SERVER["REMOTE_ADDR"],"ln"=>$ln,
			  "usereri"=>$user["ERI"],"user"=>$user["EMPNO"],"usergt"=>$user["GRPTYPE"],
			  "meri"=>$ERI,"ceri"=>$COPYERI,"seri"=>$SERI,"zeri"=>$ZERI,"mutp"=>$mutp,
			  "exec"=>$exec,"qwe"=>$qwe,"sor"=>$sor,"formtp" =>"D","path"=>"");
$output = begin_make_data($dbo,$lo,$para);
if (isset($output["meri"])) $ERI = $output["meri"];

include_once("../../classes/general/class.CSTemplate.php");
$cst = new CSTemplate();

$page = "detail.html";
$cst->set("MOVEPROC", $output["mproc"]);
$cst->set("html_mddiv", $output["ditems"]);
$cst->set("html_insl", $output["insl"]);
$cst->set("html_dset", $output["dset"]);
$cst->set("html_dtbl", $output["dtbl"]);
$cst->set("html_field", $output["field"]);
$cst->set("html_query", $output["query"]);
$cst->set("html_select", $output["select"]);
$cst->set("FTYPE", $output["ftype"]);
$cst->set("data", $output["detail"]);
$cst->set("stat_button", $output["statbtn"]);
$cst->set("TEMPERI", $output["temperi"]);
$cst->set("SID", $sid);
$cst->set("mode", $mode);
$cst->set("locale_name", $ln);
$cst->set("locale_obj", $lo);
$cst->set("user", $user);
$cst->set("ERI", $ERI);
$cst->set("COPYERI", $COPYERI);
$cst->set("SERI", $SERI);
$cst->set("fow", $fow);
$cst->set("mutp", $mutp);
$cst->set("mdir", $mdir);
$cst->show($page);
?>