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
6df150c2
Commit
6df150c2
authored
Sep 25, 2016
by
Denis S. Valdenaire
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
creation compte pour membre + placeholder sur paiements
parent
b0eff0ad
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
3 deletions
+43
-3
webroot/controllers/members.php
webroot/controllers/members.php
+20
-0
webroot/views/members/subscriptions.html
webroot/views/members/subscriptions.html
+21
-2
webroot/views/payments/list.html
webroot/views/payments/list.html
+2
-1
No files found.
webroot/controllers/members.php
View file @
6df150c2
...
...
@@ -217,6 +217,26 @@ class MembersController extends AppController {
}
}
// API CALL
function
_create_account
()
{
try
{
$member
=
Member
::
fetch
(
$GLOBALS
[
"data"
]
->
db_escape_string
(
$_REQUEST
[
"i"
]));
if
(
$member
->
id
!=
0
)
{
if
(
!
$member
->
account_id
)
{
$member
->
account_id
=
Account
::
create_for_member
(
"Adhérent #"
.
$member
->
id
.
" - "
.
$member
->
firstname
.
" "
.
$member
->
lastname
);
$member
->
save_account
();
}
echo
json_encode
(
$member
);
}
else
{
AppController
::
http_error
(
404
);
}
}
catch
(
data_exception
$e
)
{
AppController
::
http_error
();
}
exit
();
}
function
_create_subscription
()
{
$_REQUEST
[
"a"
]
=
"subscriptions"
;
$this
->
context
[
"request"
]
=
$_REQUEST
;
...
...
webroot/views/members/subscriptions.html
View file @
6df150c2
...
...
@@ -15,10 +15,14 @@
<span>
Nouvelle adhésion...
</span>
</button>
{% if member.account_id == 0 %}
<button
type=
"button"
class=
"btn btn-danger btn-md"
style=
"float: right"
>
<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>
</button>
{% else %}
<span
class=
"label label-info "
style=
"float: right; margin-right:0.25em; font-size: 150%;"
>
Compte #{{ member.account_id }}
</span>
{% endif %}
</div>
<div
class=
"panel-body"
>
...
...
@@ -50,10 +54,12 @@
data-toggle=
"modal"
data-target=
"#editModal"
data-id=
"{{ val.id }}"
>
<i
class=
"glyphicon glyphicon-edit"
></i>
</button>
{% if member.account_id %}
<button
type=
"button"
class=
"btn btn-success btn-sm"
data-toggle=
"modal"
data-target=
"#paymentModal"
data-id=
"{{ val.id }}"
>
<i
class=
"glyphicon glyphicon-euro"
></i>
</button>
{% endif %}
<button
type=
"button"
class=
"btn btn-default btn-sm button_print"
data-id=
"{{ val.id }}"
>
<i
class=
"glyphicon glyphicon-print"
></i>
</button>
...
...
@@ -114,6 +120,19 @@ $(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
);
...
...
webroot/views/payments/list.html
View file @
6df150c2
...
...
@@ -33,7 +33,8 @@
<label
class=
"control-label col-md-2"
for=
"comments"
>
Note
</label>
<div
class=
"col-md-7"
>
<input
type=
"text"
class=
"form-control"
name=
"comments"
id=
"comments"
align=
"right"
value=
""
></div>
name=
"comments"
id=
"comments"
align=
"right"
value=
""
placeholder=
"Numéro de chèque / Banque / Nom"
></div>
<div
class=
"col-md-1 col-md-offset-1"
>
<button
type=
"button"
class=
"save_payment_button btn btn-primary btn-md"
data-id=
"0"
>
<i
class=
"glyphicon glyphicon-floppy-save"
></i>
...
...
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