Commit 9f8b3279 authored by Kbida Vincent's avatar Kbida Vincent
parents ed4b719b 057f8062
<?php
// Import de la class qui a pour but de charger tous les imports du projet
require_once './vendor/autoload.php';
require_once __DIR__ . '/vendor/autoload.php';
// Liste des tous les imports
......@@ -14,17 +14,7 @@ use \Slim\Slim;
$db = new DB();
// ajout des informations pour se connecter à la base de données
$ini_file = parse_ini_file('src/conf/conf.ini');
$db->addConnection([
'driver' => $ini_file['driver'],
'host' => $ini_file['host'],
'database' => $ini_file['database'],
'username' => $ini_file['username'],
'password' => $ini_file['password'],
'charset' => $ini_file['charset'],
'collation' => $ini_file['charset'] . '_unicode_ci',
'prefix' => ''
]);
$db->addConnection(parse_ini_file("conf/conf.ini"));
// demarage de la basse de donnée
$db->setAsGlobal();
......
......@@ -9,35 +9,35 @@ use bdd\views\RequeteView;
class ControleurRequete{
public function selectMario(){
$jeu = Game::select('name')->where('name','like','%Mario%','or','alias','like','%Mario%')->get();
$jeu = \bdd\models\Game::select('name')->where('name','like','%Mario%','or','alias','like','%Mario%')->get();
$vue = new RequeteView($jeu);
$vue->render(1);
}
public function selectJapanCompany(){
$company = Company::select('name')->where('location_country','like','%Japan%')->get();
$vue = new RequeteView($company);
$company = \bdd\models\Company::select('name')->where('location_country','like','%Japan%')->get();
$vue = new \bdd\views\RequeteView($company);
$vue->render(1);
}
public function selectPlatformBase(){
$platform = Platform::select('name')->where('install_base','>','10000000')->get();
$vue = new RequeteView($platform);
$platform = \bdd\models\Platform::select('name')->where('install_base','>','10000000')->get();
$vue = new \bdd\views\RequeteView($platform);
$vue->render(1);
}
public function selectGameNumber(){
$game = Game::select('name')->orderBy('name')->take(442)->skip(21173)->get();
$vue = new RequeteView($game);
$game = \bdd\models\Game::select('name')->orderBy('name')->take(442)->skip(21173)->get();
$vue = new \bdd\views\RequeteView($game);
$vue->render(1);
}
public function selectPage($p){
$p = ($p-1)*500;
$jeu = Game::select('id','name')->orderBy('id')->take(500)->skip($p)->get();
$vue = new RequeteView($jeu);
$jeu = \bdd\models\Game::select('id','name')->orderBy('id')->take(500)->skip($p)->get();
$vue = new \bdd\views\RequeteView($jeu);
$vue->render(1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment