function force9_is_cust(){ if(document.getElementById('is_cust').value=='0'){ $("#div_msg_is_not_cust").show(500); $("#div_msg_is_cust").hide(500); $("#div_cust_info").show(500); $("#div_cust_account").show(500); $("#div_login").hide(500); }else if(document.getElementById('is_cust').value=='1'){ $("#div_msg_is_not_cust").hide(500); $("#div_msg_is_cust").show(500); $("#div_cust_info").hide(500); $("#div_cust_account").hide(500); $("#div_login").show(500); }else if(document.getElementById('is_cust').value=='loueur'){ $("#div_msg_is_not_cust").show(500); $("#div_msg_is_cust").hide(500); $("#div_cust_info").show(500); $("#div_cust_account").hide(500); $("#div_login").hide(500); }else{ $("#div_msg_is_not_cust").hide(500); $("#div_msg_is_cust").hide(500); $("#div_cust_info").hide(500); $("#div_cust_account").hide(500); $("#div_login").hide(500); } } function force9_post_step_cust(){ form_config = [{"input_id":"is_cust","label":"Client Ouest Assurances","data_type":"select","mandatory":true}] if(form_validation(form_config)){ if(document.getElementById('is_cust').value=='loueur'){ //Validation des données var is_valid; form_config = [{"input_id":"clt_civil_no","label":"Civilit\u00e9","data_type":"select","mandatory":true},{"input_id":"clt_person_name","label":"Nom","data_type":"varchar","nb_char":80,"mandatory":true},{"input_id":"clt_person_firstname","label":"Pr\u00e9nom","data_type":"varchar","nb_char":80,"mandatory":true},{"input_id":"clt_addr1","label":"Adresse","data_type":"varchar","nb_char":80,"mandatory":true},{"input_id":"clt_addr2","label":"Adresse (suite)","data_type":"varchar","nb_char":80},{"input_id":"clt_zip","label":"Code postal","data_type":"varchar","nb_char":10,"mandatory":true},{"input_id":"clt_city","label":"Ville","data_type":"varchar","nb_char":80,"mandatory":true},{"input_id":"clt_cnty_no","label":"Pays","data_type":"select","mandatory":true},{"input_id":"clt_phone_1","label":"T\u00e9l\u00e9phone principal","data_type":"phone","nb_char":25,"mandatory":true},{"input_id":"clt_phone_2","label":"T\u00e9l\u00e9phone secondaire","data_type":"phone","nb_char":25},{"input_id":"clt_email","label":"Courriel","data_type":"email","nb_char":255,"mandatory":true}]; is_valid = form_validation(form_config); if(is_valid){ document.getElementById('fr_cust').method='post'; document.getElementById('fr_cust').action='post_force9.php?is_cust=loueur'; document.getElementById('fr_cust').target='_top'; document.getElementById('fr_cust').submit(); } }else if(document.getElementById('is_cust').value=='0'){ //Validation des données var is_valid; form_config = [{"input_id":"clt_civil_no","label":"Civilit\u00e9","data_type":"select","mandatory":true},{"input_id":"clt_person_name","label":"Nom","data_type":"varchar","nb_char":80,"mandatory":true},{"input_id":"clt_person_firstname","label":"Pr\u00e9nom","data_type":"varchar","nb_char":80,"mandatory":true},{"input_id":"clt_addr1","label":"Adresse","data_type":"varchar","nb_char":80,"mandatory":true},{"input_id":"clt_addr2","label":"Adresse (suite)","data_type":"varchar","nb_char":80},{"input_id":"clt_zip","label":"Code postal","data_type":"varchar","nb_char":10,"mandatory":true},{"input_id":"clt_city","label":"Ville","data_type":"varchar","nb_char":80,"mandatory":true},{"input_id":"clt_cnty_no","label":"Pays","data_type":"select","mandatory":true},{"input_id":"clt_phone_1","label":"T\u00e9l\u00e9phone principal","data_type":"phone","nb_char":25,"mandatory":true},{"input_id":"clt_phone_2","label":"T\u00e9l\u00e9phone secondaire","data_type":"phone","nb_char":25},{"input_id":"clt_email","label":"Courriel","data_type":"email","nb_char":255,"mandatory":true}]; is_valid = form_validation(form_config); if(is_valid && document.getElementById('apporteur').value==''){ form_config = [{"input_id":"clt_www_code","label":"Code d'utilisateur","data_type":"varchar","nb_char":80,"mandatory":true},{"input_id":"clt_www_pass","label":"Mot de passe","data_type":"password","nb_char":255,"mandatory":true},{"input_id":"clt_www_pass_1","label":"Confirmation du mot de passe","data_type":"varchar","nb_char":255,"mandatory":true}]; is_valid = form_validation(form_config); } if(is_valid){ document.getElementById('fr_cust').method='post'; document.getElementById('fr_cust').action='post_force9.php'; document.getElementById('fr_cust').target='_top'; document.getElementById('fr_cust').submit(); } }else{ //Validation des données form_config = [{"input_id":"login_type","label":"Type d'utilisateur","mandatory":true,"data_type":"varchar","nb_char":25},{"input_id":"login_code","label":"Code d'utilisateur","mandatory":true,"data_type":"varchar","nb_char":255},{"input_id":"login_pass","label":"Mot de passe","mandatory":true,"data_type":"varchar","nb_char":80}] if(form_validation(form_config)){ document.getElementById('fr_login').method='post'; document.getElementById('fr_login').action='post_login.php'; document.getElementById('fr_login').target='_top'; document.getElementById('fr_login').submit(); } } /* if(document.getElementById('is_cust').value=='0'){ window.open('souscription-force9.php?step=cust', '_top'); }else{ window.open('accueil.php?redirect=souscription-force9.php%3Fstep%3D2', '_top'); } */ } } function force9_cond(){ //pcf_no_6 : Formule 1 - Annulation, Assistance et interruption de séjour //pcf_no_7 : Formule 2- Annulation //pcf_no_8 : Formule 3 - Assistance et interruption de séjour if($("#pcf_no_6").val()=="1" || $("#pcf_no_7").val()=="1" || $("#pcf_no_8").val()=="1"){ $('#f9_cond_europe').show(200); $('#f9_cond_60days').show(200); }else{ $('#f9_cond_europe').hide(200); $('#f9_cond_60days').hide(200); } if($("#pcf_no_6").val()=="1" || $("#pcf_no_7").val()=="1"){ $('#f9_cond_15days').show(200); }else{ $('#f9_cond_15days').hide(200); } } function force9_calc(){ var form = $("#fr_force9"); var url = "post_force9.php"; var can_calc=true; //Calculer le tarif uniquement si valeur et garantie if($("#pcf_no_1").val()==""){ can_calc=false; } if($("#pcf_no_6").val()=="" && $("#pcf_no_7").val()=="" && $("#pcf_no_8").val()=="" && $("#rf").val()==""){ can_calc=false; } if(can_calc){ $('#div_tarif').hide(500); $("#step").val("pre-calc"); $.ajax({ type: "POST", url: url, data: form.serialize(), // serializes the form's elements. success: function(data) { //alert(data); // show response from the php script. $('#div_tarif').html(data); $('#div_tarif').show(500); } }); } } function force9_manage_rf_amt(){ if(document.getElementById('rf').value=='1'){ //Forcer à 4000 si régate if(document.getElementById('pcf_no_5').value=='1'){ var newOptions = {"4000": "4000"}; //Hors Europe }else if(document.getElementById('pcf_no_4').value=='1'){ var newOptions = {"5000": "5000", "6000": "6000", "8000": "8000", "10000": "10000"}; }else{ var newOptions = {"4000": "4000", "5000": "5000", "6000": "6000", "8000": "8000", "10000": "10000"}; } var $el = $("#rf_amount"); $el.empty(); // remove old options $.each(newOptions, function(key,value) { $el.append($("") .attr("value", value).text(key)); }); $("#div_rf_amount").show(500); $("#div_pcf_no_1728").show(500); }else{ $("#div_rf_amount").hide(500); $("#div_pcf_no_1728").hide(500); } } function force9_manage_apporteur(){ if(document.getElementById('dev_app_1_cie_no').value=='0'){ document.getElementById('div_pcf_no_77').style.display='inline'; }else{ document.getElementById('div_pcf_no_77').style.display='none'; } } function force9_post_step1(){ //Validation des données form_config = [{"input_id":"pcf_no_1","label":"Montant de la location en €uros","data_type":"currency","greater_than":0,"mandatory":true},{"input_id":"pcf_no_3","label":"Nombre total de passagers","data_type":"integer","greater_than":0,"mandatory":true},{"input_id":"pcf_no_78","label":"Date de r\u00e9servation","mandatory":true,"data_type":"date_multi"},{"input_id":"pcf_no_79","label":"Date de d\u00e9part","mandatory":true,"data_type":"date_multi"},{"input_id":"pcf_no_80","label":"Date de retour","mandatory":true,"data_type":"date_multi"},{"input_id":"clt_cnty_no","label":"Pays de r\u00e9sidence","data_type":"select","mandatory":true},{"input_id":"pcf_no_4","label":"Navigation hors Europe","data_type":"select","mandatory":true},{"input_id":"pcf_no_5","label":"R\u00e9gate","data_type":"select","mandatory":true},{"input_id":"pcf_no_6","label":"Formule 1 - Annulation, Assistance et interruption de s\u00e9jour","data_type":"select","mandatory":true},{"input_id":"pcf_no_7","label":"Formule 2- Annulation","data_type":"select","mandatory":true},{"input_id":"pcf_no_8","label":"Formule 3 - Assistance et interruption de s\u00e9jour","data_type":"select","mandatory":true},{"input_id":"rf","label":"Rachat de franchise","data_type":"select","mandatory":true}] $("#step").val("1"); if(form_validation(form_config)){ document.getElementById('fr_force9').method='post'; document.getElementById('fr_force9').action='post_force9.php'; document.getElementById('fr_force9').target='_top'; document.getElementById('fr_force9').submit(); } } function force9_post_step2(){ //Validation des données form_config = [{"input_id":"dev_app_1_cie_no","label":"Loueur","data_type":"select","mandatory":true},{"input_id":"pcf_no_77","label":"Loueur (autre)","data_type":"varchar","nb_char":80},{"input_id":"pcf_no_90","label":"Mod\u00e8le de bateau","data_type":"varchar","nb_char":80,"mandatory":true},{"input_id":"pcf_no_1601","label":"Type de bateau","data_type":"select","mandatory":true},{"input_id":"pcf_no_91","label":"Port de d\u00e9part","data_type":"varchar","nb_char":80,"mandatory":true},{"input_id":"pcf_no_1602","label":"Pays du port de d\u00e9part","data_type":"select","mandatory":true},{"input_id":"pcf_no_1501","label":"\u00cates-vous propri\u00e9taire d'un bateau","data_type":"integer","mandatory":true}]; console.log(form_config); if(form_validation(form_config)){ document.getElementById('fr_force9').method='post'; document.getElementById('fr_force9').action='post_force9.php'; document.getElementById('fr_force9').target='_top'; document.getElementById('fr_force9').submit(); } } function force9_post_step3(){ var is_valid=true; if(document.getElementById('chk_conf')){ if(!document.getElementById('chk_conf').checked){ is_valid=false; } } if(document.getElementById('chk_conf_rf')){ if(!document.getElementById('chk_conf_rf').checked){ is_valid=false; } } if(document.getElementById('chk_conf_ajt')){ if(!document.getElementById('chk_conf_ajt').checked){ is_valid=false; } } if(document.getElementById('chk_conf_remorquage')){ if(!document.getElementById('chk_conf_remorquage').checked){ is_valid=false; } } if(document.getElementById('chk_conf_annulation')){ if(!document.getElementById('chk_conf_annulation').checked){ is_valid=false; } } //Validation des données if(is_valid){ document.getElementById('fr_force9').method='post'; document.getElementById('fr_force9').action='post_force9.php'; document.getElementById('fr_force9').target='_top'; document.getElementById('fr_force9').submit(); }else{ show_std_error_msg('Vous devez compléter les termes et conditions du contrat Force 9.'); } }