<?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'));
			}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'));
			}elseif($this -> getType() == TYPE_IMAGE_MANAGER_DETAIL){
				require_once($this -> getSystemHTML('TEMPLATE_ADVERTISEMENTS_MANAGER_DETAIL_PATH'));
			}elseif($this -> getType() == TYPE_UPDATE){
			    require_once($this -> getSystemHTML('TEMPLATE_ADVERTISEMENTS_MANAGER_PATH'));
			}elseif($this -> getType() == TYPE_IMAGE_MANAGER_UPLOAD){
				require_once($this -> getSystemHTML('TEMPLATE_ADVERTISEMENTS_MANAGER_UPLOAD_PATH'));
			}elseif($this -> getType() == TYPE_IMAGE_MANAGER_UPLOAD_COMPLETE){
				require_once($this -> getSystemHTML('TEMPLATE_ADVERTISEMENTS_MANAGER_PATH'));
			}else{
				require_once($this -> getSystemHTML('TEMPLATE_ADVERTISEMENTS_PATH'));
			}
			
		} catch (Exception $e) {
			header('Location: /');
		}
	}
}
?>