/
viewUser.php
168 lines (150 loc) · 5.1 KB
/
viewUser.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?php
require("includes/mysql_database_connection.php");
require("includes/projects_management_function.php");
include("includes/cv_management_function.php");
include("includes/profile_management_function.php");
include("includes/session.php");
include("includes/util.php");
redirectToHTTPS();
if (isset($_GET['selectedSearchedUsername'])) {
$searchedUsername = urldecode($_GET['selectedSearchedUsername']);
if (hasProfileDetailsByUsername($searchedUsername)) {
$userProfilePicturePath = getProfilePicturePathByUsername($searchedUsername);
$selectedUserProfileDetails = getProfileDetailsByUsername($searchedUsername);
$selectedUserEmail = $selectedUserProfileDetails["email"];
$selectedUserFirstName = $selectedUserProfileDetails["first_name"];
$selectedUserLastName = $selectedUserProfileDetails["last_name"];
$selectedUserGender = $selectedUserProfileDetails["gender"];
$selectedUserAddress1 = $selectedUserProfileDetails["address_line1"];
if(isset($userProfileDetails["address_line2"])){
$selectedUserAddress2 = $userProfileDetails["address_line2"] ;
}else{
$selectedUserAddress2 = "" ;
}
$selectedUserCountry = $selectedUserProfileDetails["country"];
if(isset($userProfileDetails["contact_number"])){
$selectedUserContactNumber =$userProfileDetails["contact_number"] ;
}else{
$selectedUserContactNumber = "" ;
}
$cvFilePath = getCVPathByUsername($searchedUsername);
$projectArray = getProjectsListByUsername($searchedUsername);
} else {
redirect_to("search");
}
if(isset($connection)){
mysql_close($connection);
}
} else {
redirect_to("search");
}
?>
<head>
<title>Be Linked! View user</title>
<link rel="stylesheet" href="css/layout.css" type="text/css">
<link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body >
<table width="100%" >
<tr>
<td width="100%">
<div class="headerImage"><?php require_once("headerImage.php"); ?> </div>
</td>
</tr>
<tr>
<td width="100%">
<div class="siteMenu"><?php require_once("siteMenu.php"); ?> </div>
</td>
</tr>
<tr>
<td width="100%">
<div class="viewUser">
<table border="0" cellpadding="2" class="fontOnly">
<tr>
<td><img width="120" height="120" src="<?php echo $userProfilePicturePath ?>" /></td>
</tr>
<tr>
<td>Username </td>
<td> <?php echo $searchedUsername ?></td>
</tr>
<tr>
<td>Email </td>
<td> <?php echo $selectedUserEmail ?></td>
</tr>
<tr>
<td>First name </td>
<td> <?php echo $selectedUserFirstName ?></td>
</tr>
<tr>
<td>Last name </td>
<td> <?php echo $selectedUserLastName ?></td>
</tr>
<tr>
<td>Gender </td>
<td> <?php echo $selectedUserGender ?></td>
</tr>
<tr>
<td>Address </td>
<td>
<?php echo $selectedUserAddress1 ?><br>
<?php echo $selectedUserAddress2 ?>
</td>
</tr>
<tr>
<td>Country </td>
<td> <?php echo $selectedUserCountry ?></td>
</tr>
<tr>
<td>Contact number </td>
<td><?php if ($selectedUserContactNumber == "") { ?>
Not Set
<?php } else { ?>
<?php echo $selectedUserContactNumber ?>
<?php } ?>
</td>
</tr>
<tr>
<td>CV information :</td>
<td>
<?php if (isset($cvFilePath)) { ?>
<br><a href="<?php echo $cvFilePath ?>" class="search" target="_blank"><u>Download / Show CV</u></a> (CV can be checked online on Opera and Google Chrome web browsers) <br/><br/>
<?php } else { ?>
Not has been uploaded yet.
<?php } ?>
</td>
</tr>
<tr>
<td>Project information :</td>
<td>
<table id="projectsTable" border="1" class="fontOnly" style='table-layout:fixed' width="100%" >
<col width=25%>
<col width=55%>
<col width=20%>
<?php
if(count($projectArray) > 0){
foreach($projectArray as $project){ ?>
<tr>
<td>
<b><?php echo $project["project_file_title"]; ?></b>
</td>
<td width="35%" align="center" style="overflow:hidden;" >
<div style="overflow:scroll"> <?php echo htmlentities($project["project_description"]); ?> </div>
</td>
<td>
<a href="<?php echo $project["project_file_path"] ?>" class="search" target="_blank"><u>Download Project</u></a>
</td>
</tr>
<?php } ?>
<?php }else{ ?>
No projects have been uploaded yet.
<?php } ?>
</table>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</body>
</html>