 <?php
	 include_once('koneksi.php');
	
if (isset ($_POST ['simpan_admin']))
{
	 	$nama  = $_POST['nama'];
    	$username  = $_POST['Username'];
    	$password  = $_POST['Password'];
    	$email = $_POST['Email'];
    	$jkel  = $_POST['Sex'];
		$status_admin  = $_POST['status'];
   		$level  = $_POST['level'];

     $query = "INSERT INTO admin (nama_lengkap,username,password,Email,Jkel,level,status_admin) VALUES('$nama','$username','$password','$email','$jkel','$status_admin','$level')";
    $hasil = mysql_query($query);
   
   if($hasil){
		header('Location: tabel_admin.php');
	}
	else{
		header('Location: tabel_admin.php');
		}
mysql_close();
}
elseif (isset ($_POST ['simpan_dataTR']))
{
	 	$no  = $_POST['no'];
		$musimr  = $_POST['musim'];
		$stok  = $_POST['stok'];
		$harga  = $_POST['harga'];
  		
  	
		$query = "INSERT INTO dtraining (no,musim,stok,harga) VALUES('$no','$musim','$stok','$harga')";
    $hasil = mysql_query($query);
   
   if($hasil){
		header('Location:dataTraining.php');
	}
	else{
		//header('Location:tabel_klaster.php');
		}
mysql_close();
}
elseif (isset ($_POST ['simpan_dataTS']))
{

	 	$no  = $_POST['no'];
		$musimr  = $_POST['musim'];
		$stok  = $_POST['stok'];
		$harga  = $_POST['harga'];
  		
  	
		$query = "INSERT INTO dtraining (no,musim,stok,harga) VALUES('$no','$musim','$stok','$harga')";
    $hasil = mysql_query($query);
   
   if($hasil){
		header('Location:dataTesting.php');
	}
	else{
		echo "gagal menginput";
		}
mysql_close();
}

?>