Skip to content
Snippets Groups Projects
Commit 2ca884b2 authored by GARDEL Valentin's avatar GARDEL Valentin
Browse files

fin partie 1

parent 33ebbe75
Branches
No related tags found
No related merge requests found
......@@ -16,6 +16,8 @@ CREATE TABLE `comment` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
alter table `comment` AUTO_INCREMENT=1;
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`email` varchar(128),
......
......@@ -3,24 +3,70 @@ require_once __DIR__ . '/vendor/autoload.php';
use Illuminate\Database\Capsule\Manager as DB;
use Slim\Slim;
use bddApp\model\User;
use bddApp\model\Comment;
$db = new DB();
$db->addConnection(parse_ini_file('conf.ini'));
$db->setAsGlobal();
$db->bootEloquent();
$character = \bddApp\model\Game::getCharacter();
foreach($character as $i)
print "Deck: ".$i->deck." name: ".$i->name.'</br>';
$rejane = User::find("rejane.frantzen@gmail.com");//new User();
if($rejane==NULL) {
$rejane = new User();
$rejane->email = "rejane.frantzen@gmail.com";
}
$rejane->last_name="frantzen";
$rejane->sur_name="rejane";
$rejane->adress="1 rue Truc Machin";
$rejane->phone="06.00.00.00.00";
$rejane->date_naiss="1998/06/27 (16:15)";
$rejane->save();
echo "Ajout de Rejane dans la table user</br>";
$app = new Slim();
/*
$app = new \Slim\Slim;
$app->get('/', function(){
$c=new ControllerPlanning();
$c->getCycle(1);
})->name('home');
$quentin = User::find("quentin.weber@gmail.com");//new User();
if($quentin==NULL) {
$quentin = new User();
$quentin->email = "quentin.weber@gmail.com";
}
$quentin->last_name = "weber";
$quentin->sur_name = "quentin";
$quentin->adress = "2 rue Truc Machin";
$quentin->phone = "06.00.00.00.01";
$quentin->date_naiss = "1999/03/17 (15:15)";
$quentin->save();
echo "Ajout de Quentin dans la table user</br>";
$app->run();
*/
\ No newline at end of file
$com1=Comment::find(1);
if($com1==NULL){
$com1=new Comment();
}
$com1->email="rejane.frantzen@gmail.com";
$com1->game_id="12342";
$com1->title="test";
$com1->content="Com1Test";
$com1->created_at=new DateTime();
$com1->save();
$com2=Comment::find(2);
if($com2==NULL){
$com2=new Comment();
}
$com2->email="rejane.frantzen@gmail.com";
$com2->game_id="12342";
$com2->title="test";
$com2->content="Com2Test";
$com2->created_at=new DateTime();
$com2->save();
$com3=Comment::find(3);
if($com3==NULL){
$com3=new Comment();
}
$com3->email="quentin.weber@gmail.com";
$com3->game_id="12342";
$com3->title="test";
$com3->content="Com3Test";
$com3->created_at=new DateTime();
$com3->save();
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment