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.
69 lines
2.7 KiB
69 lines
2.7 KiB
<div class="row">
|
|
<div class="col-12">
|
|
<div class="section-title">Elimina link</div>
|
|
</div>
|
|
<div class="col-12">
|
|
|
|
<div class="sheet-box p-4">
|
|
|
|
<?php
|
|
if($_POST['go']){
|
|
|
|
foreach ($_POST['links'] as $index => $link) {
|
|
mysqli_query($conn, "DELETE FROM links WHERE id='$link'");
|
|
}
|
|
|
|
|
|
echo '<div class="col-10 text-center mx-auto my-5">
|
|
<p><i class="fa fa-check-circle font-alert p-4"></i></p>
|
|
Link eliminato correttamente!
|
|
</div>';
|
|
|
|
|
|
}else{
|
|
?>
|
|
<form method="post" enctype="multipart/form-data">
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<span class="font-12">Carica in</span>
|
|
<select name="section" onChange="this.form.submit()">
|
|
<option value="">- Seleziona una sezione - </option>
|
|
<option value="cerca-un-farmaco" <?php if($_POST['section']=="cerca-un-farmaco"){echo "selected";}?>>Cerca un farmaco</option>
|
|
<option value="siti-istituzionali" <?php if($_POST['section']=="siti-istituzionali"){echo "selected";}?>>Siti istituzionali</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<form method="post" enctype="multipart/form-data">
|
|
<input type="hidden" name="section" value="<?= $_POST['section'];?>">
|
|
<div class="col-12 p-0 admin-list">
|
|
<?php
|
|
if($_POST['section']){
|
|
|
|
$q = mysqli_query($conn, "SELECT * FROM links WHERE section='".$_POST['section']."'");
|
|
$cnt=0;
|
|
while($r = mysqli_fetch_array($q)){
|
|
$cnt++;
|
|
$bg = ($cnt%2) ? "bg-light-grey" : "bg-white";
|
|
echo "<div class=\"admin-list-item row no-gutters font-12 $bg\">
|
|
<div class=\"col-11\">".$r['title']."</div>
|
|
<div class=\"col-1 text-right\">
|
|
<input type=\"checkbox\" name=\"links[]\" id=\"".$r['id']."\" value=\"".$r['id']."\"><label for=\"".$r['id']."\"><i class=\"fa fa-trash\"></i></label>
|
|
</div></div>";
|
|
}
|
|
?>
|
|
</div>
|
|
<div class="col-12 text-right">
|
|
<button type="submit" name="go" value="1">Elimina link/s</button>
|
|
</div>
|
|
</form>
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|