You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
2.7 KiB
74 lines
2.7 KiB
<div class="row">
|
|
<div class="col-12">
|
|
<div class="section-title">Aggiungi accesso</div>
|
|
</div>
|
|
<div class="col-12">
|
|
|
|
<div class="sheet-box p-4">
|
|
|
|
<?php
|
|
if($_POST['go']){
|
|
|
|
$sections = implode(',',$_POST['sec']);
|
|
$q=mysqli_query($conn, "INSERT INTO users VALUES(null, '".$_POST['usr']."', '".md5($_POST['pwd'])."', '".$_POST['name']."', '".$sections."')");
|
|
|
|
echo '<div class="col-10 text-center mx-auto my-5">
|
|
<p><i class="fa fa-check-circle font-alert p-4"></i></p>
|
|
Accesso aggiunto correttamente!
|
|
</div>';
|
|
|
|
}else{
|
|
?>
|
|
<form method="post">
|
|
<div class="row">
|
|
<div class="col-4">
|
|
<span class="font-12">Nome utente</span>
|
|
<input type="text" name="name">
|
|
</div>
|
|
<div class="col-4">
|
|
<span class="font-12">Username</span>
|
|
<input type="text" name="usr">
|
|
</div>
|
|
<div class="col-4">
|
|
<span class="font-12">Password</span>
|
|
<input type="password" name="pwd">
|
|
</div>
|
|
<div class="col-12 mt-3">
|
|
<span class="font-12">Sezioni</span>
|
|
</div>
|
|
<?php
|
|
$all_sections = array(
|
|
'Gestione iscritti' => 'user',
|
|
'Notizie' => 'news',
|
|
'E-mail' => 'email',
|
|
'Files' => 'files',
|
|
'Links' => 'links',
|
|
'Inserzioni' => 'advertisement',
|
|
'Farmacie' => 'pharmacy',
|
|
'Parafarmacie' => 'parapharmacy',
|
|
'FTP' => 'ftp',
|
|
'FTP (sola lettura)' => 'ftp-readonly',
|
|
'Gestione accessi' => 'access',
|
|
);
|
|
|
|
foreach($all_sections as $k => $v){
|
|
echo '<div class="col-3">
|
|
<input type="checkbox" name="sec[]" id="'.$v.'" value="'.$v.'"><label for="'.$v.'">'.$k.'</label>
|
|
</div>';
|
|
}
|
|
?>
|
|
<div class="col-12 mt-3 text-right">
|
|
<button type="submit" name="go" value="1">Aggiungi accesso</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<?php
|
|
}
|
|
?>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|