Revize a4f48ab9
Přidáno uživatelem horkym před asi 7 roky(ů)
app/control/control.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
require_once "../model/dao/dao.php"; |
|
4 |
require_once "../model/db/db-web.php"; |
|
5 |
require_once "../model/session.php"; |
|
6 |
|
|
7 |
$dbh = new DB_WEB(); |
|
8 |
$session = new Session(); |
|
9 |
|
|
10 |
include "../view/header.php"; |
|
11 |
include "../view/menu.php"; |
|
12 |
|
|
13 |
if (!isSet($_GET["view"])) { |
|
14 |
|
|
15 |
include "../view/intro.php"; |
|
16 |
|
|
17 |
} else { |
|
18 |
|
|
19 |
include "../view/intro.php"; |
|
20 |
|
|
21 |
} |
|
22 |
|
|
23 |
include "../view/footer.php"; |
|
24 |
|
|
25 |
?> |
app/model/dao/dao.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
require_once '../model/db/db-web.php'; |
|
4 |
|
|
5 |
class DAO { |
|
6 |
|
|
7 |
protected $dbh; |
|
8 |
|
|
9 |
public function setDB($dbh) { |
|
10 |
$this->dbh = $dbh; |
|
11 |
} |
|
12 |
|
|
13 |
public function delete($id) { |
|
14 |
$query = "DELETE FROM pom WHERE id='$id'"; |
|
15 |
$stmt = $this->dbh->executeQuery($query); |
|
16 |
} |
|
17 |
|
|
18 |
} |
|
19 |
|
|
20 |
?> |
app/model/db/db-exception.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
class DB_Exception extends Exception { |
|
4 |
|
|
5 |
public function __construct($message=false, $code=false) { |
|
6 |
if (!$message) { |
|
7 |
$this->message = mysql_error(); |
|
8 |
} |
|
9 |
if (!$code) { |
|
10 |
$this->code = mysql_errno(); |
|
11 |
} |
|
12 |
} |
|
13 |
|
|
14 |
} |
|
15 |
|
|
16 |
?> |
app/model/db/db-pdo.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
require_once 'db-exception.php'; |
|
4 |
|
|
5 |
class DB_PDO { |
|
6 |
|
|
7 |
protected $user; |
|
8 |
protected $pass; |
|
9 |
protected $dbhost; |
|
10 |
protected $dbname; |
|
11 |
protected $dbh; |
|
12 |
|
|
13 |
public function __construct($user, $pass, $dbhost, $dbname) { |
|
14 |
$this->user = $user; |
|
15 |
$this->pass = $pass; |
|
16 |
$this->dbhost = $dbhost; |
|
17 |
$this->dbname = $dbname; |
|
18 |
} |
|
19 |
|
|
20 |
protected function connect() { |
|
21 |
$this->dbh = new PDO('mysql:host='.$this->dbhost.';dbname='.$this->dbname.';charset=utf8', $this->user, $this->pass); |
|
22 |
if (!$this->dbh) { |
|
23 |
throw new DB_Exception; |
|
24 |
} |
|
25 |
} |
|
26 |
|
|
27 |
public function executeQuery($query) { |
|
28 |
if (!$this->dbh) { |
|
29 |
$this->connect(); |
|
30 |
} |
|
31 |
$ret = $this->dbh->query($query); |
|
32 |
if (!$ret) { |
|
33 |
throw new DB_Exception; |
|
34 |
} else { |
|
35 |
$stmt = new DB_PDOStatement($this->dbh, $query); |
|
36 |
$stmt->result = $ret; |
|
37 |
$stmt->number = $ret->rowCount(); |
|
38 |
return $stmt; |
|
39 |
} |
|
40 |
} |
|
41 |
|
|
42 |
} |
|
43 |
|
|
44 |
class DB_PDOStatement { |
|
45 |
|
|
46 |
public $result; |
|
47 |
public $query; |
|
48 |
public $number; |
|
49 |
protected $dbh; |
|
50 |
|
|
51 |
public function __construct($dbh, $query) { |
|
52 |
$this->query = $query; |
|
53 |
$this->dbh = $dbh; |
|
54 |
if (!$dbh) { |
|
55 |
throw new DB_Exception("Spojení s databází se nezdařilo!"); |
|
56 |
} |
|
57 |
} |
|
58 |
|
|
59 |
public function fetchAssoc() { |
|
60 |
if (!$this->result) { |
|
61 |
throw new DB_Exception("Dotaz nebyl vykonán!"); |
|
62 |
} |
|
63 |
return $this->result->fetch(PDO::FETCH_ASSOC); |
|
64 |
} |
|
65 |
|
|
66 |
} |
|
67 |
|
|
68 |
?> |
app/model/db/db-web.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
require_once 'db-pdo.php'; |
|
4 |
|
|
5 |
class DB_WEB extends DB_PDO { |
|
6 |
|
|
7 |
protected $user = "root"; |
|
8 |
protected $pass = ""; |
|
9 |
protected $dbhost = "localhost"; |
|
10 |
protected $dbname = "data"; |
|
11 |
|
|
12 |
public function __construct() { |
|
13 |
|
|
14 |
} |
|
15 |
|
|
16 |
} |
|
17 |
|
|
18 |
?> |
app/model/session.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
class Session { |
|
4 |
|
|
5 |
public function __construct() { |
|
6 |
ob_start(); |
|
7 |
session_start(); |
|
8 |
} |
|
9 |
|
|
10 |
public function create($nazev, $vloz) { |
|
11 |
$_SESSION[$nazev] = $vloz; |
|
12 |
} |
|
13 |
|
|
14 |
public function delete($nazev) { |
|
15 |
unSet($_SESSION[$nazev]); |
|
16 |
} |
|
17 |
|
|
18 |
} |
|
19 |
|
|
20 |
?> |
app/view/footer.php | ||
---|---|---|
1 |
</div> |
|
2 |
</div> |
|
3 |
<div> |
|
4 |
© ASWI team 2018 |
|
5 |
</div> |
|
6 |
</div> |
|
7 |
</body> |
|
8 |
|
|
9 |
</html> |
app/view/header.php | ||
---|---|---|
1 |
<!DOCTYPE html> |
|
2 |
<html lang='cs'> |
|
3 |
|
|
4 |
<head> |
|
5 |
<title>Průjezd vozidel - Plzeňský kraj</title> |
|
6 |
<meta charset='utf-8'> |
|
7 |
<meta name='description' content=''> |
|
8 |
<meta name='keywords' content=''> |
|
9 |
<meta name='robots' content='all'> |
|
10 |
</head> |
|
11 |
|
|
12 |
<body> |
|
13 |
<div> |
|
14 |
<h1>Zobrazení dat o průjezdu vozidel pro Plzeňský kraj</h1> |
|
15 |
|
app/view/intro.php | ||
---|---|---|
1 |
<h3>Úvodní strana</h3> |
|
2 |
<p>Vítáme Vás ...</p> |
app/view/menu.php | ||
---|---|---|
1 |
<div> |
|
2 |
<div> |
|
3 |
<a href="control.php">Úvodní strana</a> |
|
4 |
<a href="control.php?view=xxx">Další odkaz</a> |
|
5 |
</div> |
|
6 |
<div> |
fonts/READ_ME.txt | ||
---|---|---|
1 |
Jedna se o volne pouzitelne fonty stazene z http://www.1001fonts.com/free-fonts-for-commercial-use.html |
fonts/anonymous-pro/FONTLOG.txt | ||
---|---|---|
1 |
FONTLOG for Anonymous Pro |
|
2 |
|
|
3 |
This file provides detailed information on the Anonymous Pro Font Software. This information should be distributed along with the Anonymous Pro fonts and any derivative works. |
|
4 |
|
|
5 |
Anonymous Pro is a family of four fixed-width fonts designed especially with coding in mind. Characters that could be mistaken for one another (O, 0, I, l, 1, etc.) have distinct shapes to make them easier to tell apart in the context of source code. |
|
6 |
|
|
7 |
Anonymous Pro is distributed with the Open Font License (OFL). |
|
8 |
|
|
9 |
For more information, see the file "README for Anonymous Pro". |
|
10 |
|
|
11 |
Mark Simonson |
|
12 |
September 8, 2010 |
|
13 |
Mark Simonson Studio LLC |
|
14 |
http://www.ms-studio.com |
|
15 |
mark@marksimonson.com |
|
16 |
|
|
17 |
CHANGELOG |
|
18 |
|
|
19 |
8 September 2010 (Mark Simonson) Anonymous Pro Version 1.002 |
|
20 |
- Fixed (stupid) incorrect design of quotesinglbase and quotedblbase |
|
21 |
- Lengthened hyphen |
|
22 |
- Shortened underscore so that it is distinct from adjacent underscores |
|
23 |
- Increased the weight of the ampersand to make it visually the same weight as other glyphs |
|
24 |
- Adjusted vertical position of "<", ">" and math characters to align with hyphen |
|
25 |
- Modified design of Cyrillic "ze" to better distinguish it from "3" |
|
26 |
- Modified 12ppm and 13ppm "m" bitmap so it does not touch adjacent glyphs |
|
27 |
- Corrected asymmetrical parentheses in 13ppm bitmaps |
|
28 |
- Corrected missing encoding of .null and CR |
|
29 |
- Added installation instructions for Linux to README.txt |
|
30 |
|
|
31 |
9 October 2009 (Mark Simonson) Anonymous Pro Version 1.001 |
|
32 |
- Lowered comma and comma portion of semicolon for better legibility |
|
33 |
- Tweaked design of quotesinglbase and quotedblbase |
|
34 |
- Tweaked bitmaps for period and other "dot" punctuation for better legibility |
|
35 |
- Fixed bad value in CVT that caused uneven cap height at some sizes on Windows |
|
36 |
- Corrected 13ppem bitmaps for omicrontonos |
|
37 |
- Switched to the SIL Open Font License (OFL) |
|
38 |
- Created FONTLOG and new README file |
|
39 |
|
|
40 |
10 June 2009 (Mark Simonson) Anonymous Pro Version 1.0 |
|
41 |
- Initial release of Anonymous Pro fonts |
|
42 |
|
|
43 |
ACKNOWLEDGEMENTS |
|
44 |
|
|
45 |
Thanks to Susan Lesch and David Lamkins for creating the Anonymous 9 Macintosh bitmap font (1991-1994), the basis for the TrueType fonts Anonymous™ and its successor, Anonymous Pro. |
fonts/anonymous-pro/OFL.txt | ||
---|---|---|
1 |
Copyright (c) 2009, Mark Simonson (http://www.ms-studio.com, mark@marksimonson.com), |
|
2 |
with Reserved Font Name Anonymous Pro. |
|
3 |
|
|
4 |
This Font Software is licensed under the SIL Open Font License, Version 1.1. |
|
5 |
This license is copied below, and is also available with a FAQ at: |
|
6 |
http://scripts.sil.org/OFL |
|
7 |
|
|
8 |
|
|
9 |
----------------------------------------------------------- |
|
10 |
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 |
|
11 |
----------------------------------------------------------- |
|
12 |
|
|
13 |
PREAMBLE |
|
14 |
The goals of the Open Font License (OFL) are to stimulate worldwide |
|
15 |
development of collaborative font projects, to support the font creation |
|
16 |
efforts of academic and linguistic communities, and to provide a free and |
|
17 |
open framework in which fonts may be shared and improved in partnership |
|
18 |
with others. |
|
19 |
|
|
20 |
The OFL allows the licensed fonts to be used, studied, modified and |
|
21 |
redistributed freely as long as they are not sold by themselves. The |
|
22 |
fonts, including any derivative works, can be bundled, embedded, |
|
23 |
redistributed and/or sold with any software provided that any reserved |
|
24 |
names are not used by derivative works. The fonts and derivatives, |
|
25 |
however, cannot be released under any other type of license. The |
|
26 |
requirement for fonts to remain under this license does not apply |
|
27 |
to any document created using the fonts or their derivatives. |
|
28 |
|
|
29 |
DEFINITIONS |
|
30 |
"Font Software" refers to the set of files released by the Copyright |
|
31 |
Holder(s) under this license and clearly marked as such. This may |
|
32 |
include source files, build scripts and documentation. |
|
33 |
|
|
34 |
"Reserved Font Name" refers to any names specified as such after the |
|
35 |
copyright statement(s). |
|
36 |
|
|
37 |
"Original Version" refers to the collection of Font Software components as |
|
38 |
distributed by the Copyright Holder(s). |
|
39 |
|
|
40 |
"Modified Version" refers to any derivative made by adding to, deleting, |
|
41 |
or substituting -- in part or in whole -- any of the components of the |
|
42 |
Original Version, by changing formats or by porting the Font Software to a |
|
43 |
new environment. |
|
44 |
|
|
45 |
"Author" refers to any designer, engineer, programmer, technical |
|
46 |
writer or other person who contributed to the Font Software. |
|
47 |
|
|
48 |
PERMISSION & CONDITIONS |
|
49 |
Permission is hereby granted, free of charge, to any person obtaining |
|
50 |
a copy of the Font Software, to use, study, copy, merge, embed, modify, |
|
51 |
redistribute, and sell modified and unmodified copies of the Font |
|
52 |
Software, subject to the following conditions: |
|
53 |
|
|
54 |
1) Neither the Font Software nor any of its individual components, |
|
55 |
in Original or Modified Versions, may be sold by itself. |
|
56 |
|
|
57 |
2) Original or Modified Versions of the Font Software may be bundled, |
|
58 |
redistributed and/or sold with any software, provided that each copy |
|
59 |
contains the above copyright notice and this license. These can be |
|
60 |
included either as stand-alone text files, human-readable headers or |
|
61 |
in the appropriate machine-readable metadata fields within text or |
|
62 |
binary files as long as those fields can be easily viewed by the user. |
|
63 |
|
|
64 |
3) No Modified Version of the Font Software may use the Reserved Font |
|
65 |
Name(s) unless explicit written permission is granted by the corresponding |
|
66 |
Copyright Holder. This restriction only applies to the primary font name as |
|
67 |
presented to the users. |
|
68 |
|
|
69 |
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font |
|
70 |
Software shall not be used to promote, endorse or advertise any |
|
71 |
Modified Version, except to acknowledge the contribution(s) of the |
|
72 |
Copyright Holder(s) and the Author(s) or with their explicit written |
|
73 |
permission. |
|
74 |
|
|
75 |
5) The Font Software, modified or unmodified, in part or in whole, |
|
76 |
must be distributed entirely under this license, and must not be |
|
77 |
distributed under any other license. The requirement for fonts to |
|
78 |
remain under this license does not apply to any document created |
|
79 |
using the Font Software. |
|
80 |
|
|
81 |
TERMINATION |
|
82 |
This license becomes null and void if any of the above conditions are |
|
83 |
not met. |
|
84 |
|
|
85 |
DISCLAIMER |
|
86 |
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|
87 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF |
|
88 |
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT |
|
89 |
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE |
|
90 |
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
91 |
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL |
|
92 |
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
93 |
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM |
|
94 |
OTHER DEALINGS IN THE FONT SOFTWARE. |
index.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
header("Location: app/control/control.php"); |
|
4 |
|
|
5 |
?> |
Také k dispozici: Unified diff
Založení projektu
Založení nového projektu.