123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- Lib::loadClass('RouteToolBase');
- Lib::loadClass('UI');
- Lib::loadClass('Response');
- Lib::loadClass('Theme');
- require_once dirname(__FILE__) . '/../auth.php'; // Theme_Auth_panel_biall_net
- // index.php?_route=UrlAction_ViewFV - uruchamia defaultAction
- class RouteTool_ViewFV extends RouteToolBase {
- function defaultAction() {
- try {
- $nr = V::get('nr', 0, $_GET, 'int'); // ID_BILLING_NUMBERS
- if (empty($nr)) throw new Exception("Brak nr faktury");
- $idUser = User::getID();
- $body = DB::getPDO(931)->fetchValue("
- select BODY_HTML
- from HIST_CONTACTS
- where ID_BILLING_USERS = :id_user
- and ID_BILLING_NUMBERS = :nr
- order by ID DESC
- limit 1
- ", [
- ':id_user' => $idUser,
- ':nr' => $nr,
- ]);
- if (empty($body)) throw new Exception("Brak faktury");
- die($body);
- } catch (Exception $e) {
- UI::gora();
- Theme::top();
- echo UI::h('div', [ 'class' => "container" ], [
- UI::h('div', [ 'class' => 'alert alert-danger' ], $e->getMessage()),
- ]);
- UI::dol();
- }
- }
- }
|