<!DOCTYPE html>
<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="description" content="Orbitor,business,company,agency,modern,bootstrap4,tech,software">
  <meta name="author" content="themefisher.com">

  <title>kendaraan Bermotor</title>

  <!-- Favicon -->
  <link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico" />

  <!-- bootstrap.min css -->
  <link rel="stylesheet" href="plugins/bootstrap/css/bootstrap.min.css">
  <!-- Icon Font Css -->
  <link rel="stylesheet" href="plugins/icofont/icofont.min.css">
  <!-- Slick Slider  CSS -->
  <link rel="stylesheet" href="plugins/slick-carousel/slick/slick.css">
  <link rel="stylesheet" href="plugins/slick-carousel/slick/slick-theme.css">
  <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.1/font/bootstrap-icons.css">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js" integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script>

  <!-- Main Stylesheet -->
  <link rel="stylesheet" href="css/style.css">

</head>

<body id="top">

  <header>

    <nav class="navbar navbar-expand-lg navigation" id="navbar">
      <div class="container">
        <a class="navbar-brand" href="index.php">
          <img src="images/kuninganmelesat.jpeg" width="200px" class="img-fluid">
        </a>

        <button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarmain" aria-controls="navbarmain" aria-expanded="false" aria-label="Toggle navigation">
          <span class="icofont-navigation-menu"></span>
        </button>

        <div class="collapse navbar-collapse" id="navbarmain">
          <ul class="navbar-nav ml-auto">
            <li class="nav-item active">
              <a class="nav-link" href="index.php">Halaman Utama</a>
            </li>
            <!-- <li class="nav-item"><a class="nav-link" href="about.html">About</a></li>
			    <li class="nav-item"><a class="nav-link" href="service.html">Services</a></li> -->

            <li class="nav-item dropdown">
              <a class="nav-link dropdown-toggle" href="" id="dropdown02" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Aset <i class="icofont-thin-down"></i></a>
              <ul class="dropdown-menu" aria-labelledby="dropdown02">
                <li><a class="dropdown-item" href="kelolabarangaset.php">Kelola Barang Aset</a></li>
                <li><a class="dropdown-item" href="tampilkb.php">Kendaraan Bermotor</a></li>
                <li><a class="dropdown-item" href="tampilfurnitur.php">Furnitur</a></li>
                <li><a class="dropdown-item" href="tampilelektronik.php">Elektronik</a></li>
              </ul>
            </li>



            <!-- <li class="nav-item dropdown">
					<a class="nav-link dropdown-toggle" href="blog-sidebar.html" id="dropdown05" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Blog <i class="icofont-thin-down"></i></a>
					<ul class="dropdown-menu" aria-labelledby="dropdown05">
						<li><a class="dropdown-item" href="blog-sidebar.html">Blog with Sidebar</a></li>

						<li><a class="dropdown-item" href="blog-single.html">Blog Single</a></li>
					</ul>
			  	</li> -->
            <li class="nav-item dropdown">
              <a class="nav-link dropdown-toggle" href="" id="dropdown02" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Cetak Laporan<i class="icofont-thin-down"></i></a>
              <ul class="dropdown-menu" aria-labelledby="dropdown02">

                <li><a class="dropdown-item" target="_blank" href="cetak_kendaraanbermotor.php">Cetak Kendaraan Bermotor</a></li>
                <li><a class="dropdown-item" target="_blank" href="cetak_furnitur.php">Cetak Furnitur</a></li>
                <li><a class="dropdown-item" target="_blank" href="cetak_elektronik.php">Cetak Elektronik</a></li>
              </ul>
            </li>
            <li class="nav-item"><a class="nav-link" target="_blank" href="panduan.php">Panduan</a></li>
            <li class="nav-item"><a class="nav-link" href="tentang.php">Tentang</a></li>
            <li class="nav-item"><a class="nav-link" href="bantuan.php">Bantuan</a></li>
            <li class="nav-item"><a class="nav-link" href="logout.php">logout</a></li>
          </ul>
        </div>
      </div>
    </nav>
    <div class="header-top-bar">
      <div class="container">
        <div class="row align-items-center">
          <div class="col-lg-6">
            <ul class="top-bar-info list-inline-item pl-0 mb-0">

              <li class="list-inline-item"><i class="icofont-location-pin mr-2"></i>Bagian Umum Setda Kabupaten Kuningan</li>
            </ul>
          </div>
          <!-- <div class="col-lg-6">
					<div class="text-lg-right top-right-bar mt-2 mt-lg-0">
						<a href="" >
							<span>Bagian Umum Setda Kabupaten Kuningan</span>
							
						</a>
					</div>
				</div> -->
        </div>
      </div>
    </div>
  </header>
  <br>

  <?php
  require_once 'oop/class_kendaraanbermotor.php';
  $tgl = date('Y-m-d');
  $id = $_GET['id'];
  if (isset($_POST['simpan'])) {
    $no_brg = $_POST['no_brg'];
    $model = $_POST['model'];
    $merk = $_POST['merk'];
    $no_mesin = $_POST['no_mesin'];
    $status = $_POST['status'];
    $th_beli = $_POST['th_beli'];
    $jumlah = $_POST['jumlah'];
    $stn_hrg = $_POST['stn_hrg'];


    $aset->EditKB($id, $no_brg, $model, $merk, $no_mesin, $status, $tgl, $th_beli, $jumlah, $stn_hrg);
    echo "<script>
          alert('Data Berhasil Diubah');
            window.location='tampilkb.php';
        </script>";
  }


  ?>
  <div>
    <div class="container mt-3">
      <h2>Edit Data Kendaraan Bermotor</h2>
      <form action="" method="POST">
        <div class="mb-3 mt-3">
          <?php
          require_once "oop/koneksi.php";
          $query = "SELECT * FROM crudkb WHERE id=" . $_GET['id'];
          $query = $con->prepare($query);
          $query->execute();

          while ($row = $query->fetch(PDO::FETCH_ASSOC)) {

          ?>
            <label for="no_brg">No barang</label>
            <input type="text" value="<?php echo $row['no_brg'] ?>" class="form-control" id="no_brg" name="no_brg">
        </div>
        <div class="mb-3">
          <label for="model">Model</label>
          <input type="text" value="<?php echo $row['model'] ?>" class="form-control" id="model" name="model">
        </div>
        <div class="mb-3 mt-3">
          <label for="merk">Merk</label>
          <input type="text" value="<?php echo $row['merk'] ?>" class="form-control" id="merk" name="merk">
        </div>
        <div class="mb-3">
          <label for="no_mesin">No mesin</label>
          <input type="text" value="<?php echo $row['no_mesin'] ?>" class="form-control" id="no_mesin" name="no_mesin">
        </div>
        <div class="mb-3 mt-3">
          <label for="status">status</label>
          <input type="text" value="<?php echo $row['status'] ?>" class="form-control" id="status" name="status">
        </div>
        <div class="mb-3">
          <label for="tgl_input">tanggal input</label>
          <input type="text" value="<?php echo $row['tgl_input'] ?>" class="form-control" id="tgl" name="tgl_input">
        </div>
        <div class="mb-3 mt-3">
          <label for="th_beli">tahun beli</label>
          <input type="text" value="<?php echo $row['th_beli'] ?>" class="form-control" id="th_beli" name="th_beli">
        </div>
        <div class="mb-3">
          <label for="jumlah">jumlah</label>
          <input type="text" value="<?php echo $row['jumlah'] ?>" class="form-control" id="jumlah" name="jumlah">
        </div>
        <div class="mb-3 mt-3">
          <label for="stn_hrg">satuan harga</label>
          <input type="text" value="<?php echo $row['stn_hrg'] ?>" class="form-control" id="stn_hrg" name="stn_hrg">
        </div>
      <?php

          }
      ?>

      <button type="submit" name="simpan" class="btn btn-primary">Submit</button>
      </form>
    </div>

  </div>
  <br>

  </footer>



  <footer>
    <div class="text-center p-3" style="background-color: #003366">
      © 2026 Copyright: SATSET BAGIAN UMUM SETDA KABUPATEN KUNINGAN


    </div>
  </footer>


  <!-- 
    Essential Scripts
    =====================================-->


  <!-- Main jQuery -->
  <script src="plugins/jquery/jquery.js"></script>
  <!-- Bootstrap 4.3.2 -->
  <script src="plugins/bootstrap/js/popper.js"></script>
  <script src="plugins/bootstrap/js/bootstrap.min.js"></script>
  <script src="plugins/counterup/jquery.easing.js"></script>
  <!-- Slick Slider -->
  <script src="plugins/slick-carousel/slick/slick.min.js"></script>
  <!-- Counterup -->
  <script src="plugins/counterup/jquery.waypoints.min.js"></script>

  <script src="plugins/shuffle/shuffle.min.js"></script>
  <script src="plugins/counterup/jquery.counterup.min.js"></script>
  <!-- Google Map -->
  <script src="plugins/google-map/map.js"></script>
  <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAkeLMlsiwzp6b3Gnaxd86lvakimwGA6UA&callback=initMap"></script>

  <script src="js/script.js"></script>
  <script src="js/contact.js"></script>

</body>

</html>