File: C:/laragon/www/beplocal/TableAuthData.php
<?php
include_once 'DBClassOkta.php';
include_once 'Utilities.php';
$DatabaseService = new DatabaseService();
$conn = $DatabaseService->getConnection();// get data and store in a json array
$filterSql = $_POST['filter'];
$jwt = $_POST['jwt'];
$authLevel = $_POST['AUTH_LEVEL'];
if(verificaToken($jwt, $authLevel)) {
$queryPerAuth = "Select ".
" * ".
"from AuthLevel ".
"where CodificaLivello != 'ALL' ".$filterSql;
$stmt = $conn->prepare($queryPerAuth);
$stmt->execute();
$num = $stmt->rowCount();
$items = array();
while ($row = $stmt->fetch())
{
$items[] = array(
'CodificaLivello' => $row['CodificaLivello'],
'DescrizioneLivello' => $row['DescrizioneLivello']
);
}
echo json_encode($items);
} else {
echo json_encode(array('message' => "Errore nella procedura della tabela prodotti. Contattare il supporto tecnico"));
}
?>