<?php 
include "koneksi.php";

?>
<!DOCTYPE html>
<link rel="stylesheet" type="text/css" href="style.css">
<html>
  <head>
	<title> PT MULTI HYDRACHROM BALIKPAPAN </title>
	<link rel="icon" type="image/png" href="images/mhb.jpeg">
					
					<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta charset="UTF-8">
	<?php
		include "part/jss.php";
	?>
	
  </head>
  <body>
	
	<div style="width:1280px; height:100px" class="container">
	
			<div class="alert alert-info" href="#">
            <div style="display: block; margin-left: auto; margin-right: auto; width: 1000px;  height:100px;"><img style="width: 1000px;  height:180px;" src="images/hd.jpg"></div>
            <div>
                <center>
                    <h1>PT. MULTI HIDRACHROM BALIKPAPAN</h1>
                </center>
            </div>
            <div>
                <center>
                    <h4>PROFESIONAL INFORMATION SYSTEM</h4>
                </center>
            </div>
        </div>
					

			
			
		<div class="alert alert-info">
			 <h3 align="center">DAILY REPORT</h3>
			 
			 <?php
				if (isset($_GET["p"]))
				{
					$p=mysqli_real_escape_string($conn,$_GET["p"]);
					if ($p=="1")
					{
						?>		  
								<div id="ticketModal">
									<div class="w3-modal-content w3-animate-top w3-card-4">
									  <header class="w3-container w3-teal w3-center w3-padding-12"> 
										<span onclick="document.getElementById('ticketModal').style.display='none'" 
									   class="w3-button w3-teal w3-xlarge w3-display-topright">×</span>
										<h2 class="w3-wide"><i class="w3-margin-right" style="width:80%"></i>Daily Report</h2>
									  </header>
									  <div class="w3-container">
                                        <h2 class="w3-wide"><i class="w3-margin-right"></i>Berhasil Ditambah!</h2>
										<button class="w3-button w3-red w3-section" onclick="document.getElementById('ticketModal').style.display='none'">Close <i class="fa fa-remove"></i></button>
					                 
									  </div>
									</div>
								</div>
						<?php
					}
					else if ($p=="2")
					{
						?>
							<div id="ticketModal">
									<div class="w3-modal-content w3-animate-top w3-card-4">
									  <header class="w3-container w3-teal w3-center w3-padding-12"> 
										<span onclick="document.getElementById('ticketModal').style.display='none'" 
									   class="w3-button w3-teal w3-xlarge w3-display-topright">×</span>
										<h2 class="w3-wide"><i class="fa fa-suitcase w3-margin-right" style="width:80%"></i>Daily Report</h2>
									  </header>
									  <div class="w3-container">
                                        <h2 class="w3-wide"><i class="w3-margin-right"></i>Gagal! Isi kembali daily anda</h2>
										<button class="w3-button w3-red w3-section" onclick="document.getElementById('ticketModal').style.display='none'">Close <i class="fa fa-remove"></i></button>
										
									  </div>
									</div>
								</div>
						<?php
					}
				}

				if (isset($_GET['pesan'])) {
					if ($_GET['pesan'] == "berhasilInput") {
						echo "<div class='alert alert-success' role='alert'> Berhasil Input DB. </div>";
					}
					// if ($_GET['pesan'] == "berhasilInput") {
					// 	echo "<div class='alert alert-danger' role='alert'> Berhasil Input DB. </div>";
					// }
				}
				?>
			 
			 
			 
			 
			 
			 

			 <form method="POST" action="simpanDailyReport.php" enctype="multipart/form-data">
				  <div class="form-group" align="center">
				  <h5 align="center" color="rgb(239, 255, 255)" >"isi daily report anda disini"</h5>
				  
				  <?php
				   echo date('m - d - Y');
				  ?>
				  
				  <p></p>					
					<h4><div class="form-group">
					
					
				
							<label for="sel1">Daily 1:</label>
							<select class="form-control" name="kendaraan" id="kendaraan">
							<?php
							include "koneksi.php";
							//Perintah sql untuk menampilkan semua data pada tabel jurusan
							$sql="select * from form_qc_001_surfaceid_condition";
							$hasil=mysqli_query($conn,$sql);
							while ($data = mysqli_fetch_array($hasil)) 
							{
							?>
								<option  value="<?php echo $data['id'];?>"><?php echo $data['nama'];?></option>
							<?php
								}
							?>
							</select>
						</div>

				 <br>
				 </br>
				 				<?php
						    $q = "SELECT * form_qc_001_surfaceid_condition WHERE id_dipilih = '1'";
							$res = mysqli_query($conn, $q);
							while ($row = mysqli_fetch_assoc($res)) 
							{
							?>
								<tr>
									<td>
									     <?php
									         echo $row["nama"];
									     ?>
								    </td>
								</tr>
							<?php
							}
				?>
				  <button type="submit" class="btn btn-primary">Send</button> 
				
				</form>
				<br></br><br></br><br></br>
			
		<center><h5 class="form-signin">Copyright &copy; <a href="#" data-toggle="modal" data-target="#contact">SatrioPringgondani</a></h5></center>  
	</div>
<script type="text/javascript">
function readURL(input) 
{
  if (input.files && input.files[0]) {
    var reader = new FileReader();
    
    reader.onload = function(e) {
      $('#gambar').attr('src', e.target.result);
    }
    
    reader.readAsDataURL(input.files[0]); // convert to base64 string
  }
}

$("#file").change(function() {
	$('#gambar').show();
   readURL(this);
});

$("#kendaraan").change(function(){
            // variabel dari nilai combo box kendaraan
            var id_kendaraan = $("#kendaraan").val();

            // Menggunakan ajax untuk mengirim dan dan menerima data dari server
            $.ajax({
                type: "POST",
                dataType: "html",
                url: "simpanTesAjax2Hapus.php",
                data: "kendaraan="+id_kendaraan,
                success: function(data){
                   $("#kendaraan").html(data);
                }
            });
        });

        $("#merk").change(function(){
            // variabel dari nilai combo box merk
            var id_merk = $("#merk").val();

            // Menggunakan ajax untuk mengirim dan dan menerima data dari server
            $.ajax({
                type: "POST",
                dataType: "html",
                url: "simpanTesAjax2Hapus.php",
                data: "merk="+id_merk,
                success: function(data){
                    $("#merk").html(data);
                }
            });
        });
		$("#tipe").change(function(){
            // variabel dari nilai combo box merk
            var id_tipe = $("#tipe").val();

            // Menggunakan ajax untuk mengirim dan dan menerima data dari server
            $.ajax({
                type: "POST",
                dataType: "html",
                url: "simpanTesAjax2Hapus.php",
                data: "tipe="+id_tipe,
                success: function(data){
                    $("#tipe").html(data);
                }
            });
        });
</script>	
  </body>
</html>




