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
3373793d
Commit
3373793d
authored
10 years ago
by
goujonpa
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of gitlab.utc.fr:nf17-camp-p14/clivi
parents
31907a93
7c39b070
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
class/facture.php
+3
-1
3 additions, 1 deletion
class/facture.php
class/listview.php
+2
-2
2 additions, 2 deletions
class/listview.php
class/objet.php
+10
-6
10 additions, 6 deletions
class/objet.php
controller/fact.php
+1
-1
1 addition, 1 deletion
controller/fact.php
view/stats.php
+1
-1
1 addition, 1 deletion
view/stats.php
with
17 additions
and
11 deletions
class/facture.php
+
3
−
1
View file @
3373793d
...
...
@@ -107,6 +107,8 @@ class Facture extends Objet
}
public
function
str
()
{
return
$this
->
animal
.
" "
.
$this
->
date_edition
.
" "
.
$this
->
prix_total
;
$animal
=
new
Animal
()
$fields
=
$animal
->
select
(
$this
->
id
)
return
$fields
[
"nom"
]
.
" "
.
$this
->
prix_total
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
class/listview.php
+
2
−
2
View file @
3373793d
...
...
@@ -6,10 +6,10 @@ class ListView
protected
$objArray
;
public
$class
;
public
function
__construct
(
$class
,
$title
,
$
id
=
null
)
public
function
__construct
(
$class
,
$title
,
$
arr
=
Array
()
)
{
$this
->
title
=
$title
;
$this
->
objArray
=
$class
::
getAll
(
$
id
);
$this
->
objArray
=
$class
::
getAll
(
$
arr
);
$this
->
class
=
$class
;
}
...
...
This diff is collapsed.
Click to expand it.
class/objet.php
+
10
−
6
View file @
3373793d
...
...
@@ -23,18 +23,22 @@ class Objet
return
$dbName
;
}
public
static
function
getAll
(
$
id
=
null
)
public
static
function
getAll
(
$
arr
=
array
()
)
{
$className
=
get_called_class
();
$dbName
=
self
::
dbName
();
$bdd
=
new
Db
();
$result
=
Array
();
if
(
$id
==
null
)
{
if
(
count
(
$arr
)
==
0
)
{
$requete_prepare
=
$bdd
->
db
->
prepare
(
"SELECT * FROM "
.
$dbName
);
// on prépare notre requête
$requete_prepare
->
execute
();
}
else
{
$requete_prepare
=
$bdd
->
db
->
prepare
(
"SELECT * FROM "
.
$dbName
.
" WHERE id = :id"
);
$requete_prepare
->
execute
(
array
(
"id"
=>
$id
));
$req
=
"SELECT * FROM "
.
$dbName
.
" WHERE 1=1"
;
foreach
(
$arr
as
$k
=>
$a
)
{
$req
.
=
" AND
$k
= :
$k
"
;
}
$requete_prepare
=
$bdd
->
db
->
prepare
(
$req
);
$requete_prepare
->
execute
(
$arr
);
}
while
(
$ligne
=
$requete_prepare
->
fetch
(
PDO
::
FETCH_ASSOC
))
{
...
...
@@ -160,7 +164,7 @@ class Objet
return
self
::
dbName
()
.
" #"
.
$this
->
{
$this
->
_primaryAttr
};
}
public
function
getList
(
$title
,
$
id
=
null
)
{
return
new
ListView
(
get_called_class
(),
$title
,
$
id
);
public
function
getList
(
$title
,
$
arr
=
array
()
)
{
return
new
ListView
(
get_called_class
(),
$title
,
$
arr
);
}
}
This diff is collapsed.
Click to expand it.
controller/fact.php
+
1
−
1
View file @
3373793d
...
...
@@ -47,7 +47,7 @@ switch($action) {
echo
' <a href="'
.
$base_url
.
$page
.
'/addProduit'
.
'?factId='
.
$_GET
[
"id"
]
.
'" type="button" class="btn btn-success">Ajouter un Produit</a>'
;
echo
' <a href="'
.
$base_url
.
$page
.
'/addOrd'
.
'?factId='
.
$_GET
[
"id"
]
.
'" type="button" class="btn btn-success">Ajouter une Ordonnance</a>'
;
echo
'</div>'
;
$list
=
LigneFacture
::
getList
(
"Détails de la facture"
,
$_GET
[
"id"
]);
$list
=
LigneFacture
::
getList
(
"Détails de la facture"
,
array
(
"facture"
=>
$_GET
[
"id"
])
)
;
include
'view/list.php'
;
break
;
default
:
...
...
This diff is collapsed.
Click to expand it.
view/stats.php
+
1
−
1
View file @
3373793d
...
...
@@ -143,7 +143,7 @@
<th>
Nombre d'individu
</th>
</thead>
<tbody>
<?php
foreach
(
$stats
->
top10Race
)
as
$ligne
)
:
?>
<?php
foreach
(
$stats
->
top10Race
(
)
as
$ligne
)
:
?>
<tr>
<td>
<?php
echo
$ligne
[
"nom"
];
?>
</td>
<td>
<?php
echo
$ligne
[
"count"
];
?>
</td>
...
...
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