<?php
	require_once "pageBase.php";
	require_once "../bin/system/conver.php";
	require_once "../dal/registryDAL.php";
	class _orderSet extends pageBase{
		//覆蓋父類load()方法
		public function load(){
			if(!parent::chkUserLimit('57')){
				parent::alert2('您沒有使用此頁面的權限!如有疑問請洽主管理者!','index.php');
				exit;
			}

			if(!parent::isPostBack())
				$this->loadData();
			else
				$this->saveData();

			parent::load();
		}
		public function loadData(){
			$OrderName = registryDAL::getRegistryValue("OrderName");
			$webOrder = registryDAL::getRegistryValue("webOrder");
			parent::addParameter("OrderName",$OrderName);
			parent::addParameter("webOrder",$webOrder);
			parent::loadTemplateFile(dirname(__FILE__)."/templates/orderSet.html");
			parent::loadData();
		}
		public function saveData(){
			$OrderName = $_POST["OrderName"];
			$webOrder = $_POST["webOrder"];
			if(!get_magic_quotes_gpc()){
				$webOrder = addslashes($webOrder);
			}
			registryDAL::saveRegistry("OrderName",$OrderName);
			registryDAL::saveRegistry("webOrder",$webOrder);
			parent::redirect("orderSet.php");
		}
	}

	$page = new _orderSet();
	$page->load();
	$page->render();
?>