-
Notifications
You must be signed in to change notification settings - Fork 1
/
guide1.php
157 lines (120 loc) · 4.04 KB
/
guide1.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
<!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" xml:lang="EN" lang="EN" dir="ltr">
<head profile="http://gmpg.org/xfn/11">
<title>SPAM</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="imagetoolbar" content="no" />
<link rel="stylesheet" href="styles/layout.css" type="text/css" />
<script type="text/javascript" src="scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="scripts/jquery.slidepanel.setup.js"></script>
<script type="text/javascript" src="scripts/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="scripts/jquery.tabs.setup.js"></script>
<style type="text/css">
<!--
A.ssmItems:link {color:black;text-decoration:none;}
A.ssmItems:hover {color:black;text-decoration:none;}
A.ssmItems:active {color:black;text-decoration:none;}
A.ssmItems:visited {color:black;text-decoration:none;}
//-->
</style>
</head>
<body>
<?php
session_start();
include 'include/connect.php';
if(!isset($_SESSION['email']))
{
echo "<script> alert('Login First!!');</script>";
echo "<script> window.location='index.php'</script>";
}
else
{
@$a1=$_SESSION['email'];
@$b="select * from spam_sign_in where email='$a1'";
@$query=mysql_query($b);
while($result=mysql_fetch_array($query))
{
$name=$result['name'];
@$c=$result['dept'];
}
?>
<div id="himani">
<table align="center" border="1" style="width:600px; border-width:3px; border-color:#8080FF; height:auto; margin-top:100px;">
<caption> <h2><b>GUIDE LIST</b></h2> </caption>
<font size="+1">
<tr>
<th align="center"> ID </th>
<th align="center"> Name </th>
<th align="center"> Email-ID </th>
</tr>
<?php
$q= "select * from spam_guide_predefine where branch='$c' and registered=''" ;
$result=mysql_query($q);
$count=1;
while ($data = mysql_fetch_array($result))
{
echo "<tr> <td>".$count."</td>";
echo "<td>".$data['name']."</td>";
echo "<td>".$data['email']."</td>";
$count++;
}
?>
</font>
</table>
</div>
<div align="center"><h2><a href="#" onclick="CallPrint()">Print</a></h2></div>
<script type="text/javascript">
function CallPrint() {
window.print();
}
</script>
<form method="POST" >
<input type="submit" value="Send" name="submit" />
</form>
<?php
if($_POST['submit']=="Send")
{
require ('class.phpmailer.php');
require ('class.smtp.php');
require 'PHPMailerAutoload.php';
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = 'smtp.gmail.com'; // Specify main and backup server
// debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '[email protected]'; // SMTP username
$mail->Password = '9509701824'; // SMTP password
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
$mail->From = '[email protected]';
$mail->FromName = 'SPAM Support';
$q1= "select * from spam_guide_predefine where branch='$c' and registered=''" ;
$result1=mysql_query($q1);
$count=1;
while ($data1 = mysql_fetch_array($result1))
{
$cd=$data1['email'];
$mail->addAddress($cd); // Add a recipient
}
$mail->WordWrap = 50; // Set word wrap to 50 characters
$mail->IsHTML(true); // Set email format to HTML
$mail->Subject = 'Alert Message';
$mail->Body = ' Dear<br> <br>You are here by informed that you have not registered yourself yet.<br> So kindly please registere yourself as soon as possible<br> From<br>'.$name.'<br>';
$mail->AltBody = '';
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
exit;
}?>
<?php
echo "<script>alert('Mail has been send...!!');
window.location.href='#';</script>";
?>
<?php
}
?>
</body>
</html>
<?php
}
?>