Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
ludotheque
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
18
Issues
18
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Denis S. Valdenaire
ludotheque
Commits
0460d0e0
Commit
0460d0e0
authored
Oct 08, 2016
by
Denis S. Valdenaire
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changement de colonnes pour les jeux empruntes
parent
6b711e32
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
4 deletions
+24
-4
webroot/classes/game.php
webroot/classes/game.php
+4
-1
webroot/views/games/list.html
webroot/views/games/list.html
+20
-3
No files found.
webroot/classes/game.php
View file @
0460d0e0
...
...
@@ -80,10 +80,13 @@ class Game extends Record {
DATEDIFF(l.end_date, curdate())
ELSE
l.id
END AS loan_status
END AS loan_status,
m.id AS member_id,
CONCAT(m.firstname, ' ', m.lastname) AS member_name
FROM "
.
Game
::
$table
.
" g
LEFT OUTER JOIN "
.
Esar_Category
::
$table
.
" ec ON g.esar_category_id = ec.id
LEFT OUTER JOIN "
.
Loan
::
$table
.
" l ON (g.id = l.game_id AND l.is_back = 0)
LEFT OUTER JOIN "
.
Member
::
$table
.
" m ON (l.member_id = m.id)
$where_clause
ORDER BY g.name"
;
$GLOBALS
[
"data"
]
->
select
(
$sql
,
$games
,
"Game"
);
...
...
webroot/views/games/list.html
View file @
0460d0e0
...
...
@@ -28,6 +28,7 @@
<th>
Age max.
</th>
<th>
ESAR
</th>
<th>
Etat
</th>
<th>
Emprunteur
</th>
<th>
Actions
</th>
</tr>
</thead>
...
...
@@ -54,6 +55,7 @@
}
</style>
<script>
var
table
;
$
(
document
).
ready
(
function
()
{
$
(
"
#editModal
"
).
on
(
"
show.bs.modal
"
,
function
(
e
)
{
var
button
=
$
(
e
.
relatedTarget
);
...
...
@@ -84,7 +86,7 @@ $(document).ready(function() {
}
);
var
table
=
$
(
'
#list_games
'
).
DataTable
({
table
=
$
(
'
#list_games
'
).
DataTable
({
"
autoWidth
"
:
false
,
"
dom
"
:
'
<"filter_comp">frtlp
'
,
"
ajax
"
:
"
api.php?o=games&a=list&dt_format=1
"
,
...
...
@@ -94,7 +96,7 @@ $(document).ready(function() {
"
columnDefs
"
:
[
{
"
targets
"
:
[
1
,
2
],
className
:
"
text-center
"
className
:
"
text-center
"
,
},{
"
targets
"
:
[
1
,
2
,
3
],
"
defaultContent
"
:
''
...
...
@@ -114,7 +116,17 @@ $(document).ready(function() {
}
}
},{
"
targets
"
:
5
,
// action
"
targets
"
:
5
,
// borrower
"
render
"
:
function
(
data
,
type
,
row
)
{
if
(
row
.
loan_status
!==
null
)
{
return
'
<a href="index.php?o=members&a=edit&i=
'
+
row
.
member_id
+
'
">
'
+
row
.
member_name
+
'
</a>
'
;
}
return
''
;
},
visible
:
false
},{
"
targets
"
:
6
,
// action
"
render
"
:
function
(
data
,
type
,
row
)
{
var
html
=
'
<button type="button" class="btn btn-primary btn-xs edit_button"
'
+
'
data-toggle="tooltip" title="Editer"
'
...
...
@@ -143,6 +155,7 @@ $(document).ready(function() {
{
"
data
"
:
"
age_max
"
},
{
"
data
"
:
"
label
"
},
{
"
data
"
:
"
loan_status
"
},
{
"
data
"
:
"
member_name
"
},
{
"
data
"
:
null
}
],
"
fnDrawCallback
"
:
function
()
{
...
...
@@ -172,6 +185,10 @@ $(document).ready(function() {
+
'
<option value="archived">Seulement les archivés</option></select>
'
);
$
(
"
.toggle_row_display
"
).
on
(
"
change
"
,
function
()
{
var
show_age
=
$
(
"
.toggle_row_display
"
).
val
().
indexOf
(
"
borrowed
"
);
table
.
column
(
1
).
visible
(
show_age
);
table
.
column
(
2
).
visible
(
show_age
);
table
.
column
(
5
).
visible
(
!
show_age
);
table
.
draw
();
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment