-
Notifications
You must be signed in to change notification settings - Fork 0
/
emailnew.php
240 lines (212 loc) · 10.8 KB
/
emailnew.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<!-- Developed by Saurav Bajracharya and Pramesh Bajracharya -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Login</title>
<link rel="shortcut icon" href="bvc.png" type="image/x-icon" />
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="animate.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript" language="javascript">
function checkedbox(element) {
var checkboxes = document.getElementsByTagName('input');
if (element.checked) {
for (var i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].type == 'checkbox') {
checkboxes[i].checked = true;
}
}
} else {
for (var i = 0; i < checkboxes.length; i++) {
console.log(i)
if (checkboxes[i].type == 'checkbox') {
checkboxes[i].checked = false;
}
}
}
}
</script>
<script src="js/tinymce/js/tinymce/tinymce.min.js"></script>
<script>
tinymce.init({
selector: 'textarea'
});
</script>
<script type="text/javascript" src="date_time.js"></script>
</head>
<?php
include "functions.php";
create();
?>
<body>
<div class="topDiv">
<div class="imageLeft">
<img src="round.png" />
</div>
<div id="asideCont">
<h2>Bonam Venkata Chalamayya Engineering College,<br> Odalarevu</h2>
<h3>Affiliated To JNTUK, Kakinada</h3> Accredited By NBA New Delhi and NAAC With 'A' Grade<br> Approved By AICTE, New Delhi<br> Established in 1997<br><br>
</div>
<div class="imageRight">
<span id="date_time"></span>
<script type="text/javascript">
window.onload = date_time('date_time');
</script>
<img src="group.png" />
</div>
</div>
<div class="clear"></div>
<div id="main" role="main">
<center>
<ul class="menu">
<li><a class="active" href="index.php">Home</a></li>
<li><a href="contact.php">Contact</a></li>
<li><a href="About.php">About Us</a></li>
<li><a href="vision.php">Vision & Mission</a></li>
<li><a href="asd.php">Management</a>
<ul class="submenu">
<li><a href="founderchairman.php">Founder-Chairman</a></li>
<li><a href="secretary.php">Secretary</a></li>
<li><a href="chairman.php">Chairman</a></li>
<li><a href="vicechairman.php">Vice-Chairman</a></li>
</ul>
</li>
<li><a href="principal.php">Principal</a></li>
<li><a href="faculty.php">Faculty</a>
<ul class="submenu1">
<li><a href="#">CSE</a></li>
<li><a href="#">CE</a></li>
<li><a href="#">ME</a></li>
<li><a href="#">EEE</a></li>
<li><a href="#">ECE</a></li>
</ul>
</li>
<li><a href="index.php">Students</a></li>
<li><a href="#"> Departments</a>
<ul class="submenu1">
<li><a href="Department.php">CSE</a></li>
<li><a href="civil.php">CE</a></li>
<li><a href="mech.php">ME</a></li>
<li><a href="eee.php">EEE</a></li>
<li><a href="ece.php">ECE</a></li>
</ul>
</li>
<li><a href="#">Accredition</a>
<ul class="submenu">
<li><a href="naac.php">NAAC</a></li>
<li><a href="nba.php">NBA</a></li>
<li><a href="pio.php">PIO</a></li>
</ul>
</li>
<li><a href="#">Help</a></li>
</ul>
<div class="bodyDiv">
<div class="forAside">
<aside id="buttonsAside">
<form class="navBar">
<nav id="navigationBar">
<ul class="sideBar" style="margin-left:-25%;">
<li><a href="acadamic.php">Academics</a></li>
<li><a href="#">Administration</a></li>
<li><a href="#">BVC News</a></li>
<li><a href="#">Forthcoming Event</a></li>
<li><a href="#">E-mail to students</a></li>
<li><a href="#">SMS to Parents/Students</a></li>
<li><a href="#">Recruitment</a></li>
<li><a href="#">Professional Body</a></li>
<li><a href="#">Projects</a></li>
<li><a href="#">Department Library</a></li>
<li><a href="#">Training</a></li>
<li><a href="#">Games And Sports</a></li>
<li><a href="#">Placement</a></li>
<li><a href="feedback.php">Feedback to College</a></li>
<li><a href="alumini.php">Alumini</a></li>
<li><a href="#">Notices & Circulars</a></li>
</ul>
</nav>
</form>
</aside>
</div><br><br><br>
<div class="centralDiv" style="margin-left:5%;">
<?php
include('includes/config.php');
if(isset($_POST['check']) == true)
{
$subject = trim($_POST['subject']);
$message = trim($_POST['message']);
$from = 'pe.messh@gmail.com';
$reply = 'pe.messh@gmail.com';
foreach($_POST['check'] as $key => $value)
{
// Set content-type for sending HTML email
$headers = "BVC Engineering College" . "\r\n";
$headers .= "Odalarevu, Amalapuram" . "\r\n";
$headers .= "From: <".$from.">\r\n";
$headers .= "Reply-To: ".$reply."";
if(@mail($value,$subject,$message,$headers))
{
echo '<div class="container-fluid" style="width:130%;">
<div class="alert alert-success fade in">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>';
echo '<strong>Success! </strong>';
echo ' Mail has been Successfully sent to '.$value.'</br>';
echo '</div></div>';
}
}
}
?>
<div class="container-fluid" style="width:130%;">
<center>
<p>
<h2>Please Select Students</h2>
</p><br><br>
<form method="post" action="">
<?php
// Retrieve Email from Database
$getemail = mysql_query("SELECT * FROM profiles");
if (!$getemail) die('MySQL Error: ' . mysql_error());
echo '<table class="table table-bordered">';
echo "<thead>
<tr>
<th><input type='checkbox' onchange='checkedbox(this)' name='chk'/><h4> All</h4></th>
<th><h4>Registration Number</h4></th>
<th><h4>Student's Name</h4></th>
<th><h4>E-mail</h4></th>
</tr>
</thead>";
if (mysql_num_rows($getemail) == 0) {
echo "<tbody><tr><td colspan='3'>No Data Avaialble</td></tr></tbody>";
}
while ($row = mysql_fetch_assoc($getemail)) {
echo "<tbody><tr><td><input value='".$row['email']."' type='checkbox' name='check[]'/></td>";
echo "<td >".$row['roll_no']."</td>";
echo "<td >".$row['name']."</td>";
echo "<td >".$row['email']."</td></tr></tbody>";
}
echo "</table>";
?>
<br><br>
<p>Email Subject: <input type="text" name="subject" value="" class="form-control" /></p>
<br><br>
<p>Email Content: <textarea name="message" cols="40" rows="6"></textarea></p>
<center><input type='submit' name='submit' value='Send Email Now' class="btn btn-primary btn-block" />
</center>
<br></form>
</div>
</div>
</div>
</center>
</div>
<footer id="footer">
<h4 id="left">Copyright © - <?php echo "20".date('y');?></h4>
<h4 id="right">BVCEC</h4>
</footer>
</body>
</html>