This repository was archived by the owner on Aug 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditChannelRewritten.php
More file actions
225 lines (163 loc) · 5.07 KB
/
Copy patheditChannelRewritten.php
File metadata and controls
225 lines (163 loc) · 5.07 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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<?php
include_once("header2.php");
include_once("includes/classes/ProfileData.php");
?>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="column article animated slideInUp">
<?php
class editChannel {
private $con, $userLoggedInObj, $profileData;
public function __construct($con, $userLoggedInObj, $profileUsername) {
$this->con = $con;
$this->userLoggedInObj = $userLoggedInObj;
$this->profileData = new ProfileData($con, $profileUsername);
}
public function create() {
$profileUsername = $_SESSION["userLoggedIn"];
if(!$this->profileData->userExists()) {
return "<script> alert('Login to your account to access the feature'); </script>";
}
$coverPhotoSection = $this->createCoverPhotoSection();
$profilePictureSection = $this->createHeaderSection();
return "<div class='profileContainer'>
$coverPhotoSection
$profilePictureSection
</div>";
}
public function createCoverPhotoSection() {
$banner = $this->profileData->getCoverPhoto();
$html = "<p>Present Cover Photo</p>
<img class='coverPhoto' width='1000px' height='500px' src='$banner'>";
return $html;
}
public function createHeaderSection() {
$profilePic = $this->profileData->getProfilePic();
$background = $this->profileData->getBackground();
$html = "<p>Present Profile Picture</p>
<img class='profilePicture' src='$profilePic'>
<br><br>
<p>Your Channel background</p>
<img class='backgroundImage' width='1000px' height='500px' src='$background'>";
return $html;
}
public function createAboutSection() {
$aboutDescription = $this->profileData->getAboutText();
$html = "<p>Your About Section</p>
<h5>$aboutDescription</h5>";
return $html;
}
public function createCountrySection() {
$country = $this->profileData->getCountry();
$html = "<p>Your Channel Country</p>
<h5>$country</h5>";
return $html;
}
public function createLinksSection() {
$links = $this->profileData->getLinks();
$html = "<p>Your Links</p>
<h5>$links</h5>";
return $html;
}
public function createBackgroundSection() {
}
}
?>
<h1>Edit Channel Details</h1>
<p>You can edit your channel details by clicking the button on the section you want!</p>
<hr>
<h3>Upload Profile Picture</h3>
<p>Upload Profile, by clicking the Edit Profile Picture Button</p>
<hr>
<button onclick="window.location.href = 'profilePicture.php';">Edit Profile Picture</button>
<br>
<?php
// Display Page
if(isset($_GET["username"])) {
$profileUsername = $_SESSION["userLoggedIn"];
}
else {
echo "Channel not found";
exit();
}
$profileGenerator = new editChannel($con, $userLoggedInObj, $profileUsername);
echo $profileGenerator->createHeaderSection();
?>
<br>
<button onclick="window.location.href = 'channelBackground.php';">Edit Channel Background</button>
<h3>Upload Banner Image</h3>
<p>Upload Banner, by clicking the Banner Picture button</p>
<hr>
<button onclick="window.location.href = 'bannerPicture.php';">Edit Banner Picture</button>
<br>
<?php
// Display Page
if(isset($_GET["username"])) {
$profileUsername = $_SESSION["userLoggedIn"];
}
else {
echo "Channel not found";
exit();
}
$profileGenerator = new editChannel($con, $userLoggedInObj, $profileUsername);
echo $profileGenerator->createCoverPhotoSection();
?>
<br><br><br>
<h3>Change Channel Description</h3>
<p>Change Channel Description by clicking the Edit Channel Descrption Button</p>
<hr>
<button onclick="window.location.href = 'channelDescription.php';">Edit Channel Description</button>
<br>
<?php
// Display Page
if(isset($_GET["username"])) {
$profileUsername = $_SESSION["userLoggedIn"];
}
else {
echo "Channel not found";
exit();
}
$profileGenerator = new editChannel($con, $userLoggedInObj, $profileUsername);
echo $profileGenerator->createAboutSection();
?>
<br>
<h3>Update User's Region / Country</h3>
<p>Update Region, by clicking the Edit Country button</p>
<hr>
<button onclick="window.location.href = 'country.php';">Edit Country</button>
<br>
<?php
// Display Page
if(isset($_GET["username"])) {
$profileUsername = $_SESSION["userLoggedIn"];
}
else {
echo "Channel not found";
exit();
}
$profileGenerator = new editChannel($con, $userLoggedInObj, $profileUsername);
echo $profileGenerator->createCountrySection();
?>
<br>
<h3>Update Links</h3>
<p>Update Links, by clicking the Edit Links button</p>
<hr>
<button onclick="window.location.href = 'addLinks.php';">Edit Links</button>
<br>
<?php
// Display Page
if(isset($_GET["username"])) {
$profileUsername = $_SESSION["userLoggedIn"];
}
else {
echo "Channel not found";
exit();
}
$profileGenerator = new editChannel($con, $userLoggedInObj, $profileUsername);
echo $profileGenerator->createLinksSection();
?>
</body>
</html>