Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
S4AI2_Game_WEBER_GARDEL_GREGOIRE_FRANTZEN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FRANTZEN Rejane
S4AI2_Game_WEBER_GARDEL_GREGOIRE_FRANTZEN
Commits
2ca884b2
Commit
2ca884b2
authored
5 years ago
by
GARDEL Valentin
Browse files
Options
Downloads
Patches
Plain Diff
fin partie 1
parent
33ebbe75
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
BDD/schema_TP4.sql
+2
-0
2 additions, 0 deletions
BDD/schema_TP4.sql
php/index.php
+58
-12
58 additions, 12 deletions
php/index.php
with
60 additions
and
12 deletions
BDD/schema_TP4.sql
+
2
−
0
View file @
2ca884b2
...
...
@@ -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
),
...
...
This diff is collapsed.
Click to expand it.
php/index.php
+
58
−
12
View file @
2ca884b2
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment