How can I show an error condition in AppGini?
Posted: 2023-06-04 02:00
Hi
My problem has a more easy solution not involving javascript validation code.
In /hooks/reservas.php
Works fine, but the message "SITE RESERVED ..." never shows. Instead ...
error_message() is an AppGini function, as far I know.
How can I show this warning to the user
My problem has a more easy solution not involving javascript validation code.
In /hooks/reservas.php
Code: Select all
function Reservas_before_insert(&$data, $memberInfo, &$args) {
/* PHP VALIDATE SITE & DATE BEFORE INSERT THE RECORD
$idSitio = intval($data['Sitio']);
$enFecha = $data['Fecha'];
$nSitios = sqlValue("SELECT COUNT(*) FROM Reservas WHERE Sitio ='{$idSitio}' AND Fecha='{$enFecha}'");
if ($nSitios > 0) {
error_message('SITE RESERVED FOR THIS DATE!', false);
return false;
}
return TRUE;
}
How can I show this warning to the user