Commit 22a77470 by KyrieCettyara

perbaiki view user

parent c55db80c
......@@ -48,6 +48,9 @@ $routes->group("user", ["filter" => "auth"], function ($routes) {
$routes->get('logout', ' UserController::logout');
$routes->get('list-kuliner', "ArtikelController::listKuliner");
$routes->get('list-pariwisata', "ArtikelController::listPariwisata");
$routes->get('list-travel', "ArtikelController::listTravel");
$routes->get('list-oleh-oleh', "ArtikelController::listOleh");
$routes->get("artikel/(:num)", "ArtikelController::artikelById/$1");
$routes->match(["get", "post"], "add-artikel", "ArtikelController::addArtikel");
$routes->match(["get", "post"], "edit-artikel/(:num)", "ArtikelController::editArtikel/$1");
......
......@@ -17,11 +17,53 @@ class ArtikelController extends BaseController
public function listKuliner()
{
$data['title'] = 'Sistem Informasi Tapanuli Utara';
$kulinerModel = new ArtikelModel();
$allValue = $kulinerModel->where('id_jenis_artikel', 1)->findAll();
return view('list', [
"allValue" => $allValue,
"data" => $data,
]);
}
public function listPariwisata()
{
$data['title'] = 'Sistem Informasi Tapanuli Utara';
$kulinerModel = new ArtikelModel();
$allValue = $kulinerModel->where('id_jenis_artikel', 3)->findAll();
return view('list', [
"allValue" => $allValue,
"data" => $data,
]);
}
public function listTravel()
{
$data['title'] = 'Sistem Informasi Tapanuli Utara';
$kulinerModel = new ArtikelModel();
$allValue = $kulinerModel->where('id_jenis_artikel', 2)->findAll();
return view('list', [
"allValue" => $allValue,
"data" => $data,
]);
}
public function listOleh()
{
$data['title'] = 'Sistem Informasi Tapanuli Utara';
$kulinerModel = new ArtikelModel();
$allValue = $kulinerModel->where('id_jenis_artikel', 3)->findAll();
return view('list', [
"allValue" => $allValue,
"data" => $data,
]);
}
......
......@@ -10,8 +10,8 @@ class AuthController extends BaseController
public function login()
{
$data = [];
$tittle['title'] = 'Login';
$data['title'] = 'Login';
if ($this->request->getMethod() == 'post') {
......@@ -27,11 +27,11 @@ class AuthController extends BaseController
];
if (!$this->validate($rules, $errors)) {
return view(
'landing_page',
$tittle,
["validation" => $this->validator],
);
return view('landing_page', [
"validation" => $this->validator,
"data" => $data,
]);
} else {
$model = new UserModel();
......@@ -48,7 +48,9 @@ class AuthController extends BaseController
}
}
}
return view('auth/login', $tittle);
return view('auth/login', [
"data" => $data,
]);
}
private function setUserSession($user)
......@@ -76,14 +78,15 @@ class AuthController extends BaseController
$session->remove('isLoggedIn');
$session->destroy();
return view('landing_page', $data);
return view('landing_page', [
"data" => $data,
]);
}
public function register()
{
$data = [];
$tittle['title'] = 'Register';
$data['title'] = 'Register';
if ($this->request->getMethod() == 'post') {
//let's do the validation here
......@@ -116,7 +119,9 @@ class AuthController extends BaseController
return redirect()->to(base_url('login'));
}
}
return view('auth/register', $tittle);
return view('auth/register', [
"data" => $data,
]);
}
public function profile()
......
......@@ -9,7 +9,9 @@ class Home extends BaseController
public function index()
{
$data['title'] = 'Sistem Informasi Tapanuli Utara';
return view('landing_page', $data);
return view('landing_page', [
"data" => $data,
]);
}
public function search()
......
......@@ -3,6 +3,7 @@
namespace App\Controllers;
use App\Controllers\BaseController;
use App\Models\BookmarkModel;
class UserController extends BaseController
{
......@@ -17,4 +18,18 @@ class UserController extends BaseController
{
return view('Home/index');
}
public function listBookmark($)
{
$data['title'] = 'Sistem Informasi Tapanuli Utara';
$model = new BookmarkModel();
$allValue = $model->where('id_user', $key)->findAll();
return view('list', [
"allValue" => $allValue,
"data" => $data,
]);
}
}
......@@ -41,4 +41,11 @@ class BookmarkModel extends Model
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
public function getBookmark()
{
return $this->db->table('bookmark')
->join('artikel', 'artikel.id_artikel = bookmark.id_artikel')
->get()->getResultArray();
}
}
......@@ -5,7 +5,7 @@
<meta content="" name="description">
<meta content="" name="keywords">
<title><?= $title; ?></title>
<title><?= $data['title'] ?></title>
<!-- Favicons -->
<link href=" <?php echo base_url('img/favicon.png'); ?> " rel="icon">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
......@@ -15,28 +15,17 @@
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,500,500i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">
<!-- Vendor CSS Files -->
<link href="<?php echo base_url('vendor/bootstrap/css/bootstrap.min.css'); ?> " rel="stylesheet">
<link href="<?php echo base_url('vendor/bootstrap-icons/bootstrap-icons.css'); ?> " rel="stylesheet">
<link href="<?php echo base_url('vendor/boxicons/css/boxicons.min.css'); ?> " rel="stylesheet">
<link href="<?php echo base_url('vendor/glightbox/css/glightbox.min.css'); ?> " rel="stylesheet">
<link href="<?php echo base_url('vendor/remixicon/remixicon.css'); ?> " rel="stylesheet">
<link href="<?php echo base_url('vendor/swiper/swiper-bundle.min.css'); ?> " rel="stylesheet">
<link href="<?php echo base_url('assets/vendor/bootstrap/css/bootstrap.min.css'); ?> " rel="stylesheet">
<link href="<?php echo base_url('assets/vendor/bootstrap-icons/bootstrap-icons.css'); ?> " rel="stylesheet">
<link href="<?php echo base_url('assets/vendor/boxicons/css/boxicons.min.css'); ?> " rel="stylesheet">
<link href="<?php echo base_url('assets/vendor/glightbox/css/glightbox.min.css'); ?> " rel="stylesheet">
<link href="<?php echo base_url('assets/vendor/remixicon/remixicon.css'); ?> " rel="stylesheet">
<link href="<?php echo base_url('assets/vendor/swiper/swiper-bundle.min.css'); ?> " rel="stylesheet">
<!-- Template Main CSS File -->
<link href="<?php echo base_url('css/style.css'); ?> " rel="stylesheet">
<!-- Vendor JS Files -->
<script src="<?php echo base_url('vendor/bootstrap/js/bootstrap.bundle.min.js'); ?> "></script>
<script src="<?php echo base_url('vendor/glightbox/js/glightbox.min.js'); ?> "></script>
<script src="<?php echo base_url('vendor/isotope-layout/isotope.pkgd.min.js'); ?> "></script>
<script src="<?php echo base_url('vendor/php-email-form/validate.js'); ?> "></script>
<script src="<?php echo base_url('vendor/purecounter/purecounter.js'); ?> "></script>
<script src="<?php echo base_url('vendor/swiper/swiper-bundle.min.js'); ?> "></script>
<script src="<?php echo base_url('vendor/typed.js/typed.min.js'); ?> "></script>
<script src="<?php echo base_url('vendor/aos/aos.js'); ?> "></script>
<!-- Template Main JS File -->
<script type="text/javascript" src="<?php echo base_url('js/main.js'); ?> "></script>
</head>
......@@ -49,16 +38,21 @@
<div class="row justify-content-center">
<div class="col-xl-9 d-flex align-items-center justify-content-lg-between">
<h1 class="logo me-auto me-lg-0"><a href="<?= base_url('home/home'); ?>">Pariwisata Tapanuli Utara</a></h1>
<h1 class="logo me-auto me-lg-0"><a href="<?= base_url('/'); ?>">Pariwisata Tapanuli Utara</a></h1>
<!-- Uncomment below if you prefer to use an image logo -->
<!-- <a href="index.html" class="logo me-auto me-lg-0"><img src="assets/img/logo.png" alt="" class="img-fluid"></a>-->
<nav id="navbar" class="navbar order-last order-lg-0">
<ul>
<li><a class="scrollto" href="hotel1.html">Hotel</a></li>
<li><a class="scrollto " href="#portfolio">Tour & Travel</a></li>
<li><a class="scrollto" href="<?php echo base_url('Home/kuliner'); ?>">Kuliner</a></li>
<li><a class="scrollto" href="#pricing">Oleh-oleh</a></li>
<li><a class="scrollto " href="<?php echo base_url('list-pariwisata'); ?>">Pariwisata</a></li>
<li><a class="scrollto" href="<?php echo base_url('list-kuliner'); ?>">Kuliner</a></li>
<li><a class="scrollto" href="<?php echo base_url('list-travel'); ?>">Travel</a></li>
<li><a class="scrollto" href="<?php echo base_url('list-oleh-oleh'); ?>">Oleh Oleh</a></li>
<li><?php if (session()->get('role_id') == 2) : ?>
<a href="<?= base_url('AuthController/logout') ?>" class="get-started-btn">Bookmark</a>
<?php endif ?>
</li>
</ul>
</nav><!-- .navbar -->
<?php if (session()->get('isLoggedIn') != null) : ?>
......@@ -106,4 +100,20 @@
</div>
</div>
</footer><!-- End Footer -->
<!-- Vendor JS Files -->
<script src="<?php echo base_url('assets/vendor/bootstrap/js/bootstrap.bundle.min.js'); ?> "></script>
<script src="<?php echo base_url('assets/vendor/glightbox/js/glightbox.min.js'); ?> "></script>
<script src="<?php echo base_url('assets/vendor/isotope-layout/isotope.pkgd.min.js'); ?> "></script>
<script src="<?php echo base_url('assets/vendor/php-email-form/validate.js'); ?> "></script>
<script src="<?php echo base_url('assets/vendor/purecounter/purecounter.js'); ?> "></script>
<script src="<?php echo base_url('assets/vendor/swiper/swiper-bundle.min.js'); ?> "></script>
<script src="<?php echo base_url('assets/vendor/typed.js/typed.min.js'); ?> "></script>
<script src="<?php echo base_url('assets/vendor/aos/aos.js'); ?> "></script>
<script src="<?php echo base_url('dir/vendor/aos/aos.js'); ?> "></script>
<!-- Template Main JS File -->
<script type="text/javascript" src="<?php echo base_url('js/main.js'); ?> "></script>
</body>
\ No newline at end of file
......@@ -9,7 +9,7 @@
<meta name="description" content="">
<meta name="author" content="">
<title><?= $title; ?>
<title><?= $data['title']; ?>
</title>
<!-- Custom fonts for this template-->
......
<?= $this->extend('layout/template'); ?>
<?= $this->section('content'); ?>
<?php foreach ($allValue as $value) : ?>
<?php
$isi_artikel = $value['isi_artikel'];
$isi_artikel = character_limiter($isi_artikel, 100);
?>
<div class="container">
<div class="row">
<div class="col">
<div class="card">
<img id="gambar" class="card-img-top" src="<?= "upload/" . $value['gambar']; ?>" alt="image" />
<div class=" card-body">
<h5 class="card-title"><?= $value['judul_artikel']; ?></h5>
<p class="card-text"><?= $isi_artikel; ?></p>
<a href="<?= base_url('artikel/' . $value['id_artikel']); ?>" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
<?= $this->endSection(); ?>
\ No newline at end of file
<?php
$data['name'] = $_POST['firstName'] . " " . $_POST['lastName'];
$data['email'] = $_POST['email'];
$data['message'] = $_POST['message'];
echo json_encode($data);
exit;
......@@ -1728,3 +1728,17 @@ section {
width: 0px;
font-weight: bold;
}
.container {
margin: 15px 0px 15px 0px;
display: block;
margin-left: auto;
margin-right: auto;
}
#gambar {
width: 400px;
display: block;
margin-left: auto;
margin-right: auto;
}
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