Update MVC modèle
All components are in MVC mode Bug to registre presente
This commit is contained in:
49
UserWebSite/modele/home.php
Normal file
49
UserWebSite/modele/home.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
function get_MemberCount()
|
||||
{
|
||||
global $bdd;
|
||||
|
||||
$TotalDesMembres = $bdd->query('SELECT COUNT(*) FROM Client')->fetchColumn();
|
||||
return $TotalDesMembres;
|
||||
}
|
||||
function get_LastMember()
|
||||
{
|
||||
global $bdd;
|
||||
$req = $bdd->query('SELECT pseudo, idclient FROM Client ORDER BY idclient DESC LIMIT 0, 1');
|
||||
$data = $req->fetch();
|
||||
return $data;
|
||||
}
|
||||
function get_VoitureCount()
|
||||
{
|
||||
global $bdd;
|
||||
|
||||
$TotalDesVoitures = $bdd->query('SELECT COUNT(*) FROM Voiture')->fetchColumn();
|
||||
return $TotalDesVoitures;
|
||||
}
|
||||
function get_CarInfoId()
|
||||
{
|
||||
global $bdd;
|
||||
$id=1;
|
||||
|
||||
//On prend les infos de la voiture
|
||||
$req = $bdd->prepare('SELECT latitude, longitude FROM Voiture WHERE idvoiture=:id');
|
||||
$req->bindValue(':id',$id,PDO::PARAM_INT);
|
||||
$req->execute();
|
||||
$data = $req->fetch();
|
||||
return $data;
|
||||
}
|
||||
function get_allMember()
|
||||
{
|
||||
//NOT USE actually
|
||||
global $bdd;
|
||||
//Cette requête permet d'obtenir tout sur le forum
|
||||
$req = $bdd->prepare('SELECT cat_id, cat_nom,forum_forum.forum_id, forum_name, forum_desc, forum_post, forum_topic, auth_view,
|
||||
forum_topic.topic_id, forum_topic.topic_post, post_id, post_time, post_createur, membre_pseudo, membre_id FROM forum_categorie
|
||||
LEFT JOIN forum_forum ON forum_categorie.cat_id = forum_forum.forum_cat_id
|
||||
LEFT JOIN forum_post ON forum_post.post_id = forum_forum.forum_last_post_id
|
||||
LEFT JOIN forum_topic ON forum_topic.topic_id = forum_post.topic_id
|
||||
LEFT JOIN forum_membres ON forum_membres.membre_id = forum_post.post_createur
|
||||
WHERE auth_view <= :lvl ORDER BY cat_ordre, forum_ordre DESC');
|
||||
$req->bindValue(':lvl',$lvl,PDO::PARAM_INT);
|
||||
$req->execute();
|
||||
}
|
||||
Reference in New Issue
Block a user