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.
90 lines
4.2 KiB
90 lines
4.2 KiB
<div class="row pb-4">
|
|
<div class="col-12">
|
|
<div class="section-title">Inserzioni</div>
|
|
</div>
|
|
|
|
<div class="col-12 col-sm-8 mt-4 mx-auto text-center">
|
|
<form method="post">
|
|
|
|
<div class="row font-14 font-bold">
|
|
<div class="col-12 col-md-auto font-12">
|
|
<p style="line-height: 38px;">Filtra per:</p>
|
|
</div>
|
|
<div class="col-12 col-md">
|
|
<select name="type" class="input" onChange="this.form.submit()">
|
|
<option value="all" <?php if($_POST['type'] == "all"){echo "selected";}?>>Tutte le inserzioni</option>
|
|
<option value="find" <?php if($_POST['type'] == "find"){echo "selected";}?>>Cerco lavoro</option>
|
|
<option value="offer" <?php if($_POST['type'] == "offer"){echo "selected";}?>>Offro lavoro</option>
|
|
<option value="adv" <?php if($_POST['type'] == "adv"){echo "selected";}?>>Annunci di compravendita</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="col-12 col-md">
|
|
<select name="city" class="input" onChange="this.form.submit()">
|
|
<option value="all">Tutti i comuni</option>
|
|
<?php
|
|
$q=mysqli_query($conn,"SELECT DISTINCT city FROM advertisement WHERE enabled=1 ORDER BY city DESC");
|
|
while($r=mysqli_fetch_array($q)){
|
|
echo "<option value=\"".$r['city']."\" ";
|
|
if($_POST['city'] == $r['city']){echo "selected";}
|
|
echo ">".$r['city']."</option>";
|
|
}
|
|
?>
|
|
</select>
|
|
</div>
|
|
<!-- <div class="col-auto">
|
|
<button type="submit"><i class="fa fa-search"></i> Cerca </button>
|
|
</div>-->
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
|
|
|
|
<div class="col-12 text-right">
|
|
<hr>
|
|
<a class="button cboxElement" href="<?php echo $BASE_URL;?>/blocks/addADV.php">Aggiungi una inserzione</a>
|
|
</div>
|
|
|
|
<div class="col-12 items-list py-1">
|
|
<?php
|
|
$qAdd = "";
|
|
if($_POST['type'] && $_POST['type'] != "all"){$qAdd.=" AND type ='".$_POST['type']."'";}
|
|
if($_POST['city'] && $_POST['city'] != "all"){$qAdd.=" AND city ='".$_POST['city']."'";}
|
|
|
|
$q=mysqli_query($conn,"SELECT * FROM advertisement WHERE enabled=1 $qAdd ORDER BY date ASC");
|
|
while($r=mysqli_fetch_array($q)){
|
|
?>
|
|
<div class="item">
|
|
<i class="fa fa-angle-right"></i> <strong>Annuncio inserito il <?= conv_date($r['date']); ?></strong>
|
|
<p class="m-2 ml-4"><?= $r['text']; ?></p>
|
|
<div class="more m-2 ml-4">
|
|
<span class="more-title button">Info e contatti</span>
|
|
<?php
|
|
if($_SESSION['AUTH']['id'] == $r['uid']){
|
|
echo "<a href=\"$BASE_URL/blocks/removeADV.php?id=".$r['id']."&uid=".$r['uid']."\" class=\"button cboxElement\">Rimuovi annncio</a>";
|
|
}
|
|
?>
|
|
|
|
<div class="more-content">
|
|
<p class="font-bold text-upper"><?= $r['full_name']; ?></p>
|
|
<p class="">Comune di residenza: <?= $r['city']; ?></p>
|
|
<p class="">Recapiti telefonici: <?= $r['contact_phone']; ?></p>
|
|
<p class="">Email: <?= $r['contact_email']; ?></p>
|
|
|
|
<?php
|
|
if($r['append']){
|
|
$qf=mysqli_query($conn,"SELECT * FROM files WHERE id=".$r['append']);
|
|
$rf=mysqli_fetch_array($qf);
|
|
echo "<p class=\"mt-2\"><a href=\"".$BASE_URL."".$rf['path']."/".$rf['filename']."\" target=\"_blank\">".$rf['title']."</a></p>";
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|