mirror of
https://github.com/itflow-org/itflow
synced 2026-08-05 23:27:17 +00:00
82 lines
2.8 KiB
PHP
82 lines
2.8 KiB
PHP
<?php
|
|
|
|
require_once '../../../includes/modal_header.php';
|
|
|
|
enforceUserPermission('module_financial');
|
|
|
|
// Pre-filled from the trips page's current filters. Everything here is editable -
|
|
// the export runs whatever this form posts, not whatever the page happened to show.
|
|
$client_id = intval($_GET['client_id'] ?? 0);
|
|
if ($client_id) {
|
|
enforceClientAccess();
|
|
}
|
|
|
|
// Search Filter
|
|
$q_filter = $_GET['q'] ?? '';
|
|
|
|
// Date Filter - the all-time sentinels from filter_header.php leave the fields blank
|
|
$date_from_filter = (!empty($_GET['dtf']) && $_GET['dtf'] !== '1970-01-01') ? escapeHtml($_GET['dtf']) : '';
|
|
$date_to_filter = (!empty($_GET['dtt']) && $_GET['dtt'] !== '2099-12-31') ? escapeHtml($_GET['dtt']) : '';
|
|
|
|
ob_start();
|
|
|
|
?>
|
|
|
|
<div class="modal-header bg-dark">
|
|
<h5 class="modal-title"><i class="fas fa-fw fa-download mr-2"></i>Export Trips</h5>
|
|
<button type="button" class="close text-white" data-dismiss="modal">
|
|
<span>×</span>
|
|
</button>
|
|
</div>
|
|
|
|
<?php exportTabsNav(); ?>
|
|
|
|
<form action="post.php" method="post" autocomplete="off">
|
|
<input type="hidden" name="csrf_token" value="<?= $_SESSION['csrf_token'] ?>">
|
|
<input type="hidden" name="client_id" value="<?= $client_id ?>">
|
|
|
|
<div class="modal-body">
|
|
|
|
<?php exportTabsFiltersOpen(); ?>
|
|
|
|
<div class="form-group">
|
|
<label>Search</label>
|
|
<div class="input-group">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text"><i class="fa fa-fw fa-search"></i></span>
|
|
</div>
|
|
<input type="text" class="form-control" name="q" value="<?= stripslashes(escapeHtml($q_filter)) ?>" placeholder="Purpose, source, destination">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label>Dated From</label>
|
|
<div class="input-group">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
|
</div>
|
|
<input type="date" class="form-control" name="dtf" value="<?= $date_from_filter ?>" max="2999-12-31">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label>Dated To</label>
|
|
<div class="input-group">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
|
</div>
|
|
<input type="date" class="form-control" name="dtt" value="<?= $date_to_filter ?>" max="2999-12-31">
|
|
</div>
|
|
</div>
|
|
|
|
<?php exportTabsColumns('trips'); ?>
|
|
|
|
</div>
|
|
<div class="modal-footer">
|
|
<?php renderExportButtons('export_trips'); ?>
|
|
</div>
|
|
</form>
|
|
|
|
<?php
|
|
require_once '../../../includes/modal_footer.php';
|