} } else { if (isset($_POST['label'])) { // New cash register $cashReg = new \Pasteque\CashRegister($_POST['label'], $_POST['locationId']); $id = $srv->create($cashReg); if ($id !== false) { $message = \i18n("Cash register saved. <a href=\"%s\">Go to the cash register page</a>.", PLUGIN_NAME, \Pasteque\get_module_url_action(PLUGIN_NAME, 'cashregister_edit', array('id' => $id))); } else { $error = \i18n("Unable to save changes"); } } } $cashReg = null; if (isset($_GET['id'])) { $cashReg = $srv->get($_GET['id']); } ?> <h1><?php \pi18n("Edit a cash register", PLUGIN_NAME); ?> </h1> <?php \Pasteque\tpl_msg_box($message, $error); ?> <form class="edit" action="<?php echo \Pasteque\get_current_url(); ?> " method="post" enctype="multipart/form-data">
// but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Pastèque. If not, see <http://www.gnu.org/licenses/>. namespace BaseCashes; $message = NULL; $error = NULL; $pdo = \Pasteque\PDOBuilder::getPDO(); $sessId = $_GET['id']; $session = \Pasteque\CashesService::get($sessId); $zticket = \Pasteque\CashesService::getZTicket($sessId); $crSrv = new \Pasteque\CashRegistersService(); $cashRegister = $crSrv->get($session->cashRegisterId); if ($session->isClosed()) { $title = \i18n("Closed session", PLUGIN_NAME); } else { $title = \i18n("Active session", PLUGIN_NAME); } ?> <h1><?php echo $title; ?> </h1> <table cellpadding="0" cellspacing="0"> <thead> <th colspan="2"><?php