123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <?php
- Lib::loadClass('Router');
- class Theme_panel_biall_net extends ThemeDefault {
- // function head() { // echo 'html tag inside <head>'
- // }
- function top() { // first tag after body: top menu or header
- include dirname(__FILE__) . '/view/top.php';
- }
- function footer() { // before </body>
- include dirname(__FILE__) . '/view/footer.php';
- }
- function login($data) {
- if (is_array($data) && !empty($data)) {
- extract($data);
- }
- $remindPasswdLink = Router::getRoute('UrlAction_RemindPasswd')->getLink();
- include dirname(__FILE__) . '/view/login.php';
- }
- function remind($data) {
- if (is_array($data) && !empty($data)) {
- extract($data);
- }
- $loginLink = Request::getPathUri();
- include dirname(__FILE__) . '/view/remind.php';
- }
- function remindSent($data = []) {
- if (is_array($data) && !empty($data)) {
- extract($data);
- }
- include dirname(__FILE__) . '/view/remindSent.php';
- }
- function remindSetNewPassword($data = []) {
- if (is_array($data) && !empty($data)) {
- extract($data);
- }
- $loginLink = Request::getPathUri();
- include dirname(__FILE__) . '/view/remindSetNewPass.php';
- }
- function remindNewPasswordSet($data) {
- if (is_array($data) && !empty($data)) {
- extract($data);
- }
- $loginLink = Request::getPathUri();
- include dirname(__FILE__) . '/view/remindNewPassSetConfirm.php';
- }
- function logout($data) {
- if (is_array($data) && !empty($data)) {
- extract($data);
- }
- include dirname(__FILE__) . '/view/logout.php';
- }
- function home($data) { // TODO: home page view
- if (is_array($data) && !empty($data)) {
- extract($data);
- }
- if (!User::logged()) {
- UI::alert('danger', "Brak dostępu");
- return;
- }
- Lib::loadClass('Windykacja_StatsModel');
- Lib::loadClass('Windykacja_FunkcjeL1');
- $billDocs = Windykacja_StatsModel::getBillDocsByDate(User::getID());
- $billDocs->sort_docs();
- $billDocs->set_saldo_for_all_docs();
- $billDocs->set_paid_status_for_all(); // Windykacja_BillingDoc._paid_status: 1 (Opłacona) | 0 (Nieopłacona)
- $listBillDocs = $billDocs->get_docs(); // [ day => [ Windykacja_EventDoc, ... ], ... ]
- $fvList = array_reduce($listBillDocs, function ($ret, $dayDocList) {
- foreach ($dayDocList as $billDoc) {
- if ('FVAT' == $billDoc->_type) {
- // $nr = "Faktura Vat Nr " . $billDoc->get('NUMBER') . " / " . $billDoc->get('ID_BILLING_PREFIXES');
- $nr = "Nr " . $billDoc->get('NUMBER') . " / " . $billDoc->get('ID_BILLING_PREFIXES');
- array_unshift($ret, [
- 'NUMER FAKTURY' => $nr,
- 'DATA WYSTAWIENIA' => $billDoc->get('BILL_DATE'),
- 'STATUS' => ($billDoc->_paid_status) ? "Opłacona" : "Nieopłacona",
- 'WARTOŚĆ BRUTTO' => $billDoc->get('WARTOSC'),
- 'AKCJA' => UI::h('a', [
- 'href' => Router::getRoute('UrlAction_ViewFV')->getLink('', [ 'nr' => $billDoc->get('ID_BILLING_NUMBERS') ]),
- 'target' => "_blank",
- 'class' => "",
- ], "Podglgąd"),
- '_data' => $billDoc,
- ]);
- } else if ('KORV' == $billDoc->_type) {
- // DBG::nicePrint($billDoc, "TODO: DOC KORV"); // how to print?
- } else { // skip
- // DBG::nicePrint($billDoc, "TODO: DOC TYPE '{$billDoc->_type}'?");
- }
- }
- return $ret;
- }, []);
- // DBG::nicePrint($billDocs, '$billDocs');
- // DBG::nicePrint($listBillDocs, '$listBillDocs');
- // DBG::nicePrint($fvList, '$fvList');
- $company = Windykacja_StatsModel::getOwnerCompany(User::getID());
- $saldo = $billDocs->get_saldo();
- $nr_konta = Windykacja_FunkcjeL1::bankowy_make_nrach($company['NR_RACH_MASS_PAY'], User::getID(), 0);
- include dirname(__FILE__) . '/view/home.php';
- }
- }
|