<?php
	include "koneksi.php";
	$tanggal = date('m-d-Y');
				  
	if (isset($_POST['pilihan'])) 
	{
	$pilihan = $_POST['pilihan'];
	echo "ini = "."$pilihan";
		if ($pilihan == 1)
		{
			$query = "UPDATE hapus_pilihan SET id_dipilih = 1 WHERE id='$pilihan'";
			$hasil=mysqli_query($conn,$query);
			if($hasil)
			{
				echo "masuk";
				header("location:tesAjax3.php");
			}
			else
			{
				echo "quer".$query;
				echo "gagal";
				//header("location:tesAjax2.php?p=2");
				//die("Error");
			}
		}
		if ($pilihan == 2)
		{
			$query = "UPDATE hapus_pilihan SET id_dipilih = 1 WHERE id='$pilihan'";
			$hasil=mysqli_query($conn,$query);
			if($hasil)
			{
				echo "masuk";
				header("location:tesAjax3.php");
			}
			else
			{
				echo "quer".$query;
				echo "gagal";
				//header("location:tesAjax2.php?p=2");
				//die("Error");
			}
		}
		if ($pilihan == 3)
		{
			$query = "UPDATE hapus_pilihan SET id_dipilih = 1 WHERE id='$pilihan'";
			$hasil=mysqli_query($conn,$query);
			if($hasil)
			{
				echo "masuk";
				header("location:tesAjax3.php");
			}
			else
			{
				echo "quer".$query;
				echo "gagal";
				//header("location:tesAjax2.php?p=2");
				//die("Error");
			}
		}
		if ($pilihan == 4)
		{
			$query = "UPDATE hapus_pilihan SET id_dipilih = 1 WHERE id='$pilihan'";
			$hasil=mysqli_query($conn,$query);
			if($hasil)
			{
				echo "masuk";
				header("location:tesAjax3.php");
			}
			else
			{
				echo "quer".$query;
				echo "gagal";
				//header("location:tesAjax2.php?p=2");
				//die("Error");
			}
		}
		if ($pilihan == 5)
		{
			$query = "UPDATE hapus_pilihan SET id_dipilih = 1 WHERE id='$pilihan'";
			$hasil=mysqli_query($conn,$query);
			if($hasil)
			{
				echo "masuk";
				header("location:tesAjax3.php");
			}
			else
			{
				echo "quer".$query;
				echo "gagal";
				header("location:tesAjax3.php");
				//die("Error");
			}
		}
		if ($pilihan == 6)
		{
			$query = "UPDATE hapus_pilihan SET id_dipilih = 1 WHERE id='$pilihan'";
			$hasil=mysqli_query($conn,$query);
			if($hasil)
			{
				echo "masuk";
				header("location:tesAjax3.php");
			}
			else
			{
				echo "quer".$query;
				echo "gagal";
				//header("location:tesAjax2.php?p=2");
				//die("Error");
			}
		}
		if ($pilihan == 7)
		{
			$query = "UPDATE hapus_pilihan SET id_dipilih = 1 WHERE id='$pilihan'";
			$hasil=mysqli_query($conn,$query);
			if($hasil)
			{
				echo "masuk";
				header("location:tesAjax3.php");
			}
			else
			{
				echo "quer".$query;
				echo "gagal";
				//header("location:tesAjax2.php?p=2");
				//die("Error");
			}
		}
		if ($pilihan == 8)
		{
			$query = "UPDATE hapus_pilihan SET id_dipilih = 1 WHERE id='$pilihan'";
			$hasil=mysqli_query($conn,$query);
			if($hasil)
			{
				echo "masuk";
				header("location:tesAjax3.php");
			}
			else
			{
				echo "quer".$query;
				echo "gagal";
				//header("location:tesAjax2.php?p=2");
				//die("Error");
			}
		}
		if ($pilihan == 9)
		{
			$query = "UPDATE hapus_pilihan SET id_dipilih = 1 WHERE id='$pilihan'";
			$hasil=mysqli_query($conn,$query);
			{
				echo "masuk";
				header("location:tesAjax3.php");
			}
			else
			{
				echo "quer".$query;
				echo "gagal";
				//header("location:tesAjax2.php?p=2");
				//die("Error");
			}
		}
		if ($pilihan == 10)
		{
			$query = "UPDATE hapus_pilihan SET id_dipilih = 1 WHERE id='$pilihan'";
			$hasil=mysqli_query($conn,$query);
			{
				echo "masuk";
				header("location:tesAjax3.php");
			}
			else
			{
				echo "quer".$query;
				echo "gagal";
				//header("location:tesAjax2.php?p=2");
				//die("Error");
			}
		}
		if ($pilihan == 11)
		{
			$query = "UPDATE hapus_pilihan SET id_dipilih = 1 WHERE id='$pilihan'";
			$hasil=mysqli_query($conn,$query);
			{
				echo "masuk";
				header("location:tesAjax3.php");
			}
			else
			{
				echo "quer".$query;
				echo "gagal";
				//header("location:tesAjax2.php?p=2");
				//die("Error");
			}
		}
	}
	
	
	
?>