40 lines
1.2 KiB
PHP
40 lines
1.2 KiB
PHP
<?php
|
|
require_once "../controllers/fechas.controller.php";
|
|
require_once "../models/fechas.model.php";
|
|
|
|
class ajaxFechas {
|
|
public $campo;
|
|
|
|
public $id_persona;
|
|
public $campoFecha;
|
|
public $campoLugar;
|
|
public $valorFecha;
|
|
public $valorLugar;
|
|
|
|
public function ajaxLOV() {
|
|
$datos = FechasController::ctrLOV($this->campo);
|
|
echo json_encode($datos, JSON_UNESCAPED_UNICODE);
|
|
}
|
|
|
|
public function ajaxValidarFechas() {
|
|
$datos = FechasController::ctrValidarFechas($this->id_persona, $this->campoFecha, $this->campoLugar, $this->valorFecha, $this->valorLugar);
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
echo json_encode($datos, JSON_UNESCAPED_UNICODE);
|
|
}
|
|
}
|
|
|
|
if (isset($_POST['campo'])) {
|
|
$resultado = new ajaxFechas();
|
|
$resultado->campo = $_POST['campo'];
|
|
$resultado->ajaxLOV();
|
|
}
|
|
if (isset($_POST['accion']) && $_POST['accion'] == "VALIDAR-CUPO") {
|
|
$registros = new ajaxFechas();
|
|
$registros->id_persona = $_POST['id_persona'];
|
|
$registros->campoFecha = $_POST['campoFecha'];
|
|
$registros->campoLugar = $_POST['campoLugar'];
|
|
$registros->valorFecha = $_POST['valorFecha'];
|
|
$registros->valorLugar = $_POST['valorLugar'];
|
|
$registros->ajaxValidarFechas();
|
|
}
|