16 changed files with 1685 additions and 36 deletions
@ -0,0 +1,123 @@ |
|||||
|
<?php |
||||
|
session_start(); |
||||
|
|
||||
|
@include '../cgi-bin/conn.conn'; |
||||
|
@include '../cgi-bin/functions.inc'; |
||||
|
@include '../cgi-bin/params.inc'; |
||||
|
|
||||
|
$GLOBALS['conn']; |
||||
|
|
||||
|
$conn=@mysqli_connect($DATAhst,$DATAusr,$DATApwd,$DATAdtb)or die("CONNECTION ERROR"); |
||||
|
mysqli_set_charset($conn, "utf8"); |
||||
|
|
||||
|
?> |
||||
|
<!DOCTYPE html> |
||||
|
<html> |
||||
|
<head> |
||||
|
<title>Ordine dei Farmacisti della Provincia di Salerno</title> |
||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
||||
|
<base href="<?php echo $BASE_URL;?>/"> |
||||
|
<link href="<?php echo $BASE_URL;?>/css/styles.css" rel="stylesheet" type="text/css"/> |
||||
|
<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'> |
||||
|
</head> |
||||
|
<body> |
||||
|
<div class="row no-gutters"> |
||||
|
|
||||
|
<?php |
||||
|
if(!$_SESSION['AUTH']){ |
||||
|
?> |
||||
|
|
||||
|
<div id="actions" class="row mx-auto text-center"> |
||||
|
<div class="col-10 my-3 mx-auto"> |
||||
|
<button class="is-user">Sono iscritto all'Ordine di Salerno</button> |
||||
|
</div> |
||||
|
<div class="col-10 my-3 mx-auto"> |
||||
|
<button class="not-user">NON sono iscritto all'Ordine di Salerno</button> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<form id="login-form" method="post"> |
||||
|
<div class="row no-gutters"> |
||||
|
<div class="col-10 col-sm-6 mx-auto"> |
||||
|
<label class="font-10">Username</label> |
||||
|
<input type="text" name="usr" placeholder="username"> |
||||
|
|
||||
|
<label class="font-10">Password</label> |
||||
|
<input type="password" name="pwd" placeholder="password"> |
||||
|
<input type="submit" name="go" value="Accedi"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
|
||||
|
<?php |
||||
|
} |
||||
|
?> |
||||
|
|
||||
|
<form id="adv-form" method="post" enctype="multipart/form-data" action="<?php echo $BASE_URL;?>/blocks/advFormSubmit.php" <?php if($_SESSION['AUTH']){echo "style=\"display: block\"";}?>> |
||||
|
<div class="row no-gutters"> |
||||
|
<div class="col-10 mx-auto"> |
||||
|
<span class="font-12">Tipologia inserzione</span> |
||||
|
<select class="input" name="type"> |
||||
|
<option value="find">Cerco lavoro</option> |
||||
|
<option value="offer">Offro lavoro</option> |
||||
|
<option value="adv">Anninci di compravendita</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
<div class="col-sm-4 d-none d-sm-block"></div> |
||||
|
<div class="col-10 mx-auto"> |
||||
|
<span class="font-12">Nome e Cognome</span> |
||||
|
<input type="text" name="full_name" <?php if($_SESSION['AUTH']){echo "value=\"".$_SESSION['AUTH']['last_name']." ".$_SESSION['AUTH']['first_name']."\" readonly";}?>> |
||||
|
</div> |
||||
|
<div class="col-10 mx-auto"> |
||||
|
<span class="font-12">Testo inserzione</span> |
||||
|
<textarea cols="40" rows="6" name="text"></textarea> |
||||
|
</div> |
||||
|
<div class="col-10 mx-auto"> |
||||
|
<span class="font-12">Comune di residenza*</span> |
||||
|
<input type="text" name="city" required> |
||||
|
</div> |
||||
|
<div class="col-10 mx-auto"> |
||||
|
<span class="font-12">Recapiti telefonici*</span> |
||||
|
<input type="text" name="contact_phone" required> |
||||
|
</div> |
||||
|
<div class="col-10 mx-auto"> |
||||
|
<span class="font-12">Email contatto*</span> |
||||
|
<input type="text" name="contact_email" required <?php if($_SESSION['AUTH']){echo "value=\"".$_SESSION['AUTH']['email']."\"";}?>> |
||||
|
</div> |
||||
|
<div class="col-10 mx-auto"> |
||||
|
<span class="font-12">Allegato (opzionale, ES: curriculum)</span><br> |
||||
|
<input type="file" name="append"> |
||||
|
</div> |
||||
|
<div class="col-10 mx-auto"> |
||||
|
<div class="g-recaptcha" data-sitekey="6Le7kkUUAAAAAK-lsvoefiaBsH1TycWnHipCC8VF"></div> |
||||
|
</div> |
||||
|
<div class="col-10 mt-3 mx-auto font-10"> |
||||
|
<p>L'inserzione avrà una durata di 3 mesi, decorsi i quali verrà automaticamente cancellata.</p> |
||||
|
<p>ATTENZIONE: Per effettuare la pubblicazione diretta di un annuncio bisogna essere un utente iscritto all'Albo ed effettuare il log-in. Per coloro che sono iscritti ad altri Ordini oppure non ancora iscritti, è possibile pubblicare un'inserzione cliccando su "Non sono iscritto all'Ordine di Salerno"; in tal caso l'annuncio verrà valutato ed eventualmente approvato dallo staff dell'Ordine.</p> |
||||
|
</div> |
||||
|
<div class="col-10 mx-auto"> |
||||
|
<button type="submit">Pubblica inserzione</button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
<script type="text/javascript" src="<?php echo $BASE_URL;?>/node_modules/jquery/dist/jquery.min.js"></script> |
||||
|
<script type="text/javascript" src="https://www.google.com/recaptcha/api.js"></script> |
||||
|
|
||||
|
<script> |
||||
|
$('#actions .not-user').on('click', function(){ |
||||
|
$('#actions').fadeOut( function(){ |
||||
|
$('#adv-form').fadeIn(); |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
$('#actions .is-user').on('click', function(){ |
||||
|
$('#actions').fadeOut( function(){ |
||||
|
$('#login-form').fadeIn(); |
||||
|
}); |
||||
|
}); |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,75 @@ |
|||||
|
|
||||
|
<?php |
||||
|
session_start(); |
||||
|
|
||||
|
@include '../cgi-bin/conn.conn'; |
||||
|
@include '../cgi-bin/functions.inc'; |
||||
|
@include '../cgi-bin/params.inc'; |
||||
|
|
||||
|
$GLOBALS['conn']; |
||||
|
|
||||
|
$conn=@mysqli_connect($DATAhst,$DATAusr,$DATApwd,$DATAdtb)or die("CONNECTION ERROR"); |
||||
|
mysqli_set_charset($conn, "utf8"); |
||||
|
|
||||
|
?> |
||||
|
<!DOCTYPE html> |
||||
|
<html> |
||||
|
<head> |
||||
|
<title>Ordine dei Farmacisti della Provincia di Salerno</title> |
||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
||||
|
<base href="<?php echo $BASE_URL;?>/"> |
||||
|
<link href="<?php echo $BASE_URL;?>/css/styles.css" rel="stylesheet" type="text/css"/> |
||||
|
<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'> |
||||
|
</head> |
||||
|
<body> |
||||
|
<div class="row no-gutters py-4"> |
||||
|
|
||||
|
<?php |
||||
|
|
||||
|
if(sizeof($_POST)>0 && $_POST['g-recaptcha-response']){ |
||||
|
$uid = $_SESSION['AUTH']['id'] ? $_SESSION['AUTH']['id'] : 0; |
||||
|
$email = $_SESSION['AUTH']['email'] ? $_SESSION['AUTH']['email'] : ""; |
||||
|
$append = 0; |
||||
|
|
||||
|
if(is_uploaded_file($_FILES['append']['tmp_name'])){ |
||||
|
$filename = preg_replace('/[^a-zA-Z0-9\-\._]/','', $_FILES['append']['name']); |
||||
|
$filesize = ($_FILES['append']['size'] < 1000000) ? round($_FILES['append']['size'] / 1000)."k" : round($_FILES['append']['size'] / 1000000)."M"; |
||||
|
move_uploaded_file($_FILES['append']['tmp_name'], "../docs/files/advertisement/$filename"); |
||||
|
$qf=mysqli_query($conn, "INSERT INTO files VALUES(null, '$filename', '$filename', '/docs/files/advertisement', NOW(), '$filesize')"); |
||||
|
$append = mysqli_insert_id($conn); |
||||
|
} |
||||
|
|
||||
|
$q=mysqli_query($conn, "INSERT INTO advertisement VALUES(null, $uid, '".addslashes(trim($_POST['full_name']))."', |
||||
|
'".addslashes(trim($email))."', NOW(), '".addslashes(nl2br($_POST['text']))."', |
||||
|
'".addslashes(trim($_POST['city']))."', '".addslashes(trim($_POST['contact_phone']))."', |
||||
|
'".addslashes(trim($_POST['contact_email']))."', $append, '".$_POST['type']."', 1)"); |
||||
|
|
||||
|
echo "<script>setTimeout( function(){parent.location = parent.location;},1500); </script>"; |
||||
|
|
||||
|
?> |
||||
|
|
||||
|
<div class="col-10 text-center mx-auto"> |
||||
|
<p><i class="fa fa-check-circle font-alert p-4"></i></p> |
||||
|
Annuncio aggiunto correttamente! |
||||
|
</div> |
||||
|
|
||||
|
<?php |
||||
|
|
||||
|
}else{ |
||||
|
|
||||
|
if(sizeof($_POST) > 0 && |
||||
|
(!$_POST['g-recaptcha-response'] || |
||||
|
strlen($_POST['full_name']) < 5 || |
||||
|
strlen($_POST['city']) < 5 || |
||||
|
strlen($_POST['contact_phone']) < 5 || |
||||
|
strlen($_POST['contact_email']) < 5)){ |
||||
|
echo "<div class=\"col-10 mx-auto text-red text-center\"> |
||||
|
<p><i class=\"fa fa-exclamation-triangle font-alert p-4\"></i></p> |
||||
|
ATTENZIONE: Ricorda ti compilare tutti i campi contrassegnati con * ed effettuare il controllo si sicurezza.</div>"; |
||||
|
} |
||||
|
} |
||||
|
?> |
||||
|
|
||||
|
</div> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,81 @@ |
|||||
|
<?php |
||||
|
session_start(); |
||||
|
|
||||
|
@include '../cgi-bin/conn.conn'; |
||||
|
@include '../cgi-bin/functions.inc'; |
||||
|
@include '../cgi-bin/params.inc'; |
||||
|
|
||||
|
$GLOBALS['conn']; |
||||
|
|
||||
|
$conn=@mysqli_connect($DATAhst,$DATAusr,$DATApwd,$DATAdtb)or die("CONNECTION ERROR"); |
||||
|
mysqli_set_charset($conn, "utf8"); |
||||
|
|
||||
|
|
||||
|
?> |
||||
|
<!DOCTYPE html> |
||||
|
<html> |
||||
|
<head> |
||||
|
<title>Ordine dei Farmacisti della Provincia di Salerno</title> |
||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
||||
|
<base href="<?php echo $BASE_URL;?>/"> |
||||
|
<link href="<?php echo $BASE_URL;?>/css/styles.css" rel="stylesheet" type="text/css"/> |
||||
|
<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'> |
||||
|
</head> |
||||
|
<body> |
||||
|
<div class="row no-gutters"> |
||||
|
|
||||
|
<?php |
||||
|
|
||||
|
if($_POST['delete']){ |
||||
|
$q=mysqli_query($conn, "DELETE FROM advertisement WHERE id=".$_POST['delete']); |
||||
|
echo "<script>parent.$.fn.colorbox.close(); </script>"; |
||||
|
} |
||||
|
|
||||
|
if($_SESSION['AUTH'] && $_SESSION['AUTH']['id'] == $_GET['uid']){ |
||||
|
?> |
||||
|
|
||||
|
<form method="post"> |
||||
|
<div class="row"> |
||||
|
<div class="col-10 col-sm-6 mx-auto text-center"> |
||||
|
<p><i class="fa fa-question-circle font-alert pb-4"></i></p> |
||||
|
<p class="my-3">Sei sicuro di voler eliminare questo annuncio?</p> |
||||
|
<input type="hidden" name="delete" value="<?= $_GET['id'];?>"> |
||||
|
<input type="submit" name="go" value="Elimina annuncio"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
|
||||
|
<?php |
||||
|
}else{ |
||||
|
?> |
||||
|
<div class="col-10 text-center mx-auto"> |
||||
|
<p><i class="fa fa-exclamation-triangle font-alert pb-4"></i></p> |
||||
|
ATTENZIONE:<br> |
||||
|
Accesso non autorizzato, controlla di avere i permessi per eliminare l'annuncio. |
||||
|
</div> |
||||
|
<?php |
||||
|
} |
||||
|
?> |
||||
|
|
||||
|
|
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
<script type="text/javascript" src="<?php echo $BASE_URL;?>/node_modules/jquery/dist/jquery.min.js"></script> |
||||
|
<script type="text/javascript" src="https://www.google.com/recaptcha/api.js"></script> |
||||
|
|
||||
|
<script> |
||||
|
$('#actions .not-user').on('click', function(){ |
||||
|
$('#actions').fadeOut( function(){ |
||||
|
$('#adv-form').fadeIn(); |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
$('#actions .is-user').on('click', function(){ |
||||
|
$('#actions').fadeOut( function(){ |
||||
|
$('#login-form').fadeIn(); |
||||
|
}); |
||||
|
}); |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
Binary file not shown.
File diff suppressed because it is too large
@ -0,0 +1,90 @@ |
|||||
|
<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> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue