Stable without período in autidoría
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
<?
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
$ruta = "../../";
|
||||
require_once "$ruta/include/bd_pdo.php";
|
||||
header('Content-Type: application/json');
|
||||
|
||||
// json data from service\periodos.v1.php (input)
|
||||
$data = json_decode(file_get_contents('php://input'), true);
|
||||
|
||||
// check if the input is empty
|
||||
|
||||
if (is_response_empty($data)) {
|
||||
@@ -36,14 +38,14 @@ $fin = strtotime($data['fin']);
|
||||
try {
|
||||
|
||||
$result = $db->insert('periodo', [
|
||||
'id_reference' => $data['IdPeriodo'],
|
||||
'id_periodo_sgu' => $data['IdPeriodo'],
|
||||
'periodo_nombre' => "{$data['NombreNivel']}: {$formatter->format($inicio)} - {$formatter->format($fin)} " . date('Y', $inicio),
|
||||
'nivel_id' => $data['IdNivel'],
|
||||
'periodo_fecha_inicio' => $data['inicio'],
|
||||
'periodo_fecha_fin' => $data['fin'],
|
||||
'estado_id' => 4,
|
||||
'periodo_clave' => $data['NombrePeriodo']
|
||||
], ['id_reference']);
|
||||
], ['id_periodo_sgu']);
|
||||
} catch (PDOException $th) {
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
|
||||
Reference in New Issue
Block a user