Skip to content

Commit

Permalink
final version v2
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzaib78631 committed Feb 12, 2020
1 parent 6f1d456 commit c74cf47
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/controllers/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ public function process($params)

$profileManager = new ProfileModel;
$dashboardManager = new DashboardModel;
$programmingManager = new ProgrammingModel;

$this->data['profile'] = $dashboardManager->getUserData($_GET['id']);

$this->data['langs'] = $programmingManager->getUserLanguagesCards($_GET['id']);

$this->view = 'profile';
}
}
Expand Down
5 changes: 5 additions & 0 deletions app/models/ProgrammingModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ public function getLanguagesInfo(){
$query = Db::queryAll($sql, array());
return $query;
}

public function getUserLanguagesCards($user_id){
$sql = 'SELECT langs.name as `name`,logo, proficiency FROM langs INNER JOIN languages ON languages.name = langs.name AND u_id = ? ';
return Db::queryAll($sql, array($user_id));
}
}


Expand Down
39 changes: 39 additions & 0 deletions app/views/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,45 @@ <h4>Roll No</h4>
</div>
</div>
</div>

<!-- Languages -->
<section id="languages" class="pb-5" style="margin-top: -200px;">
<div class="container">
<h5 class="section-title h1">Programming Languages</h5>
<div class="row">
<?php if (is_array($langs)) {
foreach ($langs as $lang) : ?>
<!-- Programming Language -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1">
<?=$lang['name']?>
</div>
<td class="text-center">
<?php
if($lang['proficiency'] == 1)
echo '<h5><span class="badge badge-text-white" style=" background-color: #8bc34a">Beginner</span></h5>';
else if ($lang['proficiency'] == 2)
echo '<h5><span class="badge badge-text-white" style=" background-color: #00bcd4">Journeyman</span></h5>';
else
echo '<h5><span class="badge badge-text-white" style=" background-color: #ea5c68">Expert</span></h5>';
?>
</div>
<div class="col">
<?=$lang['logo'];?>
</div>
</div>
</div>
</div>
</div>
<!-- ./Programming Language -->
<?php endforeach; }?>
</div>
</div>
</section>
</main>

<?php include('include/scripts.html'); ?>
Expand Down
2 changes: 1 addition & 1 deletion app/views/students.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<main>

<div class="container my-4">

<h5 class="section-title h1"><?= "Langauge: " . strtoupper($_GET['card']) ?></h5>
<div class="row">
<div class="col card" style="margin: 10px;">
<div id="piechart"></div>
Expand Down

0 comments on commit c74cf47

Please sign in to comment.