Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
TB_Center
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Andry F. Hutapea
TB_Center
Commits
8eb9097e
Commit
8eb9097e
authored
May 25, 2017
by
josua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
in progress
parent
4e99ec95
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
191 additions
and
0 deletions
+191
-0
login.html
login.html
+90
-0
login_process.php
login_process.php
+34
-0
update.php
update.php
+46
-0
update_process.php
update_process.php
+21
-0
No files found.
login.html
0 → 100644
View file @
8eb9097e
<?php
session_start();
include_once('config/koneksi.php');
if(isset($_SESSION['is_logged_in'])){
redirect('index.php');
}
open_page('login');
?>
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<meta
name=
"description"
content=
""
>
<meta
name=
"author"
content=
""
>
<title>
SB Admin 2 - Bootstrap Admin Theme
</title>
<!-- Bootstrap Core CSS -->
<link
href=
"../vendor/bootstrap/css/bootstrap.min.css"
rel=
"stylesheet"
>
<!-- MetisMenu CSS -->
<link
href=
"../vendor/metisMenu/metisMenu.min.css"
rel=
"stylesheet"
>
<!-- Custom CSS -->
<link
href=
"../dist/css/sb-admin-2.css"
rel=
"stylesheet"
>
<!-- Custom Fonts -->
<link
href=
"../vendor/font-awesome/css/font-awesome.min.css"
rel=
"stylesheet"
type=
"text/css"
>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"col-md-4 col-md-offset-4"
>
<div
class=
"login-panel panel panel-default"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
Please Sign In
</h3>
</div>
<div
class=
"panel-body"
>
<form
action=
"login_process.php"
>
<fieldset>
<div
class=
"form-group"
>
<input
class=
"form-control"
placeholder=
"E-mail"
name=
"email"
type=
"email"
autofocus
>
</div>
<div
class=
"form-group"
>
<input
class=
"form-control"
placeholder=
"Password"
name=
"password"
type=
"password"
value=
""
>
</div>
<div
class=
"checkbox"
>
<label>
<input
name=
"remember"
type=
"checkbox"
value=
"Remember Me"
>
Remember Me
</label>
</div>
<!-- Change this to a button or input when using this as a form -->
<button
type=
"submit"
name=
"action"
value=
"login"
>
Sign In
</button>
</fieldset>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- jQuery -->
<script
src=
"../vendor/jquery/jquery.min.js"
></script>
<!-- Bootstrap Core JavaScript -->
<script
src=
"../vendor/bootstrap/js/bootstrap.min.js"
></script>
<!-- Metis Menu Plugin JavaScript -->
<script
src=
"../vendor/metisMenu/metisMenu.min.js"
></script>
<!-- Custom Theme JavaScript -->
<script
src=
"../dist/js/sb-admin-2.js"
></script>
</body>
</html>
login_process.php
0 → 100644
View file @
8eb9097e
<?php
session_start
();
$data_username
=
$_POST
[
'username'
];
$data_password
=
$_POST
[
'password'
];
$host
=
"localhost"
;
$user
=
"root"
;
$password
=
""
;
$db_name
=
"tb silalahi"
;
$connection
=
mysqli_connect
(
$nama
,
$username
,
$password
,
$db_name
);
$query
=
"select * form tb silalahi where username ='
$user
' and password = '
$password
'"
;
$exce
=
mysqli_query
(
$connection
,
$db_name
);
$user_konfirmasi
=
""
;
$password_konfirmasi
=
""
;
if
(
$data_username
==
$user_konfirmasi
&&
$data_password
==
$password_konfirmasi
){
echo
"Berhasil Login"
;
}
else
{
echo
"gagal login"
;
}
$_SESSION
[
"username"
]
=
$data_username
;
$_SESSION
[
"password"
]
=
$data_password
;
//
$new_location
=
"index.php"
;
header
(
'Location: '
.
$new_location
);
?>
\ No newline at end of file
update.php
0 → 100644
View file @
8eb9097e
<?php
session_start
();
include_once
(
'config/koneksi.php'
);
open_page
(
'update'
);
$database
=
new
mysqli
(
'localhost'
,
'root'
,
''
,
'tb silalahi'
);
$query
=
"SELECT * FROM koleksi "
;
$result_set
=
$database
->
query
(
$query
);
while
(
$query
=
$result_set
->
fetch_assoc
()){
?>
<form
action=
"update_process.php"
method=
"post"
>
<table
border=
"1"
>
<tr>
<td>
id
</td>
<td>
:
</td>
<td><input
type=
"text"
value=
"
<?php
echo
$query
[
'id'
]
?>
"
name=
"id"
></td>
</tr>
<tr>
<td>
Nama
</td>
<td>
:
</td>
<td><input
type=
"text"
value=
"
<?php
echo
$query
[
'nama'
]
?>
"
name=
"nama"
></td>
</tr>
<tr>
<td>
Description
</td>
<td>
:
</td>
<td><input
type=
"text"
value=
"
<?php
echo
$query
[
'desc'
]
?>
"
name=
"description"
></td>
</tr>
<tr>
<td>
Image
</td>
<td>
:
</td>
<td><input
type=
"file"
name=
"image"
<?php
echo
$query
[
'image'
]
?>
"
name=
"title"
></td>
</tr>
<tr><td
colspan=
"3"
><input
type=
"submit"
name=
"action"
value=
"update"
></td></tr>
</table>
</form>
<?php
}
close_page
();
?>
\ No newline at end of file
update_process.php
0 → 100644
View file @
8eb9097e
<?php
session_start
();
include_once
(
'config/koneksi.php'
);
// retrieve posted form data
$id
=
$_POST
[
'id'
];
$nama
=
$_POST
[
'nama'
];
$desc
=
$_POST
[
'desc'
];
$image
=
$_POST
[
'image'
];
$database
=
new
mysqli
(
'localhost'
,
'root'
,
''
,
'tb silalahi'
);
$query
=
"UPDATE koleksi SET id = '
$id
', nama = '
$nama
', desc = '
$desc
', image = '
$image
' WHERE id = '
$id
'"
;
if
(
$database
->
query
(
$query
)
==
TRUE
){
redirect
(
'koleksi.php'
);
}
else
{
echo
"Error update book."
;
}
?>
\ No newline at end of file
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