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.
172 lines
6.9 KiB
172 lines
6.9 KiB
|
|
<?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($_GET)>0){
|
|
$err = 0;
|
|
$mess = "";
|
|
|
|
if(!$_GET['first_name']){
|
|
$err += 1;
|
|
$mess .= "<p>Il campo \"Nome\" è obbligatorio.</p>";
|
|
}
|
|
if(!$_GET['last_name']){
|
|
$err += 1;
|
|
$mess .= "<p>Il campo \"Cognome\" è obbligatorio.</p>";
|
|
}
|
|
if(strlen($_GET['pwd'])<8){
|
|
$err += 1;
|
|
$mess .= "<p>La password deve contenere almeno 8 caratteri.</p>";
|
|
}
|
|
if($_GET['pwd']!=$_GET['rpwd']){
|
|
$err += 1;
|
|
$mess .= "<p>Le password inserite non corrispondono.</p>";
|
|
}
|
|
if(!$_GET['tax_code']){
|
|
$err += 1;
|
|
$mess .= "<p>Il campo \"Codice fiscale\" è obbligatorio.</p>";
|
|
}
|
|
if(!$_GET['email'] || !filter_var($_GET['email'], FILTER_VALIDATE_EMAIL)){
|
|
$err += 1;
|
|
$mess .= "<p>Il campo \"Email\" è obbligatorio, controlla che l'indirizzo sia corretto.</p>";
|
|
}
|
|
if(!$_GET['board_id']){
|
|
$err += 1;
|
|
$mess .= "<p>Devi inserire il numero di iscrizione all'Albo.</p>";
|
|
}
|
|
if(!$_GET['privacy']){
|
|
$err += 1;
|
|
$mess .= "<p>Devi effettuare acconsentire al trattamento dei dati.</p>";
|
|
}
|
|
if(!$_GET['g-recaptcha-response']){
|
|
$err += 1;
|
|
$mess .= "<p>Devi effettuare il controllo di sicurezza.</p>";
|
|
}
|
|
|
|
if($err!=0){
|
|
echo "<div class=\"col-10 text-center text-red mx-auto\">".
|
|
"<p><i class=\"fa fa-exclamation-triangle font-alert p-4\"></i></p>".
|
|
$mess."</div>";
|
|
}else{
|
|
|
|
$q=mysqli_query($conn, "SELECT COUNT(id) FROM board WHERE
|
|
first_name='".trim($_GET['first_name'])."' AND
|
|
last_name='".trim($_GET['last_name'])."' AND
|
|
id='".trim($_GET['board_id'])."'
|
|
");
|
|
$r=mysqli_fetch_array($q);
|
|
|
|
if(!$r[0]){
|
|
echo "<div class=\"col-10 text-center text-red mx-auto\">".
|
|
"<p><i class=\"fa fa-exclamation-triangle font-alert p-4\"></i></p>".
|
|
"ATTENZIONE: L'utente non risulta presente in database, controlla i dati inseriti e riprova.".
|
|
"</div>";
|
|
}else{
|
|
$q=mysqli_query($conn, "UPDATE board SET
|
|
usr='".trim($_GET['usr'])."',
|
|
pwd='".md5(trim($_GET['pwd']))."',
|
|
email='".trim($_GET['email'])."'
|
|
WHERE id='".trim($_GET['board_id'])."'
|
|
");
|
|
|
|
$SM_email = $_GET['email'];
|
|
$SM_email2 = 0;
|
|
$SM_email_CC = 0;
|
|
$SM_subject = "Richiesta di registrazione";
|
|
$SM_messageH1 = "Ricevi questa email perchè hai richiesto l'iscrizione al portale dell'Ordine dei Farmacisti della Provincia di Salerno.<br><br>I tuoi dati saranno controllati ed in caso di esito positivo provvederemo ad abilitare il tuo account.<br><br>Per accedere al portale è necessario attendere la mail di conferma.<br><br>";
|
|
$SM_messageH2 = "Un utente ha richiesto di iscriversi al portale dell'Ordine, accedi al pannello di amministrazione per effettuare l'abilitazione.<br><br>";
|
|
$SM_message = "<b>Riepilogo dati</b><br>".
|
|
"Nome: ".trim($_GET['first_name'])."<br>".
|
|
"Cognome: ".trim($_GET['last_name'])."<br>".
|
|
"Username: ".trim($_GET['usr'])."<br>".
|
|
"Password: ".trim($_GET['pwd'])."<br>".
|
|
"Email: ".trim($_GET['email'])."<br>".
|
|
"N. iscrizione: ".trim($_GET['board_id'])."";
|
|
$SM_showalert = 0;
|
|
$SM_append = 0;
|
|
|
|
sendMail($SM_email,$SM_email2,$SM_email_CC,$SM_subject,$SM_messageH1."".$SM_message,$SM_showalert,$SM_append);
|
|
sendMail("dslaky@gmail.com",$SM_email2,$SM_email_CC,$SM_subject,$SM_messageH2."".$SM_message,$SM_showalert,$SM_append);
|
|
|
|
echo "<div class=\"col-10 text-center mx-auto\">".
|
|
"<p><i class=\"fa fa-check-circle font-alert p-4\"></i></p>".
|
|
"<b>Dati inviati correttamente.</b><br>".
|
|
"Ti abbiamo inviato una mail all'indirizzo da te indicato, i tuoi dati saranno controllati ed in caso di esito positivo provvederemo ad abilitare il tuo account.<br>".
|
|
"Per accedere al portale è necessario attendere la mail di conferma.".
|
|
"</div>";
|
|
}
|
|
}
|
|
|
|
}
|
|
/*
|
|
if(sizeof($_GET)>0 && $_GET['g-recaptcha-response']){
|
|
|
|
$SM_email = $_GET['email'];
|
|
$SM_email2 = 0;
|
|
$SM_email_CC = 0;
|
|
$SM_subject = "Richiesta di registrazione";
|
|
$SM_message = "Nome del mittente:". $_GET['name']."<br>";
|
|
$SM_message .= "Email del mittente:". $_GET['email']."<br><br>";
|
|
$SM_message .= $_GET['message'];
|
|
$SM_showalert = 0;
|
|
$SM_append = 0;
|
|
|
|
sendMail($SM_email,$SM_email2,$SM_email_CC,$SM_subject,$SM_message,$SM_showalert,$SM_append);
|
|
|
|
?>
|
|
|
|
|
|
<div class="col-10 text-center mx-auto">
|
|
<p><i class="fa fa-check-circle font-alert p-4"></i></p>
|
|
E-mail inviata correttamente a <?= $_GET['dest'];?>
|
|
</div>
|
|
|
|
|
|
<?php
|
|
|
|
}else{
|
|
|
|
if(sizeof($_GET)>0 &&
|
|
(!$_GET['g-recaptcha-response'] ||
|
|
strlen($_GET['first_name']) < 5 ||
|
|
strlen($_GET['last_name']) < 5 ||
|
|
strlen($_GET['usr']) < 5 ||
|
|
strlen($_GET['pwd']) < 5 ||
|
|
strlen($_GET['pwd']) < 5 ||
|
|
strlen($_GET['email']) < 5 ||
|
|
strlen($_GET['message']) < 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 ed effettuare il controllo si sicurezza.</div>";
|
|
}
|
|
}*/
|
|
?>
|
|
|
|
</div>
|
|
</body>
|
|
</html>
|