Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(-1);
- ini_set('display_errors', '1');
- global $wpdb;
- define("UPLOAD_DIR", "./doc/");
- $user = $_SESSION['user']['username'];
- $table = $wpdb->prefix.'usersPoker';
- $C_Table = $wpdb->prefix.'concessionarie';
- $U_table = $wpdb->prefix.'usersconcess';
- $P_table = $wpdb->prefix.'pokerpartner';
- $DocTable = $wpdb->prefix.'usersDocument';
- $query = $wpdb->get_results("SELECT * FROM $table WHERE username='$user'");
- foreach($query as $get)
- {
- $user_id = $get->user_id;
- $username = $get->username;
- $userLevel = $get->accounttype;
- $userData = $get->multi_register_date;
- $email = $get->email;
- }
- ?>
- <?php
- if ( isset($_REQUEST['act']) && $_REQUEST['act'] != NULL && $_REQUEST['act'] != '' ){
- $act = mb_strtolower($_REQUEST['act'], 'UTF-8');
- switch ( $act ){
- case 'cazx':{
- $bonusP = $_POST['bonusP'];
- $prezzoP = $_POST['prezzoP'];
- $bonusC = $_POST['bonusC'];
- $prezzoC = $_POST['prezzoC'];
- $bonusS = $_POST['bonusS'];
- $prezzoS = $_POST['prezzoS'];
- $sesso = $_POST['sesso'];
- $nomemultireg = $_POST['nomemultireg'];
- $cognome = $_POST['cognome'];
- $cityofbirth = $_POST['cityofbirth'];
- $CF = $_POST['CF'];
- $cell = $_POST['cell'];
- $comune = $_POST['comune'];
- $indirizzo = $_POST['indirizzo'];
- $CAP = $_POST['CAP'];
- $documento = $_POST['documento'];
- $documentoN = $_POST['documentoN'];
- $rilasciatoDa = $_POST['rilasciatoDa'];
- $cittadiRilascio = $_POST['cittadiRilascio'];
- $codicePartner = $_POST['codicePartner'];
- //$fotodoc = $_POST['fotodoc'];
- $privacy = $_POST['privacy'];
- $maggiorenne = $_POST['maggiorenne'];
- $newsletter = $_POST['newsletter'];
- $datadinascita = $_POST['datadinascita'];
- $datarilascio = $_POST['datarilascio'];
- $datascadenza = $_POST['datascadenza'];
- $note = $_POST['note'];
- $registerDate = date("d-m-Y");
- $bonusPoker = explode(",", $bonusP);
- $bonusCasino = explode(",", $bonusC);
- $bonusScomme = explode(",", $bonusS);
- $sP = explode(",", $prezzoP);
- $sC = explode(",", $prezzoC);
- $sS = explode(",", $prezzoS);
- $p = implode("+", $sP);
- $c = implode("+", $sC);
- $s = implode("+", $sS);
- $price = $p + $c + $s;
- //SALVARE USER_ID, CONCESSIONARIA_ID E TIPO BONUS IN USERCONCESS, SALVARE BONUS TOTALE IN USERSPOKER
- // usersconcess = user_id, con_id, bonus; usersPoker = bonus
- if($bonusP == TRUE || $bonusC == TRUE || $bonusS == TRUE)
- {
- $price = $p + $c + $s;
- foreach($bonusPoker as $bonus_id)
- {
- if($bonus_id == 0)
- {
- }
- else
- {
- $query = $wpdb->insert($U_table,
- array(
- 'user_id' => $user_id,
- 'con_id' => $bonus_id,
- 'bonus' => 'poker'
- ));
- }
- }
- foreach($bonusCasino as $bonus)
- {
- if($bonus == 0)
- {
- }
- else
- {
- $query = $wpdb->insert($U_table,
- array(
- 'user_id' => $user_id,
- 'con_id' => $bonus,
- 'bonus' => 'casino'
- ));
- }
- }
- foreach($bonusScomme as $b)
- {
- if($b == 0)
- {
- }
- else
- {
- $query = $wpdb->insert($U_table,
- array(
- 'user_id' => $user_id,
- 'con_id' => $b,
- 'bonus' => 'scommesse'
- ));
- }
- }
- }
- //if($sesso == TRUE && $nomemreg == TRUE && $cognome == TRUE && $cityofbirth == TRUE && $CF == TRUE && $cell == TRUE && $comune == TRUE && $indirizzo == TRUE && $CAP == TRUE && $documento == TRUE && $documentoN == TRUE && $rilasciatoDa == TRUE && $cittadiRilascio == TRUE && $datadinascita == TRUE && $datarilascio == TRUE)
- $uploaddir = './doc/';//<----This is all I changed
- $uploadfile = $uploaddir . basename($_FILES['fotodoc']['name']);
- if (move_uploaded_file($_FILES['fotodoc']['tmp_name'], $uploadfile)) {
- echo "File is valid, and was successfully uploaded.\n";
- } else {
- echo "Possible file upload attack!\n";
- }
- echo 'Here is some more debugging info:';
- print_r($_FILES);
- /*if(isset($_FILES['fotodoc']))
- {
- $file = $_FILES['fotodoc'];
- if($file['error'] == UPLOAD_ERR_OK and is_uploaded_file($file['tmp_name']))
- {
- $tmp_name = $_FILES["fotodoc"]["tmp_name"];
- move_uploaded_file($tmp_name, "/doc/$user");
- }
- }*/
- if($documento == 1)
- {
- $documento = "patente";
- }
- elseif($documento == 2)
- {
- $documento = "passaporto";
- }
- elseif($documento == 3)
- {
- $documento = "carta di identita";
- }
- if($rilasciatoDa == 1)
- {
- $rilasciatoDa = "comune";
- }
- elseif($rilasciatoDa == 2)
- {
- $rilasciatoDa = "prefettura";
- }
- if($sesso == 'M')
- {
- $sesso = "M";
- }
- elseif($sesso == 'F')
- {
- $sesso = "F";
- }
- if($newsletter)
- {
- $newsletter = "1";
- }
- elseif(!$newsletter)
- {
- $newsletter = "0";
- }
- #userlevel=3
- $currentData = date('d-m-Y');
- $dataRegistrazione = explode('-', $userData);
- $update_query = $wpdb->update(
- $table,
- array(
- 'is_active' => '1',
- 'newsletter' => $newsletter,
- 'multi_register_date' => $registerDate,
- 'accounttype' => '1',
- 'note' => $note,
- 'phone' => $cell,
- 'sex' => $sesso,
- 'nome' => $nomemultireg,
- 'cognome' => $cognome,
- 'CF' => $CF,
- 'birth' => $datadinascita,
- 'cityofbirth' => $cityofbirth,
- 'comune' => $comune,
- 'via' => $indirizzo,
- 'cap' => $CAP,
- 'bonus' => $price
- ),
- array(
- 'username' => $user
- )
- );
- $query = $wpdb->insert($DocTable,
- array(
- 'user_id' => $user_id,
- 'document_type' => $documento,
- 'n_document' => $documentoN,
- 'released' => $datarilascio,
- 'expire' => $datascadenza,
- 'released_from' => $rilasciatoDa,
- 'comune' => $cittadiRilascio
- ));
- if($codicePartner == TRUE)
- {
- $query = $wpdb->insert($P_table,
- array(
- 'user_id' => $user_id,
- 'partner_id' => $codicePartner,
- ));
- }
- if($query && $update_query)
- {
- $to = "admin@bonusvip.it";
- $from = "From: FirstName LastName <info@bonusvip.it>";
- $subject = "new Multiregistration account data";
- $message = "
- User data:
- Sesso: ".$sesso.";
- Nome: ".$nomemultireg.";
- Cognome: ".$cognome.";
- Luogo di nascita: ".$cityofbirth.";
- Data di nascita: ".$datadinascita.";
- Codice Fiscale:".$CF.";
- Cellulare: ".$cell.";
- Comune: ".$comune.";
- Indirizzo: ".$indirizzo.";
- CAP: ".$CAP.";
- La copia del documento è salvata in : ".UPLOAD_DIR.";
- ";
- mail("streetoffice@yahoo.it", $subject, $message, $from);
- $admin_email = get_option( 'admin_email' );
- $from = "From: FirstName LastName <info@bonusvip.it>";
- $subject = "Registrazione via Multiregistrazione";
- $message = "Registrazione avvenuta con successo, ti contatteremo quando avremo completato la procedura";
- $headers = 'From: '.$admin_email.'' . "\r\n" .
- 'Reply-To: '.$admin_email.'' . "\r\n" .
- 'X-Mailer: PHP/' . phpversion();
- mail($email, $subject, $message, $from);
- die('<result code="1" description="Registration completed">success</result>');
- }
- else
- {
- die('<result code="3" description="Query Error">error</result>');
- }
- }break;
- }
- }
- ?>
- <div id="wrapper">
- <div class="cntBoxErrorSucc">
- <div class="st_alert st_alert-success" id="success3" style="display: none;">
- <strong>Success!</strong> This alert box indicates a successful or positive action.
- </div>
- <div class="st_alert st_alert-success" id="error6" style="display:none;">
- <strong>ERRORE!</strong> Error Text here
- </div>
- </div>
- <form method="POST" id="RegistrazioneFront" enctype="multipart/form-data">
- <div class="cntMultiRegistrazioneFront">
- <h3 class="TitleMultiRegFront">Scegli i Concessionari dove giocare</h3>
- <p class="descMultiRegFront">Seleziona i bookmaker che vuoi, scopri quanto aumenta il bonus e migliora il tuo gioco<br/>Scegli i tuoi preferiti tra tutti i Bookmaker oppure lasciati consigliare da noi i migliori del mese.</p>
- <table>
- <tr><td></td><td>Bonus Poker</td><td>Bonus Casinò</td><td>Bonus Scommesse</td><td></td></tr>
- <?php
- $content = null;
- $nome = null;
- $bns = null;
- $input_casino = null;
- $input_poker = null;
- $input_scommesse = null;
- $title = null;
- $txt = null;
- $query = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type='st_concessionari'");
- foreach($query as $te)
- {
- $nome = $te->post_title;
- $st_b_id = $te->ID;
- $args = array(
- 'post_type' => 'st_bonus',
- 'post_status' => 'publish',
- 'meta_key' => 'bns_nome_concessionario',
- 'meta_value' => $nome,
- 'tax_query' => array(
- array(
- 'taxonomy' => 'st-tipologie-gioco',
- 'field' => 'slug',
- 'terms' => "poker",
- ),
- ));
- $query = new WP_Query($args);
- while ( $query->have_posts() ) : $query->the_post();
- $terms = get_the_terms( $query->post->ID, 'st-tipologie-gioco', true);
- $is_conce_active = get_post_meta( $query->post->ID, 'bns_bonus_multi_si',true);
- $is_benven = get_the_terms($query->post->ID, 'st_tipologie_bonus', true);
- $slug = $terms[0]->slug;
- $id = $terms[0]->object_id;
- $is_conce_active = strtolower($is_conce_active);
- $b_slug = $is_benven[0]->slug;
- $b_slug = strtolower($b_slug);
- if($is_conce_active == 'si' && $b_slug == 'bonus-di-benvenuto'){
- $bns = get_post_meta( $id, 'bns_nome_concessionario', true );
- $value_bonus = get_post_meta( $id, 'bns_importo_bonus', true );
- $txt = preg_replace('/\s/', '_', $bns);
- $input_poker = "<td><input type='checkbox' id='bonus_poker_".$txt."' name='bonus_poker' class='bonus_poker' value='".$st_b_id."' price='".$value_bonus."'/>".$value_bonus." </td>";
- }
- endwhile;
- wp_reset_query();
- wp_reset_postdata();
- $args1 = array(
- 'post_type' => 'st_bonus',
- 'post_status' => 'publish',
- 'meta_key' => 'bns_nome_concessionario',
- 'meta_value' => $nome,
- 'tax_query' => array(
- array(
- 'taxonomy' => 'st-tipologie-gioco',
- 'field' => 'slug',
- 'terms' => "casino",
- ),
- ));
- $query1 = new WP_Query($args1);
- $content = null;
- while ( $query1->have_posts() ) : $query1->next_post();
- $terms = get_the_terms( $query1->post->ID, 'st-tipologie-gioco', true);
- $is_conce_active = get_post_meta( $query1->post->ID, 'bns_bonus_multi_si',true);
- $slug = $terms[0]->slug;
- $id = $terms[0]->object_id;
- $is_conce_active = strtolower($is_conce_active);
- $is_benven = get_the_terms($query1->post->ID, 'st_tipologie_bonus', true);
- $b_slug = $is_benven[0]->slug;
- $b_slug = strtolower($b_slug);
- if($is_conce_active == 'si' && $b_slug == 'bonus-di-benvenuto'){
- $bns = get_post_meta( $id, 'bns_nome_concessionario', true );
- $value_bonus = get_post_meta( $id, 'bns_importo_bonus', true );
- $txt = preg_replace('/\s/', '_', $bns);
- $input_casino = "<td><input type='checkbox' id='bonus_casino_".$txt."' name='bonus_casino[]' class='bonus_casino' value='".$st_b_id."' price='".$value_bonus."'/>".$value_bonus."</td>";
- }
- endwhile;
- wp_reset_query();
- wp_reset_postdata();
- $args2 = array(
- 'post_type' => 'st_bonus',
- 'post_status' => 'publish',
- 'meta_key' => 'bns_nome_concessionario',
- 'meta_value' => $nome,
- 'tax_query' => array(
- array(
- 'taxonomy' => 'st-tipologie-gioco',
- 'field' => 'slug',
- 'terms' => "scommesse-sportive",
- ),
- ));
- $query2 = new WP_Query($args2);
- $content = null;
- while ( $query2->have_posts() ) : $query2->the_post();
- $terms = get_the_terms( $query2->post->ID, 'st-tipologie-gioco', true);
- $is_conce_active = get_post_meta( $query2->post->ID, 'bns_bonus_multi_si',true);
- $slug = $terms[0]->slug;
- $id = $terms[0]->object_id;
- $is_conce_active = strtolower($is_conce_active);
- $is_benven = get_the_terms($query2->post->ID, 'st_tipologie_bonus', true);
- $b_slug = $is_benven[0]->slug;
- $b_slug = strtolower($b_slug);
- if($is_conce_active == 'si' && $b_slug == 'bonus-di-benvenuto'){
- $bns = get_post_meta( $query2->post->ID, 'bns_nome_concessionario', true );
- $txt = preg_replace('/\s/', '_', $bns);
- $value_bonus = get_post_meta( $query2->post->ID, 'bns_importo_bonus', true );
- $input_scommesse = "<td id='scommesse'><input type='checkbox' id='bonus_scommesse_".$txt."' name='bonus_scommesse[]' class='bonus_scommesse' value='".$st_b_id."' price='".$value_bonus."'/>".$value_bonus."</td>";
- }
- endwhile;
- wp_reset_query();
- wp_reset_postdata();
- if($nome == $bns)
- {
- $title = $bns;
- if($input_poker == '')
- {
- $input_poker = '<td>Nessun bonus</td>';
- }
- if($input_casino == '')
- {
- $input_casino = '<td>Nessun bonus</td>';
- }
- if($input_scommesse == '')
- {
- $input_scommesse = '<td>Nessun bonus</td>';
- }
- $content .= "<tr>
- <td>".$title."</td>
- ".$input_poker."
- ".$input_casino."
- ".$input_scommesse."
- </tr>";
- $content .= "
- <script type='text/javascript'>
- var count_poker = '';
- var count_casino = '';
- var count_scommesse = '';
- jQuery('#bonus_poker_".$txt."').change(function() {
- if(jQuery(this).is(':checked')) {
- count_poker++;
- if(count_poker == '1')
- {
- if(jQuery('.bonus_poker').not(':checked'))
- {
- jQuery('.bonus_poker').not(':checked').prop('disabled', true);
- }
- }
- jQuery('#bonus_casino_".$txt."').prop('disabled', true);
- jQuery('#bonus_scommesse_".$txt."').prop('disabled', true);
- }
- else {
- count_poker--;
- if(count_poker != '1')
- {
- jQuery('.bonus_poker').not(':checked').prop('disabled', false);
- }
- jQuery('#bonus_casino_".$txt."').prop('disabled', false);
- jQuery('#bonus_scommesse_".$txt."').prop('disabled', false);
- }
- });
- jQuery('#bonus_casino_".$txt."').change(function() {
- if(jQuery(this).is(':checked')) {
- count_casino++;
- if(count_casino == '1')
- {
- if(jQuery('.bonus_casino').not(':checked'))
- {
- jQuery('.bonus_casino').not(':checked').prop('disabled', true);
- }
- }
- jQuery('#bonus_poker_".$txt."').prop('disabled', true);
- jQuery('#bonus_scommesse_".$txt."').prop('disabled', true);
- }
- else {
- count_casino--;
- if(count_casino != '1')
- {
- jQuery('.bonus_casino').not(':checked').prop('disabled', false);
- }
- jQuery('#bonus_poker_".$txt."').prop('disabled', false);
- jQuery('#bonus_scommesse_".$txt."').prop('disabled', false);
- }
- });
- jQuery('#bonus_scommesse_".$txt."').change(function() {
- if(jQuery(this).is(':checked')) {
- count_scommesse++;
- if(count_scommesse == '2')
- {
- if(jQuery('.bonus_scommesse').not(':checked'))
- {
- jQuery('.bonus_scommesse').not(':checked').prop('disabled', true);
- }
- }
- jQuery('#bonus_poker_".$txt."').prop('disabled', true);
- jQuery('#bonus_casino_".$txt."').prop('disabled', true);
- }
- else {
- count_scommesse--;
- if(count_scommesse != '2')
- {
- jQuery('.bonus_scommesse').not(':checked').prop('disabled', false);
- }
- jQuery('#bonus_casino_".$txt."').prop('disabled', false);
- jQuery('#bonus_poker_".$txt."').prop('disabled', false);
- }
- });
- </script>
- ";
- }
- echo $content;
- unset($input_poker);
- unset($input_casino);
- unset($input_scommesse);
- $input_casino = null;
- $input_poker = null;
- $input_scommesse = null;
- }
- ?>
- </table>
- <div class="cntBonusPotenziale-Concessionari MultiRegLineaSep">
- <div class="col-md-6">
- <p class="MultiRegBonusPot">BONUS POTENZIALE: <span>250€</span></p>
- </div>
- <div class="col-md-6">
- <p class="MultiRegConcSegnati">Concessionari selezionati: <span>4</span></p>
- </div>
- </div><!-- Fine div cntBonusPotenziale-Concessionari-->
- </div><!-- Fine div cntMultiRegistrazioneFront-->
- <div class="cntMultiRegistrazioneFront">
- <div class="col-md-5"><div class="MultiRegLineaSepMiddle"></div></div>
- <div class="col-md-2 cntButtonContinua"><a href="#CompletaMultiReg">Continua</a></div>
- <div class="col-md-5"><div class="MultiRegLineaSepMiddle"></div></div>
- </div>
- <div id="CompletaMultiReg" class="cntMultiRegistrazioneFront">
- <h3 class="TitleMultiRegFront">Completa la Registrazione</h3>
- <p class="descMultiRegFront">Ti ricordiamo di inserire i dati esattamente come vengono riportati sul tuo documento di identità, <br/> se i dati non saranno corretti sarà impossibile completare la multiregistrazione.</p>
- <div class="col-md-4">
- <div id="firstField">
- <h4>Passo 1</h4>
- <div class="fieldGroup">
- <label for="sex" class="fieldLabel">Sesso:</label>
- <div class="fieldInput">
- <input type="radio" name="sesso" id="sesso" value="M"/>M <input type="radio" name="sesso" id="sesso" value="F"/>F
- </div>
- </div>
- <div class="fieldGroup">
- <label for="nome" class="fieldLabel">Nome: </label>
- <input type="text" class="fieldInput" name="nome" id="nomemultireg" placeholder="Nome"/>
- </div>
- <div class="fieldGroup">
- <label for="cognome" class="fieldLabel">Cognome: </label>
- <input type="text" class="fieldInput" name="cognome" id="cognome" placeholder="Cognome"/>
- </div>
- <div class="fieldGroup">
- <label for="cittadinascita" class="fieldLabel">Città di nascita: </label>
- <input type="text" class="fieldInput" name="cittadinascita" id="cittadinascita" placeholder="Teramo"/>
- </div>
- <div class="fieldGroup">
- <label for="datadinascita" class="fieldLabel">Data di nascita: </label>
- <input type="text" class="fieldInput" name="GG" id="GG" placeholder="GG" style="width:15%;"/>-<input type="text" name="MM" id="MM" placeholder="MM" style="width:15%;"/>-<input type="text" name="AAAA" id="AAAA" placeholder="AAAA" style="width:32%;"/><br/>
- </div>
- <div class="fieldGroup">
- <label for="codicefiscale" class="fieldLabel">Codice Fiscale: </label>
- <input type="text" class="fieldInput" name="codicefiscale" id="codicefiscale" placeholder="Codice Fiscale"/>
- <a href="#">calcola codice fiscale</a>
- </div>
- <div class="fieldGroup">
- <label for="email" class="fieldLabel">Email: </label>
- <div class="fieldInput block">
- <?php echo $email; ?>
- </div>
- </div>
- <div class="fieldGroup">
- <label for="cell" class="fieldLabel">Cellulare: </label>
- <input type="text" class="fieldInput" name="cell" id="cell" placeholder="Cellulare">
- </div>
- </div><!-- Fine div firsField-->
- </div><!-- Fine div col-md-4-->
- <div class="col-md-4">
- <div id="secondField">
- <h4>Passo 2</h4>
- <div class="fieldGroup">
- <label for="indirizzo" class="fieldLabel">Indirizzo e N°: </label>
- <input type="text" class="fieldInput" name="indirizzo" id="indirizzo" placeholder="Indirizzo">
- </div>
- <div class="fieldGroup">
- <label for="cap" class="fieldLabel">CAP: </label>
- <input type="text" class="fieldInput" name="cap" id="cap" placeholder="cap">
- </div>
- <div class="fieldGroup">
- <label for="comune" class="fieldLabel">Comune: </label>
- <input type="text" class="fieldInput" name="comune" id="comune" placeholder="Comune">
- </div>
- <div class="fieldGroup">
- <label for="documento" class="fieldLabel">Documento: </label>
- <select name="documento" id="documento" class="fieldInput">
- <option value="0">Seleziona...</option>
- <option value="1">Patente</option>
- <option value="2">Passaporto</option>
- <option value="3">Carta d' identità</option>
- </select>
- </div>
- <div class="fieldGroup">
- <label for="documenton" class="fieldLabel">Documento N°: </label>
- <input type="text" class="fieldInput" name="documenton" id="documenton" placeholder="Documento N°">
- </div>
- <div class="fieldGroup">
- <label for="documentorilascio" class="fieldLabel">Data rilascio: </label>
- <input type="text" class="fieldInput" name="RGG" id="RGG" placeholder="GG" style="width:15%;"/>-<input type="text" name="RMM" id="RMM" placeholder="MM" style="width:15%;"/>-<input type="text" name="RAAAA" id="RAAAA" placeholder="AAAA" style="width:32%;"/>
- </div>
- <div class="fieldGroup">
- <label for="datascadenza" class="fieldLabel">Data scadenza: </label>
- <input type="text" class="fieldInput" name="SGG" id="SGG" placeholder="GG" style="width:15%;"/>-<input type="text" name="SMM" id="SMM" placeholder="MM" style="width:15%;"/>-<input type="text" name="SAAAA" id="SAAAA" placeholder="AAAA" style="width:32%;"/>
- </div>
- <div class="fieldGroup">
- <label for="rilasciatoda" class="fieldLabel">Rilasciato da: </label>
- <select name="rilasciatoda" id="rilasciatoda" class="fieldInput">
- <option value="0">Seleziona...</option>
- <option value="1">Comune</option>
- <option value="2">prefettura</option>
- </select>
- </div>
- <div class="fieldGroup">
- <label for="cittarilascio" class="fieldLabel">Città: </label>
- <input type="text" class="fieldInput" name="cittarilascio" id="cittarilascio" placeholder="Città di rilascio"><br/>
- </div>
- </div>
- </div>
- <div class="col-md-4">
- <div id="lastField">
- <h4>Passo 3</h4>
- <div class="fieldGroup">
- <label for="username" class="fieldLabel">Username: </label>
- <div class="fieldInput block">
- <?php echo $username; ?>
- </div>
- </div>
- <div class="fielGroup">
- <label for="note" class="fieldLabel">Note: </label>
- <textarea name="note" id="note" class="fieldInput" rows="4" cols="50" style="resize:none"></textarea>
- </div>
- <div class="fieldGroup">
- <label for="partner" class="fieldLabel">Codice partner: </label>
- <input type="text" class="fieldInput" name="partner" id="partner" placeholder="Inserisci codice Partner">
- </div>
- <p id="verify"></p>
- <p>
- <input type="checkbox" name="maggiorenne" id="18y" value="18y"/>Ho più di 18 anni, dichiaro di aver letto e di accettare le <a href="#">Codinzioni Generali</a>.<br/>
- </p>
- <p>
- <input type="checkbox" value="privacy" id="privacy" name="privacy"/>Dichiaro di aver letto e accetto l'<a href="#">Informativa sulla privacy</a>.<br/>
- </p>
- <p>
- <input type="checkbox" value="1" name="newsletter" id="newsletter" checked/>Voglio ricevere la newsletter.<br/><br/>
- </p>
- <div class="fieldGroup">
- <label for="documento">Carica il tuo documento</label>
- <input type='file' class="fieldInput" name='fotodoc' id="fotodoc" accept='image/x-png, image/jpeg'/>
- </div>
- <div class="buttonInviaMultiRegFront">
- <input type="submit" value="Registrati" onclick="_event_multiacts(event);"/>
- </div>
- </div><!--Fine div lastField-->
- </div><!--Fine div col-md-4-->
- </div><!-- Fine div cntMultiRegistrazioneFront-->
- </form>
- </div>
- <script type="text/javascript">
- function _event_multiacts(event){
- event.preventDefault();
- event.stopPropagation();
- //qui ci faccio l'update delle info
- var bonusP = '', bonusC = '', bonusS = '', prezzoP = '', prezzoC = '', prezzoS = '';
- /* DATI ANAGRAFICI E DOCUMENTO D' IDENTITà */
- var sesso = jQuery("#sesso").val();
- var nomemultireg = jQuery("#nomemultireg").val();
- var cognome = jQuery("#cognome").val();
- var cityofbirth = jQuery("#cittadinascita").val();
- var giorno_nascita = jQuery("#GG").val();
- var mese_nascita = jQuery("#MM").val();
- var anno_nascita = jQuery("#AAAA").val();
- var datadinascita = giorno_nascita + '/' + mese_nascita + '/' + anno_nascita;
- var CF = jQuery("#codicefiscale").val();
- var cell = jQuery("#cell").val();
- var comune = jQuery("#comune").val();
- var indirizzo = jQuery("#indirizzo").val();
- var CAP = jQuery("#cap").val();
- var documento = jQuery("#documento").val();
- var documentoN = jQuery("#documenton").val();
- var GG_Rilascio = jQuery("#RGG").val();
- var MM_Rilascio = jQuery("#RMM").val();
- var AA_Rilascio = jQuery("#RAAAA").val();
- var datarilascio = GG_Rilascio + '/' + MM_Rilascio + '/' + AA_Rilascio;
- var GG_Scadenza = jQuery("#SGG").val();
- var MM_Scadenza = jQuery("#SMM").val();
- var AA_Scadenza = jQuery("#SAAAA").val();
- var datascadenza = GG_Scadenza + '/' + MM_Scadenza + '/' + AA_Scadenza;
- var rilasciatoDa = jQuery("#rilasciatoda").val();
- var cittadiRilascio = jQuery("#cittarilascio").val();
- var codicePartner = jQuery("#partner").val();
- var fotodoc = jQuery("#fotodoc").val();
- var privacy = jQuery("#privacy").val();
- var maggiorenne = jQuery("#18y").val();
- var newsletter = jQuery("#newsletter").val();
- var note = jQuery('#note').val();
- if(jQuery('#privacy').prop('checked') == false)
- {
- jQuery("#privacyn").show().delay(5000).queue(function(n)
- {
- jQuery("#privacyn").hide(); n();
- });
- return false;
- }
- if(jQuery('#18y').prop('checked') == false)
- {
- jQuery("#18n").show().delay(5000).queue(function(n)
- {
- jQuery("#18n").hide(); n();
- });
- return false;
- }
- jQuery(".bonus_poker").each(function()
- {
- if(jQuery(this).prop('checked'))
- {
- bonusP = bonusP + ',' + jQuery(this).val();
- prezzoP = prezzoP + ',' + jQuery(this).attr('price');
- }
- });
- jQuery(".bonus_casino").each(function()
- {
- if(jQuery(this).prop('checked'))
- {
- bonusC = bonusC + ',' + jQuery(this).val();
- prezzoC = prezzoC + jQuery(this).attr('price');
- }
- });
- jQuery(".bonus_scommesse").each(function()
- {
- if(jQuery(this).prop('checked'))
- {
- bonusS = bonusS + ',' + jQuery(this).val();
- prezzoS = prezzoS + ',' + jQuery(this).attr('price');
- }
- });
- //fai le validazioni se vuoi
- //url con act set
- if ( window.location.href.indexOf('?') >= 0 ){
- var url = '&act=cazx';
- }else{
- var url = '?act=cazx';
- }
- jQuery.ajax({
- url: url,
- //invio i dati in post
- type: 'POST',
- data:{
- bonusP: bonusP,
- prezzoP: prezzoP,
- bonusC: bonusC,
- prezzoC: prezzoC,
- bonusS: bonusS,
- prezzoS: prezzoS,
- sesso: sesso,
- nomemultireg: nomemultireg,
- cognome: cognome,
- cityofbirth: cityofbirth,
- datadinascita: datadinascita,
- CF: CF,
- cell: cell,
- comune: comune,
- indirizzo: indirizzo,
- CAP: CAP,
- documento: documento,
- documentoN: documentoN,
- datarilascio: datarilascio,
- datascadenza: datascadenza,
- rilasciatoDa: rilasciatoDa,
- cittadiRilascio: cittadiRilascio,
- codicePartner: codicePartner,
- fotodoc: fotodoc,
- privacy: privacy,
- maggiorenne: maggiorenne,
- newsletter: newsletter,
- note: note
- },
- //come prima ahah
- success: function(data){
- console.log(data);
- console.log(jQuery(data).find('result').html());
- console.log(jQuery(data).find('result').attr('code'));
- try{
- var code = parseInt(jQuery(data).find('result').attr('code'));
- var result = jQuery(data).find('result').html().toLowerCase();
- if ( result == 'error' ){
- switch ( code ){
- case 2:{
- jQuery("#error6").show().delay(2000).queue(function(n)
- {
- jQuery("#error6").hide(); n();
- });
- }break;
- case 3:{
- jQuery("#error6").show().delay(2000).queue(function(n)
- {
- jQuery("#error6").hide(); n();
- });
- }break;
- case 4:{
- jQuery("#error6").show().delay(2000).queue(function(n)
- {
- jQuery("#error6").hide(); n();
- });
- }break;
- default:{
- jQuery("#error6").show().delay(2000).queue(function(n)
- {
- jQuery("#error6").hide(); n();
- });
- }break;
- }
- return false;
- }else{
- jQuery("#success3").show();
- jQuery("#RegistrazioneFront").hide();
- alert(fotodoc);
- }
- return true;
- }catch(ex){
- console.log(ex);
- alert("Impossibile completare l'azione");
- return false;
- }
- },
- error: function(err){
- console.log(err);
- alert("Impossibile completare l'azione");
- return false;
- }
- });
- return true;
- }
- jQuery("#username").keyup(function() {
- var id = jQuery(this).val();
- jQuery('#verify').load('http://www.bonusvip.it/verify.php?username='+id);
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement