diff --git a/.gitignore b/.gitignore index 8c67458ebcaacf4276b6b413ffcb84f95d9fff54..96b8163467efe25dfb795450ed0e7929ed96ef64 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ -*.idea/ -*.project/ -*games_data.sql -*games_schema.sql -*vendor/ +*.idea/ +*.project/ +*games_data.sql +*games_schema.sql +*vendor/ *conf/ \ No newline at end of file diff --git a/tp1/composer.lock b/tp1/composer.lock index ac9743ebeda7ec517bf05864f2d3a37abaef7c6b..cc76f2dae44507a3704e2a3d59d4424bf7de0c05 100644 --- a/tp1/composer.lock +++ b/tp1/composer.lock @@ -5,8 +5,7 @@ "This file is @generated automatically" ], "content-hash": "3e70f60fac24a2aa60eedcd9ce200f65", - "packages": [ - { + "packages": [{ "name": "doctrine/inflector", "version": "1.3.1", "source": { @@ -41,8 +40,7 @@ "license": [ "MIT" ], - "authors": [ - { + "authors": [{ "name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com" }, @@ -107,12 +105,10 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], + "authors": [{ + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }], "description": "The Illuminate Container package.", "homepage": "https://laravel.com", "time": "2018-01-19T17:58:33+00:00" @@ -151,12 +147,10 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], + "authors": [{ + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }], "description": "The Illuminate Contracts package.", "homepage": "https://laravel.com", "time": "2018-03-20T15:34:35+00:00" @@ -204,12 +198,10 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], + "authors": [{ + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }], "description": "The Illuminate Database package.", "homepage": "https://laravel.com", "keywords": [ @@ -267,12 +259,10 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], + "authors": [{ + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }], "description": "The Illuminate Support package.", "homepage": "https://laravel.com", "time": "2018-08-10T19:40:01+00:00" @@ -313,12 +303,10 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Kyle", - "email": "kylekatarnls@gmail.com" - } - ], + "authors": [{ + "name": "Kyle", + "email": "kylekatarnls@gmail.com" + }], "description": "Update helper", "time": "2019-07-29T11:03:54+00:00" }, @@ -354,12 +342,10 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "PHP Enum contributors", - "homepage": "https://github.com/myclabs/php-enum/graphs/contributors" - } - ], + "authors": [{ + "name": "PHP Enum contributors", + "homepage": "https://github.com/myclabs/php-enum/graphs/contributors" + }], "description": "PHP Enum implementation", "homepage": "http://github.com/myclabs/php-enum", "keywords": [ @@ -412,13 +398,11 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Brian Nesbitt", - "email": "brian@nesbot.com", - "homepage": "http://nesbot.com" - } - ], + "authors": [{ + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "http://nesbot.com" + }], "description": "A simple API extension for DateTime.", "homepage": "http://carbon.nesbot.com", "keywords": [ @@ -460,12 +444,10 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], + "authors": [{ + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + }], "description": "Common Container Interface (PHP FIG PSR-11)", "homepage": "https://github.com/php-fig/container", "keywords": [ @@ -509,12 +491,10 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], + "authors": [{ + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + }], "description": "Common interfaces for simple caching", "keywords": [ "cache", @@ -556,13 +536,11 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Josh Lockhart", - "email": "info@joshlockhart.com", - "homepage": "http://www.joshlockhart.com/" - } - ], + "authors": [{ + "name": "Josh Lockhart", + "email": "info@joshlockhart.com", + "homepage": "http://www.joshlockhart.com/" + }], "description": "Slim Framework, a PHP micro framework", "homepage": "http://github.com/codeguy/Slim", "keywords": [ @@ -610,8 +588,7 @@ "license": [ "MIT" ], - "authors": [ - { + "authors": [{ "name": "Nicolas Grekas", "email": "p@tchwork.com" }, @@ -693,8 +670,7 @@ "license": [ "MIT" ], - "authors": [ - { + "authors": [{ "name": "Fabien Potencier", "email": "fabien@symfony.com" }, @@ -705,7 +681,7 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2019-12-12T12:53:52+00:00" + "time": "2020-02-04T09:32:40+00:00" }, { "name": "symfony/translation-contracts", @@ -742,8 +718,7 @@ "license": [ "MIT" ], - "authors": [ - { + "authors": [{ "name": "Nicolas Grekas", "email": "p@tchwork.com" }, @@ -775,4 +750,4 @@ "php": ">=7.0" }, "platform-dev": [] -} +} \ No newline at end of file diff --git a/tp1/src/controleur/ControleurRequete.php b/tp1/src/controleur/ControleurRequete.php new file mode 100644 index 0000000000000000000000000000000000000000..40cbd8fffd12d7b4cac1a3111e06de0194a72024 --- /dev/null +++ b/tp1/src/controleur/ControleurRequete.php @@ -0,0 +1,57 @@ +<?php + +namespace bdd\controleur; + +use bdd\models\company; +use bdd\models\game; +use bdd\models\platform; + +class ControleurRequete{ + public function selectMario(){ + $jeu = \bdd\models\game::select('name')->where('name','like','%Mario%','or','alias','like','%Mario%')->get(); + + $vue = new \bdd\vue\RequeteVue($jeu); + $html = $vue->render(1); + $rs->getBody()->write($html); + return $rs; + + + + } + + public function selectCompanyCountry(){ + $company = \bdd\models\company::select('name')->where('location_country','like','%Japan%')->get(); + $vue = new \bdd\vue\RequeteVue($company); + $html = $vue->render(1); + $rs->getBody()->write($html); + return $rs; + + } + + public function selectPlatformBase(){ + $platform = \bdd\models\platform::select('name')->where('install_base','>','10000000')->get(); + $vue = new \bdd\vue\RequeteVue($platform); + $html = $vue->render(1); + $rs->getBody()->write($html); + return $rs; + } + + public function selectGameNumber(){ + $game = \bdd\models\game::select('name')->orderBy('name')->limit('21173','422')->get(); + $vue = new \bdd\vue\RequeteVue($game); + $html = $vue->render(1); + $rs->getBody()->write($html); + return $rs; + } + + public function selectPage($p){ + $p = ($p-1)*500; + $jeu = \bdd\models\game::select('id','name')->orderBy('id')->limit($p,'500')->get(); + $vue = new \bdd\vue\RequeteVue($jeu); + $html = $vue->render(1); + $rs->getBody()->write($html); + return $rs; + } + + +} \ No newline at end of file diff --git a/tp1/src/controleur/ControleurRequeteExo2.php b/tp1/src/controleur/ControleurRequeteExo2.php new file mode 100644 index 0000000000000000000000000000000000000000..16d68993ea93bf936f42d665bc62e60ef5605cd1 --- /dev/null +++ b/tp1/src/controleur/ControleurRequeteExo2.php @@ -0,0 +1,12 @@ +<?php + +namespace bdd\controleur; + +use bdd\models\company; +use bdd\models\game; +use bdd\models\platform; + +class ControleurRequete{ + + +} \ No newline at end of file diff --git a/tp1/src/vue/HomeVue.php b/tp1/src/vue/HomeVue.php new file mode 100644 index 0000000000000000000000000000000000000000..58b3698329365140592a8442b4925ae40e962d46 --- /dev/null +++ b/tp1/src/vue/HomeVue.php @@ -0,0 +1,25 @@ +<?php + + +namespace src\vue; + + +class HomeVue +{ + public function renderHome{ + echo<<<END + <!DOCTYPE html> + <html lang=" "fr"> + <head> + <meta charset="utf-8"> + <title>HOME</title> + </head> + + <body> + <a href="#" title="retour à la page d'accueil"><h1>Accueil</h1></a> +</body> + </html> +END; + + } +} \ No newline at end of file