Commit 5d23c759 authored by KELBERT Paul's avatar KELBERT Paul

merge ???? branch

parents de1213d5 00e571c2
# ApplicationsBD_CHEVALIER_TONDON_KELBERT
<<<<<<< HEAD
--- BRANCHE MASTER ---
=======
--- BRANCH SEANCE 2 ---
>>>>>>> 00e571c2cf9973734a3143a25a530d86763bda8a
# SÉANCE 1
LANCER INDEX.PHP DANS LE DOSSIER "SEANCE"
NE PAS OUBLIER DE MODIFIER LE FICHIER CONF.INI POUR ACCEDER A LA BASE DE DONNEES
\ No newline at end of file
@startuml
package GamePedia #GreenYellow/LightGoldenRodYellow {
class Jeu {
-id PK
-nom
-alias
-courte
-longue
-sortie_attendu_jour
-sortie_attendu_mois
-sortie_attendu_trimestre
-sortie_attendu_annee
-sortie_reel_date
}
class Theme {
-id PK
-name
}
class Genre {
-id PK
-nom
-courte
-longue
}
class Platforme {
-id PK
-nom
-alias
-abbreviation
-courte
-longue
-c_id
-install_base
-dateSortie
-online_support
-original_price
}
class Classement {
-id PK
-nom
-courte
-longue
}
class Compagnie {
-id PK
-nom
-alias
-abreviation
-courte
-longue
-dateCreation
-adresse
-ville
-pays
-etat
-tel
-site
}
class Personnage {
-id PK
-nom
-nomReel
-pseudonyme
-alias
-dateNaissance
-genre
-courte
-longue
-premiere_apparition
}
class Amis {
-persoID1
-persoID2
}
class Ennemis {
-persoID1
-persoID2
}
class developpeurs {
-jeu_id
-compagnie_id
}
class editeur {
-jeu_id
-compagnie_id
}
class simulaire {
-jeuID1
-jeuID2
}
class jeu_classement {
-id PK
-nom
-classement_id
}
Jeu "*" - "*" Personnage
Jeu "*" - "*" Genre
Jeu "*" - "*" Classement
Jeu "*" - "*" Platforme
Jeu "*" - "*" Jeu
Jeu "*" - "1" Classement
Jeu "*" - "*" Theme
(Jeu,Classement) . jeu_classement
(Jeu,Jeu) . simulaire
(Jeu,Compagnie) . developpeurs
(Jeu,Compagnie) . editeur
(Personnage,Personnage) . Amis
(Personnage,Personnage) . Ennemis
}
@enduml
\ No newline at end of file
<?php
require 'vendor/autoload.php';
use seance\reponse\CQuestion1;
$q = new CQuestion1();
\ No newline at end of file
<?php
require 'vendor/autoload.php';
use seance\reponse\CQuestion2;
new CQuestion2();
\ No newline at end of file
<?php
require 'vendor/autoload.php';
use seance\reponse\CQuestion3;
new CQuestion3();
\ No newline at end of file
<?php
require 'vendor/autoload.php';
use seance\reponse\CQuestion4;
new CQuestion4();
\ No newline at end of file
<?php
require 'vendor/autoload.php';
use seance\reponse\CQuestion5;
new CQuestion5();
\ No newline at end of file
{
"require":{
"illuminate/database": "5.5.*",
"php": ">=7.3"
},
"autoload":{
"psr-4": {
"seance\\" : "src/"
}
}
}
This diff is collapsed.
driver=mysql
username=root
password=
host=localhost
database=applibd
\ No newline at end of file
<?php
require 'vendor/autoload.php';
use seance\modele\Game;
echo "<a href='Question1.php'>question 1</a><br>";
echo "<a href='Question2.php'>question 2</a><br>";
echo "<a href='Question3.php'>question 3</a><br>";
echo "<a href='Question4.php'>question 4</a><br>";
echo "<a href='Question5.php'>question 5</a><br>";
<?php
namespace seance\modele;
class Character extends \Illuminate\Database\Eloquent\Model
{
protected $table = 'character';
protected $primaryKey = 'id';
public $timestamps = false;
}
\ No newline at end of file
<?php
namespace seance\modele;
class Company extends \Illuminate\Database\Eloquent\Model
{
protected $table = 'company';
protected $primaryKey = 'id';
public $timestamps = false;
}
\ No newline at end of file
<?php
namespace seance\modele;
class Game extends \Illuminate\Database\Eloquent\Model
{
protected $table = 'game';
protected $primaryKey = 'id';
public $timestamps = false;
}
\ No newline at end of file
<?php
namespace seance\modele;
class Platform extends \Illuminate\Database\Eloquent\Model
{
protected $table = 'platform';
protected $primaryKey = 'id';
public $timestamps = false;
}
\ No newline at end of file
<?php
namespace seance\reponse;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use seance\modele\Game;
use Illuminate\Database\Capsule\Manager as DB;
class CQuestion1
{
public function __construct()
{
echo "<a href='index.php'>Retour au menu</a><br><br>";
$file = parse_ini_file('conf.ini');
$db = new DB();
$db->addConnection($file);
$db->setAsGlobal();
$db->bootEloquent();
$c = Game::where("name", "like","%mario%")->get();
foreach ($c as $char) {
echo $char->name . "<br>";
}
}
}
\ No newline at end of file
<?php
namespace seance\reponse;
use Illuminate\Database\Capsule\Manager as DB;
use seance\modele\Company;
class CQuestion2
{
public function __construct()
{
echo "<a href='index.php'>Retour au menu</a><br><br>";
$file = parse_ini_file('conf.ini');
$db = new DB();
$db->addConnection($file);
$db->setAsGlobal();
$db->bootEloquent();
$c = Company::where("location_country", "=","Japan")->get();
foreach ($c as $char) {
echo $char->id . " " . $char->name . "<br>";
}
}
}
\ No newline at end of file
<?php
namespace seance\reponse;
use Illuminate\Database\Capsule\Manager as DB;
use seance\modele\Platform;
class CQuestion3
{
public function __construct()
{
echo "<a href='index.php'>Retour au menu</a><br><br>";
$file = parse_ini_file('conf.ini');
$db = new DB();
$db->addConnection($file);
$db->setAsGlobal();
$db->bootEloquent();
$c = Platform::where("install_base", ">=","10000")->get();
foreach ($c as $char) {
echo $char->id . " " . $char->name . "<br>";
}
}
}
\ No newline at end of file