-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_aloja_plazos_excep_ajax.php
50 lines (40 loc) · 1.48 KB
/
admin_aloja_plazos_excep_ajax.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
require_once(__DIR__."/config.php");
require_once(__DIR__."/classes/PWETPageHelper.class.php");
require_once(__DIR__."/classes/aloja/AlojaPlazosExcepcionalDao.class.php");
$page = PWETPageHelper::start_page_ajax(array(PERM_ADMIN, PERM_ADMIN_ISTAC, PERM_GRABADOR));
define("ARG_NOTAS","notas");
define('OP_GUARDAR', 'save');
//header("Content-Type: text/html; charset=UTF-8");
$accion=$page->request_post(ARG_OP);
if ($accion == OP_GUARDAR)
{
$est = $page->request_post_or_get(ARG_ESTID, NULL);
$mes = $page->request_post_or_get(ARG_MES, NULL);
$ano = $page->request_post_or_get(ARG_ANO, NULL);
if ($est != NULL && $mes != null && $ano != null)
{
$dao = new AlojaPlazosExcepcionalDao();
$plazoGuardar = new AlojaPlazoExcepcional();
$plazoGuardar->id_estab = $est;
$plazoGuardar->mes = $mes;
$plazoGuardar->ano = $ano;
$plazoGuardar->notas = $page->request_post_or_get(ARG_NOTAS, NULL);
if(!$dao->guardarNotas($plazoGuardar))
echo json_encode(array(
'error' => TRUE,
'desc' => 'Error al grabar el campo notas del plazo excepcional en la BDD.'
));
else
echo json_encode(array('error' => FALSE));
$page->end_session();
exit;
}
}
echo json_encode(array(
'error' => TRUE,
'desc' => 'Operación incorrecta o no permitida.'
));
$page->end_session();
exit;
?>