<?php
require_once 'items_classes/_base.class.php';
class items extends items_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['_review_item_list']);
	}
	return $this->display($this->current_template,$this->cache_id);
}

function dispatch_info() {
	$this->assign_search_form();
	$result = $this->display_record();
	
	$items_id = $_GET['id'];
	require_once 'reviews.class.php';
	$reviews = new reviews();
	$reviews_list = $reviews->list_records('reviews.id='.$items_id);
	$this->assign('reviews_view',$reviews->list->display_table_value($reviews_list));

	$this->assign_form('input_form',$this->form);
	$this->assign_page_and_pathlist($this->W['_review_item_dispaly']);
	return $this->display($this->current_template);
}

function dispatch_add() {
	$this->assign_search_form();
	$result = $this->display_record();
	if($this->QuictyStatus=='INSERT') {
		redirect('<!--{$folder_name}-->/items/');
	}
	
	$this->assign_form('input_form',$this->form);
	$this->assign_page_and_pathlist($this->W['_review_item_add']);
	return $this->display($this->current_template);
}

function dispatch_edit() {
	$this->assign_search_form();
	$result = $this->display_record();
	if($this->QuictyStatus=='UPDATE') {
		redirect('<!--{$folder_name}-->/items/');
	}
	
	$this->assign_form('input_form',$this->form);
	$this->assign_page_and_pathlist($this->W['_review_item_edit']);
	return $this->display($this->current_template);
}

function dispatch_delete() {
	$this->assign_search_form();
	$result = $this->display_record();
	if($this->QuictyStatus=='DELETE') {
		redirect('<!--{$folder_name}-->/items/');
	}
	
	$this->assign_form('input_form',$this->form);
	$this->assign_page_and_pathlist($this->W['_review_item_delete']);
	return $this->display($this->current_template);
}

function dispatch_error() {
	$this->page['message'] = $this->W['_review_login_error'];
	$this->assign_page_and_pathlist($this->W['_review_please_login']);
	return $this->display($this->current_template);
}

} // end of items class
?>