source: trunk/block/index.php@ 929

Last change on this file since 929 was 929, checked in by chronos, 3 years ago
  • Modified: Removed commended out print_r and echo commands used only for debugging.
  • Property svn:executable set to *
File size: 1.8 KB
RevLine 
[291]1<?php
[548]2
[887]3include_once('../Application/Core.php');
[1]4
[291]5class BlockPage extends Page
6{
[887]7 private array $Reasons = array(
[291]8 0 => 'Internet máte povolen, avšak došlo k chybě při kontrole přístupů k Internetu.',
[886]9 1 => 'Váš počítač má blokován přístup k internetu. Pravděpodobně je váš účet v mínusu. Přihlaste se do systému a zkontrolujte stav vašich plateb. ',
[291]10 2 => 'Váš účet je v mínusu. Zaplaťte prosím chybějící peníze.',
11 3 => 'Přistupovat k internetu můžete pouze pomocí VPN(Virtuální Privátní Sítě). Aktivujte toto připojení.',
12 4 => 'Váš počítač není registrován. Zaregistrujte jej prosím.'
13 );
14
[887]15 function __construct(System $System)
[291]16 {
[887]17 parent::__construct($System);
[912]18 $this->Title = 'Blokování internetu';
[887]19 }
20
21 function Show(): string
22 {
[291]23 $Output = '<br/><div style="font-size: 20 pt;">Máte blokován přístup k Internetu.</div>
24<br/>
25<strong>Důvod:</strong> ';
26
[294]27 $DbResult = $this->Database->query('SELECT * FROM NetworkInterface WHERE LocalIP="'.GetRemoteAddress().'"');
[873]28 if ($DbResult->num_rows > 0)
[291]29 {
30 $Interface = $DbResult->fetch_array();
31 $DbResult = $this->Database->select('NetworkDevice', '*', 'Id='.$Interface['Device']);
32 $Device = $DbResult->fetch_array();
33 $DbResult = $this->Database->select('Member', '*', 'Id='.$Device['Member']);
34 $Member = $DbResult->fetch_array();
[659]35
[873]36 if ($Member['Blocked'] == 1)
[291]37 {
38 $Output .= $this->Reasons[1];
39 } else $Output .= $this->Reasons[0];
40 } else $Output .= $this->Reasons[4];
[659]41
[299]42 $Output .= '<br/><br/>V případě problémů kontaktujte technickou podporu na telefonu 737785792<br/><br/>';
43 $Output .= '</body></html>';
[874]44 return $Output;
[291]45 }
46}
47
[887]48$System = new Core();
[578]49$System->ShowPage = false;
50$System->Run();
[887]51$Page = new BlockPage($System);
52echo($Page->GetOutput());
Note: See TracBrowser for help on using the repository browser.