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

<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">

  <link rel="icon" type="image/png" sizes="16x16" href="images/kng.jpeg" />
  <title>Kelola Barang Aset</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>

  <!-- w3schools cdn -->
  <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">
  <!-- 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>
  <!-- kendaraan bermotor -->

  <?php
  require_once 'oop/class_kelolabarangaset.php';
  //query button
  if (isset($_POST['simpan'])) {
    $no_brg = $_POST['no_brg'];
    $model = $_POST['model'];



    if ($no_brg == '' || $model == '') {
      echo '<script>
                alert("Data belum lengkap");
                </script>';
    } else {
      require_once "oop/koneksi.php";
      $query = "SELECT * FROM kba_kb WHERE no_brg='$no_brg'";
      $query = $con->prepare($query);
      $query->execute();

      while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
        $data = $row['no_brg'];
      }
      if (isset($data) == $no_brg) {
        echo '<script>
                  alert("Data sudah ada");
                  </script>';
      } else {
        if ($kba_kb->Insertkendaraanbermotor($no_brg, $model)) {
          echo '<script>
                  alert("Data berhasil ditambahkan");
                  </script>';
        }
      }
    }
  } else if (isset($_POST['simpan_furnitur'])) {
    $no_brg = $_POST['no_brg'];
    $model = $_POST['model'];


    if ($no_brg == '' || $model == '') {
      echo '<script>
                alert("Data belum lengkap");
                </script>';
    } else {
      require_once "oop/koneksi.php";
      $query = "SELECT * FROM kba_furnitur WHERE no_brg='$no_brg'";
      $query = $con->prepare($query);
      $query->execute();

      //lopping query
      while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
        //mencari data
        $data = $row['no_brg'];
      }
      //perbandingan data 
      if (isset($data) == $no_brg) {
        echo '<script>
                  alert("Data sudah ada");
                  </script>';
      } else {


        if ($kba_furnitur->Insertfurnitur($no_brg, $model)) {
          echo '<script>
                  alert("Data berhasil ditambahkan");
                  </script>';
        }
      }
    }
  } else if (isset($_POST['simpan_elektronik'])) {
    $no_brg = $_POST['no_brg'];
    $model = $_POST['model'];



    if ($no_brg == '' || $model == '') {
      echo '<script>
                alert("Data belum lengkap");
                </script>';
    } else {
      require_once "oop/koneksi.php";
      $query = "SELECT * FROM kba_elektronik WHERE no_brg='$no_brg'";
      $query = $con->prepare($query);
      $query->execute();

      while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
        $data = $row['no_brg'];
      }
      if (isset($data) == $no_brg) {
        echo '<script>
                  alert("Data sudah ada");
                  </script>';
      } else {


        if ($kba_elektronik->Insertelektonik($no_brg, $model)) {
          echo '<script>
                  alert("Data berhasil ditambahkan");
                  </script>';
        }
      }
    }
  }


  ?>

  <div class="w3-third w3-section">
    <a href="#" class="" data-toggle="modal" data-target="#myModal1">

      <div class="w3-card-4">

        <div class="w3-container ">
          <div class="container">
            <h6 style="text-align:center">Tambah Kelola Kendaraan Bermotor</h6>
            <!-- Trigger the modal with a button -->

            <!-- Modal -->

    </a>
  </div>
  </div>
  <div class="modal fade" id="myModal1" role="dialog">
    <div class="modal-dialog">

      <!-- Modal content-->
      <div class="modal-content">
        <div class="modal-header">

          <h4 class="modal-title">KBA Kendaraan Bermotor</h4>
        </div>
        <div class="modal-body">
          <form method="POST">
            <label for="fname">No Barang </label><br>
            <input type="text" id="fname" name="no_brg"><br><br>
            <label for="fname">Model</label><br>
            <input type="text" id="fname" name="model"><br><br>
            <input type="submit" name="simpan" value="Submit">
          </form>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>
    </div>
  </div>
  </div>
  </div>

  <!-- furnitur -->
  <div class="w3-third w3-section">
    <a href="#" class="" data-toggle="modal" data-target="#myModal2">

      <div class="w3-card-4">

        <div class="w3-container ">
          <div class="container">
            <h6 style="text-align:center">Tambah Kelola Furnitur</h6>
            <!-- Trigger the modal with a button -->

            <!-- Modal -->

    </a>
  </div>
  </div>
  <div class="modal fade" id="myModal2" role="dialog">
    <div class="modal-dialog">

      <!-- Modal content-->
      <div class="modal-content">
        <div class="modal-header">

          <h4 class="modal-title">KBA Furnitur</h4>
        </div>
        <div class="modal-body">
          <form method="POST">
            <label for="fname">No Barang </label><br>
            <input type="text" id="fname" name="no_brg"><br><br>
            <label for="fname">Model</label><br>
            <input type="text" id="fname" name="model"><br><br>
            <input type="submit" value="Submit" name="simpan_furnitur">
          </form>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>
    </div>
  </div>
  </div>
  </div>


  <!-- elektronik -->
  <div class="w3-third w3-section">
    <a href="#" class="" data-toggle="modal" data-target="#myModal3">

      <div class="w3-card-4">

        <div class="w3-container ">
          <div class="container">
            <h6 style="text-align:center">Tambah Kelola Elektronik</h6>
            <!-- Trigger the modal with a button -->

            <!-- Modal -->

    </a>
  </div>
  </div>
  <div class="modal fade" id="myModal3" role="dialog">
    <div class="modal-dialog">

      <!-- Modal content-->
      <div class="modal-content">
        <div class="modal-header">

          <h4 class="modal-title">KBA Elektronik</h4>
        </div>
        <div class="modal-body">
          <form method="POST">
            <label for="fname">No Barang </label><br>
            <input type="text" id="fname" name="no_brg"><br><br>
            <label for="fname">Model</label><br>
            <input type="text" id="fname" name="model"><br><br>
            <input type="submit" value="Submit" name="simpan_elektronik">
          </form>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>
    </div>
  </div>
  </div>
  </div>

  <iframe src="" name="iframe_a" style="margin-left:30%" height="300px" width="100%" title="Iframe Example"></iframe>
  <a href="tampilkbakb.php" style="margin-top:-70px " class="w3-display-left btn btn-primary" target="iframe_a">Tampil Kendaraan Bermotor</a>
  <a href="tampilkbafurnitur.php" style="margin-top:-15px " class="w3-display-left btn btn-primary" target="iframe_a">Tampil Furnitur</a>
  <a href="tampilkbaelektronik.php" style="margin-top:40px" class="w3-display-left btn btn-primary" target="iframe_a">Tampil Elektronik</a>






  <footer>
    <div class="text-center p-3" style="background-color: #003366;
                position:fixed;
                bottom: 0;
                width:100%;
                color:white; ">
      © 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>