forked from ertait/uvm-studentportal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfirm.php
72 lines (57 loc) · 1.84 KB
/
confirm.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
<?php
include 'includes/top.php';
$className = $_GET['class'];
$stuName = $_GET['stuName'];
$stuId = $_GET['stuId'];
$to = $stuId . '@uvm.edu';
$crn = $_GET['crn'];
$professorNetId = $_GET['pro'];
print "<h2>" . $stuName . " is note taker for " . $className . "</h2>";
$message = "
<html>
<head>
<title>Notaker Application Approved</title>
</head>
<body id='centerEmail'>
<pre style='font-family: sans-serif'>
Greetings,
You have successfully registered for $className as a note taker.
To log in, please click the link below:
----------------------------------
<a href='http://localhost/uvm-studentportal/login.php'>Log in to NoTaker</a>
----------------------------------
Thank you for registering.
</pre>
</body>
</html>
";
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
// More headers
$headers .= 'From: <' . $professorNetId . '@uvm.edu>' . "\r\n";
//$headers .= 'Cc: myboss@example.com' . "\r\n";
$subject = "Notetaker Application Approved";
mail($to, $subject, $message, $headers);
//require("includes/top.php");
try {
$db->beginTransaction();
// $query = "UPDATE tblUsersClasses SET fldNoteTaker = 'T' WHERE fnkNetId = '$stuId'";// AND fnkCourseId = " . $crn;
echo $query;
$query = "INSERT INTO tblUsersClasses (fldNoteTaker, fnkNetId, fnkCourseId) VALUES ('T', '" .$stuId . "'," . $crn . ")";
echo " " . $query . " ";
echo $stuId;
echo $crn;
//SET fldNoteTaker = 'T' WHERE fnkNetId = '" . $stuId ."' AND fnkCourseId = '" . $crn . "'";
$statement = $db->prepare($query);
$statement->execute();
// var_dump($statement);
$statement->fetchAll(PDO::FETCH_ASSOC);
$db->commit();
} catch (PDOException $e) {
$db->rollBack();
echo $e->getMessage();
}
echo "test";
include 'includes/footer.php';
?>