Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LQDN Adminsys
don
Commits
590963df
Commit
590963df
authored
Oct 13, 2018
by
Guinness
Committed by
Okhin
Nov 12, 2018
Browse files
Remove an address from the admin page.
Refers
#26
parent
0bd91f82
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/controller/admin.php
View file @
590963df
...
...
@@ -755,6 +755,26 @@ class Admin extends Controller
$f3
->
set
(
'block_content'
,
'backend/contrepartie.html'
);
}
public
function
adresse
(
$f3
,
$args
)
{
$id
=
''
;
$user_id
=
''
;
$db
=
$f3
->
get
(
'DB'
);
if
(
$f3
->
get
(
'VERB'
)
==
'POST'
)
{
$id
=
\
Utils
::
asl
(
$f3
->
get
(
'POST.id'
));
}
$result
=
$db
->
query
(
"SELECT user_id FROM adresses WHERE id =
$id
"
);
$result
=
$result
->
fetch
(
\
PDO
::
FETCH_ASSOC
);
$user_id
=
\
Utils
::
asl
(
$result
[
"user_id"
]);
$db
->
query
(
"UPDATE dons SET adresse_id = NULL
WHERE user_id =
$user_id
"
);
$db
->
query
(
"UPDATE contreparties SET adresse_id = NULL
WHERE user_id =
$user_id
"
);
$db
->
query
(
"DELETE FROM adresses
WHERE id =
$id
"
);
$f3
->
reroute
(
"/admin/users/
$user_id
"
);
}
public
function
user
(
$f3
,
$args
)
{
$id
=
array_key_exists
(
'id'
,
$args
)
?
\
Utils
::
asl
(
$args
[
'id'
])
:
''
;
...
...
app/view/backend/user.html
View file @
590963df
...
...
@@ -196,13 +196,15 @@
</check>
</td>
<td>
<check
if=
"{{ @row.pdf != '' }}"
>
<true><a
href=
"{{ @PIPLOME_URL }}{{ @row.pdf }}.pdf"
>
{{ @row.pdf }}
</a>
( {{@user.adresses[@row.adresse_id].nom }})
</td>
</true>
<false>
</false>
</check>
<check
if=
"{{ @row.pdf == '' }}"
>
<true>
<a
href=
"/cron/piplome/{{ @row.id }}"
>
PDF
</a>
</true>
<false>
<a
href=
"{{ PIPLOME_URL }}/{{ @row.pdf }}.pdf"
target=
"_blank"
>
PDF
</a>
</false>
</check>
</td>
<td
class=
"inline"
>
{{ @DONS_STATUTS[@row.status] }}
</td>
<td>
<a
href=
"{{ 'edit_support', 'id='.@row.id | alias }}"
>
Editer
</a>
...
...
@@ -214,12 +216,6 @@
<false>
<a
href=
"{{ 'invalidate_support', 'id='.@row.id | alias }}"
>
Invalider
</a>
-
<check
if=
"{{ @row.pdf == '' }}"
>
<a
href=
"/cron/piplome/{{ @row.id }}"
>
PDF
</a>
<false>
<a
href=
"{{ PIPLOME_URL }}/{{ @row.pdf }}.pdf"
target=
"_blank"
>
PDF
</a>
</false>
</check>
</false>
</check>
</td>
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment