-
Notifications
You must be signed in to change notification settings - Fork 1
/
check_users.php
39 lines (37 loc) · 1.39 KB
/
check_users.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
require_once "inc/head.php";
require_once "crux/printFunctions.php";
extract($_GET);
extract($_POST);
?>
<div id="maincontent">
<?php
if($action == "y"){
$gest->approveUser($id);
$buttons = [array("url"=>"check_users.php", "class"=>"info", "value"=>"Torna indietro")];
printAlert("success", "Utente approvato.", $buttons, "success");
}elseif ($action == "n") {
?>
<br />
<h1>Approvazione nuovi Utenti</h1>
<br />
<?php
$fields = [array("type"=>"text", "label"=>"Motivazione", "ph"=>"E` una persona sconosciuta", "name"=>"cause", "required" => true)];
$buttons = [array("action"=>"submit", "value" =>"Rifiuta", "class"=>"btn-danger")];
printForm(false, "check_users.php?action=refuse&id=".$id, "post", $fields, null, $buttons);
}elseif ($action == "refuse") {
$gest->refuseUser($id, $cause);
$buttons = [array("url" => "check_users.php", "class" => "danger", "value" => "Torna indietro")];
printAlert("danger", "Utente rigettato.", $buttons, "danger");
}else {
?>
<br />
<h1>Approvazione nuovi Utenti</h1>
<br />
<?php
$gest->getPendingUsers();
$addFields = ["<a href='check_users.php?action=y&id=%id%'>%yes%</a>", "<a href='crud_document.php?action=n&id=%id%'>%no%</a>"];
printTable("check_users", ['Cognome', 'Nome', 'Mail', 'Azioni'], $gest->results, null, ['cognome', 'nome', 'mail'], null, $addFields);
}
?>
</div>