parent
ec70d42970
commit
0b6b0ce29d
@ -0,0 +1,49 @@ |
|||||||
|
<?php |
||||||
|
/* For licensing terms, see /license.txt */ |
||||||
|
/** |
||||||
|
* Skills reporting |
||||||
|
* @package chamilo.reporting |
||||||
|
*/ |
||||||
|
require_once '../inc/global.inc.php'; |
||||||
|
|
||||||
|
if (!api_is_student()) { |
||||||
|
api_not_allowed(); |
||||||
|
} |
||||||
|
|
||||||
|
$this_section = SECTION_TRACKING; |
||||||
|
|
||||||
|
$toolName = get_lang('Skills'); |
||||||
|
|
||||||
|
$tableRows = array(); |
||||||
|
|
||||||
|
$objSkill = new Skill(); |
||||||
|
|
||||||
|
$objSkillRelUser = new SkillRelUser(); |
||||||
|
$userSkills = $objSkillRelUser->get_all(array( |
||||||
|
'where' => array( |
||||||
|
'user_id = ?' => api_get_user_id() |
||||||
|
) |
||||||
|
)); |
||||||
|
|
||||||
|
foreach ($userSkills as $achievedSkill) { |
||||||
|
$skill = $objSkill->get($achievedSkill['skill_id']); |
||||||
|
$course = api_get_course_info_by_id($achievedSkill['course_id']); |
||||||
|
|
||||||
|
$tableRows[] = array( |
||||||
|
'skillName' => $skill['name'], |
||||||
|
'achievedAt' => api_format_date($achievedSkill['acquired_skill_at'], DATE_FORMAT_NUMBER), |
||||||
|
'courseImage' => $course['course_image'], |
||||||
|
'courseName' => $course['name'] |
||||||
|
); |
||||||
|
} |
||||||
|
|
||||||
|
/* |
||||||
|
* View |
||||||
|
*/ |
||||||
|
$tpl = new Template($toolName); |
||||||
|
|
||||||
|
$tpl->assign('rows', $tableRows); |
||||||
|
|
||||||
|
$contentTemplate = $tpl->get_template('auth/skills.tpl'); |
||||||
|
|
||||||
|
$tpl->display($contentTemplate); |
||||||
@ -0,0 +1,38 @@ |
|||||||
|
{% extends "default/layout/main.tpl" %} |
||||||
|
|
||||||
|
{% block body %} |
||||||
|
<div class="span12"> |
||||||
|
<div class="actions"> |
||||||
|
<a href="{{ _p.web_main }}auth/my_progress.php"> |
||||||
|
<img src="{{ _p.web_img }}icons/32/stats.png" alt='{{ 'MyProgress' | get_lang }}' title="Ver mis estadísticas"> |
||||||
|
</a> |
||||||
|
</div> |
||||||
|
|
||||||
|
<h1 class="page-header">{{ 'SkillsAcquired' | get_lang }}</h1> |
||||||
|
|
||||||
|
{% if rows %} |
||||||
|
<table class="table"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th>{{ 'Skill' | get_lang }}</th> |
||||||
|
<th>{{ 'Date' | get_lang }}</th> |
||||||
|
<th>{{ 'Course' | get_lang }}</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
{% for row in rows %} |
||||||
|
<tr> |
||||||
|
<td>{{ row.skillName }}</td> |
||||||
|
<td>{{ row.achievedAt }}</td> |
||||||
|
<td><img src="{{ row.courseImage }}" alt="{{ row.courseName }}" width="64"> {{ row.courseName }}</td> |
||||||
|
</tr> |
||||||
|
{% endfor %} |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
{% else %} |
||||||
|
<div class="alert alert-info"> |
||||||
|
{{ 'NoResults' | get_lang }} |
||||||
|
</div> |
||||||
|
{% endif %} |
||||||
|
</div> |
||||||
|
{% endblock %} |
||||||
Loading…
Reference in new issue