mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
selectores de papel y gramaje. falta validacion
This commit is contained in:
@ -294,14 +294,15 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
}
|
||||
|
||||
public function getPapelGenericoCliente()
|
||||
public function getPapelCliente()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
$tipo = goSanitize($this->request->getGet('tipo'))[0];
|
||||
$cubierta = goSanitize($this->request->getGet('text'))[0];
|
||||
$selected_papel = goSanitize($this->request->getGet('papel'))[0] ?? null;
|
||||
$cubierta = goSanitize($this->request->getGet('cubierta'))[0] ?? 0;
|
||||
$papel_especial = goSanitize($this->request->getGet('papel_especial'))[0] ?? 0;
|
||||
$menu = $this->model->getPapelGenericoCliente($tipo, $cubierta, $papel_especial);
|
||||
$menu = $this->model->getPapelCliente($tipo, $cubierta, $selected_papel, $papel_especial);
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
|
||||
@ -437,26 +437,4 @@ class Papelesimpresion extends \App\Controllers\BaseResourceController
|
||||
$ma_pa_model->updateRows($active_values);
|
||||
}
|
||||
}
|
||||
|
||||
public function getGramajesCliente(){
|
||||
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
$papel_generico_id = goSanitize($this->request->getGet('papel'))[0];
|
||||
$tipo = goSanitize($this->request->getGet('tipo'))[0];
|
||||
$cubierta = goSanitize($this->request->getGet('text'))[0];
|
||||
$papel_especial = goSanitize($this->request->getGet('papel_especial'))[0] ?? 0;
|
||||
$menu = $this->model->getGramajePresupuestoCliente($papel_generico_id, $tipo, $cubierta, $papel_especial);
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
$data = [
|
||||
'gramajes' => $menu,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
return $this->respond($data);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user