chore: version inicial del codigo fuente del LMS Estafeta
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?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'];
|
||||
$sql = "
|
||||
SELECT
|
||||
scormpkg.id,
|
||||
scormpkg.idcategoria,
|
||||
scormpkg.nombre as recname,
|
||||
categoria.nombre as catname,
|
||||
categoria.descripcion as catdescripcion,
|
||||
scormpkg.descripcion,
|
||||
scormpkg.imagen,
|
||||
scormpkg.url,
|
||||
scormpkg.clave
|
||||
FROM
|
||||
scormpkg
|
||||
INNER JOIN categoria ON scormpkg.idcategoria = categoria.id
|
||||
WHERE scormpkg.idcategoria = '$catid' AND scormpkg.habilitado = 1
|
||||
";
|
||||
|
||||
global $link;
|
||||
dbConnect();
|
||||
$result = mysqli_query($link, $sql);
|
||||
$return = new stdClass();
|
||||
if ( mysqli_num_rows($result) <= 0 ) {
|
||||
$return->code = "0";
|
||||
$return->msg="Sin recursos";
|
||||
}else{
|
||||
$return->code = "1";
|
||||
$return->msg="recursos";
|
||||
$return->datos = [];
|
||||
while ($row = mysqli_fetch_array ($result)){
|
||||
$return->datos[] = $row;
|
||||
}
|
||||
}
|
||||
echo json_encode($return, JSON_UNESCAPED_UNICODE);
|
||||
mysqli_free_result($result);
|
||||
?>
|
||||
Reference in New Issue
Block a user