46 lines
1.1 KiB
PHP
46 lines
1.1 KiB
PHP
|
|
<?php
|
||
|
|
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
|
||
|
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||
|
|
header("Pragma: no-cache");
|
||
|
|
|
||
|
|
require_once "../config.php";
|
||
|
|
|
||
|
|
$catid = $_GET['idcat'];
|
||
|
|
$numEmpl = $_GET['numEmpl'];
|
||
|
|
$sql = "
|
||
|
|
SELECT
|
||
|
|
categoria.id as idcat,
|
||
|
|
categoria.nombre as categoria,
|
||
|
|
scormpkg.id as idrecurso,
|
||
|
|
scormpkg.nombre as recurso,
|
||
|
|
scormvars.numempl,
|
||
|
|
scormvars.varName,
|
||
|
|
scormvars.varValue,
|
||
|
|
scormvars.fecha
|
||
|
|
FROM
|
||
|
|
categoria
|
||
|
|
INNER JOIN scormpkg ON categoria.id = scormpkg.idcategoria
|
||
|
|
INNER JOIN scormvars ON scormpkg.id = scormvars.SCOInstanceID
|
||
|
|
WHERE scormvars.numempl = '$numEmpl' AND scormvars.varName = 'cmi.core.lesson_status'
|
||
|
|
AND categoria.id = '$catid'
|
||
|
|
";
|
||
|
|
|
||
|
|
global $link;
|
||
|
|
dbConnect();
|
||
|
|
$result = mysqli_query($link, $sql);
|
||
|
|
$return = new stdClass();
|
||
|
|
if ( mysqli_num_rows($result) <= 0 ) {
|
||
|
|
$return->code = "0";
|
||
|
|
$return->msg="Sin insignias";
|
||
|
|
}else{
|
||
|
|
$return->code = "1";
|
||
|
|
$return->msg="insignias";
|
||
|
|
$return->datos = [];
|
||
|
|
while ($row = mysqli_fetch_array ($result)){
|
||
|
|
$return->datos[] = $row;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
echo json_encode($return, JSON_UNESCAPED_UNICODE);
|
||
|
|
mysqli_free_result($result);
|
||
|
|
exit;
|
||
|
|
?>
|