<?php
include_once('include/divers/functions.php');
if (isset($_POST['formsubmit']))
{
if(!isset($_POST['domain'])){ $error="Domain not set.<br>"; $count=$count+1;}
if($_POST['domain'] == ""){ $error="$error Domain not filled in<br>"; $count=$count+1;}
if(!isset($_POST['city'])){ $error="$error City not set.<br>"; $count=$count+1;}
if($_POST['city'] == ""){ $error="$error City not Filled in<br>"; $count=$count+1;}
if(!isset($_POST['country'])){ $error="$error Country not set.<br>"; $count=$count+1;}
if($_POST['country'] == ""){ $error="$error Country not filled in<br>"; $count=$count+1;}
// check to make sure the location name does not have ilegal chars
// NO SPACES as this will be a table name!!!
// $LocID=($_POST['location']);
// getLoc($LocID);
$input=($_POST['location']);
//echo"$input"; //DEBUG
if (hasSpace($input)){
$error=$error." No spaces allowed location name.<br>"; $count=$count+1;
}
if (hasPeriod($input)){
$error=$error." No periods allowed location name.<br>"; $count=$count+1;
}
// check to make sure that the Location Name does not exist yet
$location = $_POST['location'];
$domain = $_POST['domain'];
$state = $_POST['state'];
$city = $_POST['city'];
$country = $_POST['country'];
if(!isset($error)){
modify_loc($_POST['location'], $_POST['domain'], $_POST['state'], $_POST['city'], $_POST['country']);
echo "<p class=\"information\">New location <b>".$location."</b> was successfully modified.</p>";
// echo 'Now you need to add an administrator for this location.<br>'; // FIXME NOT WORKING YET
// include('add_administrator.php'); // not yet completed
}
if(isset($error)){
if($count>1){
$msg="$count errors were encountered while processing the form.";
$tailmsg="Please fix the above errors and resubmit.";}
if($count==1){
$msg="An error was encountered while processing the form.";
$tailmsg="Please fix the above error and resubmit.";}
echo("<p class=\"error\">$msg<br>$error $tailmsg</p>");
include('include/location/modify_location_form.php');}
}
if (!isset($_POST['formsubmit'])){
include('modify_location_form.php');
}
?>