1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
| <?php
/**
* Created by PhpStorm.
* User: alainserge
* Date: 29/07/2017
* Time: 07:53
*/
require_once './config.php';
if (isset($_POST["sub"])) {
require_once "phpmailer/class.phpmailer.php";
$name= trim($_POST["linkman"]); // linkman
$email= trim($_POST["uemail"]); //mail
$siret = trim($_POST["siret"]); // siret
$mobile = trim($_POST["mobile"]); //mobile
$id_zone = trim($_POST["id_zone"]); //id_zone
$ip_address = $_SERVER['REMOTE_ADDR']; // IP
//var_dump($name,$email,$siret,$mobile,$id_zone,$ip_address);
// exit();
$sql = "SELECT COUNT(*) AS count from shop_apply where mail = :email_id";
try {
$stmt = $DB->prepare($sql);
$stmt->bindValue(":email_id", $email);
$stmt->execute();
$result = $stmt->fetchAll();
if ($result[0]["count"] > 0) {
$msg = "Vous êtes déjà inscrit une fois avec cet email";
$msgType = "danger";
} else {
$sql = "INSERT INTO `shop_apply` (`linkman`, `siret`, `mobile`,`ip_address`,`mail`,`zone_id`) VALUES " . "( :name, :siret, :mobile, :ip_address, :email,:id_zone)";
//$sql1 = 'INSERT INTO shop_apply (linkman, mail, mobile, siret, zone_id,ip_address) VALUES("'.$name.'", "'.$email.'", "'.$mobile.'", "'.$siret.'", "'.$id_zone.'","'.$ip_address.'")';
$stmt = $DB->prepare($sql);
$stmt->bindValue(":linkman", $name);
$stmt->bindValue(":siret", $siret);
$stmt->bindValue(":mobile", $mobile);
$stmt->bindValue(":ip_address", $ip_address);
$stmt->bindValue(":mail", $email);
$stmt->bindValue(":id_zone", $id_zone);
$stmt->execute();
$result = $stmt->rowCount();
if ($result > 0) {
$lastID = $DB->lastInsertId();
$message = '<html><head>
<title>Accusé réception de votre demande</title>
</head>
<body>';
$message .= '<h3>Bonjour ' . $name . '!</h3>';// Contenu du message
$message .= '<p>J\'accuse réception de votre courriel et vous en remercie</p>'; // Contenu du message
$message .= "</body></html>";
// php mailer pour envoyer le mail
$mail = new PHPMailer(true);
$mail->SMTPDebug = 0;
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "mail.xxxx.com";
$mail->Port = 25 ;
$mail->Username = 'services@xxxx.com';
$mail->Password = 'xxxxxx';
$mail->SetFrom('services@xxxx.com', 'xxxx Service'); /// mail d`envois
$mail->AddAddress($email);
$mail->Subject = trim("Accusé réception de votre demande"); //Titre du mail
$mail->MsgHTML($message);
try {
$mail->send();
$msg = "Un courriel vous a été envoyé.";
$msgType = "success";
} catch (Exception $ex) {
$msg = $ex->getMessage();
$msgType = "warning";
}
} else {
$msg = "Impossible de créer une demande";
$msgType = "danger";
}
}
} catch (Exception $ex) {
echo $ex->getMessage();
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="<?php echo PROJECT_NAME; ?>">
<meta name="title" content="<?php echo PROJECT_NAME; ?>">
<title><?php echo PROJECT_NAME; ?></title>
<link href="minify/rgen_min.css" rel="stylesheet">
<link href="css/custom.css" rel="stylesheet">
<link href="css/ajout.css" rel="stylesheet">
<link rel="icon" href="images/favicons/favicon.ico">
<link rel="apple-touch-icon" href="images/favicons/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="images/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="images/favicons/apple-touch-icon-114x114.png">
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
<!--[if IE 9 ]><script src="js/ie-matchmedia.js"></script><![endif]-->
</head>
<body>
<div id="page" data-linkscroll='y'>
<section class="taille pd-0 pos-rel vh100" data-rgen-sm="h-reset" id="home">
<div class="white-block">
<div class="align-c pd-b-0" data-rgen-sm="pd-20">
<br/><br/>
<p class="sq90 inline-flex flex-cc fs80 mr-0 txt-color1"><img src="images/logoRegister.png" width="400px" height="400px" /></p>
<h2 class="title mr-0" data-rgen-sm="small">Inscription pour vendre sur xxxx</h2>
</div>
<?php if ($msg <> "") { ?>
<div class="alert alert-dismissable alert-<?php echo $msgType; ?>">
<button data-dismiss="alert" class="close" type="button">x</button>
<p><?php echo $msg; ?></p>
</div>
<?php } ?>
<div class="pop-body" data-rgen-sm="pd-20">
<!-- form-block -->
<div class="form-block">
<form class="form-horizontal contactform" action="me.php" method="post" name="f" onsubmit="return validateForm();">
<div class="field-wrp">
<input type="hidden" name="to" value="services@xxxx.com">
<div class="form-group">
<input class="form-control" data-label="Nom et prénom" required data-msg="Entrez votre Nom et prénom." id="linkman" type="text" name="linkman" placeholder="Nom et prénom">
</div>
<div class="form-group">
<input class="form-control" data-label="Email" id="uemail" required data-msg="Entrez votre email." type="email" name="uemail" placeholder="Email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$" title="monemail@xxxx.com" >
</div>
<div class="form-group">
<input class="form-control" required data-label="Phone" id="mobile" pattern="(01|02|03|04|05|06|07|08|09)[ \.\-]?[0-9]{2}[ \.\-]?[0-9]{2}[ \.\-]?[0-9]{2}[ \.\-]?[0-9]{2}" data-msg="Entrez votre numéro de téléphone." type="text" name="mobile" placeholder="Téléphone" title="Téléphone au format 04.00.00.00.00 ou 0400000000">
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Départements</label>
<div class="col-sm-10">
<select name="id" class="form-control">
<?php
require_once './config.php';
$sql = 'SELECT * FROM client_zone';
$stmt = $DB->prepare($sql);
$stmt->execute();
foreach($stmt as $row){
echo ('<option value="'.$row['id'].'">'.$row['name'].'</option>');
}
?>
</select>
</div>
<div class="form-group">
<input class="form-control" data-label="siret" pattern="[0-9]{3}[ \.\-]?[0-9]{3}[ \.\-]?[0-9]{3}[ \.\-]?[0-9]{5}" data-msg="Entrez votre Siret." type="text" name="siret" placeholder="Siret" title="Siret au format 254 851 369 54218">
</div>
</div>
<button type="submit" name="sub" class="btn solid btn-default block"><i class="fa fa-envelope-o"></i> soumettre</button>
<input type="hidden" placeholder="adresse IP" id="ip_address" class="form-control" name="ip_address">
</form><!-- / form -->
<br><p class="text-center">Vous possédez déjà un compte*? <a href="http://www.partenaires.xxxxxx.com" class="ensavoir"> Connexion ? </a></p>
</div><!-- / form block -->
</div>
</div><!-- /#popup-content -->
</section>
<div class="pos-rel pd-tb-tiny bg-dark1">
<div class="container">
<center>xxxx SARL au capital de 1000 xxx xxx xxx R.C.S Rouen <br/> Siège social: 1 Rue Rétimare, Imm. Adolphe Adam N°42, 76190 Yvetot, France. <br/>Site internet :www.xxxx.com</center>
</div>
</div>
<include file="./includes/footer.php" />
</div>
<script>
var fgroup = [
'Open Sans:400,300,300italic,400italic,600,700,600italic,700italic,800,800italic',
'Montserrat:400,700'
];
</script>
<script data-pace-options='{ "ajax": false }' src="lib/pace/pace.min.js"></script>
<script src="minify/rgen_min.js"></script>
<script async src="js/rgen.js"></script>
</body>
</html> |
Partager