-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.php
112 lines (101 loc) · 4.64 KB
/
profile.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
<?php
require_once '../utils/dbConfig.php';
require_once '../utils/auth.php';
$title = "Artefact | PROFILE";
$query = $db->prepare('SELECT * FROM users WHERE email= ?');
$query->execute([$_SESSION['edu-artefact']['user']['email']]);
$user = $query->fetch();
$favorites = $db->prepare('SELECT * FROM favorite WHERE userId= ?');
$favorites->execute([$user['id']]);
$courses = $db->prepare('SELECT * FROM courses WHERE id= ?');
require_once 'elements/header.php' ?>
<!-- ##### Breadcumb Area Start ##### -->
<div class="breadcumb-area bg-img" style="background-image: url(img/bg-img/breadcumb.jpg);">
<div class="bradcumbContent">
<h2>Profile</h2>
</div>
</div>
<!-- ##### Breadcumb Area End ##### -->
<!-- ##### Register Area Start ##### -->
<div class="blog-area mt-50 section-padding-100">
<!--================Login Box Area =================-->
<section class="login_box_area section_gap">
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="pt-2 login_form_inner">
<img class="rounded-circle pb-2 pr-5 pl-5 pt-2 w-75" src="img/profile/<?= $_SESSION['edu-artefact']['user']['profileImage'] ?>" alt="">
<div class="w-100 row p-2 ml-0">
<div class="col-12">
<h6><?= $_SESSION['edu-artefact']['user']['name'] ?></h6>
</div>
<div class="col-12">
<h7 class="badge badge-primary"><?= $_SESSION['edu-artefact']['user']['email'] ?></h7>
</div>
</div>
</div>
</div>
<div class="col-md-8">
<div class="p-2 login_form_inner">
<!--------------------============ Tab =============------------>
<div class="academy-tabs-content">
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active show" id="tab--1" data-toggle="tab" href="#tab1" role="tab" aria-controls="tab1" aria-selected="true">Your informations</a>
</li>
<li class="nav-item">
<a class="nav-link" id="tab--2" data-toggle="tab" href="#tab2" role="tab" aria-controls="tab2" aria-selected="false">Your courses</a>
</li>
<li class="nav-item">
<a class="nav-link" id="tab--3" data-toggle="tab" href="#tab3" role="tab" aria-controls="tab3" aria-selected="false">Edit</a>
</li>
</ul>
<div class="tab-content mb-100" id="myTabContent">
<div class="tab-pane fade active show" id="tab1" role="tabpanel" aria-labelledby="tab--1">
<div class="academy-tab-content">
<!-- Tab Text -->
<div class="academy-tab-text">
<ul class="list-group">
<li class="list-group-item text-left"><span class="badge badge-primary font-weight-bold p-2">Name</span> <span class="ml-2"><?= $user['name'] ?></span></li>
<li class="list-group-item text-left"><span class="badge badge-primary font-weight-bold p-2">Email</span> <span class="ml-2"><?= $user['email'] ?></span></li>
<li class="list-group-item text-left"><span class="badge badge-primary font-weight-bold p-2">Language</span> <span class="ml-2"><?= $user['language'] ?></span></li>
<li class="list-group-item text-left"><span class="badge badge-primary font-weight-bold p-2">Tel</span> <span class="ml-2"><?= $user['telephone'] ?></span></li>
<li class="list-group-item text-left"><span class="badge badge-primary font-weight-bold p-2">Country</span> <span class="ml-2"><?= $user['country'] ?></span></li>
</ul>
</div>
</div>
</div>
<div class="tab-pane fade" id="tab2" role="tabpanel" aria-labelledby="tab--2">
<div class="academy-tab-content">
<!-- Tab Text -->
<div class="academy-tab-text">
<ul class="list-group list-group-flush">
<?php foreach ($favorites as $favorite) :
$courses->execute([$favorite['courseId']]);
$cour = $courses->fetch(); ?>
<a href="corses.php?id=<?= $cour['id'] ?>" class="list-group-item list-group-item-action text-left"><?= $cour['title'] ?></a>
<?php endforeach ?>
</ul>
</div>
</div>
</div>
<div class="tab-pane fade" id="tab3" role="tabpanel" aria-labelledby="tab--3">
<div class="academy-tab-content">
<!-- Tab Text -->
<div class="academy-tab-text">
<p>3</p>
</div>
</div>
</div>
</div>
</div>
<!--------------------============== End Tab ==============------------>
</div>
</div>
</div>
</div>
</section>
<!--================End Login Box Area =================-->
</div>
<!-- ##### Blog Area End ##### -->
<?php require 'elements/footer.php' ?>