-
Notifications
You must be signed in to change notification settings - Fork 0
/
myprofile.php
executable file
·99 lines (89 loc) · 2.33 KB
/
myprofile.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
<?php
/*
Copyright © 2009,2015,2022 Siggi Bjarnason.
Licensed under GNU GPL v3 and later. Check out LICENSE.TXT for details
or see <https://www.gnu.org/licenses/gpl-3.0-standalone.html>
Main profile page that gives an overview over your profile
*/
require("header.php");
$strUserID = $_SESSION["UID"];
printPg("My Profile","h1");
$strQuery = "select * from tblUsers where iUserID = $strUserID;";
$QueryData = QuerySQL($strQuery);
if($QueryData[0] > 0)
{
foreach($QueryData[1] as $Row)
{
$strName = $Row["vcName"];
$strAddr1 = $Row["vcAddr1"];
$strAddr2 = $Row["vcAddr2"];
$strCity = $Row["vcCity"];
$strState = $Row["vcState"];
$strZip = $Row["vcZip"];
$strCountry = $Row["vcCountry"];
$strEmail = $Row["vcEmail"];
$strCell = $Row["vcCell"];
$iPrivLevel = $Row["iPrivLevel"];
$strLastLogin = $Row["dtLastLogin"];
}
}
else
{
if($QueryData[0] == 0)
{
$strName = "User with ID of $strUserID not found";
$strAddr1 = "";
$strAddr2 = "";
$strCity = "";
$strState = "";
$strZip = "";
$strCountry = "";
$strEmail = "";
$strCell = "";
$iPrivLevel = "";
$strLastLogin = "";
}
else
{
$strMsg = Array2String($QueryData[1]);
error_log("Query of $strQuery did not return data. Rowcount: $QueryData[0] Msg:$strMsg");
printPg("$ErrMsg","error");
}
}
print "<div class=\"MainTextCenter\">\n";
print "RegistrationID: $strUserID<br>\n";
print "$strName<br>\n";
if($strAddr1 != "")
{
print "$strAddr1<br>\n";
}
if($strAddr2 != "")
{
print "$strAddr2<br>\n";
}
if($strCity != "")
{
print "$strCity, $strState $strZip <br>\n";
}
print "$strCountry<br>\n";
print "$strEmail<br>\n";
print "$strCell<br>\n";
$strQuery = "SELECT vcPrivName FROM tblprivlevels where iPrivLevel = $iPrivLevel;";
$PrivName = GetSQLValue($strQuery);
if($PrivName == "" or $PrivName == 0)
{
$PrivName = $iPrivLevel;
}
print "Authorization level is set to $PrivName<br>\n";
if($strLastLogin)
{
$LastLogin = "on " . date('l F jS Y \a\t G:i',strtotime($strLastLogin));
}
else
{
$LastLogin = "never";
}
print "Last logged in $LastLogin";
print "</div>";
require("footer.php");
?>