<?php
require_once '<!--{$class_name}-->_classes/_base.class.php';
class <!--{$class_name}--> extends <!--{$class_name}-->_base {

function dispatch_index() {
	if(!$this->is_cached($this->current_template,$this->cache_id)) {
		$this->assign_search_form();
		$list_table = $this->list_records('');
			
		$this->assign('table_view',$this->list->display_table_value($list_table));
		$this->assign('display_cmd','info');
		$this->page['pager'] = $this->list->get_pager_links();
		$this->page['name'] = '<!--{$page_title}-->の一覧';
		$this->assign('page',$this->page);
	}
	return $this->display($this->current_template,$this->cache_id);
}

function dispatch_info() {
	$this->assign_search_form();
	$result = $this->display_record();
	
	$this->assign_form('input_form',$this->form);
	$this->page['name'] = '<!--{$page_title}-->の表示';
	$this->assign_page_and_pathlist();
	return $this->display($this->current_template);
}

function dispatch_add() {
	$this->assign_search_form();
	$result = $this->display_record();
	if($this->QuictyStatus=='INSERT') {
		redirect('<!--{$dir_name}-->/');
	}
	
	$this->assign_form('input_form',$this->form);
	$this->page['name'] = '<!--{$page_title}-->の追加';
	$this->assign_page_and_pathlist();
	return $this->display($this->current_template);
}

function dispatch_edit() {
	$this->assign_search_form();
	$result = $this->display_record();
	if($this->QuictyStatus=='UPDATE') {
		redirect('<!--{$dir_name}-->/');
	}
	
	$this->assign_form('input_form',$this->form);
	$this->page['name'] = '<!--{$page_title}-->の編集';
	$this->assign_page_and_pathlist();
	return $this->display($this->current_template);
}

function dispatch_delete() {
	$this->assign_search_form();
	$result = $this->display_record();
	if($this->QuictyStatus=='DELETE') {
		redirect('<!--{$dir_name}-->/');
	}
	
	$this->assign_form('input_form',$this->form);
	$this->page['name'] = '<!--{$page_title}-->の削除';
	$this->assign_page_and_pathlist();
	return $this->display($this->current_template);
}

function dispatch_batch_update() {
	$list_table = $this->batch_update();
	if($this->QuictyStatus=='UPDATE') {
		redirect('<!--{$dir_name}-->/');
	}
	
	$base_url = quicty_base_url();
	$update_form['display_cmd'] = $base_url.'<!--{$dir_name}-->/edit';
	//$update_form['conditions']['any_key'] = $_REQUEST['any_key'];
	$update_form['even_color'] = '#fee';	
	$this->assign_batch_form('table_view',$list_table,$max_column=1,$update_form);
	$navi = $this->list->get_pager_links();
	$this->assign('pager_navi',$navi['all']);
	$this->page['name'] = '<!--{$page_title}-->の一括更新';
	$this->assign_page_and_pathlist();
	$this->assign('page',$this->page);
	return $this->display($this->current_template);
}

} // end of <!--{$class_name}--> class
?>