<?php
include "koneksi.php";
if (isset($_POST['kendaraan'])) 
{
    $kendaraan = $_POST["kendaraan"];
    $kendaraan2 = $kendaraan;
	
	$query1 = "UPDATE form_qc_001_surfaceid_condition SET id_dipilih = '1' WHERE id = $kendaraan";
	$result = mysqli_query($conn, $query1);
	
	$query2 = "UPDATE form_qc_001_surfaceid_condition SET status = '1' WHERE id = '0'";
	$result2 = mysqli_query($conn, $query2);
	
    $sql = "select * from form_qc_001_surfaceid_condition where id_dipilih = '0'";
    $hasil = mysqli_query($conn, $sql);
    $no = 0;
    while ($data = mysqli_fetch_array($hasil)) {
        ?>
        <option value="<?php echo  $data['id']; ?>"><?php echo $data['nama']; ?></option>
        <?php
    }
}
if (isset($_POST['merk'])) {
    $merk = $_POST["merk"];
			
	$q="UPDATE form_qc_001_surfaceid_condition SET id_dipilih = '1' WHERE id = $merk";
	$result = mysqli_query($conn, $q);
	
	$sql = "select * from form_qc_001_surfaceid_condition where id_dipilih = '0'";
    $hasil = mysqli_query($conn, $sql);
    $no = 0;
    while ($data = mysqli_fetch_array($hasil)) 
	{
        ?>
		<option value="<?php echo  $data['id']; ?>"><?php echo $data['nama']; ?></option>
		
        <?php
    }
	
}
//if (isset($_POST['tipe'])) 
//{
	//$tipe = $_POST["tipe"];
	//$query = "SELECT * FROM daily_report ORDER BY id DESC LIMIT 1";
	//$res=mysqli_query($conn,$query);
	//$dataUser=mysqli_fetch_assoc($res);
	//$id_daily_report_isi1 = $dataUser["id_daily_report_isi1"];
	//$id_daily = $dataUser["id"];
    
	
	//$q="UPDATE daily_report SET id_daily_report_isi3='$tipe' WHERE id='$id_daily'";
	//$result = mysqli_query($conn, $q);
	
  
//}

?>