This repository has been archived by the owner on Aug 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
success.php
71 lines (53 loc) · 1.69 KB
/
success.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
<?php
//Sessions start
//----------------------------------------------------------
session_start();
$var1 = $_SESSION['inputStudentID'];
$deg=$_SESSION['deg_prog_code'];
//----------------------------------------------------------
//verifies if the voters ID and password are carried to this file
//----------------------------------------------------------
echo "verifying the student_ID in student_info ";
echo $var1;
echo "<br/>";
//Connect to the database
//-------------------------------------------------
mysql_connect("localhost", "root", "")
or die(mysql_error());
//-------------------------------------------------
//Select Database
//-------------------------------------------------
mysql_select_db("elecom")
or die(mysql_error());
//-------------------------------------------------
//----------------------------------------------------------
//this the where voters chosen candidate will be placed
//----------------------------------------------------------
echo "<br/>";
echo "<br/>";
echo "the Voters Results";
echo "<br/>";
echo "<br/>";
echo $pres=$_POST['CampPresVar'];
echo "<br/>";
echo $LA=$_POST['LegAsemblVar'];
echo"<br/>";
echo $Batch=$_POST['ColRepVar'];
echo"<br />";
mysql_query("
INSERT INTO `tally` (student_id, candidate_fname) VALUES
( '" . $var1 . "' , '" . $pres ."' ),
( '" . $var1 . "' , '" . $LA ."' ),
( '" . $var1 . "' , '" . $Batch ."' );
");
mysql_query("
UPDATE student_info
SET is_enrolled = 'N'
WHERE student_id = '" . $var1 . "'
AND is_enrolled = 'Y'
");
session_destroy();
header('location:index.php');
exit();
//----------------------------------------------------------
?>