Skip to content
Extraits de code Groupes Projets
Valider 590963df rédigé par Guinness's avatar Guinness Validation de Okhin
Parcourir les fichiers

Remove an address from the admin page.

Refers #26
parent 0bd91f82
Aucune branche associée trouvée
Aucune étiquette associée trouvée
2 requêtes de fusion!55Guinness/don fix admin user view,!54Modification front
......@@ -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']) : '';
......
......@@ -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>
&nbsp;
</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>
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter