-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassign_process.php
More file actions
executable file
·84 lines (56 loc) · 2.19 KB
/
assign_process.php
File metadata and controls
executable file
·84 lines (56 loc) · 2.19 KB
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
<?php
/********************************************************
*
* phpAbstracts
* http://www.phpabstracts.com
*
* For copyright and license information, see readme.txt
*
*********************************************************/
//Include header template
include('header.php');
//Only ADMINs can view this page
if ($admin) {
//Grab variables from form
$abstract_id=$_POST['abstract_id'];
$user_id = $_POST['user_id'];
//Database Connection Variables
include('db.php');
//Connect to database
mysql_connect($host,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
//Add assignment to database
$query = "INSERT INTO reviews VALUES ('', '$abstract_id', '$user_id', 'Assigned', '', '', '', '') ";
mysql_query($query) or die(mysql_error());
//Find e-mail address for assignee
$query2 = "SELECT email FROM users WHERE user_id = '$user_id'";
$result = mysql_query($query2);
$email = mysql_result($result,0,"email");
//Close database
mysql_close();
//Send e-mail to assignee
$to = $email;
$subject = "Abstract Review Assignment: " . $abstract_id;
$body = $site_title . "\n\n" .
"Abstract " . $abstract_id . " has been assigned for your review.\n\n" .
"Please complete the review online at " . $site_url .
"\n\nThank you for your participation!";
$from = $site_email;
$headers = "From: $from";
mail($to, $subject, $body, $headers);
//Print confirmation
$goback_abstract = "<form method='post' action='detail.php' name='goback_abstract_form' id='goback_abstract_form'>" .
"<input type='hidden' id='abstract_id' name='abstract_id' value='" . $abstract_id . "' />" .
"<a href='list.php'>Return " . $home_title . "</a> | " .
"<a href='#' onclick='javascript:document.goback_abstract_form.submit();'>Return to abstract</a>" .
"</form>";
echo "<br /><br /><br />" .
"<div class='statusbox'>" .
"<p>Abstract ID #" . $abstract_id . " has been successfully assigned.</p>" .
$goback_abstract .
"</div>".
"<br /><br /><br />";
}//if admin
//Include footer template
include('footer.php');
?>