<?php
require_once __DIR__ . '/../app/helpers.php';
require_login();

$id = (int)($_GET['id'] ?? 0);
$from = $_GET['from'] ?? '';
$to = $_GET['to'] ?? '';

$q = ['edit' => $id];
if ($from !== '') $q['from'] = $from;
if ($to !== '') $q['to'] = $to;

header('Location: ' . url('/cash/index.php?' . http_build_query($q)));
exit;
