Upload New File

parent c96b0084
<?php
session_start();
include('../config.php');
include("template/header.php");
include("../common/function.php");
include("function.php");
open_page("Ubah Kendaraan");
// include("../common/dbconfig.php");
if(! isset($_SESSION['is_login']))
{
header('location:../index.php');
}
if (!isset($_SESSION["username"])){
// echo "<script>alert('Login terlebih dahulu');window.location='../index.php';</script>";
// exit;
echo "Anda harus login dulu <br><a href='../index.php'>Klik disini</a>";
exit;
}
$role = $_SESSION["role"];
if($role != "admin"){
echo "<script>alert('Anda bukan admin');window.location='../index.php';</script>";
exit;
}
$id_akun = $_SESSION["id_akun"];
$nama = $_SESSION["nama"];
$username = $_SESSION["username"];
$id_transp = $_GET["id_transp"];
// kita query
$data = query("SELECT * FROM pt_trans WHERE id_transp = $id_transp")[0];
if(isset($_POST["submit"]))
{
if(ubahtransp($_POST) > 0)
{
echo
"
<script>
alert('Berhasil diubah');
document.location.href = 'transportasi_admin.php';
</script>
";
}else{
echo
"
<script>
alert('Gagal diubah');
document.location.href = 'transportasi_admin.php';
</script>
";
}
}
?>
<!-- ======= Breadcrumbs ======= -->
<section id="breadcrumbs" class="breadcrumbs">
<div class="container">
<div class="d-flex justify-content-between align-items-center">
<h2>Ubah Kendaraan</h2>
</div>
</div>
</section>
<!-- End Breadcrumbs -->
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h2>Ubah Kendaraan</h2>
</div>
<div class="modal-body">
<form action="" method="post">
<input type="hidden" name="id_transp" value="<?= $data['id_transp']?>" >
<div class="form-group">
<label for="nama_kategori">Nama Kategori</label>
<input type="number" name="kategori_id" class="form-control" value="<?= $data['kategori_id']?>" >
</div>
<div class="form-group">
<label for="deskripsi">Deskripsi</label>
<input type="text" name="nama_transp" class="form-control" value="<?= $data['nama_transp']?>">
</div>
<div class="form-group">
<label>Keterangan Tipe Kendaraan</label>
<ol>
<li>Darat</li>
<li>Udara</li>
<li>Laut</li>
</ol>
</div>
<button class="btn btn-primary mb-3" type="submit" name="submit">Submit</button>
</form>
</div>
</div>
</div>
<?php
include("template/footer.php")
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment