-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathget_registration_expiry.php
72 lines (56 loc) · 2.29 KB
/
get_registration_expiry.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
<!DOCTYPE HTML>
<html>
<title>Registration Table</title>
<body>
<p><h1><b><u>RTO Karnataka: Registration Table</u></b></h1></p>
<p><a href="rto_admin.php"><font color="blue" size="5"><b>Back</b></font></a>       
<a href="admin_logout.php"><font color="red" size="5"><b>Logout</b></font></a></p>
<?php
session_start();
$username=$_SESSION['username'];
$conn = mysqli_connect("localhost","root","");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
mysqli_select_db($conn,"dbms_p1");
$sql1 = "SELECT aadhar,name,cov,vno,reg_issue_date,reg_expiry_date,mail_id FROM reg where DATEDIFF(reg_expiry_date,CURDATE())<=30";
$result1 = $conn->query($sql1);
$subject="Vehicle Registration Update";
if($result1){
echo '<div align="center"><table align="left" border="2"
cellspacing="2" cellpadding="10">
<tr>
<td align="left"><b>Aadhaar No</b></td>
<td align="left"><b>Name</b></td>
<td align="left"><b>COV</b></td>
<td align="left"><b>Vehicle No</b></td>
<td align="left"><b>Registration Issue Date</b></td>
<td align="left"><b>Registration Expiry Date</b></td>
<td align="left"><b>Email</b></td>
</tr></div>';
while($row = mysqli_fetch_array($result1)){
$body='Hello,'.'Your Registration for vehicle with No '.$row['vno'].' will expire within a month. '.'Please visit nearest RTO Office to renew registration of your vehicle '.' - RTO Karnataka';
$link=$row['mail_id'];
echo '<div align="center"><tr><td align="left">' .
$row['aadhar'] . '</td><td align="left">' .
$row['name'] . '</td><td align="left">' .
$row['cov'] . '</td><td align="left">' .
$row['vno'] . '</td><td align="left">' .
$row['reg_issue_date'] . '</td><td align="left">' .
$row['reg_expiry_date'] . '</td><td align="left">' .
'<a href="mailto:'.$row['mail_id'].'?subject='.$subject.'&body='.$body.'">'.$row['mail_id'].'</a>'.'</td><td align="left"></td></tr></div>';
//echo '</tr>';
}
echo '</table><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>';
} else {
echo ("<SCRIPT LANGUAGE='JavaScript'>
window.alert('Couldn't fetch the data')
window.location.href='rto_admin.php'
</SCRIPT>");
}
mysqli_close($conn);
?>
<br>
</body>
</html>