<?php
session_start();
require_once("config/configDB.php"); 

function validation_input($data) {
    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    return $data;
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {

    $regcode   = stripslashes($_POST['regcode']);
    $regname       = stripslashes($_POST['regname']);
	$reg_address       = stripslashes($_POST['reg_address']);
    
    $createdate  	= date("Y-m-d");
    $createdby      = $_SESSION['username'];
    $userID         = $_SESSION['user_id'];
	
	$autoinc=mysqli_query($conn,"ALTER TABLE vehiclereg CHANGE id id INT(11) NOT NULL AUTO_INCREMENT ");

    $sql  = "INSERT INTO vehiclereg (regcode, regname,reg_address, isdelete,createdby,userID,createdate) VALUES ('".$regcode."', '".$regname."', '".$reg_address."','1','".$createdby."','".$userID."','".$createdate."')";

    mysqli_query($conn,$sql);

    $siteID = mysqli_insert_id($conn);
    
    header("Location:vehicleregMasterDashboard.php");

}





?>