if (isset($_POST['userid'])) { $userid = $_POST['userid']; } if (isset($_POST['station_code'])) { $station_code = $_POST['station_code']; } switch ($_POST['action']) { case 'export': if ($id_log = Station::export_data($userid, $station_code)) { $archivo = Log::search($id_log); $enlace = $archivo[0]->getInfo(); $enlace2 = $archivo[0]->getFile(); ob_clean(); header("Content-Disposition: attachment; filename={$enlace2} "); header("Content-Type: application/force-download"); header("Content-Length: " . filesize($enlace)); readfile($enlace); } else { echo "ocurrio algun error<br>"; } break; case 'config': if ($errores = Config_Station::update()) { mensaje("Se guardó la configuración de la estación", "Configurar estación", "", "/"); } else { echo "Errores--->{$errores}<br>"; mensaje("Error en la configuración de la estación", "", "error", "/"); } break; } }
if (User::borrar_informe($id_informe)) { mensaje("Se borr\\u00F3 el informe", "Borrar informe"); } else { mensaje("ERROR! No se pudo borrar el informe", "", "error"); } } if (isset($_POST['confirmed_erase_all'])) { // borra todos los informes para el usuario if (isset($_SESSION['userid'])) { $userid = $_SESSION['userid']; User::borrar_informes_todos($userid); } } if (isset($_POST['save_config'])) { $config = new Config_Station(); if ($config->update()) { mensaje("Se guardó la configuración para la estación", "Configurar estación"); } else { mensaje($config->getError(), "", "error"); } } } // if (isset($_GET['sign_off'])) { User::SignOff(); } echo "<pre>"; print_r($_POST); echo "</pre>"; if (!User::getLoginSession()) { if (isset($_POST['usuario']) and isset($_POST['password'])) {