Commit 8c354753 by Roy Junedi Simamora

progress

parents 3d062ca0 16cb3164
...@@ -2,74 +2,42 @@ ...@@ -2,74 +2,42 @@
require_once(dirname(__FILE__).'/common/header.php'); require_once(dirname(__FILE__).'/common/header.php');
require_once(dirname(__FILE__).'/cek_login.php'); require_once(dirname(__FILE__).'/cek_login.php');
require_once(dirname(__FILE__).'/fungsi/session.php'); require_once(dirname(__FILE__).'/fungsi/session.php');
?>
global $con;
$con = mysqli_connect("localhost", "p1d3ti04", "p1d3ti04", "MeiHong05"); <br/>
if (!$con) { <form class='well form-horizontal' action='form_login.php?do_login=1' method='post' id='contact_form'>
die("database connect problem"); <fieldset>
} <legend><span class='glyphicon glyphicon-log-in'></span>&nbsp;Login</legend>
$db_use = mysqli_select_db($con, "p1d3ti04_pondokedo") or die("selet db problem !!"); <div class='form-group'>
<label class='col-md-4 control-label'>Username</label>
if(isset($_GET['do_login'])){ <div class='col-md-4 inputGroupContainer'>
$login =getUser($_POST['username'],$_POST['password']); <div class='input-group'>
if($login == false){ <span class='input-group-addon'><i class='glyphicon glyphicon-user'></i></span>
$_SESSION['login_error'] = TRUE; <input type='text' name='username' required placeholder='Username' class='form-control' type='text'>
}else{ </div>
$_SESSION['user'] = TRUE; </div>
$row = mysqli_fetch_array($login); </div>
$_SESSION['username'] = $row['username']; <div class='form-group'>
$_SESSION['id_member'] = $row['id_member']; <label class='col-md-4 control-label'>Password</label>
$_SESSION['user'] = TRUE; <div class='col-md-4 inputGroupContainer'>
header("location:index.php"); <div class='input-group'>
} <span class='input-group-addon'><i class='glyphicon glyphicon-lock'></i></span>
$log =getAdmin($_POST['username'],$_POST['password']); <input name='password' required placeholder='Password' class='form-control' type='password'>
if($log == false){ </div>
$_SESSION['login_error'] = TRUE; </div>
}else{ </div>
$resAdm = mysqli_fetch_array($log); <div class='form-group'>
$_SESSION['admin'] = TRUE; <label class='col-md-4 control-label'></label>
header("location:admin_menu.php"); <div class='col-md-4'>
} <input type='submit' value='login' class='btn btn-default'>
if(isset($_SESSION["login_error"])){ </div>
echo "<script> window.alert('Login Gagal !! Username dan Password Salah !!')</script>"; </div>
} <center>Belum punya akun?
} <a href='form_daftar.php'> silahkan daftar disini </center>
?> </fieldset>
<br/> </form>
<form class='well form-horizontal' action='form_login.php?do_login=1' method='post' id='contact_form'> <?php
<fieldset> require_once(dirname(__FILE__).'/common/footer.php');
<legend><span class='glyphicon glyphicon-log-in'></span>&nbsp;Login</legend>
<div class='form-group'>
<label class='col-md-4 control-label'>Username</label>
<div class='col-md-4 inputGroupContainer'>
<div class='input-group'>
<span class='input-group-addon'><i class='glyphicon glyphicon-user'></i></span>
<input type='text' name='username' required placeholder='Username' class='form-control' type='text'>
</div>
</div>
</div>
<div class='form-group'>
<label class='col-md-4 control-label'>Password</label>
<div class='col-md-4 inputGroupContainer'>
<div class='input-group'>
<span class='input-group-addon'><i class='glyphicon glyphicon-lock'></i></span>
<input name='password' required placeholder='Password' class='form-control' type='password'>
</div>
</div>
</div>
<div class='form-group'>
<label class='col-md-4 control-label'></label>
<div class='col-md-4'>
<input type='submit' value='login' class='btn btn-default'>
</div>
</div>
<center>Belum punya akun?
<a href='form_daftar.php'> silahkan daftar disini </center>
</fieldset>
</form>
<?php
require_once(dirname(__FILE__).'/common/footer.php');
?> ?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment