chore: version inicial del codigo fuente del LMS Estafeta

This commit is contained in:
2026-10-02 20:33:12 -06:00
commit c8bb6b97b9
1572 changed files with 457520 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
<?php
require_once __DIR__.'/auth_guard.php';
require_once __DIR__.'/audit.php';
require_once "../config.php";
$urlimgcat = isset($_POST['urlimgcat']) ? $_POST['urlimgcat'] : '';
$nombre = isset($_POST['nombre']) ? $_POST['nombre'] : '';
$desc = isset($_POST['desc']) ? $_POST['desc'] : '';
$habilitado = isset($_POST['habilitado']) ? (int)$_POST['habilitado'] : 0;
$order = isset($_POST['order']) ? (int)$_POST['order'] : 0;
$clave = isset($_POST['clave']) ? $_POST['clave'] : '';
$catsuperior = isset($_POST['catsuperior']) ? (int)$_POST['catsuperior'] : 0;
global $link;
dbConnect();
$sql = "INSERT INTO categoria (padre,imagen,nombre,descripcion,habilitado,order_desc,clave) VALUES (?,?,?,?,?,?,?)";
$stmt = mysqli_prepare($link, $sql);
if ($stmt) {
mysqli_stmt_bind_param($stmt, 'issssis', $catsuperior, $urlimgcat, $nombre, $desc, $habilitado, $order, $clave);
if (mysqli_stmt_execute($stmt)) {
audit_log('categoria_create', 'nombre=' . $nombre . ' padre=' . $catsuperior);
echo "Categoría creada";
} else {
http_response_code(500);
echo "Error al crear categoría";
}
mysqli_stmt_close($stmt);
} else {
http_response_code(500);
echo "Error al preparar la consulta";
}
?>