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

			if(!parent::isPostBack())
				$this->loadData();
			else
				$this->saveData();
			parent::load();
		}
		public function loadData(){
			$webConfig = registryDAL::getRegistryValues();
			$keys = array_keys($webConfig);
			$values = array_values($webConfig);
			for($i=0;$i<count($webConfig);$i++){
				parent::addParameter($keys[$i],$values[$i]);
			}
			parent::loadTemplateFile("templates/webDemoSet.html");
			parent::loadData();
		}
		public function saveData(){
			$keys = array_keys($_POST);
			$values = array_values($_POST);
			for($i=0;$i<count($_POST);$i++){
				registryDAL::saveRegistry($keys[$i],conver::toDbString($values[$i]));
			}
			registryDAL::saveRegistry("ModifiedTime",date("Y-m-d H:i:s"));
			parent::alert2("儲存完畢!","webDemoSet.php");
		}
	}
	$page = new _webDemoSet();
	$page->load();
	$page->render();
?>