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
22a77470
Commit
22a77470
authored
Jul 22, 2021
by
KyrieCettyara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perbaiki view user
parent
c55db80c
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
162 additions
and
44 deletions
+162
-44
Routes.php
app/Config/Routes.php
+3
-0
ArtikelController.php
app/Controllers/ArtikelController.php
+42
-0
AuthController.php
app/Controllers/AuthController.php
+17
-12
Home.php
app/Controllers/Home.php
+3
-1
UserController.php
app/Controllers/UserController.php
+15
-0
BookmarkModel.php
app/Models/BookmarkModel.php
+7
-0
template.php
app/Views/layout/template.php
+33
-22
template_login.php
app/Views/layout/template_login.php
+1
-1
list.php
app/Views/list.php
+27
-0
sub.php
app/Views/sub.php
+0
-8
style.css
public/css/style.css
+14
-0
1626935315_4403a6ca18312f752d0a.jpg
public/upload/1626935315_4403a6ca18312f752d0a.jpg
+0
-0
No files found.
app/Config/Routes.php
View file @
22a77470
...
@@ -48,6 +48,9 @@ $routes->group("user", ["filter" => "auth"], function ($routes) {
...
@@ -48,6 +48,9 @@ $routes->group("user", ["filter" => "auth"], function ($routes) {
$routes
->
get
(
'logout'
,
' UserController::logout'
);
$routes
->
get
(
'logout'
,
' UserController::logout'
);
$routes
->
get
(
'list-kuliner'
,
"ArtikelController::listKuliner"
);
$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
->
get
(
"artikel/(:num)"
,
"ArtikelController::artikelById/$1"
);
$routes
->
match
([
"get"
,
"post"
],
"add-artikel"
,
"ArtikelController::addArtikel"
);
$routes
->
match
([
"get"
,
"post"
],
"add-artikel"
,
"ArtikelController::addArtikel"
);
$routes
->
match
([
"get"
,
"post"
],
"edit-artikel/(:num)"
,
"ArtikelController::editArtikel/$1"
);
$routes
->
match
([
"get"
,
"post"
],
"edit-artikel/(:num)"
,
"ArtikelController::editArtikel/$1"
);
...
...
app/Controllers/ArtikelController.php
View file @
22a77470
...
@@ -17,11 +17,53 @@ class ArtikelController extends BaseController
...
@@ -17,11 +17,53 @@ class ArtikelController extends BaseController
public
function
listKuliner
()
public
function
listKuliner
()
{
{
$data
[
'title'
]
=
'Sistem Informasi Tapanuli Utara'
;
$kulinerModel
=
new
ArtikelModel
();
$kulinerModel
=
new
ArtikelModel
();
$allValue
=
$kulinerModel
->
where
(
'id_jenis_artikel'
,
1
)
->
findAll
();
$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'
,
[
return
view
(
'list'
,
[
"allValue"
=>
$allValue
,
"allValue"
=>
$allValue
,
"data"
=>
$data
,
]);
]);
}
}
...
...
app/Controllers/AuthController.php
View file @
22a77470
...
@@ -10,8 +10,8 @@ class AuthController extends BaseController
...
@@ -10,8 +10,8 @@ class AuthController extends BaseController
public
function
login
()
public
function
login
()
{
{
$data
=
[];
$
tittle
[
'title'
]
=
'Login'
;
$
data
[
'title'
]
=
'Login'
;
if
(
$this
->
request
->
getMethod
()
==
'post'
)
{
if
(
$this
->
request
->
getMethod
()
==
'post'
)
{
...
@@ -27,11 +27,11 @@ class AuthController extends BaseController
...
@@ -27,11 +27,11 @@ class AuthController extends BaseController
];
];
if
(
!
$this
->
validate
(
$rules
,
$errors
))
{
if
(
!
$this
->
validate
(
$rules
,
$errors
))
{
return
view
(
return
view
(
'landing_page'
,
[
'landing_page'
,
"validation"
=>
$this
->
validator
,
$tittle
,
"data"
=>
$data
,
[
"validation"
=>
$this
->
validator
],
);
]
);
}
else
{
}
else
{
$model
=
new
UserModel
();
$model
=
new
UserModel
();
...
@@ -48,7 +48,9 @@ class AuthController extends BaseController
...
@@ -48,7 +48,9 @@ class AuthController extends BaseController
}
}
}
}
}
}
return
view
(
'auth/login'
,
$tittle
);
return
view
(
'auth/login'
,
[
"data"
=>
$data
,
]);
}
}
private
function
setUserSession
(
$user
)
private
function
setUserSession
(
$user
)
...
@@ -76,14 +78,15 @@ class AuthController extends BaseController
...
@@ -76,14 +78,15 @@ class AuthController extends BaseController
$session
->
remove
(
'isLoggedIn'
);
$session
->
remove
(
'isLoggedIn'
);
$session
->
destroy
();
$session
->
destroy
();
return
view
(
'landing_page'
,
$data
);
return
view
(
'landing_page'
,
[
"data"
=>
$data
,
]);
}
}
public
function
register
()
public
function
register
()
{
{
$data
=
[];
$data
[
'title'
]
=
'Register'
;
$tittle
[
'title'
]
=
'Register'
;
if
(
$this
->
request
->
getMethod
()
==
'post'
)
{
if
(
$this
->
request
->
getMethod
()
==
'post'
)
{
//let's do the validation here
//let's do the validation here
...
@@ -116,7 +119,9 @@ class AuthController extends BaseController
...
@@ -116,7 +119,9 @@ class AuthController extends BaseController
return
redirect
()
->
to
(
base_url
(
'login'
));
return
redirect
()
->
to
(
base_url
(
'login'
));
}
}
}
}
return
view
(
'auth/register'
,
$tittle
);
return
view
(
'auth/register'
,
[
"data"
=>
$data
,
]);
}
}
public
function
profile
()
public
function
profile
()
...
...
app/Controllers/Home.php
View file @
22a77470
...
@@ -9,7 +9,9 @@ class Home extends BaseController
...
@@ -9,7 +9,9 @@ class Home extends BaseController
public
function
index
()
public
function
index
()
{
{
$data
[
'title'
]
=
'Sistem Informasi Tapanuli Utara'
;
$data
[
'title'
]
=
'Sistem Informasi Tapanuli Utara'
;
return
view
(
'landing_page'
,
$data
);
return
view
(
'landing_page'
,
[
"data"
=>
$data
,
]);
}
}
public
function
search
()
public
function
search
()
...
...
app/Controllers/UserController.php
View file @
22a77470
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
namespace
App\Controllers
;
namespace
App\Controllers
;
use
App\Controllers\BaseController
;
use
App\Controllers\BaseController
;
use
App\Models\BookmarkModel
;
class
UserController
extends
BaseController
class
UserController
extends
BaseController
{
{
...
@@ -17,4 +18,18 @@ class UserController extends BaseController
...
@@ -17,4 +18,18 @@ class UserController extends BaseController
{
{
return
view
(
'Home/index'
);
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
,
]);
}
}
}
app/Models/BookmarkModel.php
View file @
22a77470
...
@@ -41,4 +41,11 @@ class BookmarkModel extends Model
...
@@ -41,4 +41,11 @@ class BookmarkModel extends Model
protected
$afterFind
=
[];
protected
$afterFind
=
[];
protected
$beforeDelete
=
[];
protected
$beforeDelete
=
[];
protected
$afterDelete
=
[];
protected
$afterDelete
=
[];
public
function
getBookmark
()
{
return
$this
->
db
->
table
(
'bookmark'
)
->
join
(
'artikel'
,
'artikel.id_artikel = bookmark.id_artikel'
)
->
get
()
->
getResultArray
();
}
}
}
app/Views/layout/template.php
View file @
22a77470
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<meta
content=
""
name=
"description"
>
<meta
content=
""
name=
"description"
>
<meta
content=
""
name=
"keywords"
>
<meta
content=
""
name=
"keywords"
>
<title>
<?=
$
title
;
?>
</title>
<title>
<?=
$
data
[
'title'
]
?>
</title>
<!-- Favicons -->
<!-- Favicons -->
<link
href=
"
<?php
echo
base_url
(
'img/favicon.png'
);
?>
"
rel=
"icon"
>
<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"
>
<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 @@
...
@@ -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"
>
<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 -->
<!-- Vendor CSS Files -->
<link
href=
"
<?php
echo
base_url
(
'vendor/bootstrap/css/bootstrap.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
(
'vendor/bootstrap-icons/bootstrap-icons.css'
);
?>
"
rel=
"stylesheet"
>
<link
href=
"
<?php
echo
base_url
(
'
assets/
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
(
'
assets/
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
(
'
assets/
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
(
'
assets/
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/swiper/swiper-bundle.min.css'
);
?>
"
rel=
"stylesheet"
>
<!-- Template Main CSS File -->
<!-- Template Main CSS File -->
<link
href=
"
<?php
echo
base_url
(
'css/style.css'
);
?>
"
rel=
"stylesheet"
>
<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>
</head>
...
@@ -49,16 +38,21 @@
...
@@ -49,16 +38,21 @@
<div
class=
"row justify-content-center"
>
<div
class=
"row justify-content-center"
>
<div
class=
"col-xl-9 d-flex align-items-center justify-content-lg-between"
>
<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 -->
<!-- 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>-->
<!-- <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"
>
<nav
id=
"navbar"
class=
"navbar order-last order-lg-0"
>
<ul>
<ul>
<li><a
class=
"scrollto"
href=
"hotel1.html"
>
Hotel
</a></li>
<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
(
'list-pariwisata'
);
?>
"
>
Pariwisata
</a></li>
<li><a
class=
"scrollto"
href=
"
<?php
echo
base_url
(
'Home/kuliner'
);
?>
"
>
Kuliner
</a></li>
<li><a
class=
"scrollto"
href=
"
<?php
echo
base_url
(
'list-kuliner'
);
?>
"
>
Kuliner
</a></li>
<li><a
class=
"scrollto"
href=
"#pricing"
>
Oleh-oleh
</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>
</ul>
</nav>
<!-- .navbar -->
</nav>
<!-- .navbar -->
<?php
if
(
session
()
->
get
(
'isLoggedIn'
)
!=
null
)
:
?>
<?php
if
(
session
()
->
get
(
'isLoggedIn'
)
!=
null
)
:
?>
...
@@ -106,4 +100,20 @@
...
@@ -106,4 +100,20 @@
</div>
</div>
</div>
</div>
</footer>
<!-- End Footer -->
</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>
</body>
\ No newline at end of file
app/Views/layout/template_login.php
View file @
22a77470
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<meta
name=
"description"
content=
""
>
<meta
name=
"description"
content=
""
>
<meta
name=
"author"
content=
""
>
<meta
name=
"author"
content=
""
>
<title>
<?=
$
title
;
?>
<title>
<?=
$
data
[
'title'
]
;
?>
</title>
</title>
<!-- Custom fonts for this template-->
<!-- Custom fonts for this template-->
...
...
app/Views/list.php
0 → 100644
View file @
22a77470
<?=
$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
app/Views/sub.php
deleted
100644 → 0
View file @
c55db80c
<?php
$data
[
'name'
]
=
$_POST
[
'firstName'
]
.
" "
.
$_POST
[
'lastName'
];
$data
[
'email'
]
=
$_POST
[
'email'
];
$data
[
'message'
]
=
$_POST
[
'message'
];
echo
json_encode
(
$data
);
exit
;
public/css/style.css
View file @
22a77470
...
@@ -1728,3 +1728,17 @@ section {
...
@@ -1728,3 +1728,17 @@ section {
width
:
0px
;
width
:
0px
;
font-weight
:
bold
;
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
;
}
public/upload/1626935315_4403a6ca18312f752d0a.jpg
0 → 100644
View file @
22a77470
77.1 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