Merge branch 'master' of https://github.com/xdrm-brackets/projetphp
merge
This commit is contained in:
commit
1e1ace2800
|
@ -13,7 +13,7 @@ function autoloader($class) {
|
|||
if(strpos($class, 'StaticRepo') !== FALSE){
|
||||
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'repositories'.DIRECTORY_SEPARATOR.$class . '.php';
|
||||
}
|
||||
//si on charge un Repo
|
||||
//si on charge un repos
|
||||
elseif(strpos($class, 'Repo') !== FALSE){
|
||||
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'repositories'.DIRECTORY_SEPARATOR.'repos'.DIRECTORY_SEPARATOR.$class . '.php';
|
||||
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: seekdasky
|
||||
* Date: 02/12/15
|
||||
* Time: 12:36
|
||||
*/
|
||||
class MedecinRepo
|
||||
{
|
||||
private $connexion;
|
||||
|
||||
public function __construct(){
|
||||
$this->connexion = StaticRepo::getConnexion();
|
||||
}
|
||||
|
||||
public function getById($id){
|
||||
$req = $this->connexion->prepare('SELECT * FROM Medecin WHERE Id = :id');
|
||||
$req->execute(['id' => $id]);
|
||||
return $req->fetchAll();
|
||||
|
||||
}
|
||||
|
||||
public function add($civilite,$prenom,$nom){
|
||||
|
||||
}
|
||||
|
||||
public function delete($idPatient){
|
||||
|
||||
}
|
||||
|
||||
public function search($nom,$prenom){
|
||||
|
||||
}
|
||||
|
||||
public function getPatients($idMedecin){
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: seekdasky
|
||||
* Date: 02/12/15
|
||||
* Time: 12:36
|
||||
*/
|
||||
class PatientRepo
|
||||
{
|
||||
private $connexion;
|
||||
|
||||
public function __construct(){
|
||||
$this->connexion = StaticRepo::getConnexion();
|
||||
}
|
||||
|
||||
public function getById($id){
|
||||
$req = $this->connexion->prepare('SELECT * FROM Patient WHERE Id = :id');
|
||||
$req->execute(['id' => $id]);
|
||||
return $req->fetchAll();
|
||||
|
||||
}
|
||||
|
||||
public function add($civilite,$prenom,$nom,$adresse,$ville,$codePostal,$dateNaissance,$lieuNaissance,$numSecu,$medecinTraitant = null){
|
||||
|
||||
$req = $this->connexion->prepare('INSERT INTO Patient VALUES (:civilite,:nom,:prenom,:adresse,:ville,:codePostal,:dateNaissance,:lieuNaissance,:numSecu,DEFAULT,:medecin)');
|
||||
$req->execute(['civilite' => $civilite,
|
||||
'nom' => $nom,
|
||||
'prenom' => $prenom,
|
||||
'adresse' => $adresse,
|
||||
'ville' => $ville,
|
||||
'codePostal' => $codePostal,
|
||||
'dateNaissance' => $dateNaissance,
|
||||
'lieuNaissance' => $lieuNaissance,
|
||||
'numSecu' => $numSecu,
|
||||
'medecin' => $medecinTraitant ]);
|
||||
|
||||
}
|
||||
|
||||
public function delete($idPatient){
|
||||
|
||||
}
|
||||
|
||||
public function updateMedecinTraitant($idPatient,$IdMedecin){
|
||||
|
||||
}
|
||||
|
||||
public function search($nom,$prenom){
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: seekdasky
|
||||
* Date: 02/12/15
|
||||
* Time: 12:36
|
||||
*/
|
||||
class RDVRepo
|
||||
{
|
||||
private $connexion;
|
||||
|
||||
public function __construct(){
|
||||
$this->connexion = StaticRepo::getConnexion();
|
||||
}
|
||||
|
||||
public function getById($id){
|
||||
$req = $this->connexion->prepare('SELECT * FROM RDV WHERE Id = :id');
|
||||
$req->execute(['id' => $id]);
|
||||
return $req->fetchAll();
|
||||
|
||||
}
|
||||
|
||||
public function getByDate($date){
|
||||
|
||||
}
|
||||
|
||||
public function delete($idPatient){
|
||||
|
||||
}
|
||||
|
||||
public function add($timestamp,$duree,$idPatient,$idMedecin){
|
||||
|
||||
}
|
||||
|
||||
public function updateDateTime($idRDV,$dateTime){
|
||||
|
||||
}
|
||||
|
||||
public function getByPatientAndDate($idPatient,$date){
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: seekdasky
|
||||
* Date: 02/12/15
|
||||
* Time: 12:36
|
||||
*/
|
||||
class StatsRepo
|
||||
{
|
||||
private $connexion;
|
||||
|
||||
public function __construct(){
|
||||
$this->connexion = StaticRepo::getConnexion();
|
||||
}
|
||||
|
||||
public function getStats(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue