source: trunk/block/index.php

Last change on this file was 929, checked in by chronos, 2 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
Line 
1<?php
2
3include_once('../Application/Core.php');
4
5class BlockPage extends Page
6{
7 private array $Reasons = array(
8 0 => 'Internet máte povolen, avšak došlo k chybě při kontrole přístupů k Internetu.',
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. ',
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
15 function __construct(System $System)
16 {
17 parent::__construct($System);
18 $this->Title = 'Blokování internetu';
19 }
20
21 function Show(): string
22 {
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
27 $DbResult = $this->Database->query('SELECT * FROM NetworkInterface WHERE LocalIP="'.GetRemoteAddress().'"');
28 if ($DbResult->num_rows > 0)
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();
35
36 if ($Member['Blocked'] == 1)
37 {
38 $Output .= $this->Reasons[1];
39 } else $Output .= $this->Reasons[0];
40 } else $Output .= $this->Reasons[4];
41
42 $Output .= '<br/><br/>V případě problémů kontaktujte technickou podporu na telefonu 737785792<br/><br/>';
43 $Output .= '</body></html>';
44 return $Output;
45 }
46}
47
48$System = new Core();
49$System->ShowPage = false;
50$System->Run();
51$Page = new BlockPage($System);
52echo($Page->GetOutput());
Note: See TracBrowser for help on using the repository browser.