Browse Source

Fix undefined index notice

master
Skylar Ittner 1 year ago
parent
commit
0c72450c19
2 changed files with 9 additions and 3 deletions
  1. 0
    2
      lib/chooseregister.php
  2. 9
    1
      pages/pos.php

+ 0
- 2
lib/chooseregister.php View File

@@ -40,8 +40,6 @@ $registers = $database->select("registers", ['[>]cash_drawer' => ['registerid' =
}
?>
</div>
<div class="card-footer">
</div>
<input type="hidden" name="action" value="set_register" />
<input type="hidden" name="source" value="pos" />
</form>

+ 9
- 1
pages/pos.php View File

@@ -8,7 +8,12 @@ $register = [
"name" => lang("no cash", false),
"id" => ""
];
$registeropen = $database->has("registers", ['[>]cash_drawer' => ['registerid' => 'registerid']], ['AND' => ['open[!]' => null, 'close' => null, 'registers.registerid' => $_SESSION['register']]]);

$registeropen = false;
if (isset($_SESSION['register'])) {
$registeropen = $database->has("registers", ['[>]cash_drawer' => ['registerid' => 'registerid']], ['AND' => ['open[!]' => null, 'close' => null, 'registers.registerid' => $_SESSION['register']]]);
}

if (isset($_GET['switch']) || !isset($_SESSION['register']) || !$registeropen) {
require_once __DIR__ . "/../lib/chooseregister.php";
} else {
@@ -73,6 +78,9 @@ if (isset($_GET['switch']) || !isset($_SESSION['register']) || !$registeropen) {
</div>
<div class="modal-body">
<div class="row">
<div class="col-12 col-md-6">

</div>
<div class="col-12 col-md-6">
<button type="button" class="btn btn-primary" id="xprintbtn"><i class="fas fa-print"></i> <?php lang("print"); ?></button>
<iframe class="w-100 shadow-lg" id="xframe" src="action.php?action=xreport&format=html&register=<?php echo $register['id']; ?>"></iframe>

Loading…
Cancel
Save