<?php

require_once("headHotelStaff.php");

if($_POST["submit"])
{ 
   $start=$_POST['start'];  $hnm=$_POST['hiD'];
   $rlength =$_POST['rlength'];

   $via =$_POST['via']; $ownID=$_POST['owniD']; 
   $end =$_POST['end'];
   $ldistance =$_POST['ldistance']; $routeId =$_POST['routeId'];
    
   if($con->vVia($via) && $con->vStart($start) && $con->vRlength($rlength) && $con->vEnd($end) && $con->vDistance($ldistance) && $con->vRouteId($routeId))
      {
       require("successAddRouteFormStaff.php");

      }
   else
      {
	     if(isset($_POST['hiD']) && isset($_POST['owniD']))
           {

            require("repostAddRouteFormStaff.php");
           }
      }

 
     }
else 
     {
	echo "Error occured when saving data!..";
     }

?>