-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
189 lines (171 loc) · 10.4 KB
/
login.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<?php
include("header.php");
?>
<!-- Start Breadcrumb -->
<div class="page-heading">
<div class="container">
<div class="row">
<div class="col-sm-12 text-center">
<h1 class="title"><span>Login/Register</span></h1>
<div class="breadcrumb">
<a href="index.php">Home</a>
<span class="delimeter">/</span>
<a href="login.php">Login</a>
</div>
</div>
</div>
</div>
</div>
<!-- End Breadcrumb -->
<section class="main-contain bg-white" style="margin-bottom: 200px;">
<div class="container">
<div class="login-area">
<div class="login-header">
<div class="login-details">
<ul class="nav nav-tabs navbar-right">
<li><a data-toggle="tab" href="#register">Buyer Register</a></li>
<li><a data-toggle="tab" href="#farmer">Farmer register</a></li>
<li class="active"><a data-toggle="tab" href="#login">Login</a></li>
</ul>
</div>
</div>
<div class="tab-content">
<div id="farmer" class="tab-pane">
<div class="login-inner">
<div class="title">
<h1>Welcome to <span>Farmer's Register</span></h1>
</div>
<div>
<?php if(isset($_SESSION["msg"])){ ?>
<div class="alert alert-success" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<strong><?=$_SESSION["msg"]?></strong>
</div>
<script>
window.setTimeout(function() {
$(".alert").fadeTo(500, 0).slideUp(500, function(){
$(this).remove();
});
}, 8000);
</script>
<?php
unset($_SESSION["msg"]);
}
?>
</div>
<div class="login-form">
<form method="post" action="loginCheck.php">
<div class="form-details">
<label class="user">
<input type="text" name="Fname" placeholder="Full Name" id="Fusername" required>
</label>
<label class="user">
<input type="text" name="Fphone" placeholder="Mobile Number" id="Fphone" required>
</label>
<label class="mail">
<input type="email" name="Femail" placeholder="Email Address" id="Fmail" required>
</label>
<label class="pass">
<input type="password" name="Fpass" placeholder="Password" id="Fpassword" required>
</label>
<label class="pass">
<input type="password" name="FR_pass" placeholder="Confirm Password" id="Fpassword" required>
</label>
<label class="user">
<input type="text" name="Faddress" placeholder="Address" id="Faddress" required>
</label>
<label class="user">
<input type="text" name="state" placeholder="State" id="state" required>
</label>
<label class="user">
<input type="text" name="pincode" placeholder="Pin code" id="pincode" required>
</label>
</div>
<button type="submit" class="form-btn" name="Fregisubmit" onsubmit="">Register</button>
</form>
</div>
</div>
</div>
<div id="register" class="tab-pane">
<div class="login-inner">
<div class="title">
<h1>Welcome to <span>Register</span></h1>
</div>
<div>
<?php if(isset($_SESSION["msg"])){ ?>
<div class="alert alert-success" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<strong><?=$_SESSION["msg"]?></strong>
</div>
<script>
window.setTimeout(function() {
$(".alert").fadeTo(500, 0).slideUp(500, function(){
$(this).remove();
});
}, 8000);
</script>
<?php
unset($_SESSION["msg"]);
}
?>
</div>
<div class="login-form">
<form method="post" action="loginCheck.php">
<div class="form-details">
<label class="user">
<input type="text" name="name" placeholder="Full Name" id="username" required>
</label>
<label class="user">
<input type="text" name="phone" placeholder="Mobile Number" id="phone" required>
</label>
<label class="mail">
<input type="email" name="email" placeholder="Email Address" id="mail" required>
</label>
<label class="pass">
<input type="password" name="pass" placeholder="Password" id="password" required>
</label>
<label class="pass">
<input type="password" name="R_pass" placeholder="Confirm Password" id="password" required>
</label>
<label class="user">
<input type="text" name="address" placeholder="Address" id="address" required>
</label>
</div>
<button type="submit" class="form-btn" name="regisubmit" onsubmit="">Register</button>
</form>
</div>
</div>
</div>
<div id="login" class="tab-pane fade in active">
<div class="login-inner">
<div class="title">
<h1>Welcome to <span>Login</span></h1>
</div>
<div class="login-inner">
<label style="color: red"> <?php if(isset($_SESSION["message"])){echo($_SESSION["message"]); unset($_SESSION["message"]);} ?> </label><br>
<label style="color: red"> <?php if(isset($_SESSION["wrong"])){echo($_SESSION["wrong"]); unset($_SESSION["wrong"]);} ?> </label><br>
<label style="color: red;"><?php if(isset($_SESSION["loginChk"]) && ($_SESSION["loginChk"]>=3)){
echo("You have try ".$_SESSION["loginChk"]." times already and cannot try more than 5 time. So only ".(5-$_SESSION["loginChk"])." times you can try to login.<br>");}
if(isset($_SESSION["loginChk"]) && ($_SESSION["loginChk"]>=5)){echo("Please restart your browser");}
?></label><br>
</div>
<div class="login-form">
<form action="loginCheck.php" method="post">
<div class="form-details">
<label class="user">
<input type="text" name="username" placeholder="Email" id="username" required>
</label>
<label class="pass">
<input type="password" name="passsword" placeholder="Password" id="password" required>
</label>
</div>
<input type="submit" class="form-btn btn-success" name="loginSubmit" value="Login" <?php if(isset($_SESSION["loginChk"]) && ($_SESSION["loginChk"]>=5)){ ?>disabled <?php } ?> />
</form>
<a style="display: block;float: right;margin: 0px;padding-right: 21%;margin-top: 10px; " href="<?=$_SESSION["directory"]?>forgotpassword.php">forgot password? </a>
</div>
</div>
</div>
</section>
<?php
include("footer.php");
?>