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
bdeb51df
Commit
bdeb51df
authored
Jan 31, 2016
by
Denis S. Valdenaire
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes
#67
parent
69039275
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
84 additions
and
50 deletions
+84
-50
classes/member.php
classes/member.php
+20
-8
controllers/app.php
controllers/app.php
+1
-1
scripts/201601301833_contrainte_bank_operations_moves.sql
scripts/201601301833_contrainte_bank_operations_moves.sql
+8
-0
scripts/201601310006_create_tables_checks.sql
scripts/201601310006_create_tables_checks.sql
+29
-0
views/esar_categories/list.html
views/esar_categories/list.html
+3
-6
views/games/list.html
views/games/list.html
+1
-4
views/loans/list.html
views/loans/list.html
+4
-1
views/members/list.html
views/members/list.html
+6
-8
views/membership_types/list.html
views/membership_types/list.html
+3
-6
views/payment_methods/list.html
views/payment_methods/list.html
+3
-6
views/reservations/list.html
views/reservations/list.html
+3
-4
views/users/list.html
views/users/list.html
+3
-6
No files found.
classes/member.php
View file @
bdeb51df
...
...
@@ -45,10 +45,10 @@ class Member extends Record {
// SQL SELECT members
$sql
=
"SELECT id, firstname, lastname, birth_date, address, po_town,
home_phone, work_phone, mobile_phone, fax_phone, comments, member_ref,
email, newsletter, other_members, deposit, deposit_expiration_date,
DATEDIFF(deposit_expiration_date, curdate()) as remaining_deposit_days,
CONCAT(lastname, ' ', firstname) AS full_name
home_phone, work_phone, mobile_phone, fax_phone, comments, member_ref,
email, newsletter, other_members, deposit, deposit_expiration_date,
DATEDIFF(deposit_expiration_date, curdate()) as remaining_deposit_days,
CONCAT(lastname, ' ', firstname) AS full_name
FROM members
WHERE id = "
.
$id
;
$GLOBALS
[
"data"
]
->
select
(
$sql
,
$member
,
"Member"
);
...
...
@@ -189,10 +189,22 @@ class Member extends Record {
public
static
function
fetch_all
(
&
$members
)
{
$members
=
array
();
// SQL SELECT members
$sql
=
"SELECT id, lastname, firstname, po_town, CONCAT(firstname, ' ', lastname) AS full_name
FROM members
ORDER BY lastname"
;
// SQL SELECT members subscriptions
$sql
=
"SELECT m.id, m.lastname, m.firstname, m.po_town,
CONCAT(m.firstname, ' ', m.lastname) AS full_name,
s.id AS subscription_id, MAX(s.end_date) AS subscription_end_date,
CASE WHEN s.id IS NULL
THEN 'Non trouvée'
ELSE
CASE WHEN MAX(s.end_date) < curdate()
THEN 'Expirée'
ELSE 'Valide'
END
END AS subscription_status
FROM members m
LEFT OUTER JOIN subscriptions s ON (s.member_id = m.id)
GROUP BY m.id
ORDER BY m.lastname"
;
$GLOBALS
[
"data"
]
->
select
(
$sql
,
$members
,
"Member"
);
return
sizeof
(
$members
);
}
...
...
controllers/app.php
View file @
bdeb51df
...
...
@@ -16,7 +16,7 @@ class AppController {
$loader
=
new
Twig_Loader_Filesystem
(
'views'
);
// Dossier contenant les templates
$this
->
twig
=
new
Twig_Environment
(
$loader
,
array
(
'cache'
=>
false
'cache'
=>
false
,
));
$this
->
context
[
"global"
]
=
$GLOBALS
;
$this
->
context
[
"request"
]
=
$_REQUEST
;
...
...
scripts/201601301833_contrainte_bank_operations_moves.sql
0 → 100644
View file @
bdeb51df
ALTER
TABLE
`bank_operations`
ADD
KEY
`move_id_idx`
(
`move_id`
);
ALTER
TABLE
`bank_operations`
CHANGE
`move_id`
`move_id`
INT
(
11
)
NULL
DEFAULT
NULL
;
update
bank_operations
set
move_id
=
NULL
where
move_id
=
0
;
ALTER
TABLE
`bank_operations`
ADD
FOREIGN
KEY
(
`move_id`
)
REFERENCES
`ludotheque`
.
`moves`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
RESTRICT
;
INSERT
INTO
schema_migrations
values
(
'201601301833'
);
scripts/201601310006_create_tables_checks.sql
0 → 100644
View file @
bdeb51df
CREATE
TABLE
IF
NOT
EXISTS
`checkbooks`
(
`id`
int
(
11
)
NOT
NULL
,
`name`
varchar
(
128
)
NOT
NULL
,
`num_start`
int
(
11
)
NOT
NULL
,
`num_end`
int
(
11
)
NOT
NULL
,
`num_length`
int
(
11
)
NOT
NULL
,
`account_id`
int
(
11
)
NOT
NULL
,
`created_at`
datetime
NOT
NULL
,
`updated_at`
datetime
NOT
NULL
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
ALTER
TABLE
`checkbooks`
ADD
PRIMARY
KEY
(
`id`
);
ALTER
TABLE
`checkbooks`
MODIFY
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
:;
CREATE
TABLE
IF
NOT
EXISTS
`checks`
(
`id`
varchar
(
16
)
NOT
NULL
,
`checkbook_id`
int
(
11
)
NOT
NULL
,
`move_id`
int
(
11
)
DEFAULT
NULL
,
`is_canceled`
tinyint
(
4
)
NOT
NULL
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
ALTER
TABLE
`checks`
ADD
PRIMARY
KEY
(
`id`
),
ADD
UNIQUE
KEY
`move_id`
(
`move_id`
),
ADD
KEY
`checkbook_id`
(
`checkbook_id`
);
ALTER
TABLE
`checks`
ADD
CONSTRAINT
`checks_ibfk_1`
FOREIGN
KEY
(
`checkbook_id`
)
REFERENCES
`checkbooks`
(
`id`
),
ADD
CONSTRAINT
`checks_ibfk_2`
FOREIGN
KEY
(
`move_id`
)
REFERENCES
`moves`
(
`id`
);
INSERT
INTO
schema_migrations
VALUES
(
'201601310006'
);
views/esar_categories/list.html
View file @
bdeb51df
...
...
@@ -45,12 +45,6 @@
</a>
</td>
</tr>
{% else %}
<tr>
<td
colspan=
"2"
>
Aucune catégorie n'a été trouvée.
</td>
</tr>
{% endfor %}
</tbody>
</table>
...
...
@@ -72,6 +66,9 @@
$
(
document
).
ready
(
function
()
{
$
(
'
#object_list
'
).
DataTable
({
"
autoWidth
"
:
false
,
"
language
"
:
{
"
emptyTable
"
:
"
Aucune catégorie n'a été trouvée.
"
},
"
columnDefs
"
:
[{
"
orderable
"
:
false
,
"
targets
"
:
-
1
}],
"
fnDrawCallback
"
:
function
()
{
$
(
this
).
show
();
...
...
views/games/list.html
View file @
bdeb51df
...
...
@@ -49,10 +49,6 @@
{% if val.loan_status == '' %} Libre {% else %} Emprunté {% endif %}
</td>
</tr>
{% else %}
<tr>
<td
colspan=
"3"
align=
"center"
>
Aucun jeu trouvé
</td>
</tr>
{% endfor %}
</tbody>
</table>
...
...
@@ -90,6 +86,7 @@ $(document).ready(function() {
"
language
"
:
{
"
url
"
:
"
js/dataTables.french.json
"
},
"
dom
"
:
'
<"slider_div">frtip
'
});
$
(
'
#new_button
'
).
click
(
function
(){
...
...
views/loans/list.html
View file @
bdeb51df
...
...
@@ -57,7 +57,10 @@ $(document).ready(function() {
"
autoWidth
"
:
false
,
"
fnDrawCallback
"
:
function
()
{
$
(
this
).
show
();
}
},
"
language
"
:
{
"
emptyTable
"
:
"
Aucun emprunt en cours
"
},
});
$
(
'
#new_button
'
).
click
(
function
(){
$
(
'
#a
'
).
val
(
'
new
'
);
...
...
views/members/list.html
View file @
bdeb51df
...
...
@@ -23,7 +23,7 @@
<tr>
<th>
Nom
</th>
<th>
Ville
</th>
<th>
Etat
</th>
<th>
Adhésion
</th>
</tr>
</thead>
<tbody>
...
...
@@ -36,15 +36,10 @@
{{ val.po_town }}
</td>
<td>
FIXME
{{ val.subscription_status }}
{{ val.subscription_end_date }}
</td>
</tr>
{% else %}
<tr>
<td
colspan=
"3"
>
Aucun membre trouvé.
</td>
</tr>
{% endfor %}
</tbody>
</table>
...
...
@@ -56,6 +51,9 @@
$
(
document
).
ready
(
function
()
{
$
(
'
#list_member
'
).
DataTable
({
"
autoWidth
"
:
false
,
"
language
"
:
{
"
emptyTable
"
:
"
Aucun membre trouvé
"
},
"
fnDrawCallback
"
:
function
()
{
$
(
this
).
show
();
}
...
...
views/membership_types/list.html
View file @
bdeb51df
...
...
@@ -47,12 +47,6 @@
</a>
</td>
</tr>
{% else %}
<tr>
<td
colspan=
"4"
>
Aucun type d'adhésion trouvée
</td>
</tr>
{% endfor %}
</tbody>
</table>
...
...
@@ -74,6 +68,9 @@
$
(
document
).
ready
(
function
()
{
$
(
'
#object_list
'
).
DataTable
({
"
autoWidth
"
:
false
,
"
language
"
:
{
"
emptyTable
"
:
"
Aucun type d'adhésion trouvée
"
},
"
columnDefs
"
:
[{
"
orderable
"
:
false
,
"
targets
"
:
-
1
}],
"
fnDrawCallback
"
:
function
()
{
$
(
this
).
show
();
...
...
views/payment_methods/list.html
View file @
bdeb51df
...
...
@@ -45,12 +45,6 @@
</a>
</td>
</tr>
{% else %}
<tr>
<td
colspan=
"2"
>
Aucun moyen de paiement n'a été trouvé.
</td>
</tr>
{% endfor %}
</tbody>
</table>
...
...
@@ -72,6 +66,9 @@
$
(
document
).
ready
(
function
()
{
$
(
'
#object_list
'
).
DataTable
({
"
autoWidth
"
:
false
,
"
language
"
:
{
"
emptyTable
"
:
"
Aucun moyen de paiement n'a été trouvé.
"
},
"
columnDefs
"
:
[{
"
orderable
"
:
false
,
"
targets
"
:
-
1
}],
"
fnDrawCallback
"
:
function
()
{
$
(
this
).
show
();
...
...
views/reservations/list.html
View file @
bdeb51df
...
...
@@ -45,10 +45,6 @@
</a>
</td>
</tr>
{% else %}
<tr>
<td
colspan=
"4"
align=
"center"
>
Aucune réservation en cours
</td>
</tr>
{% endfor %}
</tbody>
</table>
...
...
@@ -62,6 +58,9 @@
$
(
document
).
ready
(
function
()
{
$
(
'
#object_list
'
).
DataTable
({
"
autoWidth
"
:
false
,
"
language
"
:
{
"
emptyTable
"
:
"
Aucune réservation en cours.
"
},
"
columnDefs
"
:
[{
"
orderable
"
:
false
,
"
targets
"
:
-
1
}],
"
fnDrawCallback
"
:
function
()
{
$
(
this
).
show
();
...
...
views/users/list.html
View file @
bdeb51df
...
...
@@ -56,12 +56,6 @@
{% endif %}
</td>
</tr>
{% else %}
<tr>
<td
colspan=
"4"
>
Aucun utilisateur trouvé. À se demander comment l'utilisateur courant peut être connecté !
</td>
</tr>
{% endfor %}
</tbody>
</table>
...
...
@@ -83,6 +77,9 @@
$
(
document
).
ready
(
function
()
{
$
(
'
#object_list
'
).
DataTable
({
"
autoWidth
"
:
false
,
"
language
"
:
{
"
emptyTable
"
:
"
Aucun utilisateur trouvé. À se demander comment l'utilisateur courant peut être connecté !
"
},
"
columnDefs
"
:
[{
"
orderable
"
:
false
,
"
targets
"
:
-
1
}],
"
fnDrawCallback
"
:
function
()
{
$
(
this
).
show
();
...
...
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