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

function pre_dispatch_index() {
	parent::pre_dispatch_index();
	$dbpath = realpath('../var/sqlite/<!--{$db_name}-->');
	$this->dsn = "sqlite:///$dbpath?mode=0666";

	if($_SERVER['SERVER_NAME']=='quicty.local') {
		$this->API_key = 'ABQIAAAAC436CRylt4eXoOKxyByBiBRBQE8rB7imLa7zJdMNnYqHlMIovBSIZs_tiVm4m8qF3dmjsROzw4E4_Q';
	} elseif($_SERVER['SERVER_NAME']=='other domain') {
		$this->API_key = 'other keys';
	}
}

function dispatch_index() {
	require_once 'Quicty/lib/GoogleMap.class.php';
	$this->map = new GoogleMap($this->dsn,$this->API_key,'500px','400px',0);
	$this->assign_search_form();

	$list_table = $this->list_records('');
	if(is_array($list_table) and count($list_table)>0) {
		foreach($list_table as $spot) {
			$this->map->add_marker_by_address($spot['address'],$spot['name'],'');
		}
	} else {
		$center = 'ÅìµþÅÔ¿·½É¶èÀ¾¿·½ÉÆóÃúÌÜ8ÈÖ1¹æ';
		$this->map->add_marker_by_address($center,'ÅìµþÅÔÄ£<br />');
	}

	$result = $this->display_record('');
	switch($this->QuictyStatus) {
		case 'INSERT':
		case 'UPDATE':
		case 'DELETE':
			redirect('<!--{$dir_name}-->/');
	}
	$this->assign_form('input_form',$this->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->page = array_merge($this->page,$this->map->get_components());
	$this->assign('page',$this->page);
	return $this->display($this->current_template);
}

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