
<?php 
date_default_timezone_set('Asia/Jakarta');

session_start();

$logkanwil=$_SESSION["logkanwil"] ;


if(!isset($_SESSION["login"]) ) {
	header("Location: login.php");
	exit;
}




 //if(isset($_SESSION["login"]) && ($_SESSION["logkanwil"] =="KP") ) {
  //   	header("Location: index.php");
 // 	exit;
 // }

require 'functions.php';

if( isset($_POST["tomboltambah"]) ) {
	if( tambah_vendor($_POST) > 0 ) {
		echo "<script>
				alert('Data berhasil ditambahkan !');
				document.location.href = 'tambah_vendor.php';
			  </script>";
	} else {
		echo "<script>
				alert('Data gagal ditambahkan !');
				document.location.href = 'tambah_vendor.php';
			  </script>";
	}
}


?>


<!DOCTYPE html>
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">


<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="main.js"></script>


<?php 
echo "USER:$logkanwil ";


?>

<a href="logout.php"> |Logout|</a>
<a href="tabel_vendor.php">Tabel Vendor|</a>



	
	<title>Tambah Vendor</title>
	<style>
		ul li { list-style: none; }
	</style>
</head>
<body>
	<h1>Tambah Vendor</h1>
	
	
	
<!-- 	<table cellpadding="0" border="1">  --ada border -->
	<table>
	<form action="" method="post">


				
				
    	<!-- <tr height="100"> , tinggi 100 -->
        <tr>       	
    	
			<td><label for="vendor">Vendor: </label></td>
			<td><input required type="text" name="vendor" id="vendor" size="70" onkeyup="this.value = this.value.toUpperCase()" autofocus></td>
		</tr>
	
   	
	
			    
			    
			<td colspan="2">

                <button type="submit" class="btn btn-danger" name="tomboltambah">Tambah data</button>

				
</td>

		</tr>
	</form>

</table>


	
</body>
</html>

