-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
101 lines (92 loc) · 4.4 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="./css/main.css">
<title>tomsikr</title>
<!-- Nastavení faviconu -->
<link rel="apple-touch-icon" sizes="57x57" href="./favicon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="./favicon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="./favicon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="./favicon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="./favicon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="./favicon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="./favicon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="./favicon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="./favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="./favicon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="./favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="./favicon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="./favicon/favicon-16x16.png">
<link rel="manifest" href="./favicon/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="./favicon/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
</head>
<body>
<!-- Připojení souboru functions.php, chová se jako by celý obsah byl nad touto řádkou-->
<?php
include('functions.php');
$lastRow = getLastRowISPIndexes($connectDB);
?>
<div class="main">
<div class="warningTop">
<?php
//Samotné připojení do databáze v souboru functions.php, lepší by bylo použít PHP class ale tohle momentálně funguje jak potřebuju
//echo "Připojení k databázi bylo úspěšné.";
if (!$connectDB) {
echo "Error: Unable to connect to MySQL." . PHP_EOL;
echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL;
echo "Debugging error: " . mysqli_connect_error() . PHP_EOL;
exit;
}
?>
</div class="warningTop">
<div class="navbar">
<ul>
<li><a href="index.php">Domů</a></li>
<li><a href="zadani.php">Zadání</a></li>
<li style="float:right"><a href="https://github.com/tomsik-radek/spse_twa_2">Github</a></li>
</ul>
</div class="navbar">
<div class="content">
<h2 style="text-align:center">Zde si můžete najít poskytovatele internetu ve vaší lokalitě.</h2>
<table class="selectTable">
<tr>
<?php $idKraj = getIdKraj($connectDB); ?>
<tr>
<tr>
<?php $idOkres = getIdOkres($connectDB,$idKraj); ?>
</tr>
</table class="selectTable">
<?php
if($idOkres > $lastRow){
echo "<h3 id='errortext1'>Ve vybrané lokalitě není nic dostupné, zkuste vybrat jinou.</h3>";
}elseif($idOkres == NULL){
echo "<h3 id='errortext1'>Není vybrán žádný okres, prosím vyberte.</h3>";
}
else{
?>
<table class="contentTable">
<tr>
<th>Název poskytovatele</th>
<th>Cena</th>
<th>Odkaz</th>
</tr>
<?php
printISPInfo($connectDB,$idOkres);
}
?>
</table class="contentTable">
</div class="content">
<div class="warningBottom">
<?php
mysqli_close($connectDB);
//echo "Spojení s zatabází ukončeno.";
?>
</div class="warningBottom">
</div class="main">
</body>
</html>