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.
116 lines
4.1 KiB
116 lines
4.1 KiB
<?php
|
|
|
|
$initial = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
|
|
|
|
$qUpdate = mysqli_query($conn, "SELECT UPDATE_TIME FROM information_schema.tables WHERE TABLE_SCHEMA = '$DATAdtb' AND TABLE_NAME = 'board'");
|
|
$qTotal = mysqli_query($conn, "SELECT COUNT(id) FROM board");
|
|
|
|
$rUpdate = mysqli_fetch_array($qUpdate);
|
|
$rTotal = mysqli_fetch_array($qTotal);
|
|
?>
|
|
|
|
|
|
<div class="row board">
|
|
|
|
<div class="col-12">
|
|
<div class="section-title">Albo degli iscritti</div>
|
|
|
|
<div class="col-12 col-sm-8 my-2 mx-auto pages">
|
|
|
|
<?php
|
|
for($i=0;$i<count($initial);$i++){
|
|
echo "<a class=\"font-12 ";
|
|
if($initial[$i]==$initialSelected){echo "selected";}
|
|
echo "\" href=\"$BASE_URL/albo/init/".$initial[$i]."\">".strtoupper($initial[$i])."</a>";
|
|
}
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-12 col-sm-6 my-4 mx-auto text-center">
|
|
<form method="post" action="<?php echo $BASE_URL;?>/albo/find">
|
|
<p class="font-14 font-bold"><!--Cerca-->
|
|
<input type="text" name="q" class="input">
|
|
<button type="submit"><i class="fa fa-search"></i> Cerca </button>
|
|
</p>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="col-12 text-center">
|
|
<p class="font-14 my-3">Aggiornato al <?= conv_date($rUpdate[0]);?>, ad oggi siamo <?= $rTotal[0];?> iscritti</p>
|
|
<a href="<?php echo $BASE_URL."/XLS_export.php?db=board";?>">
|
|
<button>Scarica in formato .XLS</button>
|
|
</a>
|
|
</div>
|
|
|
|
|
|
<div class="col-12 col-sm-8 my-5 mx-auto results">
|
|
|
|
<?php
|
|
$query="";
|
|
if($getQ[1]=="init"){
|
|
$query="WHERE last_name LIKE '".$getQ[2]."%'";
|
|
$q = mysqli_query($conn, "SELECT * FROM board $query ORDER BY last_name");
|
|
}
|
|
|
|
if($getQ[1]=="find"){
|
|
|
|
$keys = explode(' ',addslashes($_POST['q']));
|
|
|
|
if(count($keys)>1){
|
|
|
|
$query="WHERE (";
|
|
foreach($keys as $k=>$value){
|
|
if($k>0){$query .= " OR";}
|
|
$query .= " first_name LIKE '%$value%' ";
|
|
}
|
|
|
|
$query .= " OR first_name LIKE '%".addslashes($_POST['q'])."%' OR last_name LIKE '%".addslashes($_POST['q'])."%') AND (";
|
|
|
|
foreach($keys as $k=>$value){
|
|
if($k>0){$query .= " OR";}
|
|
$query .= " last_name LIKE '%$value%' ";
|
|
}
|
|
|
|
$query .= ") ";
|
|
|
|
}else{
|
|
$query="WHERE first_name LIKE '%".$keys[0]."%' OR last_name LIKE '%".$keys[0]."%'";
|
|
}
|
|
|
|
$q = mysqli_query($conn, "SELECT * FROM board $query ORDER BY last_name");
|
|
}
|
|
|
|
if($getQ[1]=="details"){
|
|
$q = mysqli_query($conn, "SELECT * FROM board WHERE id=".$getQ[2]."");
|
|
$r = mysqli_fetch_array($q);
|
|
?>
|
|
|
|
<a name="sheet"></a>
|
|
<div class="sheet">
|
|
<div class="name"><?= $r['last_name']." ".$r['first_name'];?></div>
|
|
<p>N° iscrizione <strong><?= $r['id'];?></strong></p>
|
|
<p>Nato/a il <strong><?= $r['birth_date'];?></strong> a <strong><?= $r['birth_place'];?></strong></p>
|
|
<p>Iscritto/a il <strong><?= $r['register_date'];?></strong></p>
|
|
<p>Residente in <strong><?= $r['address'];?> - <?= $r['zip_code'];?> - <?= $r['city'];?> (<?= $r['province'];?>)</strong></p>
|
|
<p>Laurea in <strong><?= $r['degree'];?></strong> il <strong><?= $r['degree_date'];?></strong> a <strong><?= $r['degree_place'];?></strong></p>
|
|
<p>Abilitato/a nel <strong><?= $r['qualification_date'];?></strong> presso <strong><?= $r['qualification_place'];?></strong></p>
|
|
|
|
</div>
|
|
<?php
|
|
}else{
|
|
while($r = mysqli_fetch_array($q)){
|
|
echo "<div class=\"item\"><i class=\"fa fa-angle-right\"></i> <a href=\"$BASE_URL/albo/details/".$r['id']."#sheet\">".$r['last_name']." ".$r['first_name']."</a></div>";
|
|
}
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|