-
Notifications
You must be signed in to change notification settings - Fork 0
/
reglist.php
145 lines (128 loc) · 4.43 KB
/
reglist.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
<?php
require_once('module-config.php');
require_once('module-sql-connect.php');
require_once('module-date-func.php');
function EncodeCSVField($string) {
if(strpos($string, ',') !== false || strpos($string, '"') !== false || strpos($string, "\n") !== false)
{
$string = '"' . str_replace('"', '""', $string) . '"';
}
return $string;
}
?>
<?php
if(isset($_POST['password']))
{
if($_POST['password']=='jT12.jolu38')
{
//access
header("Content-type: application/csv");
header("Content-Disposition: attachment; filename=t2j_copy_of_regd_list.csv");
header("Pragma: no-cache");
header("Expires: 0");
echo "Registration #,";
echo "Firstname,";
echo "Lastname,";
echo "College Nickname,";
echo "Year of Passing,";
echo "Department,";
echo "Date of Birth,";
echo "Gender,";
echo "Present City,";
echo "Present Country,";
echo "Contact Address,";
echo "Primary Email,";
echo "Secondary Email,";
echo "Phone 1,";
echo "Phone 2,";
echo "Present Industry,";
echo "Companies Worked";
echo "\n";
$tbl_name=__SQL_TABLE_PREFIX__ . "alumreg";
$sql_query="SELECT * FROM $tbl_name";
$query_result=mysql_query($sql_query);
while($row=mysql_fetch_array($query_result))
{
$aid = stripslashes($row['aid']);
$firstname = stripslashes($row['firstname']);
$lastname = stripslashes($row['lastname']);
$collegenick = stripslashes($row['collegenick']);
$yearofpassing = stripslashes($row['yearofpassing']);
$department = stripslashes($row['department']);
$dob = stripslashes($row['dob']);
$gender = stripslashes($row['gender']);
$presentcity = stripslashes($row['presentcity']);
$presentcountry = stripslashes($row['presentcountry']);
$contactaddress = stripslashes($row['contactaddress']);
$email1 = stripslashes($row['email1']);
$email2 = stripslashes($row['email2']);
$phone1 = stripslashes($row['phone1']);
$phone2 = stripslashes($row['phone2']);
$presentindustry = stripslashes($row['presentindustry']);
echo EncodeCSVField($aid) . ",";
echo EncodeCSVField($firstname) . ",";
echo EncodeCSVField($lastname) . ",";
echo EncodeCSVField($collegenick) . ",";
echo EncodeCSVField($yearofpassing) . ",";
echo EncodeCSVField($department) . ",";
echo EncodeCSVField(date_ip_to_op($dob,"n")) . ",";
echo EncodeCSVField($gender) . ",";
echo EncodeCSVField($presentcity) . ",";
echo EncodeCSVField($presentcountry) . ",";
echo EncodeCSVField($contactaddress) . ",";
echo EncodeCSVField($email1) . ",";
echo EncodeCSVField($email2) . ",";
echo EncodeCSVField($phone1) . ",";
echo EncodeCSVField($phone2) . ",";
echo EncodeCSVField($presentindustry) . ",";
$tbl_name2=__SQL_TABLE_PREFIX__ . "alumcompanies";
$sql_query2="SELECT * FROM $tbl_name2 WHERE alumemail1='$email1'";
$query_result2=mysql_query($sql_query2);
$clist="";
while($row2=mysql_fetch_array($query_result2))
{
$cname = stripslashes($row2['companyname']);
$wfrom = stripslashes($row2['workedfrom']);
$wto = stripslashes($row2['workedto']);
$clist = $clist . $cname . " (" . $wfrom . " - " . $wto . ")\n";
}
echo EncodeCSVField($clist);
echo "\n";
}
mysql_close($con);
?>
<?php
}
else
{
?>
<html>
<head><title>Tribute 2 Jolu :: Registered List</title></head>
<body>
<form method="post" action="reglist.php">
Password:
<input name="password" type="password" value="" maxlength="32" size="30" />
<input type="submit" value="Enter" />
</form>
<code style="color: #f00">WRONG PASSWORD!</code>
</body>
</html>
<?php
}
}
else
{
?>
<html>
<head><title>Tribute 2 Jolu :: Registered List</title></head>
<body>
<form method="post" action="reglist.php">
Password:
<input name="password" type="password" value="" maxlength="32" size="30" />
<input type="submit" value="Enter" />
</form>
</body>
</html>
<?php
}
?>