Upload New File

parent f4d1fc38
<?php
session_start();
include('../config.php');
include("template/header.php");
include("../common/function.php");
include("functions.php");
open_page("Destinasi");
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 != "user"){
echo "<script>alert('Anda bukan user');window.location='../index.php';</script>";
exit;
}
$id_akun = $_SESSION["id_akun"];
$nama = $_SESSION["nama"];
$username = $_SESSION["username"];
$data = query("SELECT * FROM destinasi");
// function cari
if (isset($_POST["cari"])){
$data = caridestinasi($_POST["keyword"]);
}
?>
<!-- ======= Breadcrumbs ======= -->
<section id="breadcrumbs" class="breadcrumbs">
<div class="container">
<div class="d-flex justify-content-between align-items-center">
<h2>Destinasi</h2>
</div>
</div>
</section>
<!-- End Breadcrumbs -->
<!-- Start form search -->
<div class="container mt-2 ml-2">
<form method="post" action="">
<label for="">Cari Destinasi </label><br>
<input type="text" class="btn-outline-light" name="keyword" placeholder="Masukkan keyword" autocomplete="off" autofocus>
<button type="submit" name="cari" class="btn btn-sm btn-outline-primary">
<svg class="bi bi-search" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M10.442 10.442a1 1 0 0 1 1.415 0l3.85 3.85a1 1 0 0 1-1.414 1.415l-3.85-3.85a1 1 0 0 1 0-1.415z"/>
<path fill-rule="evenodd" d="M6.5 12a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11zM13 6.5a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0z"/>
</svg>
</button>
</form>
</div>
<!-- End form search -->
<div class="card-group mt-2" >
<?php foreach($data as $destinasi) { ?>
<div class="card mt-2">
<div class="card-body">
<h5 class="card-title"><?=$destinasi['nama_destinasi']?></h5>
<p class="card-text"><?=$destinasi['deskripsi_destinasi']?></p>
<img src="<?= BASEURL; ?>public/img/<?= $destinasi['gambar_destinasi'] ?>" class="align-self-center mr-5 mt-3" alt="gambar_destinasi" style="width:150px;length:150px">
</div>
</div>
</div>
<?php } ?>
<?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