Location: PHPKode > projects > KISS > CodeGenerator/config.php
<?php
include_once("include/include.globalvariable.php");

class Page extends Application
{
	function Page()
	{
		parent::Application();
		if(isset($_GET['table']) && isset($_GET['config']))
		{
			$this->mConfigFile = CONFIG_PATH."/{$_GET['config']}_{$_GET['table']}.serialize";
			if(!file_exists($this->mConfigFile))
			{
				$this->mMappingTableObject = new BaseTableObject($_GET['table'],$_GET['config']);
				foreach($this->mMappingTableObject->mMapHash as $key => $value)
				{
					$config[] = array (	'name' => $key,'comment' => $key,'type' => 'text','insert' => '1','update' => '1','select' => '1','list' => '1','search' => '1');
				}
				file_put_contents($this->mConfigFile,serialize($config));
			}	
			$this->run();
		}
		else
		{
			echo "ûÓÐÖ¸¶¨±íÃû";
		}		
	}

	function run()
	{
 		if($_SERVER['REQUEST_METHOD']=="POST")
		{
			file_put_contents($this->mConfigFile,serialize($_POST['table_config']));
		}
		$table_config = unserialize(file_get_contents($this->mConfigFile));

		$this->mSmarty->assign('list', $table_config);
		$this->mSmarty->assign('types', array('text'=>'µ¥ÐÐÎı¾','textarea'=>'¶àÐÐÎı¾','file'=>'Îļþ','password'=>'ÃÜÂë','select'=>'Áбí'));
		$this->mSmarty->assign('yesno', array('1'=>'ÊÇ','0'=>'·ñ'));
		$this->mSmarty->display("config/tpl.config.htm");
	}
}

$page = new Page();
?>
Return current item: KISS