-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripts.php
130 lines (118 loc) · 3.16 KB
/
scripts.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
<?php require_once('Connections/HMS.php');
mysql_select_db($database_HMS, $HMS);
if ($HMS == NULL)
{
die('Could not connect: ' . mysql_error());
}
function sendRecoveryMail($emailId)
{
$query = "SELECT password FROM users WHERE emailId = '$emailId'";
$password = mysql_query($query, $HMS) or die(mysql_error());
$totalRows = mysql_num_rows($person);
if($totalRows == 1)
{
$message = "
Your password for the HMS login has been recovered!
The password is :
<strong> <? $password ?> </strong>
You can go ahead and use this password to login to our site.
Have a good Day.
-Admin
HMS Webmaster
";
mail($emailId,"HMS Password Recovery",$message,"From:HMSAdmin <[email protected]>");
}
mysql_free_result($password);
}
function error($msg)
{
echo '<html>
<head>
<script language="JavaScript">
<!--
alert("';
echo $msg;
echo '");
history.back();
//-->
</script>
</head>
<body>
</body>
</html>';
}
function selectAll()
{
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;
}
}
$query_Recordset1 = "SELECT * FROM person";
$Recordset1 = mysql_query($query_Recordset1, $HMS) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
$even=1;
do
{
$fName = $row_Recordset1['fName'];
$mName = $row_Recordset1['mName'];
$lName = $row_Recordset1['lName'];
$gender = $row_Recordset1['gender'];
$DOB = $row_Recordset1['DOB'];
$mobile = $row_Recordset1['mobile'];
if($even == 1)
{
echo'<tr>';
}
else
{
echo'<tr class="alternate-row">';
}
echo <<<EOT
<td><input type="checkbox"/></td>
<td>$fName</td>
<td>$mName</td>
<td>$lName</td>
<td>$gender</td>
<td>$DOB</td>
<td>$mobile</td>
<td class="options-width">
<a href="" title="Edit" class="icon-1 info-tooltip"></a>
<a href="" title="Edit" class="icon-2 info-tooltip"></a>
</td>
</tr>
EOT;
if($even == 1)
$even = 0;
elseif($even == 0)
$even = 1;
}while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
}
?>