Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
web
/
vhosts
/
www.volley92.asso.fr
/
htdocs
/
functions
/
/srv/data/web/vhosts/www.volley92.asso.fr/htdocs/functions/success_url.php
<?php //start_block('title','keywords','description') start_block('','',''); ?> <?php if(!empty($_SESSION['stripeKey'])){ $firstname = $_SESSION['firstname']; $lastname = $_SESSION['lastname']; $email = $_SESSION['email']; $phone = $_SESSION['phone']; $title = $_SESSION['title']; $price = $_SESSION['prix']; $privatekey = $_SESSION['reference'] = getToken(12); $token = $_SESSION['stripeKey']; }else{ header("Location: no-access"); } $stmt=$db_client->prepare("INSERT INTO paiement(firstname,lastname,email,phone,title,price,privatekey,token,created_at,id_company) VALUES (?,?,?,?,?,?,?,?,NOW(),?)"); // on prépare notre requête $stmt->execute(array($firstname,$lastname,$email,$phone,$title,$price,$privatekey,$token,$conf_id_company)); echo "<div class='alert alert-success'><button type='button' class='close' data-dismiss='alert'>×</button>Votre paiement en ligne à bien été effectué, merci à bientôt</div>"; //how to use it $data = array( 'firstname' => array('value' => null,'status'=>null,'regex'=> null, 'label'=>'Prénom'), 'lastname' => array('value' => null,'status'=>null,'regex'=> _2_CHARS_REGEX_, 'label'=>'NOM'), 'email' => array('value' => null,'status'=>null,'regex'=> _EMAIL_REGEX_, 'label'=>'E-mail'), 'phone' => array('value' => null,'status'=>null,'regex'=> _PHONE_REGEX_, 'label'=>'Téléphone'), 'title' => array('value' => null,'status'=>null,'regex'=> null, 'label'=>'Formation'), 'price' => array('value' => null,'status'=>null,'regex'=> null, 'label'=>'Prix'), 'privatekey' => array('value' => null,'status'=>null,'regex'=> null, 'label'=>'Référence'), ); //Formulaire envoyé if(isset($_SESSION['prix'])) { $data['firstname']['value'] = (isset($_SESSION['firstname']))?$_SESSION['firstname']:null; $data['lastname']['value'] = (isset($_SESSION['lastname']))?$_SESSION['lastname']:null; $data['email']['value'] = (isset($_SESSION['email']))?$_SESSION['email']:null; $data['phone']['value'] = (isset($_SESSION['phone']))?$_SESSION['phone']:null; $data['title']['value'] = (isset($_SESSION['title']))?$_SESSION['title']:null; $data['price']['value'] = (isset($_SESSION['prix']))?$_SESSION['prix']:null; $data['privatekey']['value'] = (isset($_SESSION['reference']))?$_SESSION['reference']:null; $form_is_submitted = true; //Form validation rules foreach($data as $key => $field) { if (!is_null($field['regex'])){ if (validate($field['regex'],$field['value'])){$data[$key]['status'] = 'has-success';} else{$data[$key]['status'] = 'has-error';$form_is_valid = false;} } } //validation rules are OK //Filling my product field foreach($data as $field => $params) { //just fill the 'demande' section of the order if(!in_array($field,array('company','firstname','lastname','title','price','privatekey','email','phone'))) { //search for checkboxN and fill it with Oui (checked) or No (unchecked) if(substr($field, 0, 8) == 'checkbox') { $product[$params['label']] = ($params['value'])?'Oui':'Non'; } //search for radio and fill it with the checked option label elseif(substr($field, 0, 5) == 'radio'){ $product[$params['label']['title']] = $params['label']['options'][$params['value']]; } //fill all the remain fields into products else{ $product[$params['label']] = $params['value']; } } } } mailPaiement($data); mailConfirmationPaiement($data); session_destroy(); ?> <?php end_block(); ?>