<?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->set_pager();
		$this->assign_page_and_pathlist($this->W['<!--{$page_name}-->'].' '.$this->W['list']);
	}
	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->assign_page_and_pathlist($this->W['<!--{$page_name}-->'].' '.$this->W['display']);
	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->assign_page_and_pathlist($this->W['<!--{$page_name}-->'].' '.$this->W['add']);
	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->assign_page_and_pathlist($this->W['<!--{$page_name}-->'].' '.$this->W['edit']);
	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->assign_page_and_pathlist($this->W['<!--{$page_name}-->'].' '.$this->W['delete']);
	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['pager'] = $this->set_pager();
	$this->assign_page_and_pathlist($this->W['<!--{$page_name}-->'].' '.$this->W['batch_update']);
	return $this->display($this->current_template);
}

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