Skip to content

Commit 3ca0f56

Browse files
authored
Add files via upload
1 parent 111015f commit 3ca0f56

22 files changed

+23558
-2
lines changed

DoesntMatter.php

+144
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
<?php
2+
/**
3+
* Group Name : Doesnt Matter
4+
* Students:
5+
* Joao Vitor Wilke Silva 300278748
6+
* Alina Pak 300277280
7+
* Sergei Bisborodov 300264653
8+
*
9+
*/
10+
11+
// Requires the files
12+
require_once("inc/config.inc.php");
13+
require_once("inc/PDOAgent.class.php");
14+
require_once("inc/Page.class.php");
15+
require_once("inc/Playermapper.class.php");
16+
require_once("inc/Teammapper.class.php");
17+
require_once("inc/Coachmapper.class.php");
18+
19+
// Sets the page title
20+
Page::$title = "Doesn't matter";
21+
22+
// Renders the page header
23+
Page::header();
24+
25+
// Instantiate the mappers for the 3 entities (Players, Teams and Coaches)
26+
$pm = new playermapper();
27+
$tm = new teammapper();
28+
$cm = new coachmapper();
29+
30+
if (!empty($_GET))
31+
{
32+
// Verifies that one of the entities was selected by clicking the link
33+
if (isset($_GET['entity']))
34+
{
35+
// Renders the "search for terms form
36+
Page::searchForm();
37+
// Verifies which link was selected in order to display the appropriate entity's information
38+
switch ($_GET['entity'])
39+
{
40+
// If PLAYERS was selected
41+
case 'players':
42+
// Verifies if the user input any search terms, and if so renders a table with the PLAYERS that partially and/or fully match the search term(s)
43+
if (!empty($_GET['search']))
44+
{
45+
Page::createTablePlayers($pm->listAllWithSearch($_GET['search']));
46+
}
47+
// If no search term(s) were provided, renders the complete PLAYERS table
48+
else
49+
{
50+
Page::createTablePlayers($pm->listAll());
51+
}
52+
// Displays players' statistics
53+
Page::showPlayersStatistics($pm->getStatistics());
54+
break;
55+
// If TEAMS was selected
56+
case 'teams':
57+
// Verifies if the user input any search terms, and if so, renders a table with the TEAMS that partially and/or fully match the search term(s)
58+
if (!empty($_GET['search']))
59+
{
60+
Page::createTableTeams($tm->listAllWithSearch($_GET['search']));
61+
}
62+
// If no search term(s) were provided, renders the complete TEAMS table
63+
else
64+
{
65+
Page::createTableTeams($tm->listAll());
66+
}
67+
// Displays teams' statistics
68+
Page::showTeamsStatistics($tm->getStatistics());
69+
break;
70+
// If COACHES was selected
71+
case 'coaches':
72+
// Verifies if the user input any search terms, and if so renders a table with the COACHES that partially and/or fully match the search term(s)
73+
if (!empty($_GET['search']))
74+
{
75+
Page::createTableCoaches($cm->listAllWithSearch($_GET['search']));
76+
}
77+
// If no search term(s) were provided, renders the complete COACHES table
78+
else
79+
{
80+
Page::createTableCoaches($cm->listAll());
81+
}
82+
// Displays coaches' statistics
83+
Page::showCoachesStatistics($cm->getStatistics());
84+
break;
85+
}
86+
}
87+
// Verifies if the user clicked on "ADD, UPDATE OR DELETE" in ANY of the entities
88+
else if (isset($_GET['action']))
89+
{
90+
switch ($_GET['action'])
91+
{
92+
// Renders the form to update the selected player
93+
case 'updatePlayer':
94+
Page::updatePlayerForm($pm->listOne($_GET['playerID']),$tm->listAll());
95+
break;
96+
// Renders the form to update the selected team
97+
case 'updateTeam':
98+
Page::updateTeamForm($tm->listOne($_GET['teamID']));
99+
break;
100+
// Renders the form to update the selected coach - jvws
101+
case 'updateCoach':
102+
Page::updateCoachForm($cm->listOne($_GET['coachID']),$tm->listAll());
103+
break;
104+
// Calls the function to delete the selected player and renders the player table
105+
case 'deletePlayer':
106+
$pm->delete($_GET['playerID']);
107+
Page::createTablePlayers($pm->listAll());
108+
break;
109+
// Calls the function to delete the selected team and renders the team table
110+
case 'deleteTeam':
111+
$tm->delete($_GET['teamID']);
112+
Page::createTableTeams($tm->listAll());
113+
break;
114+
// Calls the function to delete the selected coach and render the coach table
115+
case 'deleteCoach':
116+
$cm->delete($_GET['coachID']);
117+
Page::createTableCoaches($cm->listAll());
118+
break;
119+
case 'createPlayer':
120+
// Renders the form to add a new player
121+
Page::addPlayerForm($tm->listAll());
122+
break;
123+
case 'createTeam':
124+
// Renders the form to add a new team
125+
Page::addTeamForm();
126+
break;
127+
case 'createCoach':
128+
// Renders a form to add a new coach
129+
Page::addCoachForm($tm->listAll());
130+
break;
131+
}
132+
}
133+
}
134+
135+
/**Renders the clocks at the bottom of the page
136+
* The clocks are rendered via HTML Canvas(New technology 2)
137+
* and the times used in the clocks come from the API we used *
138+
*/
139+
Page::showClocks();
140+
141+
// Renders the page footer
142+
Page::footer();
143+
144+
?>

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014-2018 Materialize
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+91-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,91 @@
1-
# php-and-mySQL
2-
CRUD operations on mySQL database using php PDO Agent
1+
<p align="center">
2+
<a href="http://materializecss.com/">
3+
<img src="http://materializecss.com/res/materialize.svg" width="150">
4+
</a>
5+
</p>
6+
7+
<h3 align="center">MaterializeCSS</h3>
8+
9+
<p align="center">
10+
Materialize, a CSS Framework based on material design.
11+
<br>
12+
<a href="http://materializecss.com/"><strong>-- Browse the docs --</strong></a>
13+
<br>
14+
<br>
15+
<a href="https://travis-ci.org/Dogfalo/materialize">
16+
<img src="https://travis-ci.org/Dogfalo/materialize.svg?branch=master" alt="Travis CI badge">
17+
</a>
18+
<a href="https://badge.fury.io/js/materialize-css">
19+
<img src="https://badge.fury.io/js/materialize-css.svg" alt="npm version badge">
20+
</a>
21+
<a href="https://cdnjs.com/libraries/materialize">
22+
<img src="https://img.shields.io/cdnjs/v/materialize.svg" alt="CDNJS version badge">
23+
</a>
24+
<a href="https://david-dm.org/Dogfalo/materialize">
25+
<img src="https://david-dm.org/Dogfalo/materialize/status.svg" alt="dependencies Status badge">
26+
</a>
27+
<a href="https://david-dm.org/Dogfalo/materialize#info=devDependencies">
28+
<img src="https://david-dm.org/Dogfalo/materialize/dev-status.svg" alt="devDependency Status badge">
29+
</a>
30+
<a href="https://gitter.im/Dogfalo/materialize">
31+
<img src="https://badges.gitter.im/Join%20Chat.svg" alt="Gitter badge">
32+
</a>
33+
</p>
34+
35+
## Table of Contents
36+
- [Quickstart](#quickstart)
37+
- [Documentation](#documentation)
38+
- [Supported Browsers](#supported-browsers)
39+
- [Changelog](#changelog)
40+
- [Testing](#testing)
41+
- [Contributing](#contributing)
42+
- [Copyright and license](#copyright-and-license)
43+
44+
## Quickstart:
45+
Read the [getting started guide](http://materializecss.com/getting-started.html) for more information on how to use materialize.
46+
47+
- [Download the latest release](https://github.com/Dogfalo/materialize/releases/latest) of materialize directly from GitHub. ([Beta](https://github.com/Dogfalo/materialize/releases/))
48+
- Clone the repo: `git clone https://github.com/Dogfalo/materialize.git` (Beta: `git clone -b v1-dev https://github.com/Dogfalo/materialize.git`)
49+
- Include the files via [cdnjs](https://cdnjs.com/libraries/materialize). More [here](http://materializecss.com/getting-started.html). ([Beta](https://cdnjs.com/libraries/materialize/1.0.0-beta))
50+
- Install with [npm](https://www.npmjs.com): `npm install materialize-css` (Beta: `npm install materialize-css@next`)
51+
- Install with [Bower](https://bower.io): `bower install materialize` ([DEPRECATED](https://bower.io/blog/2017/how-to-migrate-away-from-bower/))
52+
- Install with [Atmosphere](https://atmospherejs.com): `meteor add materialize:materialize` (Beta: `meteor add materialize:materialize@=1.0.0-beta`)
53+
54+
## Documentation
55+
The documentation can be found at <http://materializecss.com>. To run the documentation locally on your machine, you need [Node.js](https://nodejs.org/en/) installed on your computer.
56+
57+
### Running documentation locally
58+
Run these commands to set up the documentation:
59+
60+
```bash
61+
git clone https://github.com/Dogfalo/materialize
62+
cd materialize
63+
npm install
64+
```
65+
66+
Then run `grunt monitor` to compile the documentation. When it finishes, open a new browser window and navigate to `localhost:8000`. We use [BrowserSync](https://www.browsersync.io/) to display the documentation.
67+
68+
### Documentation for previous releases
69+
Previous releases and their documentation are available for [download](https://github.com/Dogfalo/materialize/releases).
70+
71+
## Supported Browsers:
72+
Materialize is compatible with:
73+
74+
- Chrome 35+
75+
- Firefox 31+
76+
- Safari 9+
77+
- Opera
78+
- Edge
79+
- IE 11+
80+
81+
## Changelog
82+
For changelogs, check out [the Releases section of materialize](https://github.com/Dogfalo/materialize/releases) or the [CHANGELOG.md](CHANGELOG.md).
83+
84+
## Testing
85+
We use Jasmine as our testing framework and we're trying to write a robust test suite for our components. If you want to help, [here's a starting guide on how to write tests in Jasmine](CONTRIBUTING.md#jasmine-testing-guide).
86+
87+
## Contributing
88+
Check out the [CONTRIBUTING document](CONTRIBUTING.md) in the root of the repository to learn how you can contribute. You can also browse the [help-wanted](https://github.com/Dogfalo/materialize/labels/help-wanted) tag in our issue tracker to find things to do.
89+
90+
## Copyright and license
91+
Code Copyright 2018 Materialize. Code released under the MIT license.

api/time.php

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
// API
4+
$timezone = $_GET['zone'];
5+
$url = 'http://api.timezonedb.com/v2/get-time-zone?key=PTYIG6CV3HI5&format=json&by=zone&zone='.$timezone;
6+
$json = file_get_contents($url);
7+
header('Content-type:application/json;charset=utf-8');
8+
echo $json;
9+
10+
?>

css/grid.css

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
body {
2+
margin: 40px;
3+
}
4+
5+
.main {
6+
display: grid;
7+
grid-gap: 5px;
8+
grid-template-columns: 220px 300px;
9+
grid-template-areas:
10+
"...... header header"
11+
"stat content content"
12+
"clock clock clock";
13+
}
14+
15+
.box {
16+
background-color: #E0F8EC;
17+
color: #585858;
18+
border-radius: 5px;
19+
padding: 10px;
20+
font-size: 100%;
21+
}
22+
23+
.header {
24+
grid-area: header;
25+
}
26+
27+
.content {
28+
grid-area: content;
29+
}
30+
31+
.stat {
32+
grid-area: stat;
33+
}
34+
35+
.clock {
36+
grid-area: clock;
37+
}
38+
39+
40+
.header {
41+
background-color: #01DFA5;
42+
}

0 commit comments

Comments
 (0)