-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofile.pro.php
More file actions
193 lines (178 loc) · 6.62 KB
/
profile.pro.php
File metadata and controls
193 lines (178 loc) · 6.62 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
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<?php
session_start();
if (array_key_exists("user", $_SESSION)) {
//add the header
include("./layouts/header.php");
//add the database manager
require_once('./mydb/databaseManager/DBEnter.db.php');
//CP = client profile. also this is gathering all the info for the profile
$CP = DB::queryFirstRow("SELECT displayName, UIMG, web, social, postNo FROM clientProfile WHERE CDID = ".$_SESSION['cdid']);
if ($CP != NULL) {
//DN = display name
$DN = $CP['displayName'];
$uimg = $CP['UIMG'];
$web = $CP['web'];
$social = $CP['social'];
$postNo = $CP['postNo'];
?>
<script>
$(document).ready(function () {
const btnActivity = $("#btnActivity");
const btnAboutMe = $("#btnAboutMe");
const btnEditProfile = $("#btnEditProfile");
const load = $('#load');
load.load("./mydb/profile/profileShower/activity.db.show.php");
btnActivity.click(function () {
btnActivity.addClass("btn-primary");
btnActivity.removeClass("btn-outline-primary");
btnAboutMe.removeClass("btn-primary");
btnAboutMe.addClass("btn-outline-primary");
btnEditProfile.removeClass("btn-primary");
btnEditProfile.addClass("btn-outline-primary");
load.load("./mydb/profile/profileShower/activity.db.show.php");
});
btnAboutMe.click(function () {
btnActivity.removeClass("btn-primary");
btnActivity.addClass("btn-outline-primary");
btnAboutMe.addClass("btn-primary");
btnAboutMe.removeClass("btn-outline-primary");
btnEditProfile.removeClass("btn-primary");
btnActivity.addClass("btn-outline-primary");
load.load("./mydb/profile/profileShower/aboutMe.db.show.php");
});
btnEditProfile.click(function () {
btnActivity.removeClass("btn-primary");
btnActivity.addClass("btn-outline-primary");
btnAboutMe.removeClass("btn-primary");
btnAboutMe.addClass("btn-outline-primary");
btnEditProfile.addClass("btn-primary");
btnEditProfile.removeClass("btn-outline-primary");
load.load("./mydb/profile/profileShower/editProfile.db.show.php");
});
});
</script>
<!-- Profile Section of the page -->
<section class="container">
<br>
<!-- Profile Left and Right-->
<div class="row">
<div class="col-sm-3" style="background-color: darkgray;"><!-- Left side start -->
<br>
<!-- user profile img -->
<div class="text-center" style=" padding: 5px;">
<img src="<?php if (!empty($uimg)) {
echo "./img/profileIMG/" . $uimg;
} else {
echo "./img/Flat%20Gradient%20Social%20Media%20Icons/80/500px%20icon.png";
} ?>" style="width: 200px; height: 200px; " class="img-fluid rounded" alt="avatar">
</div>
<br>
<!-- profile social media pages -->
<table class="table">
<thead class="thead-dark">
<th scope="col">Websites</th>
</thead>
<tbody>
<tr>
<td>
<?php
if ($web == null) {
?><p><strong>no website yet</strong></p><?php
} else {
?><a target="_blank" href="http://<?php echo $web; ?>"><?php echo $web; ?></a><?php
}
?>
</td>
</tr>
</tbody>
</table>
<!-- basic reputation table -->
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">Activity</th>
<th scope="col"></th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Shares</strong></td>
<td></td>
<td>0</td>
</tr>
<tr>
<td><strong>Reputation</strong></td>
<td></td>
<td>0</td>
</tr>
<tr>
<td><strong>Posts</strong></td>
<td></td>
<td><?php if ($postNo == null) {
echo 0;
} else {
echo $postNo;
} ?></td>
</tr>
<tr>
<td><strong>Followers</strong></td>
<td></td>
<td>0</td>
</tr>
</tbody>
</table>
<!-- profile external social platforms -->
<table class="table">
<thead class="thead-dark">
<th scope="col">Social Media</th>
</thead>
<tbody>
<tr>
<td>
<?php
if ($social == null) {
?><p><strong>No link</strong></p><?php
} else {
?><a target="_blank" href="http://<?php echo $social; ?>"><?php echo $social; ?></a><?php
}
?>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Left Col End-->
<br>
<!-- Right Col Start -->
<div class="col-sm-9" style="background-color: lightgray;">
<!-- Button Selection for Activity About Me and Edit profile-->
<div class="row container" style="padding-top: 10px;">
<button id="btnActivity" class="btn btn-primary" style="">Activity</button>
<button id="btnAboutMe" class="btn btn-outline-primary" style="">About Me</button>
<button id="btnEditProfile" class="btn btn-outline-primary" style="">Edit Profile</button>
</div>
<!-- The Three different sections of the profile -->
<section id="load">
<!-- documents will be loaded here -->
</section>
</div><!-- Right Col End -->
</div>
</section>
<br>
<script
src="https://code.jquery.com/jquery-3.4.0.min.js"
integrity="sha256-BJeo0qm959uMBGb65z40ejJYGSgR7REI4+CW1fNKwOg="
crossorigin="anonymous">
</script>
<?php
} else {
echo "something went wrong with client profile search<br>";
echo DB::affectedRows();
}
include("./layouts/footer.php");
}else{
header('location: index.php?pageaccess=forbidden');
exit;
}
?>