<?php require_once('../auth/auth.php');
if (isset($_POST['newroute'])) {
    $newroute=    $_POST['newroute'];
    $route_name=    $_POST['route_name'];
    $road_name= $_POST['road_name'];

if ($newroute=='0') {
    mysqli_query($conn,"INSERT INTO route_area( `coid`,`bid`,`brid`, `route_name`, `road_name`,`userid`,`op_date`) VALUES ('$coid','$bid','$brid','$route_name','$road_name','$uid','$datetime')")or die(mysqli_error($conn));
} else if($newroute >0){
mysqli_query($conn,"UPDATE route_area SET route_name='$route_name',road_name='$road_name' WHERE roid='$newroute'");
echo "update"; 

}

}       
?>