本文整理汇总了PHP中Skill::user_has_skill方法的典型用法代码示例。如果您正苦于以下问题:PHP Skill::user_has_skill方法的具体用法?PHP Skill::user_has_skill怎么用?PHP Skill::user_has_skill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skill
的用法示例。
在下文中一共展示了Skill::user_has_skill方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: json_encode
<?php
/* For licensing terms, see /license.txt */
/**
* Show information about a new assertion
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
* @package chamilo.badge
*/
header('Content-Type: application/json');
require_once '../inc/global.inc.php';
$userId = isset($_GET['user']) ? intval($_GET['user']) : 0;
$skillId = isset($_GET['skill']) ? intval($_GET['skill']) : 0;
$courseId = isset($_GET['course']) ? intval($_GET['course']) : 0;
$sessionId = isset($_GET['session']) ? intval($_GET['session']) : 0;
if ($userId === 0 || $skillId === 0) {
exit;
}
$objSkill = new Skill();
if (!$objSkill->user_has_skill($userId, $skillId, $courseId, $sessionId)) {
exit;
}
$objSkillRelUser = new SkillRelUser();
$userSkill = $objSkillRelUser->getByUserAndSkill($userId, $skillId, $courseId, $sessionId);
if ($userSkill == false) {
exit;
}
$user = api_get_user_info($userSkill['user_id']);
$json = array('uid' => $userSkill['id'], 'recipient' => array('type' => 'email', 'hashed' => false, 'identity' => $user['email']), 'issuedOn' => strtotime($userSkill['acquired_skill_at']), 'badge' => api_get_path(WEB_CODE_PATH) . "badge/class.php?id={$skillId}", 'verify' => array('type' => 'hosted', 'url' => api_get_path(WEB_CODE_PATH) . "badge/assertion.php?" . http_build_query(array('user' => $userId, 'skill' => $skillId, 'course' => $courseId, 'session' => $sessionId))));
echo json_encode($json);