Notes
Notes - notes.io |
session_start();
include("DBConnection.class.php");
$DBConnection = new DBConnection();
function login(){
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if(isset($_POST["email"]) && isset($_POST["password"])){
if ($_POST["email"] === "" AND $_POST["password"] === "") {
echo '<script language="javascript">';
echo 'alert("Email dan Password tidak bisa kosong")';
echo '</script>';
header("refresh:3,url=account.php");
}
else if ($_POST["email"] === "") {
echo '<script language="javascript">';
echo 'alert("Email tidak bisa kosong")';
echo '</script>';
header("refresh:3,url=account.php");
}
else if ($_POST["password"] === "") {
echo '<script language="javascript">';
echo 'alert("Password tidak bisa kosong")';
echo '</script>';
header("refresh:3,url=account.php");
}
$email = $_POST["email"];
$password = $_POST["password"];
// $db_connection = connectDB();
$query = "SELECT email, password, nama FROM TOKOKEREN.PENGGUNA WHERE email = '$email' AND password = '$password'";
$result = pg_query($query);
// if (pg_num_rows($result)==1) {echo "<script type='text/javascript'>alert('hai');</script>";
// }
// if(!$result) {
// echo "<script type='text/javascript'>alert('hai');</script>";
// }
while($myrow = pg_fetch_assoc($result)) {
$_SESSION['current_user_email'] = $myrow['email'];
$_SESSION['current_user_name'] = $myrow['nama'];
$query = "SELECT PENGGUNA.email, PELANGGAN.is_penjual FROM TOKOKEREN.PENGGUNA INNER JOIN TOKOKEREN.PELANGGAN ON PENGGUNA.email=PELANGGAN.email WHERE PENGGUNA.email='$email'";
$result = pg_query($query);
$myrow = pg_fetch_assoc($result);
if(!$myrow){
$_SESSION['current_role']= 'admin';
$message = $_SESSION['current_role'];
echo "<script type='text/javascript'>alert('hai');</script>";
header("Location: adminpage.php");
}
else
{
if($myrow['is_penjual']==='t'){
$_SESSION['current_role'] = 'penjual';
}else{
$_SESSION['current_role'] = 'pembeli';
}
header("Location: indexPengguna.php");
}
//SELECT PG.email FROM PENGGUNA PG WHERE NOT EXISTS (SELECT PL.email FROM PELANGGAN PL WHERE PG.email='$email');
//SELECT PG.email, PL.is_penjual FROM PENGGUNA PG INNER JOIN PELANGGAN PL ON PG.email=PL.email WHERE PG.email='$email';
//SELECT PG.email, PL.is_penjual FROM PENGGUNA as PG, PELANGGAN as PL WHERE PG.email='[email protected]' AND PG.email NOT IN (SELECT email FROM PELANGGAN);
//select PG.email FROM PENGGUNA PG WHERE NOT EXISTS (select PL.email FROM PELANGGAN PL WHERE PG.email = '[email protected]');
}
// pg_close($db_connection);
}else{
//
// alert('Username atau password kosong');
header("refresh:3,url=account.php");
}
}
}
function logout(){
session_unset();
header("Location: ../account.php");
}
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// $db_connection = connectDB();
if($_POST['command'] === 'login') {
login();
}else if($_POST['command'] === 'logout'){
session_destroy();
header("Location: account.php");
}
}
?>
<!--
Author: W3layouts
Author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<!DOCTYPE html>
<html>
<head>
<title>Toko Keren - Tempatnya Barang Keren</title>
<link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery.min.js"></script>
<!-- Custom Theme files -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- Custom Theme files -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Eshop Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template,
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!--webfont-->
<!-- for bootstrap working -->
<script type="text/javascript" src="js/bootstrap-3.1.1.min.js"></script>
<!-- //for bootstrap working -->
<!-- cart -->
<script src="js/simpleCart.min.js"> </script>
<!-- cart -->
<link rel="stylesheet" href="css/flexslider.css" type="text/css" media="screen" />
</head>
<body>
<!-- header-section-starts -->
<div class="header">
<div class="header-top-strip">
<div class="container">
<div class="header-top-left">
<ul>
<li><a href="account.php"><span class="glyphicon glyphicon-user"> </span>Login</a></li>
<li><a href="register.php"><span class="glyphicon glyphicon-lock"> </span>Register</a></li>
</ul>
</div>
<div class="clearfix"> </div>
</div>
</div>
</div>
<!-- header-section-ends -->
<div class="banner-top">
<div class="container">
<nav class="navbar navbar-default" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" 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>
<div class="logo">
<h1><a href="index.php"><span>T</span> Keren</a></h1>
</div>
</div>
<!--/.navbar-header-->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="index.php">Home</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown">Beli Produk <b class="caret"></b></a>
<ul class="dropdown-menu multi-column columns-3">
<div class="row">
<div class="col-sm-4">
<ul class="multi-column-dropdown">
<!-- Trigger the modal-->
<li><a href="ProdukPulsa.php">Produk Pulsa</a></li>
<li><a href="ProdukLainnya.php">Produk Lainnya</a></li>
</ul>
</div>
<div class="clearfix"></div>
</div>
</ul>
</li>
<li><a href="contact.php">HUBUNGI KAMI</a></li>
</ul>
</div>
<!--/.navbar-collapse-->
</nav>
<!--/.navbar-->
</div>
</div>
<!-- content-section-starts -->
<div class="content">
<div class="container">
<div class="login-page">
<div class="dreamcrub">
<ul class="breadcrumbs">
<li class="home">
<a href="index.php" title="Go to Home Page">Home</a>
<span>></span>
</li>
<li class="women">
Login
</li>
</ul>
<ul class="previous">
<li><a href="index.php">Kembali ke halaman sebelumnya</a></li>
</ul>
<div class="clearfix"></div>
</div>
<div class="account_grid">
<div class="col-md-6 login-left wow fadeInLeft" data-wow-delay="0.4s">
<h2>Customer Baru?</h2>
<p>Dengan membuat akun di TOKO KEREN, akan memudahkan kegiatan transaksi anda dengan ribuan seller yang bergabung dengan TOKO KEREN. Temukan barang kerenmu dari sekarang!</p>
<a class="acount-btn" href="register.php">Membuat Akun Baru</a>
</div>
<div class="col-md-6 login-right wow fadeInRight" data-wow-delay="0.4s">
<h3>Sudah punya akun?</h3>
<p>Jika anda telah memiliki akun, silahkan login.</p>
<form method="POST" action="account.php">
<div>
<span>Email Address<label>*</label></span>
<input type="text" name="email">
</div>
<div>
<span>Password<label>*</label></span>
<input type="password" name="password">
</div>
<a class="forgot" href="#">Lupa Password?</a>
<input type="submit" value="login" name='command'>
</form>
</div>
<div class="clearfix"> </div>
</div>
</div>
</div>
<div class="news-letter">
<div class="container">
<div class="join">
<h6>JOIN OUR MAILING LIST</h6>
<div class="sub-left-right">
<form>
<input type="text" value="Enter Your Email Here" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Enter Your Email Here';}" />
<input type="submit" value="SUBSCRIBE" />
</form>
</div>
<div class="clearfix"> </div>
</div>
</div>
</div>
</div>
<div class="footer">
<div class="container">
<div class="footer_top">
<div class="span_of_4">
<div class="col-md-3 span1_of_4">
<h4>Shop</h4>
<ul class="f_nav">
<li><a href="#">new arrivals</a></li>
<li><a href="#">men</a></li>
<li><a href="#">women</a></li>
<li><a href="#">accessories</a></li>
<li><a href="#">kids</a></li>
<li><a href="#">brands</a></li>
<li><a href="#">trends</a></li>
<li><a href="#">sale</a></li>
<li><a href="#">style videos</a></li>
</ul>
</div>
<div class="col-md-3 span1_of_4">
<h4>help</h4>
<ul class="f_nav">
<li><a href="#">frequently asked questions</a></li>
<li><a href="#">men</a></li>
<li><a href="#">women</a></li>
<li><a href="#">accessories</a></li>
<li><a href="#">kids</a></li>
<li><a href="#">brands</a></li>
</ul>
</div>
<div class="col-md-3 span1_of_4">
<h4>account</h4>
<ul class="f_nav">
<li><a href="account.php">login</a></li>
<li><a href="register.php">create an account</a></li>
<li><a href="#">create wishlist</a></li>
<li><a href="checkout.php">my shopping bag</a></li>
<li><a href="#">brands</a></li>
<li><a href="#">create wishlist</a></li>
</ul>
</div>
<div class="col-md-3 span1_of_4">
<h4>popular</h4>
<ul class="f_nav">
<li><a href="#">new arrivals</a></li>
<li><a href="#">men</a></li>
<li><a href="#">women</a></li>
<li><a href="#">accessories</a></li>
<li><a href="#">kids</a></li>
<li><a href="#">brands</a></li>
<li><a href="#">trends</a></li>
<li><a href="#">sale</a></li>
<li><a href="#">style videos</a></li>
<li><a href="#">login</a></li>
<li><a href="#">brands</a></li>
</ul>
</div>
<div class="clearfix"></div>
</div>
</div>
<div class="cards text-center">
<img src="images/cards.jpg" alt="" />
</div>
<div class="copyright text-center">
<p>© 2015 Eshop. All Rights Reserved | Design by <a href="http://w3layouts.com"> W3layouts</a></p>
</div>
</div>
</div>
</body>
</html>
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team