	<script language="javascript">
	function validateEmail(email) {
		const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
		return re.test(String(email).toLowerCase());
	}

	function validateTesto(testo) {
		if (typeof testo == 'undefined') {
			return false;
		}
		const re = /^[A-Za-z\s\S]{2,50}$/;
		return re.test(testo);
	}

	function validateInt(testo) {
		if (typeof testo == 'undefined') {
				return false;
		}
		const re = /[0-9]{1,50}$/;
		return re.test(testo);
	}

	function inviaRichiesta() {
		var tipologia = jQuery("#tipologiaNuovo").val();
		if (!validateTesto(tipologia)) {
			alert(" 选择您的设备类型");
			return false;
		}

		var marca = jQuery("#marcaNuovo").val();
		if (!validateTesto(marca)) {
			alert("选择您的设备品牌");
			return false;
		}

		var modello = jQuery("#modelloNuovo").val();
		if (!validateTesto(modello)) {
			alert("选择您的设备类型");
			return false;
		}

                var riparazione = "";
                var sep = "";
                jQuery('#telefoni:checked').each(function(i){
                	riparazione = riparazione + sep + jQuery(this).val();
                	sep = "|";
                });
		if (!validateTesto(riparazione)) {
			alert("选择您的修理项目");
			return false;
		}

		var snegozio = jQuery("input[name='snegozio']:checked").val();
		if (!validateInt(snegozio)) {
			alert("选择您要去的商店");
			return false;
		}
		var email = jQuery("#email").val();
		if (!validateEmail(email)) {
			alert("请输入有效的电子邮箱");
			return false;
		}
		var totale = jQuery("#totale_listino_prodotti_selezionate").val();
		jQuery.ajax({url:
			"/gestionale/controllo.php?pagina=getPreventivoNuovo&metodo=libera&tipologia="+tipologia+"&marca="+marca+"&modello="+modello+"&riparazione="+riparazione+"&negozio="+snegozio+"&email="+email+"&totale="+totale+"&lang=zh-hans",
			type: 'GET',
			async: false,
			dataType: 'text',
			success: function(target_text){
				if(target_text != ''){
					var idPreventivo = parseInt(target_text);
					if (idPreventivo > 0) {
						alert("申请代码 "+target_text+" 已保存 稍后您会收到一封带有报价的电子邮箱");
					} else {
						alert("保存失败");
					}
				}
			}
		});
	}
	
	function aggiornaVisibilita(tabella) {
		switch (tabella) {
			case 'tipologiaNuovo':
				jQuery("#cont_marca").hide();
				jQuery("#cont_modello").hide();
				jQuery("#cont_riparazione").hide();
				jQuery("#cont_negozio").hide();
				jQuery("#cont_preventivo").hide();
			break;
			case 'marcaNuovo':
				jQuery("#cont_marca").show();
				jQuery("#cont_modello").hide();
				jQuery("#cont_riparazione").hide();
				jQuery("#cont_negozio").hide();
				jQuery("#cont_preventivo").hide();
			break;
			case 'modelloNuovo':
				jQuery("#cont_marca").show();
				jQuery("#cont_modello").show();
				jQuery("#cont_riparazione").hide();
				jQuery("#cont_negozio").hide();
				jQuery("#cont_preventivo").hide();
			break;
			case 'telefoni':
				jQuery("#cont_marca").show();
				jQuery("#cont_modello").show();
				jQuery("#cont_riparazione").show();
				jQuery("#cont_negozio").show();
				jQuery("#cont_preventivo").show();
			break;
		}
	}

	function loadTendina(tendina,dato) {
		jQuery.ajax({url:
			"/gestionale/controllo.php?pagina=getTendinePrezzi&metodo=libera&tendina="+tendina+"&dato="+dato+"&lang=zh-hans&secdata="+jQuery("#tipologiaNuovo").val()+"",
			type: 'GET',
			async: false,
			dataType: 'text',
			success: function(target_text){
				if(target_text != ''){
					var lista = target_text.split('+++');
					var el = jQuery("#" + tendina);
					var selezione = "";
					el.empty();
						for (i=0; i<lista.length; i = i+2) {
								el.append("<option value='"+lista[i]+"' "+selezione+">"+lista[i+1]+"</option>");
						}       
					//jQuery("#containerNEGOZIO_PRESTITO").show();
				}
			}
		});
		aggiornaVisibilita(tendina);
	}

	function loadTelefoni() {
		jQuery("#tipoRip").empty();
		var testoRitorno = "";
		jQuery.ajax({
			url: "/gestionale/controllo.php?pagina=getTendinePrezzi&metodo=libera&tendina=telefoni&dato=" + jQuery("#modelloNuovo").val() + "",
			type: 'GET',
			async: false,
			dataType: 'text',
			success: function(target_text) {
				if (target_text != '') {
					var lista = target_text.split('+++');
					if (lista.length > 2) {
						testoRitorno += "<table style=\"border:0; width:100%; margin-bottom: 0;\"><tbody>";
						for (i = 0; i < lista.length; i = i + 2) {
							if (i>0) {
								testoRitorno += "<tr><td style=\"text-align:left; padding:4px 10px; border-bottom:1px solid #F0F0F0;\"><label><input name=\"telefoni\" type=\"checkbox\" class=\"checkbox-calcolo-costo\" id=\"telefoni\" value=\""+lista[i]+"\" lang=\""+lista[i+1]+"\" onclick=\"calcolaStampaCostoProdotti();\">"+lista[i]+"</label></td><td style=\"text-align:right; padding:4px 10px; border-bottom:1px solid #F0F0F0; \">€&nbsp;"+lista[i+1]+"</td>";
							}
						}
						testoRitorno += "</tbody></table>"
					}
					testoRitorno += "</div>";
					jQuery("#tipoRip").append(testoRitorno);
					//jQuery("#containerNEGOZIO_PRESTITO").show();
				}
			}
		});
		aggiornaVisibilita('telefoni');
	}


	function calcolaStampaCostoProdotti() {
    		var totaleCostoProdotti = 0;
			jQuery(".checkbox-calcolo-costo:checkbox:checked").each(function() {
				// isolo il valore numerico dal nome della prodotti
			var prezzo = this.lang;
        		totaleCostoProdotti = totaleCostoProdotti + parseFloat(prezzo.replace(",", "."));
    		});
    
		jQuery("#span_totale_listino_prodotti_selezionate").html("所选设备的成本为 <b>€ " + totaleCostoProdotti.toFixed(2).replace(".", ",")) + "</b>";
    		jQuery("input#totale_listino_prodotti_selezionate").val(totaleCostoProdotti.toFixed(2).replace(".", ","));
	}


	function loadNeogzi() {
		jQuery("#negozio").empty();
		var testoRitorno = "";
		jQuery.ajax({
			url: "/gestionale/controllo.php?pagina=getTendinePrezzi&metodo=libera&tendina=negozio&source=web",
			type: 'GET',
			async: false,
			dataType: 'text',
			success: function(target_text) {
				if (target_text != '') {
					var lista = target_text.split('+++');
					for (i = 0; i < lista.length; i = i + 2) {
						if ((i / 2) % 3 == 0) {
							if (i == 0) {
								testoRitorno += "<div class=\"col-md-6\">";
							} else {
								testoRitorno += "</div><div class=\"col-md-6\">";
							}
						}
						testoRitorno += "<div class=\"form-check\"><label><input value='" + lista[i] + "' type='radio' name='snegozio' id='snegozio'>" + lista[i + 1] + "</label></div>";
					}
					testoRitorno += "</div>";
					jQuery("#negozio").append(testoRitorno);
					//jQuery("#containerNEGOZIO_PRESTITO").show();
				}
			}
		});
	}
	</script>

	<form action="" class="sky-form uli-form">
		<div class="row">
			<div id="scelta" class="col-md-4 form-group">
				<label class="label uli-form-titolo">类型</label>
				<select name="tipologia" id="tipologiaNuovo" onchange='loadTendina("marcaNuovo",jQuery("#tipologiaNuovo").val())'>
				</select>
			</div>
			<div id="cont_marca"  class="col-md-4 form-group">
				<label class="label uli-form-titolo">牌</label>
				<select name="marca" id="marcaNuovo" onchange='loadTendina("modelloNuovo",jQuery("#marcaNuovo").val())'>
				</select>
			</div>
			<div id="cont_modello"  class="col-md-4 form-group">
				<label class="label uli-form-titolo">模板</label>
				<select name="modello" id="modelloNuovo" onchange='loadTelefoni();loadNeogzi();'>
				</select>
			</div>
		</div>
		
		<div class="row">
			<div id="cont_riparazione" class="col-md-12 form-group">
				<label class="label uli-form-titolo">可用项目</label>
				<div id="tipoRip" class="form-check">
				</div>
			</div>
		</div>

		<div class="row">
			<div class="col-md-12 form-group">
				<span id="span_totale_listino_prodotti_selezionate"></span>
				<input type="hidden" name="prezzo_totale" id="totale_listino_prodotti_selezionate" value="">
			</diV>
		</diV>

		<div class="row">
			<div id="cont_negozio" class="col-md-12 form-group">
				<label class="label uli-form-titolo">选择收集地点</label>
				<div id="negozio" class="row">
				</div>
			</div>
		</div>
	   
		<div class="row">
			<div id="cont_preventivo" class="col-md-12 form-group">
				<div id="preventivo">
				<label class="label uli-form-titolo">在下面插入您的电子邮件地址</label>
				<input type="text" name="email" id ="email"><br>
				
				</div>
			</div>
			<div id="cont_preventivo" class="col-md-12 form-group">
				<input type="button" value="您必须索取报价" onclick="inviaRichiesta()">
			</div>
		</div>

	</form>


	<script>
		loadTendina("tipologiaNuovo");	
	</script>
	<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /home/it168store/www/wp-content/themes/ostrya-child/shortcodes/sc-prodotti.php:164) in <b>/home/it168store/www/wp-includes/rest-api/class-wp-rest-server.php</b> on line <b>1893</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /home/it168store/www/wp-content/themes/ostrya-child/shortcodes/sc-prodotti.php:164) in <b>/home/it168store/www/wp-includes/rest-api/class-wp-rest-server.php</b> on line <b>1893</b><br />
{"id":1128,"date":"2021-03-22T21:29:55","date_gmt":"2021-03-22T20:29:55","guid":{"rendered":"http:\/\/www.it168store.com\/prodotti\/"},"modified":"2021-04-18T15:39:39","modified_gmt":"2021-04-18T13:39:39","slug":"%e4%ba%a7%e5%93%81","status":"publish","type":"page","link":"https:\/\/www.it168store.com\/zh-hans\/%e4%ba%a7%e5%93%81\/","title":{"rendered":"\u4ea7\u54c1"},"content":{"rendered":"<section class=\"wpb-content-wrapper\"><p>[vc_row css=&#8221;.vc_custom_1616533702832{padding-top: 50px !important;}&#8221;][vc_column][wdc_heading title=&#8221;\u5728\u7ebf\u4ea7\u54c1\u6e05\u5355&#8221;][\/wdc_heading][vc_column_text]\u9009\u62e9\u60a8\u8981\u5bfb\u627e\u7684\u8bbe\u5907\uff0c\u7acb\u5373\u4e86\u89e3\u6211\u4eec\u7684\u7ade\u4e89\u529b\uff01<\/p>\n<p>\u7136\u540e\u60a8\u53ef\u4ee5\u9009\u62e9\u60a8\u60f3\u8981\u79bb\u60a8\u6700\u8fd1\u7684\u5546\u5e97\uff0c\u5e76\u7559\u4e0b\u60a8\u7684\u7535\u5b50\u90ae\u4ef6\u5730\u5740\uff0c\u60a8\u5c06\u7acb\u5373\u901a\u8fc7\u7535\u5b50\u90ae\u4ef6\u6536\u5230<span style=\"color: #ff0000;\"> <strong> 5\u6b27\u5143\u7684\u6298\u6263<\/strong> <\/span>\uff01[\/vc_column_text][vc_column_text][\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/section>","protected":false},"excerpt":{"rendered":"<p>[vc_row css=&#8221;.vc_custom_1616533702832{padding-top [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1128","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u4ea7\u54c1 - IT 168 STORE<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.it168store.com\/zh-hans\/%e4%ba%a7%e5%93%81\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4ea7\u54c1 - IT 168 STORE\" \/>\n<meta property=\"og:description\" content=\"[vc_row css=&#8221;.vc_custom_1616533702832{padding-top [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.it168store.com\/zh-hans\/%e4%ba%a7%e5%93%81\/\" \/>\n<meta property=\"og:site_name\" content=\"IT 168 STORE\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-18T13:39:39+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.it168store.com\/zh-hans\/%e4%ba%a7%e5%93%81\/\",\"url\":\"https:\/\/www.it168store.com\/zh-hans\/%e4%ba%a7%e5%93%81\/\",\"name\":\"\u4ea7\u54c1 - IT 168 STORE\",\"isPartOf\":{\"@id\":\"https:\/\/www.it168store.com\/zh-hans\/#website\"},\"datePublished\":\"2021-03-22T20:29:55+00:00\",\"dateModified\":\"2021-04-18T13:39:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.it168store.com\/zh-hans\/%e4%ba%a7%e5%93%81\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.it168store.com\/zh-hans\/%e4%ba%a7%e5%93%81\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.it168store.com\/zh-hans\/%e4%ba%a7%e5%93%81\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.it168store.com\/zh-hans\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4ea7\u54c1\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.it168store.com\/zh-hans\/#website\",\"url\":\"https:\/\/www.it168store.com\/zh-hans\/\",\"name\":\"IT 168 STORE\",\"description\":\"Vendita Riparazione Smartphone Tablet PC\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.it168store.com\/zh-hans\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u4ea7\u54c1 - IT 168 STORE","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.it168store.com\/zh-hans\/%e4%ba%a7%e5%93%81\/","og_locale":"zh_CN","og_type":"article","og_title":"\u4ea7\u54c1 - IT 168 STORE","og_description":"[vc_row css=&#8221;.vc_custom_1616533702832{padding-top [&hellip;]","og_url":"https:\/\/www.it168store.com\/zh-hans\/%e4%ba%a7%e5%93%81\/","og_site_name":"IT 168 STORE","article_modified_time":"2021-04-18T13:39:39+00:00","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.it168store.com\/zh-hans\/%e4%ba%a7%e5%93%81\/","url":"https:\/\/www.it168store.com\/zh-hans\/%e4%ba%a7%e5%93%81\/","name":"\u4ea7\u54c1 - IT 168 STORE","isPartOf":{"@id":"https:\/\/www.it168store.com\/zh-hans\/#website"},"datePublished":"2021-03-22T20:29:55+00:00","dateModified":"2021-04-18T13:39:39+00:00","breadcrumb":{"@id":"https:\/\/www.it168store.com\/zh-hans\/%e4%ba%a7%e5%93%81\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.it168store.com\/zh-hans\/%e4%ba%a7%e5%93%81\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.it168store.com\/zh-hans\/%e4%ba%a7%e5%93%81\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.it168store.com\/zh-hans\/"},{"@type":"ListItem","position":2,"name":"\u4ea7\u54c1"}]},{"@type":"WebSite","@id":"https:\/\/www.it168store.com\/zh-hans\/#website","url":"https:\/\/www.it168store.com\/zh-hans\/","name":"IT 168 STORE","description":"Vendita Riparazione Smartphone Tablet PC","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.it168store.com\/zh-hans\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"}]}},"_links":{"self":[{"href":"https:\/\/www.it168store.com\/zh-hans\/wp-json\/wp\/v2\/pages\/1128","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.it168store.com\/zh-hans\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.it168store.com\/zh-hans\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.it168store.com\/zh-hans\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.it168store.com\/zh-hans\/wp-json\/wp\/v2\/comments?post=1128"}],"version-history":[{"count":4,"href":"https:\/\/www.it168store.com\/zh-hans\/wp-json\/wp\/v2\/pages\/1128\/revisions"}],"predecessor-version":[{"id":1196,"href":"https:\/\/www.it168store.com\/zh-hans\/wp-json\/wp\/v2\/pages\/1128\/revisions\/1196"}],"wp:attachment":[{"href":"https:\/\/www.it168store.com\/zh-hans\/wp-json\/wp\/v2\/media?parent=1128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}