<?php /*SVN-1324(5.0.09)*/
$SID = $cst->get("SID");
$user = $cst->get("user");
$ln = $cst->get("locale_name");
$lo = $cst->get("locale_obj");
$ERI = $cst->get("ERI");
$COPYERI = $cst->get("COPYERI");
$SERI = $cst->get("SERI");
$TEMPERI = $cst->get("TEMPERI");
$data = $cst->get("data");
$stat_button = $cst->get("stat_button");
$mode = $cst->get("mode");
$fow = $cst->get("fow");
$FTYPE = $cst->get("FTYPE");
$MOVEPROC = $cst->get("MOVEPROC");
$mddiv = $cst->get("html_mddiv");
$insl = $cst->get("html_insl");
$dset = $cst->get("html_dset");
$dtbl = $cst->get("html_dtbl");
$field = $cst->get("html_field");
$query = $cst->get("html_query");
$select = $cst->get("html_select");
$mutp = $cst->get("mutp");
$mdir = $cst->get("mdir");
// HTML ENGINE BEGIN 
$hstr = "";
$hstr .= field_default_class($dtbl,$field).
		 "<link rel=\"stylesheet\" type=\"text/css\" href=\"".$mdir."/".$mode."/mask.css\">";
if (empty($fow)) {
	$hstr .= "<div id=\"detail_div_".$mode.$fow."\">".
			 "<input type=\"hidden\" version=\"SVN-1324(5.0.09)\">";
	switch ($insl["MODNAME"]) {
		case "CSEXE_M":
		case "CSEXE_MD":
		case "CSEXE_MDS":
			if (($insl["SANEW"]) || ($insl["SAEDIT"]) || ($insl["SADEL"])) {
				$hstr .= "&nbsp;&nbsp;";
			}
			if ($insl["SANEW"]) {
				$hstr .= " <input type=\"button\" class=\"proj_all_btn proj_new_btn ".$mode."_all_btn ".$mode."_new_btn\" id=\"btn_new\" value=\"".$lo->text("NEW")."\" onclick=\"mode_addcopy_detail('','".$SID."','".$mode."','add','','".$insl["PGLDIV"]."','".$mutp."');\"".(($stat_button["new"]) ? "" : " disabled").">".
						 " <input type=\"button\" class=\"proj_all_btn proj_copy_btn ".$mode."_all_btn ".$mode."_copy_btn\" id=\"btn_copy\" value=\"".$lo->text("COPY")."\" onclick=\"mode_addcopy_detail('','".$SID."','".$mode."','copy','".$ERI."','".$insl["PGLDIV"]."','".$mutp."');\"".(($stat_button["new"]) ? "" : " disabled").">";
			}
			if ($insl["SAEDIT"]) {
				$hstr .= " <input type=\"button\" class=\"proj_all_btn proj_edit_btn ".$mode."_all_btn ".$mode."_edit_btn\" id=\"btn_edit\" value=\"".$lo->text("EDIT")."\" onclick=\"detail_edit_open('','".$SID."','".$mode."','#detail_form_".$mode.$fow."','".$ERI."','".$mddiv."');\" ".(($stat_button["edit"]) ? "" : " disabled").">".
						 " <input type=\"button\" class=\"proj_all_btn proj_save_btn ".$mode."_all_btn ".$mode."_save_btn\" id=\"btn_save\" value=\"".$lo->text("SAVE")."\" onclick=\"mode_save_detail('','".$SID."','".$mode."','#detail_form_".$mode.$fow."','websave','".$ERI."','".$insl["SATYPE"]."',\$('#search_exec_".$insl["PGTYPE"]."').val(),\$('#search_where_".$insl["PGTYPE"]."').val(),\$('#search_order_".$insl["PGTYPE"]."').val(),'".$insl["PGLDIV"]."','".$insl["PGTYPE"]."','".$mutp."');\"".(($stat_button["save"]) ? "" : " disabled").">".
						 " <input type=\"button\" class=\"proj_all_btn proj_cancel_btn ".$mode."_all_btn ".$mode."_cancel_btn\" id=\"btn_cancel\" value=\"".$lo->text("CANCEL")."\" onclick=\"mode_cancel_detail('','".$SID."','".$mode."','#detail_form_".$mode.$fow."','".$ERI."','".$SERI."',\$('#search_exec_".$insl["PGTYPE"]."').val(),\$('#search_where_".$insl["PGTYPE"]."').val(),\$('#search_order_".$insl["PGTYPE"]."').val(),'".$insl["PGLDIV"]."','".$insl["PGTYPE"]."','0','".$mutp."');\"".(($stat_button["cancel"]) ? "" : " disabled").">";
			}
			if ($insl["SADEL"]) {
				$hstr .= " <input type=\"button\" class=\"proj_all_btn proj_del_btn ".$mode."_all_btn ".$mode."_del_btn\" id=\"btn_del\" value=\"".$lo->text("DELETE")."\" onclick=\"mode_delete_detail('','".$SID."','".$mode."','".$ERI."','".$insl["PGTYPE"]."');\"".(($stat_button["del"]) ? "" : " disabled").">";
			}
			$hstr .= "&nbsp;&nbsp;".
					 " <input type=\"button\" class=\"proj_all_btn proj_return_btn ".$mode."_all_btn ".$mode."_return_btn\" id=\"btn_return\" value=\"".$lo->text("GO_BACK")."\" onclick=\"mode_return_detail('','".$SID."','".$mode."','".$insl["PGTYPE"]."');\"".(($stat_button["return"]) ? "" : " disabled").">";
			if (isset($dset[0]["REPORTSDC"]) && trim($dset[0]["REPORTSDC"]) != "") {
				$hstr .= "&nbsp;&nbsp;".
						 " <input type=\"button\" class=\"proj_all_btn proj_print_btn ".$mode."_all_btn ".$mode."_print_btn\" id=\"btn_print\" value=\"".$lo->text("PRINT")."\" onclick=\"post_redirect('report_Panel', '', 'core/cw5e_print.php?sid=".$SID."&parent=&aid=".$dset[0]["QUERYSDC"]."&bid=".$dset[0]["REPORTSDC"]."&ptype=1&act=view&key=".$ERI."');\"".(($stat_button["print"]) ? "" : " disabled").">";
			}
			if ($insl["SASCRT"]) {
				$hstr .= "&nbsp;&nbsp;".
						 " <input type=\"button\" class=\"proj_all_btn proj_scrut_btn ".$mode."_all_btn ".$mode."_scrut_btn\" id=\"btn_scrut\" value=\"".$lo->text("SCRUT")."\" onclick=\"mode_scrut_detail('','".$SID."','".$mode."','scrut','".$ERI."','CONFIRM_SCRUTINY','SCRUTINY_COMPLETE',\$('#search_exec_".$insl["PGTYPE"]."').val(),\$('#search_where_".$insl["PGTYPE"]."').val(),\$('#search_order_".$insl["PGTYPE"]."').val(),'".$insl["PGLDIV"]."','".$insl["PGTYPE"]."','".$mutp."');\"".(($stat_button["scrutiny"]) ? "" : " disabled").">".
						 " <input type=\"button\" class=\"proj_all_btn proj_unscrut_btn ".$mode."_all_btn ".$mode."_unscrut_btn\" id=\"btn_unscrut\" value=\"".$lo->text("UNSCRUT")."\" onclick=\"mode_scrut_detail('','".$SID."','".$mode."','unscrut','".$ERI."','CONFIRM_UNSCRUTINY','UNSCRUTINY_COMPLETE',\$('#search_exec_".$insl["PGTYPE"]."').val(),\$('#search_where_".$insl["PGTYPE"]."').val(),\$('#search_order_".$insl["PGTYPE"]."').val(),'".$insl["PGLDIV"]."','".$insl["PGTYPE"]."','".$mutp."');\"".(($stat_button["unscrutiny"]) ? "" : " disabled").">";
			}
			$hstr .= "&nbsp;&nbsp;".
					 " <input type=\"button\" class=\"proj_all_btn proj_first_btn ".$mode."_all_btn ".$mode."_first_btn\" id=\"btn_first\" value=\"|< ".$lo->text("FIRST")."\" onclick=\"mode_feedpage_detail('','".$SID."','".$mode."','first','".$ERI."',\$('#search_exec_".$insl["PGTYPE"]."').val(),\$('#search_where_".$insl["PGTYPE"]."').val(),\$('#search_order_".$insl["PGTYPE"]."').val(),'".$insl["PGLDIV"]."','".$insl["PGTYPE"]."','".$mutp."');\"".(($stat_button["first"]) ? "" : " disabled").">".
					 " <input type=\"button\" class=\"proj_all_btn proj_prev_btn ".$mode."_all_btn ".$mode."_prev_btn\" id=\"btn_prev\" value=\"< ".$lo->text("PREV")."\" onclick=\"mode_feedpage_detail('','".$SID."','".$mode."','prev','".$ERI."',\$('#search_exec_".$insl["PGTYPE"]."').val(),\$('#search_where_".$insl["PGTYPE"]."').val(),\$('#search_order_".$insl["PGTYPE"]."').val(),'".$insl["PGLDIV"]."','".$insl["PGTYPE"]."','".$mutp."');\"".(($stat_button["prev"]) ? "" : " disabled").">".
					 " <input type=\"button\" class=\"proj_all_btn proj_next_btn ".$mode."_all_btn ".$mode."_next_btn\" id=\"btn_next\" value=\"> ".$lo->text("NEXT")."\" onclick=\"mode_feedpage_detail('','".$SID."','".$mode."','next','".$ERI."',\$('#search_exec_".$insl["PGTYPE"]."').val(),\$('#search_where_".$insl["PGTYPE"]."').val(),\$('#search_order_".$insl["PGTYPE"]."').val(),'".$insl["PGLDIV"]."','".$insl["PGTYPE"]."','".$mutp."');\"".(($stat_button["next"]) ? "" : " disabled").">".
					 " <input type=\"button\" class=\"proj_all_btn proj_final_btn ".$mode."_all_btn ".$mode."_final_btn\" id=\"btn_final\" value=\">| ".$lo->text("FINAL")."\" onclick=\"mode_feedpage_detail('','".$SID."','".$mode."','final','".$ERI."',\$('#search_exec_".$insl["PGTYPE"]."').val(),\$('#search_where_".$insl["PGTYPE"]."').val(),\$('#search_order_".$insl["PGTYPE"]."').val(),'".$insl["PGLDIV"]."','".$insl["PGTYPE"]."','".$mutp."');\"".(($stat_button["final"]) ? "" : " disabled").">";
			if ($FTYPE) {
				$hstr .= "&nbsp;&nbsp;".
						 " <input type=\"button\" class=\"proj_all_btn proj_send_btn ".$mode."_all_btn ".$mode."_send_btn\" id=\"btn_send\" value=\"".$lo->text("SEND")."\" onclick=\"flow_send_detail('','".$SID."','".$mode."','".$ERI."','#detail_form_".$mode.$fow."','".$insl["PGLDIV"]."','".$insl["PGTYPE"]."','".$mutp."');\"".(($stat_button["send"]) ? "" : " disabled").">".
						 " <input type=\"button\" class=\"proj_all_btn proj_invalid_btn ".$mode."_all_btn ".$mode."_invalid_btn\" id=\"btn_invalid\" value=\"".$lo->text("INVALID")."\" onclick=\"flow_invalid_detail('','".$SID."','".$mode."','".$ERI."',\$('#search_exec_".$insl["PGTYPE"]."').val(),\$('#search_where_".$insl["PGTYPE"]."').val(),\$('#search_order_".$insl["PGTYPE"]."').val(),'".$insl["PGLDIV"]."','".$insl["PGTYPE"]."','".$mutp."');\"".(($stat_button["invalid"]) ? "" : " disabled").">".
						 " <input type=\"button\" class=\"proj_all_btn proj_brout_btn ".$mode."_all_btn ".$mode."_brout_btn\" id=\"btn_brout\" value=\"".$lo->text("BROUT")."\" onclick=\"flowmap_mtod_detail('','".$SID."','".$mode."','#detail_form_".$mode.$fow."','".$mutp."');\"".(($stat_button["brout"]) ? "" : " disabled").">";
			}
			if (!empty($MOVEPROC)) {
				$hstr .= "&nbsp;&nbsp;".
						 " <input type=\"button\" class=\"proj_all_btn proj_prout_btn ".$mode."_all_btn ".$mode."_prout_btn\" id=\"btn_prout\" value=\"".$lo->text("PROUT")."\" onclick=\"mode_prout_detail('','".$SID."','".$mode."','".$ERI."','".$MOVEPROC."','#search_exec_".$insl["PGTYPE"]."','#search_where_".$insl["PGTYPE"]."','#search_order_".$insl["PGTYPE"]."','".$insl["PGLDIV"]."','".$insl["PGTYPE"]."','".$mutp."');\"".(($stat_button["prout"]) ? "" : " disabled").">";
			}
			$hstr .= "<hr>";
			break;
		case "CSSETUP":
			if ($insl["SAEDIT"]) {
				$hstr .= "&nbsp;&nbsp;".
						 " <input type=\"button\" class=\"proj_all_btn proj_edit_btn ".$mode."_all_btn ".$mode."_edit_btn\" id=\"btn_edit\" value=\"".$lo->text("EDIT")."\" onclick=\"detail_edit_open('','".$SID."','".$mode."','#detail_form_".$mode.$fow."','".$ERI."','".$mddiv."');\"".(($stat_button["edit"]) ? "" : " disabled").">".
						 " <input type=\"button\" class=\"proj_all_btn proj_save_btn ".$mode."_all_btn ".$mode."_save_btn\" id=\"btn_save\" value=\"".$lo->text("SAVE")."\" onclick=\"mode_save_detail('','".$SID."','".$mode."','#detail_form_".$mode.$fow."','websave','".$ERI."','1',\$('#search_exec_".$insl["PGTYPE"]."').val(),\$('#search_where_".$insl["PGTYPE"]."').val(),\$('#search_order_".$insl["PGTYPE"]."').val(),'".$insl["PGLDIV"]."','".$insl["PGTYPE"]."','".$mutp."');\"".(($stat_button["save"]) ? "" : " disabled").">".
						 " <input type=\"button\" class=\"proj_all_btn proj_cancel_btn ".$mode."_all_btn ".$mode."_cancel_btn\" id=\"btn_cancel\" value=\"".$lo->text("CANCEL")."\" onclick=\"mode_cancel_detail('','".$SID."','".$mode."','#detail_form_".$mode.$fow."','".$ERI."','".$SERI."',\$('#search_exec_".$insl["PGTYPE"]."').val(),\$('#search_where_".$insl["PGTYPE"]."').val(),\$('#search_order_".$insl["PGTYPE"]."').val(),'".$insl["PGLDIV"]."','".$insl["PGTYPE"]."','1','".$mutp."');\"".(($stat_button["cancel"]) ? "" : " disabled").">".
						 "<hr>";
			}
			break;
		case "CSWEB_TMP":
			if ($insl["SAEDIT"]) {
				$hstr .= "&nbsp;&nbsp;".
						 " <input type=\"button\" class=\"proj_all_btn proj_save_btn ".$mode."_all_btn ".$mode."_save_btn\" id=\"btn_save\" value=\"".$lo->text($mode."_SAVE")."\" onclick=\"mode_tempsave_detail('','".$SID."','".$mode."','#detail_form_".$mode.$fow."','websave','".$ERI."','1',\$('#search_exec_".$insl["PGTYPE"]."').val(),\$('#search_where_".$insl["PGTYPE"]."').val(),\$('#search_order_".$insl["PGTYPE"]."').val(),'".$insl["PGLDIV"]."','".$insl["PGTYPE"]."','".$mutp."');\"".(($stat_button["save"]) ? "" : " disabled").">".
						 "<hr>";
			}
			break;
		default:
			$hstr .= "未完成相關模組之底層設定!<hr>";
			break;
	}
}
if (empty($fow) || $fow == "C") $hstr .= "<form id=\"detail_form_".$mode.$fow."\">";
$hstr .= "<input type=\"hidden\" id=\"ERI\" name=\"ERI\" value=\"".$ERI."\">".
		 "<input type=\"hidden\" id=\"COPYERI\" name=\"COPYERI\" value=\"".$COPYERI."\">".
		 "<input type=\"hidden\" id=\"SERI\" name=\"SERI\" value=\"".$SERI."\">".
		 "<input type=\"hidden\" id=\"TEMPERI\" name=\"TEMPERI\" value=\"".$TEMPERI."\">".
		 create_mdmixhtml_engine($lo,$data,$dtbl,$field,$query,$select);
if (empty($fow) || $fow == "C") {
	$hstr .= "</form>".
			 "</div>".
			 "<div id=\"sub_div_".$mode.$fow."\" style=\"display: none;\">".
			 "<input type=\"hidden\" id=\"SUB_MODE".$fow."\" name=\"SUB_MODE".$fow."\" value=\"".$mode."\">".
			 "<input type=\"hidden\" id=\"SUB_SUBPATH".$fow."\" name=\"SUB_SUBPATH".$fow."\" value=\"".$mode."\">".
			 "<input type=\"hidden\" id=\"SUB_ERIPATH".$fow."\" name=\"SUB_ERIPATH".$fow."\" value=\"".$ERI."\">".
			 "<form id=\"sub_form_".$mode.$fow."\"></form>".
			 "</div>";
}
$hstr .= "<script>mode_enableck_control('','".$SID."','".$mode."','".(($stat_button["save"]) ? "edit" : "view")."','#detail_form_".$mode.$fow."', '', '', '".$ERI."');</script>".
		 "<script src=\"".$mdir."/".$mode."/mask.js\"></script>";
// HTML ENGINE END 
echo $hstr;
?>