Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
ludotheque
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
18
Issues
18
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
thejoelinux
ludotheque
Commits
d0a2c6e6
Commit
d0a2c6e6
authored
Sep 25, 2016
by
thejoelinux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transformation liste des membres en sapin de noël + bouton créer compte dans la fiche adhérent
parent
6df150c2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
28 deletions
+51
-28
member.php
webroot/classes/member.php
+5
-2
account_info.html
webroot/views/members/account_info.html
+27
-0
edit.html
webroot/views/members/edit.html
+4
-2
list.html
webroot/views/members/list.html
+14
-1
subscriptions.html
webroot/views/members/subscriptions.html
+1
-23
No files found.
webroot/classes/member.php
View file @
d0a2c6e6
...
...
@@ -236,7 +236,8 @@ class Member extends Record {
$members
=
array
();
// SQL SELECT lud_members subscriptions
$sql
=
"SELECT m.id, m.lastname, m.firstname, m.po_town,
CONCAT(m.firstname, ' ', m.lastname) AS full_name,
CONCAT(m.firstname, ' ', m.lastname) AS full_name,
account_id,
s.id AS subscription_id, MAX(s.end_date) AS subscription_end_date,
CASE WHEN s.id IS NULL
THEN 'Non trouvée'
...
...
@@ -245,9 +246,11 @@ class Member extends Record {
THEN 'Expirée'
ELSE 'Valide'
END
END AS subscription_status
END AS subscription_status,
COUNT(l.id) AS num_loans
FROM "
.
Member
::
$table
.
" m
LEFT OUTER JOIN "
.
Subscription
::
$table
.
" s ON (s.member_id = m.id)
LEFT OUTER JOIN "
.
Loan
::
$table
.
" l ON (l.member_id = m.id AND l.is_back = 0)
GROUP BY m.id
ORDER BY m.lastname"
;
$GLOBALS
[
"data"
]
->
select
(
$sql
,
$members
,
"Member"
);
...
...
webroot/views/members/account_info.html
0 → 100644
View file @
d0a2c6e6
{% if member.account_id == 0 %}
<button
type=
"button"
class=
"btn btn-danger btn-md account_create_button"
data-id=
"{{ member.id }}"
style=
"float: right; margin-right:0.25em"
>
<i
class=
"glyphicon glyphicon-plus"
></i>
<span>
Créer le compte !
</span>
</button>
{% else %}
<span
class=
"label label-info"
style=
"float: right; margin-right:0.25em; font-size: 150%;"
>
Compte #{{ member.account_id }}
</span>
{% endif %}
<script>
$
(
document
).
ready
(
function
()
{
$
(
'.account_create_button'
).
on
(
'click'
,
function
(
e
)
{
var
button
=
$
(
e
.
currentTarget
);
$
.
post
(
'api.php'
,
{
o
:
'members'
,
a
:
'create_account'
,
i
:
button
.
data
(
'id'
)
})
.
done
(
function
(
data
)
{
alert
(
'Compte créé : #'
+
data
.
account_id
);
window
.
location
.
href
=
'index.php?o=members&a='
+
$
(
'#a'
).
val
()
+
'&i='
+
$
(
'#i'
).
val
();
})
.
fail
(
function
(
data
)
{
alert
(
'Erreur lors de la création du compte'
);
});
});
});
</script>
webroot/views/members/edit.html
View file @
d0a2c6e6
...
...
@@ -5,14 +5,16 @@
{% block content %}
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<h4><span
class=
"glyphicon glyphicon-user"
style=
"margin-right: 10px"
></span>
<span
style=
"font-size: 150%; font-weight: bold"
>
<span
class=
"glyphicon glyphicon-user"
style=
"margin-right: 10px"
></span>
{% if member.id %}
{{ member.lastname }} {{ member.firstname }}
{% if member.reservations %}
<span
class=
"label label-info"
>
Réservations en cours
</span>
{% endif %}
{% else %} Nouvel adhérent {% endif %}
</h4>
</span>
{% include 'members/account_info.html' %}
</div>
<div
class=
"panel-body"
>
...
...
webroot/views/members/list.html
View file @
d0a2c6e6
...
...
@@ -27,7 +27,7 @@
<tr>
<th>
Nom
</th>
<th>
Ville
</th>
<th>
Adhésion
</th>
<th>
Adhésion
/ Prêts en cours / Compte
</th>
</tr>
</thead>
<tbody>
...
...
@@ -40,8 +40,21 @@
{{ val.po_town }}
</td>
<td>
<span
style=
"margin:0.25em;"
class=
"label
{% if val.subscription_status == 'Non trouvée' %}
label-warning
{% else %}
{% if val.subscription_status == 'Expirée' %} label-danger {% else %} label-primary {% endif %}
{% endif %}"
>
{{ val.subscription_status }}
{{ val.subscription_end_date }}
</span>
{% if val.num_loans %}
<span
class=
"label label-default"
style=
"margin:0.25em;"
>
{{ val.num_loans }} prêt(s) en cours
</span>
{% endif %}
{% if val.account_id %}
<span
class=
"label label-info"
style=
"margin:0.25em;"
>
Compte #{{ val.account_id }}
</span>
{% endif %}
</td>
</tr>
{% endfor %}
...
...
webroot/views/members/subscriptions.html
View file @
d0a2c6e6
...
...
@@ -14,16 +14,7 @@
<i
class=
"glyphicon glyphicon-plus"
></i>
<span>
Nouvelle adhésion...
</span>
</button>
{% if member.account_id == 0 %}
<button
type=
"button"
class=
"btn btn-danger btn-md account_create_button"
data-id=
"{{ member.id }}"
style=
"float: right; margin-right:0.25em"
>
<i
class=
"glyphicon glyphicon-plus"
></i>
<span>
Créer le compte !
</span>
</button>
{% else %}
<span
class=
"label label-info "
style=
"float: right; margin-right:0.25em; font-size: 150%;"
>
Compte #{{ member.account_id }}
</span>
{% endif %}
{% include 'members/account_info.html' %}
</div>
<div
class=
"panel-body"
>
...
...
@@ -120,19 +111,6 @@ $(document).ready(function () {
}).
on
(
"hidden.bs.modal"
,
function
(
e
)
{
$
(
this
).
find
(
".modal-content"
).
empty
();
});
$
(
'.account_create_button'
).
on
(
'click'
,
function
(
e
)
{
var
button
=
$
(
e
.
currentTarget
);
$
.
post
(
'api.php'
,
{
o
:
'members'
,
a
:
'create_account'
,
i
:
button
.
data
(
'id'
)
})
.
done
(
function
(
data
)
{
alert
(
'Compte créé : #'
+
data
.
account_id
);
window
.
location
.
href
=
'index.php?o=members&a=subscriptions&i='
+
$
(
'#i'
).
val
();
})
.
fail
(
function
(
data
)
{
alert
(
'Erreur lors de la création du compte'
);
});
});
$
(
'#object_list'
).
on
(
'click'
,
'.button_delete'
,
function
(
e
){
if
(
confirm
(
'Êtes vous sur ?'
))
{
var
button
=
$
(
e
.
currentTarget
);
...
...
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