projet-php/toBDD.php

28 lines
845 B
PHP
Raw Normal View History

2015-12-03 11:00:22 +00:00
<?php
/**
* Created by PhpStorm.
* User: seekdasky
* Date: 03/12/15
* Time: 11:52
*/
2015-12-03 11:25:02 +00:00
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
2015-12-03 11:00:22 +00:00
require_once('autoloader.php');
2015-12-03 11:25:02 +00:00
$jsonP = json_decode(file_get_contents('Docs/PatientExemple.json'),true);
$jsonM = json_decode(file_get_contents('Docs/MedecinExemple.json'),true);
var_dump(StaticRepo::testConnexion());
2015-12-03 11:00:22 +00:00
$repo = new PatientRepo();
2015-12-03 11:25:02 +00:00
$repoM = new MedecinRepo();
2015-12-03 11:00:22 +00:00
foreach($jsonM as $patient) {
2015-12-03 11:25:02 +00:00
$repoM->add($patient['Civilite'], $patient['Prenom'], $patient['Nom']);
2015-12-03 11:00:22 +00:00
}
foreach($jsonP as $patient){
2015-12-03 11:25:02 +00:00
$repo->add($patient['Civilite'],$patient['Prenom'],$patient['Nom'],$patient['Adresse'],NULL,$patient['Ville'],$patient['CodePostal'],$patient['DateNaissance'],$patient['LieuNaissance'],$patient['NumSecuriteSociale'],$patient['MedecinTraitant']);
2015-12-03 11:00:22 +00:00
}