forked from Business/BinStack
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.7 KiB
PHP
40 lines
1.7 KiB
PHP
<?php
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
require_once __DIR__ . '/../required.php';
|
|
|
|
redirectifnotloggedin();
|
|
?>
|
|
|
|
<form action="lib/reports.php" method="GET" target="_BLANK">
|
|
<div class="row">
|
|
<div class="col-xs-12 col-sm-6">
|
|
<label for="type"><?php lang("report type"); ?></label>
|
|
<select name="type" class="form-control" required>
|
|
<option value="item"><?php lang("items") ?></option>
|
|
<option value="category"><?php lang("categories") ?></option>
|
|
<option value="location"><?php lang("locations") ?></option>
|
|
<option value="itemstock"><?php lang("understocked items") ?></option>
|
|
</select>
|
|
</div>
|
|
<div class="col-xs-12 col-sm-6">
|
|
<label for="type"><?php lang("format"); ?></label>
|
|
<select name="format" class="form-control" required>
|
|
<option value="csv"><?php lang("csv file") ?></option>
|
|
<option value="ods"><?php lang("ods file") ?></option>
|
|
<option value="html"><?php lang("html file") ?></option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<br />
|
|
<?php
|
|
$code = uniqid(rand(10000000,99999999), true);
|
|
$database->insert('report_access_codes', ['code' => $code, 'expires' => date("Y-m-d H:i:s", strtotime("+5 minutes"))]);
|
|
?>
|
|
<input type="hidden" name="code" value="<?php echo $code; ?>" />
|
|
|
|
<button type="submit" class="btn btn-success" id="genrptbtn"><i class="fa fa-download"></i> <?php lang("generate report"); ?></button>
|
|
</form>
|