Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php require_once('../Connections/growsart.php'); ?>
- <?php
- if (!function_exists("GetSQLValueString")) {
- function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
- {
- if (PHP_VERSION < 6) {
- $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
- }
- $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
- switch ($theType) {
- case "text":
- $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
- break;
- case "long":
- case "int":
- $theValue = ($theValue != "") ? intval($theValue) : "NULL";
- break;
- case "double":
- $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
- break;
- case "date":
- $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
- break;
- case "defined":
- $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
- break;
- }
- return $theValue;
- }
- }
- mysql_select_db($database_growsart, $growsart);
- $query_rscustomer = "SELECT * FROM customer";
- $rscustomer = mysql_query($query_rscustomer, $growsart) or die(mysql_error());
- $row_rscustomer = mysql_fetch_assoc($rscustomer);
- $totalRows_rscustomer = mysql_num_rows($rscustomer);
- ?>
- <?php
- // *** Validate request to login to this site.
- if (!isset($_SESSION)) {
- session_start();
- }
- $loginFormAction = $_SERVER['PHP_SELF'];
- if (isset($_GET['accesscheck'])) {
- $_SESSION['PrevUrl'] = $_GET['accesscheck'];
- }
- if (isset($_POST['username'])) {
- $loginUsername=$_POST['username'];
- $password=$_POST['pwd'];
- $MM_fldUserAuthorization = "";
- $MM_redirectLoginSuccess = "index.php";
- $MM_redirectLoginFailed = "login.php?status=gagal";
- $MM_redirecttoReferrer = false;
- mysql_select_db($database_growsart, $growsart);
- $LoginRS__query=sprintf("SELECT username, password FROM customer WHERE username=%s AND password=%s",
- GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
- $LoginRS = mysql_query($LoginRS__query, $growsart) or die(mysql_error());
- $loginFoundUser = mysql_num_rows($LoginRS);
- if ($loginFoundUser) {
- $loginStrGroup = "";
- if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
- //declare two session variables and assign them
- $_SESSION['MM_Username'] = $loginUsername;
- $_SESSION['MM_UserGroup'] = $loginStrGroup;
- if (isset($_SESSION['PrevUrl']) && false) {
- $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
- }
- header("Location: " . $MM_redirectLoginSuccess );
- }
- else {
- header("Location: ". $MM_redirectLoginFailed );
- }
- }
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Login</title>
- <link href="../vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
- </head>
- <body style="width:100%; height:100%; background: url(img/Form%20Cart%20-%20Login.png) no-repeat; background-size:100%; ">
- <div class="container" style="margin-top:2%;">
- <h3 class="text-center" style="color:#fff; font-family:'Times New Roman';"> Welcome to </h3>
- <h1 class="text-center" style="margin-top:0; color:#fff; font-family:'Times New Roman';"> GrowsArt</h1>
- <div class="col-md-4 col-xs-offset-4" style=" font-family: 'jagw 0';" >
- <div class="panel panel-default">
- <div class="panel-heading" style=" color:#a7a9ab; background-color:#fff;"><h3 class=" text-center" style="font-family: 'jagw 0'; ">MEMBER LOGIN</h3></div>
- <div class="panel-body">
- <form ACTION="<?php echo $loginFormAction; ?>" role="form" method="POST" name="login">
- <div class="form-group"><div class="col-lg-12" style="padding:0;">
- <div class="col-lg-2" style="padding-top:1%;">
- <img src="img/Form Cart-06.png" width="80%" />
- </div>
- <div class="col-lg-10" style="padding:0;">
- <input type="text" class="form-control" style="color:#a7a9ab;" name="username" placeholder="Username">
- </div>
- </div>
- </div>
- <div class="form-group" ><div class="col-lg-12" style="padding:0; margin-top:5%;">
- <div class="col-lg-2" style=" padding-top:1%;">
- <img src="img/Form Cart-07.png" width="80%" />
- </div>
- <div class="col-lg-10" style="padding:0;">
- <div class="input-group">
- <input type="password" class="form-control " name="pwd" placeholder="Password" >
- <span class="input-group-btn">
- <button class="btn btn-default reveal" type="button" style="margin:0; color:#a7a9ab;"><i class="glyphicon glyphicon-eye-open"></i></button>
- </span>
- </div></div></div></div>
- <div class="form-group col-lg-12" style="padding-left:18%; margin-top:2%; color:#a7a9ab; font-size:12px;">
- <input name="remind" type="checkbox" value="remind" /> Remember Me
- </div>
- <div class="col-lg-12" style=" font-size:12px;">
- <div class="col-lg-2 col-xs-offset-1"><img src="img/Form Cart-09 - 7ebae5.png" width="100%" /></div><div class="col-lg-9" style="color:#7ebae5; padding:0;"> Forgot your <u >password</u> ?</div>
- </div>
- <div class="col-lg-6 col-xs-offset-3"><button type="submit" class="btn btn-sm btn-default" style="margin-top:10%; width:100%; background-color:#50a3da; padding:3%; font-size:16px; color:#fff;">LOGIN</button></div>
- </form>
- </div>
- <div class="col-md-12 text-center" style="margin-top:5%;" >
- <div class="col-lg-7" style="padding-top:2%; color:#6d6e70; padding-right:0;">Don't have an account ? </div><div class="col-lg-5" style="padding-left:0;"><button type="submit" class="btn btn-sm btn-default" style=" width:100%; background-color:#F5861f; padding:5%; font-size:14px; color:#fff;">REGISTER</button></div>
- </div>
- </div>
- </div>
- </div>
- <script>
- $(".reveal").on('click',function() {
- var $pwd = $("#pwd");
- if ($pwd.attr('type') == 'password') {
- $pwd.attr('type', 'text');
- } else {
- $pwd.attr('type', 'password');
- }
- });</script>
- </body>
- </html>
- <?php
- mysql_free_result($rscustomer);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement