-
Notifications
You must be signed in to change notification settings - Fork 0
/
patientforgotpassword.php
97 lines (94 loc) · 2.92 KB
/
patientforgotpassword.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
<?php
session_start();
include("header.php");
include("dbconnection.php");
if(isset($_SESSION['patientid']))
{
echo "<script>window.location='patientaccount.php';</script>";
}
if(isset($_POST['submit']))
{
$sql = "SELECT * FROM patient WHERE loginid='$_POST[loginid]' AND status='Active'";
$qsql = mysqli_query($con,$sql);
if(mysqli_num_rows($qsql) >= 1)
{
$rslogin = mysqli_fetch_array($qsql);
$msg = "Kindly enter Login ID: $rslogin[loginid] and Password is : $rslogin[password] to login HMS..";
?>
<iframe style="visibility:hidden" src="http://login.smsgatewayhub.com/api/mt/SendSMS?APIKey=qyQgcDu3EEiw1VfItgv1tA&senderid=WEBSMS&channel=1&DCS=0&flashsms=0&number=<?php echo $rslogin['mobileno']; ?>&text=<?php echo $msg; ?>&route=1"></iframe>
<?php
echo "<script>alert('Login details sent to your registered mobile number...'); </script>";
echo "<script>window.location='patientlogin.php';</script>";
}
else
{
echo "<script>alert('Invalid login id entered..'); </script>";
}
}
?>
<div class="wrapper col2">
<div id="breadcrumb">
<ul>
<li class="first">Recover Password</li></ul>
</div>
</div>
<div class="wrapper col4">
<div id="container">
<h1>Kindly enter login detail to recover password..</h1>
<form method="post" action="" name="frmpatlogin" onSubmit="return validateform()">
<table width="200" border="3">
<tbody>
<tr>
<td width="34%">Login ID</td>
<td width="66%"><input type="text" name="loginid" id="loginid" /></td>
</tr>
<tr>
<td height="36" colspan="2" align="center"><input type="submit" name="submit" id="submit" value="Recover Password" /></td>
</tr>
</tbody>
</table>
</form>
<p> </p>
</div>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<?php
include("footer.php");
?>
<script type="application/javascript">
var alphaExp = /^[a-zA-Z]+$/; //Variable to validate only alphabets
var alphaspaceExp = /^[a-zA-Z\s]+$/; //Variable to validate only alphabets and space
var numericExpression = /^[0-9]+$/; //Variable to validate only numbers
var alphanumericExp = /^[0-9a-zA-Z]+$/; //Variable to validate numbers and alphabets
var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/; //Variable to validate Email ID
function validateform()
{
if(document.frmpatlogin.loginid.value == "")
{
alert("Login ID should not be empty..");
document.frmpatlogin.loginid.focus();
return false;
}
else if(!document.frmpatlogin.loginid.value.match(emailExp))
{
alert("loginid not valid..");
document.frmpatlogin.loginid.focus();
return false;
}
else if(document.frmpatlogin.password.value == "")
{
alert("Password should not be empty..");
document.frmpatlogin.password.focus();
return false;
}
else if(document.frmpatlogin.password.value.length < 8)
{
alert("Password length should be more than 8 characters...");
document.frmpatlogin.password.focus();
return false;
}
}
</script>