$field = 'id';
}
?>
<?
include 'models/selects.php';
include 'models/updates.php';

if(isset($_REQUEST['submit'])){
	$table = 'contact';
	$setFields = "data='".$_REQUEST['data']."'";
	$where = "id='".$_REQUEST['zone_id']."'";
	$updateData = updateField($table, $setFields, $where, $db_location,$db_user,$db_pass,$db_db);
}

if(selectAllSingle('contact',$field,$id,$db_location, $db_user,$db_pass,$db_db)){
	$theData = selectAllSingle('contact',$field,$id,$db_location, $db_user,$db_pass,$db_db);
	foreach($theData as $value){
		$ids[] = $value['id'];
		$zone_title[] = $value['zone_title'];
		$data[] = $value['data'];
	}
}else{
	$data['id'] = 'error';
}
?>
<? if(isset($id)){?>
<a href="<?php 
echo $base_url;
?>
contact">&lt; Back</a>
<form action="" method="POST">
<?
if(isset($_REQUEST['id'])){
	$id=$_REQUEST['id'];
	$field = 'id';
}
?>
<?
include 'models/selects.php';
include 'models/updates.php';
include 'models/inserts.php';

//SELECT POST DATA IF ID IS SET
if(isset($id)){
	if($id != 'new'){
		if(selectAllSingle('blog_form',$field,$id,$db_location, $db_user,$db_pass,$db_db)){
			$theData = selectAllSingle('blog_form',$field,$id,$db_location, $db_user,$db_pass,$db_db);
			foreach($theData as $value){
				$ids[] = $value['id'];
				$modified[] = $value['modified'];
				$author[] = $value['author'];
				$title[] = $value['title'];
				$data[] = $value['data'];
				$tags[] = $value['tags'];
			}
		}else{
			$data['id'] = 'error';
		}
	}
}

//IF THE FORM WAS SUBMITTED DO SOME SQL INSERTION OR UPDATE