<?php
require_once(SYSTEM_LOGICS . 'advertisements/logic.php');

class ControlAdvertisements extends LogicAdvertisements {
	/*-------------------------------------------------------------------------
	* @ メンバ変数
	-------------------------------------------------------------------------*/

	/*-------------------------------------------------------------------------
	* @function_name: ロジックのコンストラクタ
	* @parameter	: なし
	* @return		: なし
	-------------------------------------------------------------------------*/
	function __construct() {
		parent::__construct();
	}


	/*-------------------------------------------------------------------------
	* @function_name: コントロールパネルシステム動画データ編集ロジック（各クラス共通）
	* @parameter	: なし
	* @return		: なし
	-------------------------------------------------------------------------*/
	function action() {
		try {
		    $this -> checkAvailability("system", function(){
		        require_once($this -> getSystemHTML('TEMPLATE_MAINTENANCE_MODE_SYSTEM_PATH'));
		        exit();
		    });
		    
			// アクション実行
			$this -> logic();
			if($this -> getType() == NO_STRING && $this -> getType()	== TYPE_SEARCH){
				require_once($this -> getSystemHTML('TEMPLATE_ADVERTISEMENTS_PATH', $this -> dispHTML()));
			}elseif($this -> getType() == TYPE_IMAGE_MANAGER || $this -> getType()	== TYPE_SEARCH || $this -> getType() == 'save_sequence'
					|| $this -> getType() == TYPE_DELETE){
				require_once($this -> getSystemHTML('TEMPLATE_ADVERTISEMENTS_MANAGER_PATH', $this -> dispHTML()));
			}elseif($this -> getType() == TYPE_IMAGE_MANAGER_DETAIL || $this -> getType() == TYPE_UPDATE){
				require_once($this -> getSystemHTML('TEMPLATE_ADVERTISEMENTS_MANAGER_DETAIL_PATH', $this -> dispHTML()));
			}elseif($this -> getType() == TYPE_IMAGE_MANAGER_UPLOAD){
				require_once($this -> getSystemHTML('TEMPLATE_ADVERTISEMENTS_MANAGER_UPLOAD_PATH', $this -> dispHTML()));
			}elseif($this -> getType() == TYPE_IMAGE_MANAGER_UPLOAD_COMPLETE){
				require_once($this -> getSystemHTML('TEMPLATE_ADVERTISEMENTS_MANAGER_PATH', $this -> dispHTML()));
			}else{
				require_once($this -> getSystemHTML('TEMPLATE_ADVERTISEMENTS_PATH', $this -> dispHTML()));
			}
			
		} catch (Exception $e) {
			header('Location: /');
		}
	}
}
?>