Advertisement
Guest User

fotodoc

a guest
Aug 13th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.63 KB | None | 0 0
  1. <?php
  2. error_reporting(-1);
  3. ini_set('display_errors', '1');
  4. global $wpdb;
  5. define("UPLOAD_DIR", "./doc/");
  6. $user = $_SESSION['user']['username'];
  7. $table = $wpdb->prefix.'usersPoker';
  8. $C_Table = $wpdb->prefix.'concessionarie';
  9. $U_table = $wpdb->prefix.'usersconcess';
  10. $P_table = $wpdb->prefix.'pokerpartner';
  11. $DocTable = $wpdb->prefix.'usersDocument';
  12. $query = $wpdb->get_results("SELECT * FROM $table WHERE username='$user'");
  13.  
  14. foreach($query as $get)
  15. {
  16. $user_id = $get->user_id;
  17. $username = $get->username;
  18. $userLevel = $get->accounttype;
  19. $userData = $get->multi_register_date;
  20. $email = $get->email;
  21. }
  22.  
  23. ?>
  24. <?php
  25. if ( isset($_REQUEST['act']) && $_REQUEST['act'] != NULL && $_REQUEST['act'] != '' ){
  26. $act = mb_strtolower($_REQUEST['act'], 'UTF-8');
  27. switch ( $act ){
  28. case 'cazx':{
  29.  
  30.  
  31.  
  32. $bonusP = $_POST['bonusP'];
  33. $prezzoP = $_POST['prezzoP'];
  34. $bonusC = $_POST['bonusC'];
  35. $prezzoC = $_POST['prezzoC'];
  36. $bonusS = $_POST['bonusS'];
  37. $prezzoS = $_POST['prezzoS'];
  38. $sesso = $_POST['sesso'];
  39. $nomemultireg = $_POST['nomemultireg'];
  40. $cognome = $_POST['cognome'];
  41. $cityofbirth = $_POST['cityofbirth'];
  42. $CF = $_POST['CF'];
  43. $cell = $_POST['cell'];
  44. $comune = $_POST['comune'];
  45. $indirizzo = $_POST['indirizzo'];
  46. $CAP = $_POST['CAP'];
  47. $documento = $_POST['documento'];
  48. $documentoN = $_POST['documentoN'];
  49. $rilasciatoDa = $_POST['rilasciatoDa'];
  50. $cittadiRilascio = $_POST['cittadiRilascio'];
  51. $codicePartner = $_POST['codicePartner'];
  52. //$fotodoc = $_POST['fotodoc'];
  53. $privacy = $_POST['privacy'];
  54. $maggiorenne = $_POST['maggiorenne'];
  55. $newsletter = $_POST['newsletter'];
  56. $datadinascita = $_POST['datadinascita'];
  57. $datarilascio = $_POST['datarilascio'];
  58. $datascadenza = $_POST['datascadenza'];
  59. $note = $_POST['note'];
  60. $registerDate = date("d-m-Y");
  61. $bonusPoker = explode(",", $bonusP);
  62. $bonusCasino = explode(",", $bonusC);
  63. $bonusScomme = explode(",", $bonusS);
  64. $sP = explode(",", $prezzoP);
  65. $sC = explode(",", $prezzoC);
  66. $sS = explode(",", $prezzoS);
  67. $p = implode("+", $sP);
  68. $c = implode("+", $sC);
  69. $s = implode("+", $sS);
  70. $price = $p + $c + $s;
  71.  
  72. //SALVARE USER_ID, CONCESSIONARIA_ID E TIPO BONUS IN USERCONCESS, SALVARE BONUS TOTALE IN USERSPOKER
  73. // usersconcess = user_id, con_id, bonus; usersPoker = bonus
  74. if($bonusP == TRUE || $bonusC == TRUE || $bonusS == TRUE)
  75. {
  76. $price = $p + $c + $s;
  77.  
  78. foreach($bonusPoker as $bonus_id)
  79. {
  80. if($bonus_id == 0)
  81. {
  82.  
  83. }
  84. else
  85. {
  86. $query = $wpdb->insert($U_table,
  87. array(
  88. 'user_id' => $user_id,
  89. 'con_id' => $bonus_id,
  90. 'bonus' => 'poker'
  91. ));
  92. }
  93. }
  94. foreach($bonusCasino as $bonus)
  95. {
  96. if($bonus == 0)
  97. {
  98.  
  99. }
  100. else
  101. {
  102. $query = $wpdb->insert($U_table,
  103. array(
  104. 'user_id' => $user_id,
  105. 'con_id' => $bonus,
  106. 'bonus' => 'casino'
  107. ));
  108. }
  109. }
  110. foreach($bonusScomme as $b)
  111. {
  112. if($b == 0)
  113. {
  114.  
  115. }
  116. else
  117. {
  118. $query = $wpdb->insert($U_table,
  119. array(
  120. 'user_id' => $user_id,
  121. 'con_id' => $b,
  122. 'bonus' => 'scommesse'
  123. ));
  124. }
  125. }
  126. }
  127. //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)
  128. $uploaddir = './doc/';//<----This is all I changed
  129. $uploadfile = $uploaddir . basename($_FILES['fotodoc']['name']);
  130. if (move_uploaded_file($_FILES['fotodoc']['tmp_name'], $uploadfile)) {
  131. echo "File is valid, and was successfully uploaded.\n";
  132. } else {
  133. echo "Possible file upload attack!\n";
  134. }
  135.  
  136. echo 'Here is some more debugging info:';
  137. print_r($_FILES);
  138. /*if(isset($_FILES['fotodoc']))
  139. {
  140. $file = $_FILES['fotodoc'];
  141. if($file['error'] == UPLOAD_ERR_OK and is_uploaded_file($file['tmp_name']))
  142. {
  143. $tmp_name = $_FILES["fotodoc"]["tmp_name"];
  144. move_uploaded_file($tmp_name, "/doc/$user");
  145. }
  146. }*/
  147. if($documento == 1)
  148. {
  149. $documento = "patente";
  150. }
  151. elseif($documento == 2)
  152. {
  153. $documento = "passaporto";
  154. }
  155. elseif($documento == 3)
  156. {
  157. $documento = "carta di identita";
  158. }
  159. if($rilasciatoDa == 1)
  160. {
  161. $rilasciatoDa = "comune";
  162. }
  163. elseif($rilasciatoDa == 2)
  164. {
  165. $rilasciatoDa = "prefettura";
  166. }
  167. if($sesso == 'M')
  168. {
  169. $sesso = "M";
  170. }
  171. elseif($sesso == 'F')
  172. {
  173. $sesso = "F";
  174. }
  175. if($newsletter)
  176. {
  177. $newsletter = "1";
  178. }
  179. elseif(!$newsletter)
  180. {
  181. $newsletter = "0";
  182. }
  183. #userlevel=3
  184. $currentData = date('d-m-Y');
  185. $dataRegistrazione = explode('-', $userData);
  186. $update_query = $wpdb->update(
  187. $table,
  188. array(
  189. 'is_active' => '1',
  190. 'newsletter' => $newsletter,
  191. 'multi_register_date' => $registerDate,
  192. 'accounttype' => '1',
  193. 'note' => $note,
  194. 'phone' => $cell,
  195. 'sex' => $sesso,
  196. 'nome' => $nomemultireg,
  197. 'cognome' => $cognome,
  198. 'CF' => $CF,
  199. 'birth' => $datadinascita,
  200. 'cityofbirth' => $cityofbirth,
  201. 'comune' => $comune,
  202. 'via' => $indirizzo,
  203. 'cap' => $CAP,
  204. 'bonus' => $price
  205. ),
  206. array(
  207. 'username' => $user
  208. )
  209. );
  210. $query = $wpdb->insert($DocTable,
  211. array(
  212. 'user_id' => $user_id,
  213. 'document_type' => $documento,
  214. 'n_document' => $documentoN,
  215. 'released' => $datarilascio,
  216. 'expire' => $datascadenza,
  217. 'released_from' => $rilasciatoDa,
  218. 'comune' => $cittadiRilascio
  219. ));
  220. if($codicePartner == TRUE)
  221. {
  222. $query = $wpdb->insert($P_table,
  223. array(
  224. 'user_id' => $user_id,
  225. 'partner_id' => $codicePartner,
  226. ));
  227. }
  228. if($query && $update_query)
  229. {
  230. $to = "admin@bonusvip.it";
  231. $from = "From: FirstName LastName <info@bonusvip.it>";
  232. $subject = "new Multiregistration account data";
  233. $message = "
  234. User data:
  235. Sesso: ".$sesso.";
  236. Nome: ".$nomemultireg.";
  237. Cognome: ".$cognome.";
  238. Luogo di nascita: ".$cityofbirth.";
  239. Data di nascita: ".$datadinascita.";
  240. Codice Fiscale:".$CF.";
  241. Cellulare: ".$cell.";
  242. Comune: ".$comune.";
  243. Indirizzo: ".$indirizzo.";
  244. CAP: ".$CAP.";
  245. La copia del documento è salvata in : ".UPLOAD_DIR.";
  246. ";
  247.  
  248. mail("streetoffice@yahoo.it", $subject, $message, $from);
  249.  
  250. $admin_email = get_option( 'admin_email' );
  251. $from = "From: FirstName LastName <info@bonusvip.it>";
  252. $subject = "Registrazione via Multiregistrazione";
  253. $message = "Registrazione avvenuta con successo, ti contatteremo quando avremo completato la procedura";
  254.  
  255. $headers = 'From: '.$admin_email.'' . "\r\n" .
  256. 'Reply-To: '.$admin_email.'' . "\r\n" .
  257. 'X-Mailer: PHP/' . phpversion();
  258.  
  259. mail($email, $subject, $message, $from);
  260. die('<result code="1" description="Registration completed">success</result>');
  261. }
  262. else
  263. {
  264. die('<result code="3" description="Query Error">error</result>');
  265. }
  266.  
  267. }break;
  268.  
  269. }
  270. }
  271. ?>
  272.  
  273. <div id="wrapper">
  274. <div class="cntBoxErrorSucc">
  275. <div class="st_alert st_alert-success" id="success3" style="display: none;">
  276. <strong>Success!</strong> This alert box indicates a successful or positive action.
  277. </div>
  278. <div class="st_alert st_alert-success" id="error6" style="display:none;">
  279. <strong>ERRORE!</strong> Error Text here
  280. </div>
  281. </div>
  282. <form method="POST" id="RegistrazioneFront" enctype="multipart/form-data">
  283. <div class="cntMultiRegistrazioneFront">
  284. <h3 class="TitleMultiRegFront">Scegli i Concessionari dove giocare</h3>
  285. <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>
  286.  
  287. <table>
  288. <tr><td></td><td>Bonus Poker</td><td>Bonus Casinò</td><td>Bonus Scommesse</td><td></td></tr>
  289. <?php
  290. $content = null;
  291. $nome = null;
  292. $bns = null;
  293. $input_casino = null;
  294. $input_poker = null;
  295. $input_scommesse = null;
  296. $title = null;
  297. $txt = null;
  298. $query = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type='st_concessionari'");
  299. foreach($query as $te)
  300. {
  301. $nome = $te->post_title;
  302. $st_b_id = $te->ID;
  303. $args = array(
  304. 'post_type' => 'st_bonus',
  305. 'post_status' => 'publish',
  306. 'meta_key' => 'bns_nome_concessionario',
  307. 'meta_value' => $nome,
  308. 'tax_query' => array(
  309. array(
  310. 'taxonomy' => 'st-tipologie-gioco',
  311. 'field' => 'slug',
  312. 'terms' => "poker",
  313. ),
  314. ));
  315.  
  316. $query = new WP_Query($args);
  317. while ( $query->have_posts() ) : $query->the_post();
  318. $terms = get_the_terms( $query->post->ID, 'st-tipologie-gioco', true);
  319. $is_conce_active = get_post_meta( $query->post->ID, 'bns_bonus_multi_si',true);
  320. $is_benven = get_the_terms($query->post->ID, 'st_tipologie_bonus', true);
  321. $slug = $terms[0]->slug;
  322. $id = $terms[0]->object_id;
  323. $is_conce_active = strtolower($is_conce_active);
  324. $b_slug = $is_benven[0]->slug;
  325. $b_slug = strtolower($b_slug);
  326.  
  327. if($is_conce_active == 'si' && $b_slug == 'bonus-di-benvenuto'){
  328. $bns = get_post_meta( $id, 'bns_nome_concessionario', true );
  329. $value_bonus = get_post_meta( $id, 'bns_importo_bonus', true );
  330. $txt = preg_replace('/\s/', '_', $bns);
  331. $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>";
  332.  
  333. }
  334.  
  335. endwhile;
  336.  
  337. wp_reset_query();
  338. wp_reset_postdata();
  339. $args1 = array(
  340. 'post_type' => 'st_bonus',
  341. 'post_status' => 'publish',
  342. 'meta_key' => 'bns_nome_concessionario',
  343. 'meta_value' => $nome,
  344. 'tax_query' => array(
  345. array(
  346. 'taxonomy' => 'st-tipologie-gioco',
  347. 'field' => 'slug',
  348. 'terms' => "casino",
  349. ),
  350. ));
  351.  
  352. $query1 = new WP_Query($args1);
  353. $content = null;
  354. while ( $query1->have_posts() ) : $query1->next_post();
  355. $terms = get_the_terms( $query1->post->ID, 'st-tipologie-gioco', true);
  356. $is_conce_active = get_post_meta( $query1->post->ID, 'bns_bonus_multi_si',true);
  357. $slug = $terms[0]->slug;
  358. $id = $terms[0]->object_id;
  359. $is_conce_active = strtolower($is_conce_active);
  360. $is_benven = get_the_terms($query1->post->ID, 'st_tipologie_bonus', true);
  361. $b_slug = $is_benven[0]->slug;
  362. $b_slug = strtolower($b_slug);
  363.  
  364. if($is_conce_active == 'si' && $b_slug == 'bonus-di-benvenuto'){
  365. $bns = get_post_meta( $id, 'bns_nome_concessionario', true );
  366. $value_bonus = get_post_meta( $id, 'bns_importo_bonus', true );
  367. $txt = preg_replace('/\s/', '_', $bns);
  368. $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>";
  369.  
  370.  
  371. }
  372.  
  373. endwhile;
  374.  
  375. wp_reset_query();
  376. wp_reset_postdata();
  377. $args2 = array(
  378. 'post_type' => 'st_bonus',
  379. 'post_status' => 'publish',
  380. 'meta_key' => 'bns_nome_concessionario',
  381. 'meta_value' => $nome,
  382. 'tax_query' => array(
  383. array(
  384. 'taxonomy' => 'st-tipologie-gioco',
  385. 'field' => 'slug',
  386. 'terms' => "scommesse-sportive",
  387. ),
  388. ));
  389.  
  390. $query2 = new WP_Query($args2);
  391. $content = null;
  392. while ( $query2->have_posts() ) : $query2->the_post();
  393. $terms = get_the_terms( $query2->post->ID, 'st-tipologie-gioco', true);
  394. $is_conce_active = get_post_meta( $query2->post->ID, 'bns_bonus_multi_si',true);
  395. $slug = $terms[0]->slug;
  396. $id = $terms[0]->object_id;
  397. $is_conce_active = strtolower($is_conce_active);
  398. $is_benven = get_the_terms($query2->post->ID, 'st_tipologie_bonus', true);
  399. $b_slug = $is_benven[0]->slug;
  400. $b_slug = strtolower($b_slug);
  401.  
  402. if($is_conce_active == 'si' && $b_slug == 'bonus-di-benvenuto'){
  403. $bns = get_post_meta( $query2->post->ID, 'bns_nome_concessionario', true );
  404. $txt = preg_replace('/\s/', '_', $bns);
  405. $value_bonus = get_post_meta( $query2->post->ID, 'bns_importo_bonus', true );
  406. $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>";
  407.  
  408. }
  409.  
  410. endwhile;
  411.  
  412. wp_reset_query();
  413. wp_reset_postdata();
  414. if($nome == $bns)
  415. {
  416. $title = $bns;
  417. if($input_poker == '')
  418. {
  419. $input_poker = '<td>Nessun bonus</td>';
  420. }
  421. if($input_casino == '')
  422. {
  423. $input_casino = '<td>Nessun bonus</td>';
  424. }
  425. if($input_scommesse == '')
  426. {
  427. $input_scommesse = '<td>Nessun bonus</td>';
  428. }
  429. $content .= "<tr>
  430. <td>".$title."</td>
  431. ".$input_poker."
  432. ".$input_casino."
  433. ".$input_scommesse."
  434. </tr>";
  435. $content .= "
  436. <script type='text/javascript'>
  437. var count_poker = '';
  438. var count_casino = '';
  439. var count_scommesse = '';
  440. jQuery('#bonus_poker_".$txt."').change(function() {
  441. if(jQuery(this).is(':checked')) {
  442. count_poker++;
  443. if(count_poker == '1')
  444. {
  445. if(jQuery('.bonus_poker').not(':checked'))
  446. {
  447. jQuery('.bonus_poker').not(':checked').prop('disabled', true);
  448.  
  449. }
  450. }
  451. jQuery('#bonus_casino_".$txt."').prop('disabled', true);
  452. jQuery('#bonus_scommesse_".$txt."').prop('disabled', true);
  453.  
  454. }
  455. else {
  456. count_poker--;
  457. if(count_poker != '1')
  458. {
  459. jQuery('.bonus_poker').not(':checked').prop('disabled', false);
  460. }
  461. jQuery('#bonus_casino_".$txt."').prop('disabled', false);
  462. jQuery('#bonus_scommesse_".$txt."').prop('disabled', false);
  463. }
  464.  
  465. });
  466. jQuery('#bonus_casino_".$txt."').change(function() {
  467. if(jQuery(this).is(':checked')) {
  468. count_casino++;
  469. if(count_casino == '1')
  470. {
  471. if(jQuery('.bonus_casino').not(':checked'))
  472. {
  473. jQuery('.bonus_casino').not(':checked').prop('disabled', true);
  474. }
  475. }
  476. jQuery('#bonus_poker_".$txt."').prop('disabled', true);
  477. jQuery('#bonus_scommesse_".$txt."').prop('disabled', true);
  478. }
  479. else {
  480. count_casino--;
  481. if(count_casino != '1')
  482. {
  483. jQuery('.bonus_casino').not(':checked').prop('disabled', false);
  484. }
  485. jQuery('#bonus_poker_".$txt."').prop('disabled', false);
  486. jQuery('#bonus_scommesse_".$txt."').prop('disabled', false);
  487. }
  488. });
  489. jQuery('#bonus_scommesse_".$txt."').change(function() {
  490. if(jQuery(this).is(':checked')) {
  491. count_scommesse++;
  492. if(count_scommesse == '2')
  493. {
  494. if(jQuery('.bonus_scommesse').not(':checked'))
  495. {
  496. jQuery('.bonus_scommesse').not(':checked').prop('disabled', true);
  497. }
  498. }
  499. jQuery('#bonus_poker_".$txt."').prop('disabled', true);
  500. jQuery('#bonus_casino_".$txt."').prop('disabled', true);
  501. }
  502. else {
  503. count_scommesse--;
  504. if(count_scommesse != '2')
  505. {
  506. jQuery('.bonus_scommesse').not(':checked').prop('disabled', false);
  507. }
  508. jQuery('#bonus_casino_".$txt."').prop('disabled', false);
  509. jQuery('#bonus_poker_".$txt."').prop('disabled', false);
  510. }
  511. });
  512.  
  513. </script>
  514. ";
  515. }
  516. echo $content;
  517. unset($input_poker);
  518. unset($input_casino);
  519. unset($input_scommesse);
  520. $input_casino = null;
  521. $input_poker = null;
  522. $input_scommesse = null;
  523. }
  524.  
  525. ?>
  526.  
  527.  
  528. </table>
  529. <div class="cntBonusPotenziale-Concessionari MultiRegLineaSep">
  530. <div class="col-md-6">
  531. <p class="MultiRegBonusPot">BONUS POTENZIALE: <span>250&euro;</span></p>
  532. </div>
  533. <div class="col-md-6">
  534. <p class="MultiRegConcSegnati">Concessionari selezionati: <span>4</span></p>
  535. </div>
  536. </div><!-- Fine div cntBonusPotenziale-Concessionari-->
  537. </div><!-- Fine div cntMultiRegistrazioneFront-->
  538. <div class="cntMultiRegistrazioneFront">
  539. <div class="col-md-5"><div class="MultiRegLineaSepMiddle"></div></div>
  540. <div class="col-md-2 cntButtonContinua"><a href="#CompletaMultiReg">Continua</a></div>
  541. <div class="col-md-5"><div class="MultiRegLineaSepMiddle"></div></div>
  542. </div>
  543. <div id="CompletaMultiReg" class="cntMultiRegistrazioneFront">
  544. <h3 class="TitleMultiRegFront">Completa la Registrazione</h3>
  545. <p class="descMultiRegFront">Ti ricordiamo di inserire i dati esattamente come vengono riportati sul tuo documento di identit&agrave, <br/> se i dati non saranno corretti sar&agrave impossibile completare la multiregistrazione.</p>
  546. <div class="col-md-4">
  547. <div id="firstField">
  548. <h4>Passo 1</h4>
  549. <div class="fieldGroup">
  550. <label for="sex" class="fieldLabel">Sesso:</label>
  551. <div class="fieldInput">
  552. <input type="radio" name="sesso" id="sesso" value="M"/>M <input type="radio" name="sesso" id="sesso" value="F"/>F
  553. </div>
  554. </div>
  555. <div class="fieldGroup">
  556. <label for="nome" class="fieldLabel">Nome: </label>
  557. <input type="text" class="fieldInput" name="nome" id="nomemultireg" placeholder="Nome"/>
  558. </div>
  559. <div class="fieldGroup">
  560. <label for="cognome" class="fieldLabel">Cognome: </label>
  561. <input type="text" class="fieldInput" name="cognome" id="cognome" placeholder="Cognome"/>
  562. </div>
  563. <div class="fieldGroup">
  564. <label for="cittadinascita" class="fieldLabel">Città di nascita: </label>
  565. <input type="text" class="fieldInput" name="cittadinascita" id="cittadinascita" placeholder="Teramo"/>
  566. </div>
  567. <div class="fieldGroup">
  568. <label for="datadinascita" class="fieldLabel">Data di nascita: </label>
  569. <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/>
  570. </div>
  571. <div class="fieldGroup">
  572. <label for="codicefiscale" class="fieldLabel">Codice Fiscale: </label>
  573. <input type="text" class="fieldInput" name="codicefiscale" id="codicefiscale" placeholder="Codice Fiscale"/>
  574. <a href="#">calcola codice fiscale</a>
  575. </div>
  576. <div class="fieldGroup">
  577. <label for="email" class="fieldLabel">Email: </label>
  578. <div class="fieldInput block">
  579. <?php echo $email; ?>
  580. </div>
  581. </div>
  582. <div class="fieldGroup">
  583. <label for="cell" class="fieldLabel">Cellulare: </label>
  584. <input type="text" class="fieldInput" name="cell" id="cell" placeholder="Cellulare">
  585. </div>
  586. </div><!-- Fine div firsField-->
  587. </div><!-- Fine div col-md-4-->
  588. <div class="col-md-4">
  589. <div id="secondField">
  590. <h4>Passo 2</h4>
  591. <div class="fieldGroup">
  592. <label for="indirizzo" class="fieldLabel">Indirizzo e N°: </label>
  593. <input type="text" class="fieldInput" name="indirizzo" id="indirizzo" placeholder="Indirizzo">
  594. </div>
  595. <div class="fieldGroup">
  596. <label for="cap" class="fieldLabel">CAP: </label>
  597. <input type="text" class="fieldInput" name="cap" id="cap" placeholder="cap">
  598. </div>
  599. <div class="fieldGroup">
  600. <label for="comune" class="fieldLabel">Comune: </label>
  601. <input type="text" class="fieldInput" name="comune" id="comune" placeholder="Comune">
  602. </div>
  603. <div class="fieldGroup">
  604. <label for="documento" class="fieldLabel">Documento: </label>
  605. <select name="documento" id="documento" class="fieldInput">
  606. <option value="0">Seleziona...</option>
  607. <option value="1">Patente</option>
  608. <option value="2">Passaporto</option>
  609. <option value="3">Carta d' identità</option>
  610. </select>
  611. </div>
  612. <div class="fieldGroup">
  613. <label for="documenton" class="fieldLabel">Documento N°: </label>
  614. <input type="text" class="fieldInput" name="documenton" id="documenton" placeholder="Documento N°">
  615. </div>
  616. <div class="fieldGroup">
  617. <label for="documentorilascio" class="fieldLabel">Data rilascio: </label>
  618. <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%;"/>
  619. </div>
  620. <div class="fieldGroup">
  621. <label for="datascadenza" class="fieldLabel">Data scadenza: </label>
  622. <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%;"/>
  623. </div>
  624. <div class="fieldGroup">
  625. <label for="rilasciatoda" class="fieldLabel">Rilasciato da: </label>
  626. <select name="rilasciatoda" id="rilasciatoda" class="fieldInput">
  627. <option value="0">Seleziona...</option>
  628. <option value="1">Comune</option>
  629. <option value="2">prefettura</option>
  630. </select>
  631. </div>
  632. <div class="fieldGroup">
  633. <label for="cittarilascio" class="fieldLabel">Città: </label>
  634. <input type="text" class="fieldInput" name="cittarilascio" id="cittarilascio" placeholder="Città di rilascio"><br/>
  635. </div>
  636.  
  637. </div>
  638. </div>
  639. <div class="col-md-4">
  640. <div id="lastField">
  641. <h4>Passo 3</h4>
  642. <div class="fieldGroup">
  643. <label for="username" class="fieldLabel">Username: </label>
  644. <div class="fieldInput block">
  645. <?php echo $username; ?>
  646. </div>
  647. </div>
  648. <div class="fielGroup">
  649. <label for="note" class="fieldLabel">Note: </label>
  650. <textarea name="note" id="note" class="fieldInput" rows="4" cols="50" style="resize:none"></textarea>
  651. </div>
  652. <div class="fieldGroup">
  653. <label for="partner" class="fieldLabel">Codice partner: </label>
  654. <input type="text" class="fieldInput" name="partner" id="partner" placeholder="Inserisci codice Partner">
  655. </div>
  656. <p id="verify"></p>
  657. <p>
  658. <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/>
  659. </p>
  660. <p>
  661. <input type="checkbox" value="privacy" id="privacy" name="privacy"/>Dichiaro di aver letto e accetto l'<a href="#">Informativa sulla privacy</a>.<br/>
  662. </p>
  663. <p>
  664. <input type="checkbox" value="1" name="newsletter" id="newsletter" checked/>Voglio ricevere la newsletter.<br/><br/>
  665. </p>
  666. <div class="fieldGroup">
  667. <label for="documento">Carica il tuo documento</label>
  668. <input type='file' class="fieldInput" name='fotodoc' id="fotodoc" accept='image/x-png, image/jpeg'/>
  669. </div>
  670. <div class="buttonInviaMultiRegFront">
  671. <input type="submit" value="Registrati" onclick="_event_multiacts(event);"/>
  672. </div>
  673.  
  674. </div><!--Fine div lastField-->
  675.  
  676. </div><!--Fine div col-md-4-->
  677.  
  678.  
  679.  
  680. </div><!-- Fine div cntMultiRegistrazioneFront-->
  681. </form>
  682. </div>
  683. <script type="text/javascript">
  684. function _event_multiacts(event){
  685. event.preventDefault();
  686. event.stopPropagation();
  687. //qui ci faccio l'update delle info
  688. var bonusP = '', bonusC = '', bonusS = '', prezzoP = '', prezzoC = '', prezzoS = '';
  689. /* DATI ANAGRAFICI E DOCUMENTO D' IDENTITà */
  690. var sesso = jQuery("#sesso").val();
  691. var nomemultireg = jQuery("#nomemultireg").val();
  692. var cognome = jQuery("#cognome").val();
  693. var cityofbirth = jQuery("#cittadinascita").val();
  694. var giorno_nascita = jQuery("#GG").val();
  695. var mese_nascita = jQuery("#MM").val();
  696. var anno_nascita = jQuery("#AAAA").val();
  697. var datadinascita = giorno_nascita + '/' + mese_nascita + '/' + anno_nascita;
  698. var CF = jQuery("#codicefiscale").val();
  699. var cell = jQuery("#cell").val();
  700. var comune = jQuery("#comune").val();
  701. var indirizzo = jQuery("#indirizzo").val();
  702. var CAP = jQuery("#cap").val();
  703. var documento = jQuery("#documento").val();
  704. var documentoN = jQuery("#documenton").val();
  705. var GG_Rilascio = jQuery("#RGG").val();
  706. var MM_Rilascio = jQuery("#RMM").val();
  707. var AA_Rilascio = jQuery("#RAAAA").val();
  708. var datarilascio = GG_Rilascio + '/' + MM_Rilascio + '/' + AA_Rilascio;
  709. var GG_Scadenza = jQuery("#SGG").val();
  710. var MM_Scadenza = jQuery("#SMM").val();
  711. var AA_Scadenza = jQuery("#SAAAA").val();
  712. var datascadenza = GG_Scadenza + '/' + MM_Scadenza + '/' + AA_Scadenza;
  713. var rilasciatoDa = jQuery("#rilasciatoda").val();
  714. var cittadiRilascio = jQuery("#cittarilascio").val();
  715. var codicePartner = jQuery("#partner").val();
  716. var fotodoc = jQuery("#fotodoc").val();
  717. var privacy = jQuery("#privacy").val();
  718. var maggiorenne = jQuery("#18y").val();
  719. var newsletter = jQuery("#newsletter").val();
  720. var note = jQuery('#note').val();
  721. if(jQuery('#privacy').prop('checked') == false)
  722. {
  723. jQuery("#privacyn").show().delay(5000).queue(function(n)
  724. {
  725. jQuery("#privacyn").hide(); n();
  726.  
  727. });
  728. return false;
  729. }
  730. if(jQuery('#18y').prop('checked') == false)
  731. {
  732. jQuery("#18n").show().delay(5000).queue(function(n)
  733. {
  734. jQuery("#18n").hide(); n();
  735.  
  736. });
  737. return false;
  738. }
  739. jQuery(".bonus_poker").each(function()
  740. {
  741. if(jQuery(this).prop('checked'))
  742. {
  743. bonusP = bonusP + ',' + jQuery(this).val();
  744. prezzoP = prezzoP + ',' + jQuery(this).attr('price');
  745.  
  746. }
  747.  
  748. });
  749. jQuery(".bonus_casino").each(function()
  750. {
  751. if(jQuery(this).prop('checked'))
  752. {
  753. bonusC = bonusC + ',' + jQuery(this).val();
  754. prezzoC = prezzoC + jQuery(this).attr('price');
  755. }
  756. });
  757. jQuery(".bonus_scommesse").each(function()
  758. {
  759. if(jQuery(this).prop('checked'))
  760. {
  761. bonusS = bonusS + ',' + jQuery(this).val();
  762. prezzoS = prezzoS + ',' + jQuery(this).attr('price');
  763. }
  764. });
  765. //fai le validazioni se vuoi
  766. //url con act set
  767. if ( window.location.href.indexOf('?') >= 0 ){
  768. var url = '&act=cazx';
  769. }else{
  770. var url = '?act=cazx';
  771. }
  772. jQuery.ajax({
  773. url: url,
  774. //invio i dati in post
  775. type: 'POST',
  776. data:{
  777. bonusP: bonusP,
  778. prezzoP: prezzoP,
  779. bonusC: bonusC,
  780. prezzoC: prezzoC,
  781. bonusS: bonusS,
  782. prezzoS: prezzoS,
  783. sesso: sesso,
  784. nomemultireg: nomemultireg,
  785. cognome: cognome,
  786. cityofbirth: cityofbirth,
  787. datadinascita: datadinascita,
  788. CF: CF,
  789. cell: cell,
  790. comune: comune,
  791. indirizzo: indirizzo,
  792. CAP: CAP,
  793. documento: documento,
  794. documentoN: documentoN,
  795. datarilascio: datarilascio,
  796. datascadenza: datascadenza,
  797. rilasciatoDa: rilasciatoDa,
  798. cittadiRilascio: cittadiRilascio,
  799. codicePartner: codicePartner,
  800. fotodoc: fotodoc,
  801. privacy: privacy,
  802. maggiorenne: maggiorenne,
  803. newsletter: newsletter,
  804. note: note
  805. },
  806. //come prima ahah
  807. success: function(data){
  808. console.log(data);
  809. console.log(jQuery(data).find('result').html());
  810. console.log(jQuery(data).find('result').attr('code'));
  811. try{
  812. var code = parseInt(jQuery(data).find('result').attr('code'));
  813. var result = jQuery(data).find('result').html().toLowerCase();
  814. if ( result == 'error' ){
  815. switch ( code ){
  816. case 2:{
  817. jQuery("#error6").show().delay(2000).queue(function(n)
  818. {
  819. jQuery("#error6").hide(); n();
  820. });
  821. }break;
  822. case 3:{
  823. jQuery("#error6").show().delay(2000).queue(function(n)
  824. {
  825. jQuery("#error6").hide(); n();
  826. });
  827. }break;
  828. case 4:{
  829. jQuery("#error6").show().delay(2000).queue(function(n)
  830. {
  831. jQuery("#error6").hide(); n();
  832. });
  833. }break;
  834. default:{
  835. jQuery("#error6").show().delay(2000).queue(function(n)
  836. {
  837. jQuery("#error6").hide(); n();
  838. });
  839. }break;
  840. }
  841. return false;
  842. }else{
  843. jQuery("#success3").show();
  844. jQuery("#RegistrazioneFront").hide();
  845. alert(fotodoc);
  846. }
  847. return true;
  848. }catch(ex){
  849. console.log(ex);
  850.  
  851. alert("Impossibile completare l'azione");
  852. return false;
  853. }
  854. },
  855. error: function(err){
  856. console.log(err);
  857. alert("Impossibile completare l'azione");
  858.  
  859. return false;
  860. }
  861. });
  862. return true;
  863. }
  864.  
  865. jQuery("#username").keyup(function() {
  866. var id = jQuery(this).val();
  867. jQuery('#verify').load('http://www.bonusvip.it/verify.php?username='+id);
  868. });
  869. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement