Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PA1-1617-D3TI05
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
Fredrick Mangampu Theodorus Pardosi
PA1-1617-D3TI05
Commits
74a5442a
Commit
74a5442a
authored
7 years ago
by
Fredrick Mangampu Theodorus Pardosi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Register
parent
b0e89015
master
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
150 additions
and
0 deletions
+150
-0
register_process.php
register_process.php
+28
-0
signup.php
signup.php
+122
-0
No files found.
register_process.php
0 → 100644
View file @
74a5442a
<?php
session_start
();
include_once
'functions/fungsi.php'
;
include_once
'connection/koneksi.php'
;
if
(
!
isset
(
$_SESSION
[
"isLogin"
]))
redirect
(
'index.php'
);
if
(
!
(
$_SESSION
[
"role"
]
==
"inventory"
))
redirect
(
'index.php'
);
$firstName
=
$_POST
[
'first_name'
];
$lastName
=
$_POST
[
'last_name'
];
$email
=
$_POST
[
'email'
];
$username
=
$_POST
[
'username'
];
$password
=
$_POST
[
'password'
];
$role
=
"member"
;
$query
=
'INSERT INTO user( `first_name`, `last_name`, `email`,`username`,`password`,`role`) VALUES(?, ?, ?, ?, ?, ?)'
;
$statement
=
$database
->
prepare
(
$query
);
$statement
->
bind_param
(
'ssssss'
,
$firstName
,
$lastName
,
$email
,
$username
,
$password
,
$role
);
$statement
->
execute
();
redirect
(
'index.php'
);
?>
This diff is collapsed.
Click to expand it.
signup.php
0 → 100644
View file @
74a5442a
<?php
session_start
();
include_once
'functions/fungsi.php'
;
include_once
'connection/koneksi.php'
;
?>
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"UTF-8"
>
<title>
Cafe Bunga Toba
</title>
<link
rel=
"stylesheet"
href=
"css/normalize.css"
>
<link
rel=
"stylesheet"
href=
"css/main.css"
media=
"screen"
type=
"text/css"
>
<link
href=
'http://fonts.googleapis.com/css?family=Pacifico'
rel=
'stylesheet'
type=
'text/css'
>
<link
href=
'http://fonts.googleapis.com/css?family=Playball'
rel=
'stylesheet'
type=
'text/css'
>
<link
rel=
"stylesheet"
href=
"css/bootstrap.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"css/style-portfolio.css"
>
<link
rel=
"stylesheet"
href=
"css/picto-foundry-food.css"
/>
<link
rel=
"stylesheet"
href=
"css/jquery-ui.css"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<link
href=
"css/font-awesome.min.css"
rel=
"stylesheet"
>
<link
rel=
"icon"
href=
"favicon-1.ico"
type=
"image/x-icon"
>
</head>
<body>
<nav
class=
"navbar navbar-default navbar-fixed-top"
role=
"navigation"
>
<div
class=
"container"
>
<div
class=
"row"
>
<!-- Brand and toggle get grouped for better mobile display -->
<div
class=
"navbar-header"
>
<button
type=
"button"
class=
"navbar-toggle collapsed"
data-toggle=
"collapse"
data-target=
"#bs-example-navbar-collapse-1"
>
<span
class=
"sr-only"
>
Toggle navigation
</span>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
</button>
<a
class=
"navbar-brand"
href=
"index.php"
>
Cafe BUNGA TOBA
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div
class=
"collapse navbar-collapse"
id=
"bs-example-navbar-collapse-1"
>
<ul
class=
"nav navbar-nav main-nav clear navbar-right "
>
<li><a
class=
"navactive color_animation"
href=
"index.php"
>
WELCOME
</a></li>
<?php
if
(
isset
(
$_SESSION
[
'isLogin'
])
&&
(
get_session
(
'role'
)
==
"member"
))
{
echo
(
'<li><a class="color_animation" href="#pricing">MENU</a></li>'
);
echo
(
'<li><a class="color_animation" href="#pesanan">PESANAN</a></li>'
);
echo
(
'<li><a class="color_animation" href="#pembayaran">Pembayaran</a></li>'
);
echo
(
'<li><a class="color_animation" href="logout.php">LOGOUT ('
.
get_session
(
'first_name'
)
.
')</a></li>'
);
}
if
(
isset
(
$_SESSION
[
'isLogin'
])
&&
(
get_session
(
'role'
)
==
"karyawan"
||
get_session
(
'role'
)
==
"admin"
))
{
echo
(
'<li><a class="color_animation" href="#olahmenu">OLAH MENU</a></li>'
);
echo
(
'<li><a class="color_animation" href="#daftarpesanan">DAFTAR PESANAN</a></li>'
);
echo
(
'<li><a class="color_animation" href="logout.php">LOGOUT ('
.
get_session
(
'first_name'
)
.
')</a></li>'
);
}
if
(
!
isset
(
$_SESSION
[
'isLogin'
]))
{
echo
(
'<li><a class="color_animation active" href="login.php">LOGIN</a></li>'
);
echo
(
'<li><a class="color_animation" href="signup.php">SIGN UP</a></li>'
);
}
?>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
</div>
<!-- /.container-fluid -->
</nav>
<?php
if
(
!
isset
(
$_SESSION
[
'isLogin'
]))
{
?>
<!-- ============ Signup ============= -->
<section
id=
"signup"
class=
"description_content"
>
<div
class=
"text-content container"
>
<div
class=
"inner contact"
>
<!-- Form Area -->
<div
class=
"contact-form"
>
<!-- Form -->
<form
id=
"contact-us"
method=
"post"
action=
"register_process.php"
>
<!-- Left Inputs -->
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"col-lg-8 col-md-6 col-xs-12"
>
<div
class=
"row"
>
<div
class=
"col-lg-8 col-md-6 col-xs-6"
>
<!-- Name -->
<input
type=
"text"
name=
"first_name"
id=
"first_name"
required=
"required"
class=
"form"
placeholder=
"First Name"
/>
<input
type=
"text"
name=
"last_name"
id=
"last_name"
required=
"required"
class=
"form"
placeholder=
"Last Name"
/>
<input
type=
"email"
name=
"email"
id=
"email"
required=
"required"
class=
"form"
placeholder=
"Email"
/>
<input
type=
"text"
name=
"username"
id=
"username"
required=
"required"
class=
"form"
placeholder=
"Username"
/>
<input
type=
"password"
name=
"password"
id=
"password"
required=
"required"
class=
"form"
placeholder=
"Password"
/>
</div>
<div
class=
"col-xs-6 "
>
<!-- Send Button -->
<button
type=
"submit"
id=
"submit"
name=
"submit"
class=
"text-center form-btn form-btn"
>
Register
</button>
</div>
</div>
</div>
</div>
</div>
<!-- Clear -->
<div
class=
"clear"
></div>
</form>
</div>
<!-- End Contact Form Area -->
</div>
<!-- End Inner -->
</div>
</section>
<?php
}
?>
This diff is collapsed.
Click to expand it.
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