Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Sistem-Informasi-Pariwisata-Tapanuli-Utara
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kyrie Cettyara
Sistem-Informasi-Pariwisata-Tapanuli-Utara
Commits
c55db80c
Commit
c55db80c
authored
Jul 22, 2021
by
KyrieCettyara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perbaikan fungsi admin
parent
f36e6cdb
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
45 additions
and
37 deletions
+45
-37
ArtikelController.php
app/Controllers/ArtikelController.php
+12
-2
add_artikel.php
app/Views/admin/add_artikel.php
+13
-30
detail.php
app/Views/admin/detail.php
+1
-1
edit_artikel.php
app/Views/admin/edit_artikel.php
+17
-4
list.php
app/Views/admin/list.php
+2
-0
1626923179_7c4dd9346f8c79248e03.jpg
public/upload/1626923179_7c4dd9346f8c79248e03.jpg
+0
-0
1626923204_5855993a5030a17acfe6.jpg
public/upload/1626923204_5855993a5030a17acfe6.jpg
+0
-0
1626923417_9d0e8754cd5a842a8e47.jpg
public/upload/1626923417_9d0e8754cd5a842a8e47.jpg
+0
-0
1626923482_6dd5ffe3d62b84920d1f.jpg
public/upload/1626923482_6dd5ffe3d62b84920d1f.jpg
+0
-0
1626923552_bbe99ff16fadaa4d58c9.jpg
public/upload/1626923552_bbe99ff16fadaa4d58c9.jpg
+0
-0
1626923940_42ec5fd08055b043e20f.jpg
public/upload/1626923940_42ec5fd08055b043e20f.jpg
+0
-0
1626924547_4bd1b3823a3ac4061bbf.jpg
public/upload/1626924547_4bd1b3823a3ac4061bbf.jpg
+0
-0
No files found.
app/Controllers/ArtikelController.php
View file @
c55db80c
...
...
@@ -89,6 +89,8 @@ class ArtikelController extends BaseController
$imageName
=
$file
->
getRandomName
();
$file
->
move
(
'upload/'
,
$imageName
);
}
$newData
=
[
'id_jenis_artikel'
=>
$this
->
request
->
getVar
(
'id_jenis_artikel'
),
'gambar'
=>
$imageName
,
...
...
@@ -121,9 +123,17 @@ class ArtikelController extends BaseController
if
(
$this
->
request
->
getMethod
()
==
"post"
)
{
$file
=
$this
->
request
->
getFile
(
'gambar'
);
if
(
$file
->
isValid
()
&&
!
$file
->
hasMoved
())
{
$imageName
=
$file
->
getRandomName
();
$file
->
move
(
'upload/'
,
$imageName
);
}
$newData
=
[
'id_jenis_artikel'
=>
$this
->
request
->
getVar
(
'id_jenis_artikel'
),
'gambar'
=>
$
this
->
request
->
getVar
(
'gambar'
)
,
'gambar'
=>
$
imageName
,
'judul_artikel'
=>
$this
->
request
->
getVar
(
'judul_artikel'
),
'isi_artikel'
=>
$this
->
request
->
getVar
(
'isi_artikel'
),
...
...
@@ -133,7 +143,7 @@ class ArtikelController extends BaseController
$session
=
session
();
$session
->
setFlashdata
(
"success"
,
"Data updated successfully"
);
return
redirect
()
->
to
(
base_url
(
'
kuliner/7
'
));
return
redirect
()
->
to
(
base_url
(
'
admin
'
));
}
...
...
app/Views/admin/add_artikel.php
View file @
c55db80c
<!DOCTYPE html>
<html
lang=
"en"
>
<?=
$this
->
extend
(
'admin/side_menu'
);
?>
<head>
<meta
charset=
"UTF-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<?=
$this
->
section
(
'content'
);
?>
<head>
<link
rel=
"stylesheet"
href=
"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity=
"sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin=
"anonymous"
>
<script
src=
"https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity=
"sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin=
"anonymous"
></script>
<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>
</head>
<body>
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"col"
>
<div
class=
"panel-body"
>
...
...
@@ -23,7 +10,8 @@
<form
class=
""
enctype=
"multipart/form-data"
action=
"
<?=
base_url
(
'ArtikelController/addArtikel'
);
?>
"
method=
"post"
>
<div
class=
"form-group"
>
<label
for=
"name"
>
Jenis Artikel
</label>
<select
class=
"form-control"
name=
"id_jenis_artikel"
id=
"id_jenis_artikel"
>
<select
name=
"id_jenis_artikel"
id=
"id_jenis_artikel"
class=
"form-control"
>
<?php
foreach
(
$data
as
$value
)
:
?>
<option
value=
"
<?=
$value
[
'id_jenis_artikel'
];
?>
"
>
...
...
@@ -33,19 +21,17 @@
</select>
</div>
<div
class=
"custom-file"
>
<input
type=
"file"
class=
"custom-file-input"
id=
"gambar"
>
<label
class=
"custom-file-label"
for=
"gambar"
>
Choose file...
</label>
<input
type=
"file"
class=
"custom-file-input"
name=
"gambar"
id=
"gambar"
>
<div
class=
"form-group"
>
<label
for=
"gambar"
>
Gambar
</label>
<input
type=
"file"
class=
"form-control"
name=
"gambar"
id=
"gambar"
>
</div>
<div
class=
"form-group"
>
<label
for=
"judul_artikel"
>
Judul Artikel
</label>
<input
class=
"form-control"
type=
"text"
class=
"form-control"
name=
"judul_artikel"
id=
"judul_artikel"
>
<input
type=
"text"
class=
"form-control"
name=
"judul_artikel"
id=
"judul_artikel"
>
</div>
<div
class=
"form-group"
>
<label
for=
"isi_artikel"
>
Isi
</label>
<textarea
class=
"form-control"
type=
"text"
class=
"form-control"
name=
"isi_artikel"
id=
"isi_artikel"
></textarea>
<textarea
type=
"text"
class=
"form-control"
name=
"isi_artikel"
id=
"isi_artikel"
></textarea>
</div>
<button
type=
"submit"
class=
"btn btn-success"
>
Submit
</button>
</form>
...
...
@@ -53,9 +39,6 @@
</div>
</div>
</div>
</body>
</div>
</html>
\ No newline at end of file
<?=
$this
->
endSection
();
?>
\ No newline at end of file
app/Views/admin/detail.php
View file @
c55db80c
...
...
@@ -11,7 +11,7 @@
<div
class=
"card"
>
<?php
$image
=
$value
[
'gambar'
];
?>
<img
id=
"gambar"
src=
"
<?php
echo
base_url
(
"upload/
$image
"
);
?>
"
alt=
"image"
/>
<img
id=
"gambar"
src=
"
<?php
echo
base_url
(
"upload/
$image
"
);
?>
"
/>
<div
class=
" card-body"
>
...
...
app/Views/admin/edit_artikel.php
View file @
c55db80c
<div
class=
"panel-body"
>
<?=
$this
->
extend
(
'admin/side_menu'
);
?>
<?=
$this
->
section
(
'content'
);
?>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"col"
>
<div
class=
"panel-body"
>
<hr>
<form
class=
"
"
action=
"
<?=
base_url
(
'ArtikelController/editArtikel/'
.
$modelId
[
'id_artikel'
]);
?>
"
method=
"post"
>
<form
class=
""
enctype=
"multipart/form-data
"
action=
"
<?=
base_url
(
'ArtikelController/editArtikel/'
.
$modelId
[
'id_artikel'
]);
?>
"
method=
"post"
>
<div
class=
"form-group"
>
<label
for=
"name"
>
Jenis Artikel
</label>
<select
name=
"id_jenis_artikel"
id=
"id_jenis_artikel"
value=
"
<?=
$modelId
[
'id_jenis_artikel'
]
?>
"
>
<select
class=
"form-control"
name=
"id_jenis_artikel"
id=
"id_jenis_artikel"
value=
"
<?=
$modelId
[
'id_jenis_artikel'
]
?>
"
>
<?php
foreach
(
$data
as
$value
)
:
?>
<option
value=
"
<?=
$value
[
'id_jenis_artikel'
];
?>
"
>
...
...
@@ -28,8 +35,13 @@
</div>
<div
class=
"form-group"
>
<label
for=
"isi_artikel"
>
Isi
</label>
<input
type=
"text"
class=
"form-control"
name=
"isi_artikel"
id=
"isi_artikel"
value=
"
<?=
$modelId
[
'isi_artikel'
]
?>
"
>
<textarea
class=
"form-control"
type=
"text"
class=
"form-control"
name=
"isi_artikel"
id=
"isi_artikel"
>
<?=
$modelId
[
'isi_artikel'
]
?>
</textarea
>
</div>
<button
type=
"submit"
class=
"btn btn-success"
>
Submit
</button>
</form>
</div>
</div>
</div>
</div>
<?=
$this
->
endSection
();
?>
\ No newline at end of file
app/Views/admin/list.php
View file @
c55db80c
...
...
@@ -2,6 +2,8 @@
<?=
$this
->
section
(
'content'
);
?>
<a
href=
"
<?=
base_url
(
'add-artikel'
);
?>
"
class=
"btn btn-primary"
>
Tambah Artikel
</a>
<?php
foreach
(
$data
as
$value
)
:
?>
<?php
$isi_artikel
=
$value
[
'isi_artikel'
];
...
...
public/upload/1626923179_7c4dd9346f8c79248e03.jpg
0 → 100644
View file @
c55db80c
23.6 KB
public/upload/1626923204_5855993a5030a17acfe6.jpg
0 → 100644
View file @
c55db80c
58.1 KB
public/upload/1626923417_9d0e8754cd5a842a8e47.jpg
0 → 100644
View file @
c55db80c
14.4 KB
public/upload/1626923482_6dd5ffe3d62b84920d1f.jpg
0 → 100644
View file @
c55db80c
167 KB
public/upload/1626923552_bbe99ff16fadaa4d58c9.jpg
0 → 100644
View file @
c55db80c
14.4 KB
public/upload/1626923940_42ec5fd08055b043e20f.jpg
0 → 100644
View file @
c55db80c
14.4 KB
public/upload/1626924547_4bd1b3823a3ac4061bbf.jpg
0 → 100644
View file @
c55db80c
14.4 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment