-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofile-settings.php
More file actions
79 lines (57 loc) · 2.71 KB
/
profile-settings.php
File metadata and controls
79 lines (57 loc) · 2.71 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
<?php
include './system.php';
include './database.php';
System::sessionStart();
System::setContentTitle("Настройки на профила");
System::getPageHeader();
System::setTimeZone("Europe/Sofia");
if (isset($_SESSION['isLogged']) === true) {
Database::setDatabaseConnection();
$userID = $_SESSION['userInfo']['id'];
$query = 'SELECT specialty, faculty, course, profile_picture FROM user_info WHERE user_id = '.$userID.';';
$infoDataQuery = Database::runQuery(Database::getDatabaseConnection(), $query);
//$outputData = mysqli_fetch_assoc($infoDataQuery);
if (Database::getRowNumber($infoDataQuery) == 0) { //mysqli_num_rows($infoDataQuery)
echo '<p>Все още не си задал информация.</p>';
?>
<form action="profile-settings.php" method="POST">
<input type="hidden" name="formSubmit" value="1" />
<input type="submit" name="submit" value="Направи промени" />
</form>
<?php
} else {
if (isset($_POST['formSubmit']) == 1) {
echo 'must be submited'; //run update query - echo success
} else {
$outputData = Database::fetchAssoc($infoDataQuery); //$outputData = mysqli_fetch_assoc($infoDataQuery);
$userAgent = System::getUserAgent();
$platform = System::getUserPlatform($userAgent);
$browser = System::getUserBrowser($userAgent);
echo '
<div class="panel panel-default"> <!--primary-->
<!--<div class="panel-heading"><strong></strong></div>-->
<div class="panel-body">
<div style="width: 130px; text-align: center; position: relative; float: left;">
<div><img class="img-thumbnail" alt="" data-src="" style="width: 130px; height: 130px;" src="'.$outputData['profile_picture'].'" data-holder-rendered="true"></div>
<!--<div style="margin-top: 10px; font-weight: bold; color: #0066ff;"></div>-->
</div>
<div style="width: 975px; position: relative; float: left;">
<div style="padding-left: 30px;"><br /><a target="_blank" href=""></a></div>
<!--<div style="margin-top: 40px; text-align: right;"><p>Публикувано на: <span style="color: #0066ff;"></span></p></div>-->
</div>
</div>
'.$platform.$browser.'
</div>';
?>
<form action="profile-settings.php" method="POST" class="form-inline">
<input type="hidden" name="formSubmit" value="1" />
<!--<input type="submit" name="submit" value="Направи промени" />-->
<button type="submit" name="submit" class="btn btn-success"><span class="glyphicon glyphicon-floppy-disk"></span> Направи промени</button>
</form>
</div>
<?php
}
}
} else {
}
System::getPageFooter();