Commit 2fc3037a by KyrieCettyara

memperbaiki admin

parent d915607a
......@@ -192,17 +192,19 @@ class ArtikelController extends BaseController
$data = $model->findAll();
$modelId = $modelArtikel->where("id_artikel", $id)->first();
$imageName = $modelId['gambar'];
if ($this->request->getMethod() == "post") {
$file = $this->request->getFile('gambar');
if ($file->isValid() && !$file->hasMoved()) {
$imageName = $file->getRandomName();
$file->move('upload/', $imageName);
if ($file != null) {
if ($file->isValid() && !$file->hasMoved()) {
$imageName = $file->getRandomName();
$file->move('upload/', $imageName);
}
}
$newData = [
'id_jenis_artikel' => $this->request->getVar('id_jenis_artikel'),
'gambar' => $imageName,
......
......@@ -26,7 +26,7 @@
<div class="form-group row">
<label for="gambar" class="col-sm-2 col-form-label">Gambar</label>
<div class="col-sm-10">
<input type="file" class="form-control" style="height: fit-content;" name="gambar" id="gambar">
<input type="file" class="form-control" style="height: fit-content;" name="gambar">
</div>
</div>
<div class="form-group row">
......
<?= $this->extend('admin/side_menu'); ?>
<?= $this->section('content'); ?>
<a href=" <?= base_url('edit-artikel/' . $value['id_artikel']); ?>" class="btn btn-primary">Edit</a>
<a href="<?= base_url('delete-artikel/' . $value['id_artikel']); ?>" class="btn btn-primary">Delete</a>
<div class="container">
<div class="buttn">
<a href=" <?= base_url('edit-artikel/' . $value['id_artikel']); ?>" class="btn" id="btn">Edit</a>
<a href="<?= base_url('delete-artikel/' . $value['id_artikel']); ?>" class="btn" id="btn">Delete</a>
</div>
</div>
<div class="container">
<div class="row">
<div class="col">
<div class="card">
<div class="detail">
<?php $image = $value['gambar']; ?>
<img id="gambar" src="<?php echo base_url("upload/$image"); ?> " />
<div class=" card-body">
<h5 class="card-title"><?= $value['judul_artikel']; ?></h5>
<p class="card-text"><?= $value['isi_artikel']; ?></p>
</div>
<h3 class="title"><?= $value['judul_artikel']; ?></h3>
<p><?= $value['isi_artikel']; ?></p>
</div>
</div>
</div>
......
......@@ -6,6 +6,8 @@
<div class="row">
<div class="col">
<div class="panel-body">
<h1>Edit Artikel</h1>
<hr>
<form class="" enctype="multipart/form-data" action="<?= base_url('ArtikelController/editArtikel/' . $modelId['id_artikel']); ?>" method="post">
<div class="form-group">
......@@ -22,7 +24,7 @@
</div>
<div class="form-group">
<label for="gambar">Gambar</label>
<input type="file" class="form-control" name="gambar" id="gambar" value="<?= $modelId['gambar'] ?>">
<input type="file" class="form-control" name="gambar" value="<?= base_url("upload/" . $modelId['gambar']) ?>">
</div>
<div class="form-group">
<label for="judul_artikel">Id Artikel</label>
......
......@@ -2,8 +2,14 @@
<?= $this->section('content'); ?>
<a href=" <?= base_url('add-artikel'); ?>" class="btn btn-primary">Tambah Artikel</a>
<div class="container">
<div class="butn">
<a href=" <?= base_url('add-artikel'); ?>" class="btn" id="btn">Tambah Artikel</a>
</div>
</div>
<?php foreach ($data as $value) : ?>
<?php
$isi_artikel = $value['isi_artikel'];
......@@ -18,7 +24,7 @@
<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">Baca Artikel...</a>
<a href="<?= base_url('artikel/' . $value['id_artikel']); ?>" class="btn">Baca Artikel...</a>
</div>
</div>
</div>
......
......@@ -10,6 +10,9 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<link href="<?php echo base_url('css/admin.css'); ?> " rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap" rel="stylesheet">
</head>
......@@ -21,17 +24,14 @@
</div>
<div class="menu">
<ul>
<li><a href="<?= base_url('admin') ?>"><i class="fa fa-server" aria-hidden="true"></i><span class="text"> Kelola Artikel </span></a></li>
<li><a href="#"><i class="fa fa-user-plus" aria-hidden="true"></i><span class="text"> Kelola Akun Admin </span></a></li>
<li><a href="<?= base_url('admin') ?>"><i class="fa fa-server" aria-hidden="true"></i><span class="text"> Artikel </span></a></li>
<li><a href="<?= base_url('AuthController/logout') ?>"><i class="fa fa-sign-out" aria-hidden="true"></i><span class="text"> Keluar</span></a></li>
</ul>
</div>
</div>
<div class="main-content">
<div class="topmenu">
<div class="search"><i class="fa fa-search" aria-hidden="true"></i> <input type='text' class='src' placeholder='Search for cards...' /></div>
</div>
<div class="main-section">
<?= $this->renderSection('content'); ?>
......
......@@ -8,7 +8,7 @@
<div class="detail">
<?php $image = $value['gambar']; ?>
<img id="gambar" src="<?php echo base_url("upload/$image"); ?> " />
<img id="gambars" src="<?php echo base_url("upload/$image"); ?> " />
<?php if (session()->get('isLoggedIn')) : ?>
<?php if (session()->get('isExist')) : ?>
......
......@@ -88,6 +88,7 @@
</header><!-- End Header -->
<?= $this->renderSection('content'); ?>
<!--=======Footer=======-->
<footer id="footer">
<div class="container">
......
......@@ -40,7 +40,7 @@ body {
}
a {
text-decoration: none;
color: #e1e2fa;
color: #fff;
}
.menu ul {
list-style-type: none;
......@@ -68,7 +68,6 @@ a {
}
.main-section {
background: #f6f9fc;
height: 100%;
margin-bottom: -5000px; /* any large number will do */
padding-bottom: 5000px;
......@@ -135,41 +134,86 @@ input.src {
}
#gambar {
width: 50%;
width: 100%;
height: 300px;
object-fit: cover;
object-position: center;
}
.detail > #gambar {
width: 70%;
display: block;
margin-left: auto;
margin-right: auto;
}
.card {
width: 100%;
}
.card > .card-body {
text-align: justify;
text-justify: inter-word;
font-family: "Poppins", sans-serif;
}
.card > .card-body > .card-title {
font-family: "Poppins", sans-serif;
}
.card > .card-body > .btn {
float: right;
border-radius: 25px;
background-color: #009961;
background-color: #32325d;
}
.row > .coll {
.row > .col {
display: flex;
justify-content: center;
}
.row > .coll > .detail {
.row > .col > .detail {
text-align: justify;
text-justify: inter-word;
font-family: "Poppins", sans-serif;
width: 75%;
}
.row > .coll > .detail > .title {
.row > .col > .detail > .title {
padding-top: 15px;
font-family: "Poppins", sans-serif;
}
.row > .coll > .btn {
/* .row > .coll > .detail > a {
padding-top: 10px;
float: right;
border-radius: 25px;
background-color: #009961;
} */
h4,
h3 {
font-weight: bold;
}
.container > .buttn > #btn {
border-radius: 20px;
width: 100px;
margin: 0px 5px 15px;
background-color: #32325d;
font-family: "Poppins", sans-serif;
}
.container > .butn > #btn {
border-radius: 20px;
margin: 0px 5px 15px;
background-color: #32325d;
font-family: "Poppins", sans-serif;
}
/* .row {
float: right;
} */
.container > .buttn {
display: flex;
}
.panel-body {
width: 100%;
}
......@@ -1681,7 +1681,14 @@ section {
}
#gambar {
width: 50%;
width: 100%;
height: 400px;
object-fit: cover;
object-position: center;
}
.row > .coll > .detail > #gambars {
width: 60%;
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