<?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") {

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

    $sql  = "INSERT INTO brand_master (brand_name, brand_type, isdelete,createdby,userID,createdate) VALUES ('".$brandname."', '".$brand_type."', '1','".$createdby."','".$userID."','".$createdate."')";
    
    mysqli_query($conn,$sql);

    $brandID = mysqli_insert_id($conn);
    
    header("Location:brandMasterDashboard.php");

}





?>