. */ include_once __DIR__.'/core.php'; use Carbon\Carbon; use Models\Module; // Disabilitazione dei campi $read_only = $structure->permission == 'r'; $module_header_html = ''; if (empty($id_record) && !empty($id_module) && empty($id_plugin)) { redirect(base_path().'/controller.php?id_module='.$id_module); } elseif (empty($id_record) && empty($id_module) && empty($id_plugin)) { redirect(base_path().'/index.php'); } include_once App::filepath('include|custom|', 'top.php'); if (!empty($id_record)) { Util\Query::setSegments(false); $query = Util\Query::getQuery($structure, [ 'id' => $id_record, ]); Util\Query::setSegments(true); } // Rimozione della condizione deleted_at IS NULL per visualizzare anche i record eliminati if (!empty($query)) { if (preg_match('/[`]*([a-z0-9_]*)[`]*[\.]*([`]*deleted_at[`]* IS NULL)/si', $query, $m)) { $query = str_replace(["\n", "\t"], ' ', $query); $conditions_to_remove = []; $condition = trim($m[0]); if (!empty($table_name)) { $condition = $table_name.'.'.$condition; } $conditions_to_remove[] = ' AND\s*'.$condition; $conditions_to_remove[] = $condition.'\s*AND '; foreach ($conditions_to_remove as $condition_to_remove) { $query = preg_replace('/'.$condition_to_remove.'/si', '', $query); } $query = str_replace($condition, '', $query); } } $has_access = !empty($query) ? $dbo->fetchNum($query) !== 0 : true; if ($has_access) { // Inclusione gli elementi fondamentali include_once base_dir().'/actions.php'; } if (empty($record) || !$has_access) { echo '