Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
clivi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
NF17 - CAMP - P14
clivi
Commits
376736b7
Commit
376736b7
authored
10 years ago
by
goujonpa
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of gitlab.utc.fr:nf17-camp-p14/clivi
parents
3e75b7d1
570cd5b0
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
class/lignefacture.php
+0
-0
0 additions, 0 deletions
class/lignefacture.php
class/ligneordonnance.php
+0
-0
0 additions, 0 deletions
class/ligneordonnance.php
class/stats.php
+3
-7
3 additions, 7 deletions
class/stats.php
view/stats.php
+2
-2
2 additions, 2 deletions
view/stats.php
with
5 additions
and
9 deletions
class/ligne
F
acture.php
→
class/ligne
f
acture.php
+
0
−
0
View file @
376736b7
File moved
This diff is collapsed.
Click to expand it.
class/ligne
O
rdonnance.php
→
class/ligne
o
rdonnance.php
+
0
−
0
View file @
376736b7
File moved
This diff is collapsed.
Click to expand it.
class/stats.php
+
3
−
7
View file @
376736b7
...
@@ -2,16 +2,12 @@
...
@@ -2,16 +2,12 @@
class
Stats
class
Stats
{
{
public
function
factureMoy
Client
()
public
function
factureMoy
()
{
{
$bdd
=
new
Db
();
$bdd
=
new
Db
();
$requete_prepare
=
$bdd
->
db
->
prepare
(
" SELECT SUM(t.prix)/COUNT(*) AS value
$requete_prepare
=
$bdd
->
db
->
prepare
(
" SELECT SUM(f.prix_total)/COUNT(*) AS value
FROM ( SELECT c.nom, c.prenom, SUM(f.prix_total) AS prix
FROM facture f"
);
// on prépare notre requête
FROM animal a, client c, facture f
WHERE a.client = c.id
AND f.animal = a.id
GROUP BY c.nom, c.prenom, c.id) t"
);
// on prépare notre requête
$requete_prepare
->
execute
();
$requete_prepare
->
execute
();
$ligne
=
$requete_prepare
->
fetch
(
PDO
::
FETCH_ASSOC
);
$ligne
=
$requete_prepare
->
fetch
(
PDO
::
FETCH_ASSOC
);
...
...
This diff is collapsed.
Click to expand it.
view/stats.php
+
2
−
2
View file @
376736b7
...
@@ -6,8 +6,8 @@
...
@@ -6,8 +6,8 @@
<table
class=
"table"
>
<table
class=
"table"
>
<thead>
<thead>
<th>
Facture moyenne
par client
: /th>
<th>
Facture moyenne :
<
/th>
<th>
<?php
$tmp
=
$stats
->
factureMoy
Client
();
$nb_formated
=
number_format
(
$tmp
[
"value"
],
2
,
','
,
' '
);
echo
$nb_formated
;
?>
</th>
<th>
<?php
$tmp
=
$stats
->
factureMoy
();
$nb_formated
=
number_format
(
$tmp
[
"value"
],
2
,
','
,
' '
);
echo
$nb_formated
;
?>
</th>
</thead>
</thead>
<tbody>
<tbody>
<tr>
<tr>
...
...
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