Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BDAPPLI_LAURENT_VONDERSCHER_SASSU_PERCIN
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
VONDERSCHER William
BDAPPLI_LAURENT_VONDERSCHER_SASSU_PERCIN
Commits
2cf3e430
Commit
2cf3e430
authored
5 years ago
by
PERCIN Cahit
Browse files
Options
Downloads
Patches
Plain Diff
création du script 3 a
parent
0ff136b8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GamePedia/php/script_TD3a.php
+6
-5
6 additions, 5 deletions
GamePedia/php/script_TD3a.php
GamePedia/src/controleurs/ControleurScript.php
+36
-1
36 additions, 1 deletion
GamePedia/src/controleurs/ControleurScript.php
with
42 additions
and
6 deletions
GamePedia/php/script_TD3a.php
+
6
−
5
View file @
2cf3e430
...
...
@@ -22,10 +22,11 @@ echo ("<!DOCTYPE html>
<h2> Consignes : </h2>
<p> Pour chaque requête, calculer le temps d'execution </p>
</div>"
);
if
(
isset
(
$_GET
[
'requete'
])
&&
$_GET
[
'requete'
]
>
0
&&
$_GET
[
'requete'
]
<=
9
)
{
$nb
=
$_GET
[
'requete'
];
$c
=
new
ControleurScript
();
$function
=
'td3_q'
.
$nb
;
$c
->
$function
();
}
echo
$c
->
allGame
();
echo
$c
->
gameMario
();
echo
$c
->
gameDebMario
();
echo
$c
->
gameDebMarioRate
();
echo
(
"</body> </html>"
);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
GamePedia/src/controleurs/ControleurScript.php
+
36
−
1
View file @
2cf3e430
...
...
@@ -84,6 +84,7 @@ class ControleurScript
* TD_2
*/
public
function
td2_q1
()
{
$q
=
$this
->
nameDeckByGame
(
12342
)
->
get
();
...
...
@@ -190,7 +191,7 @@ class ControleurScript
echo
(
"<p>---------------------------------------------<br>"
.
"<p>les jeux dont le nom débute par Mario, publiés par une compagnie dont le nom contient
\"
Inc.
\"
et dont le rating initial contient
\"
3+
\"
t ayant reçu un avis de la part du rating board nommé
\"
CERO
\"
<br>"
.
"<p>---------------------------------------------<br>"
);
$list
=
Game_rating
::
select
(
'name'
)
->
where
(
'name'
,
'like'
,
"
%3+%
"
)
->
get
();
$list
=
Game_rating
::
select
(
'name'
)
->
where
(
'name'
,
'like'
,
'
%3+%
'
)
->
get
();
foreach
(
$list
as
$rate
)
{
echo
"<p>
$rate->name
</p>"
;
$games
=
$rate
->
games
()
->
where
(
'name'
,
'like'
,
"Mario%"
)
->
get
();
...
...
@@ -221,4 +222,38 @@ class ControleurScript
private
function
nameDeckByGame
(
$id
){
return
Game
::
where
(
'id'
,
'='
,
$id
)
->
first
()
->
characters
();
}
public
function
allGame
(){
$time_start
=
microtime
(
true
);
Game
::
get
();
$time_end
=
microtime
(
true
);
$time
=
$time_end
-
$time_start
;
return
$time
;
}
public
function
gameMario
(){
$time_start
=
microtime
(
true
);
Game
::
where
(
'name'
,
'like'
,
"%Mario%"
)
->
get
();
$time_end
=
microtime
(
true
);
$time
=
$time_end
-
$time_start
;
return
$time
;
}
public
function
gameDebMario
(){
$time_start
=
microtime
(
true
);
Game
::
where
(
'name'
,
'like'
,
"Mario%"
)
->
characters
()
->
get
();
$time_end
=
microtime
(
true
);
$time
=
$time_end
-
$time_start
;
return
$time
;
}
public
function
gameDebMarioRate
(){
$time_start
=
microtime
(
true
);
Game_rating
::
select
(
'name'
)
->
where
(
'name'
,
'like'
,
'%3+%'
)
->
get
();
$time_end
=
microtime
(
true
);
$time
=
$time_end
-
$time_start
;
return
$time
;
}
}
\ 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