1
0
Fork 0
viz_produttori/index.html
2020-05-13 17:27:17 +02:00

135 Zeilen
5,7 KiB
HTML

<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Campi aperti schede</title>
<script type="text/javascript" src="software_export/bower_components/d3/d3.min.js"></script>
<script type="text/javascript" src="software_export/bower_components/underscore/underscore-min.js"></script>
<script type="text/javascript" src="software_export/bower_components/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="software_export/bower_components/jquery-ui/jquery-ui.min.js"></script>
<script type="text/javascript" src="software_export/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="software_export/bower_components/lightbox2/src/js/lightbox.js"></script>
<script type="text/javascript" src="software_export/bower_components/shufflejs/dist/jquery.shuffle.modernizr.min.js"></script>
<script src="software_export/js/html2canvas.js"></script>
<script src="software_export/js/jspdf.min.js"></script>
<script type="text/javascript" src="software_export/js/main.js"></script>
<link href="software_export/bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="software_export/bower_components/jquery-ui/themes/ui-lightness/jquery-ui.min.css" rel="stylesheet">
<link href="software_export/bower_components/lightbox2/src/css/lightbox.css" rel="stylesheet">
<link href="software_export/css/main.css" rel="stylesheet">
</head>
<body id="printa">
<center class="noprint" style="background:rgba(255,255,255,0.7);">
<h2>Campi aperti</h2>
</center>
<span id="quanti" style="float: right;"></span>
<p class="noprint">
<button type="button" class="btn btn-success" id="ingressi">Visite di ingresso</button>
<button type="button" class="btn btn-warning" id="aziende">Aziende in CA</button>
<button type="button" class="btn btn-dark" id="scartati">Recessi e rifiuti</button>
<!--button id="print">Pdf "Desidera un mercato"</button-->
</p>
<p class="noprint" >
<button type="button" id="toggleinfo" onclick='$(".card-hidden").toggleClass("hide")'>Più o meno info</button>
<button type="button" onclick="myFunction()">Stampa PDF dettagliato</button>
<button type="button" onclick="schedeBanco()">Stampa PDF schede Banco</button>
<button type="button" id="exportcsv" onclick="exportCsv()" alt="Solo Nome, Referente, Nome referente di visita di ingresso, Località">Esporta CSV x sito</button>
<!--button type="button" id="exportcsvP" onclick="exportCsvP()" alt="Prodotto,Solo Nome">Esporta CSV prodotti</button-->
</p>
<p class="noprint">Il campo ricerca funziona con il nome dell'azienda, nome dei mercati e "in attesa"</p>
<p id="vizcorrente"> </p>
<div id="viz">
</div>
<script>
function myFunction() {
/* $('div.card').each(function() {
$(this).attr("style", $(this).attr("style") + "page-break-after: always !important;display:block !important;");
});*/
$("div.col-sm-12.card.accordion.shuffle-item.concealed").addClass("hide");
$('div.card').attr("style","");
$('#grid').attr("style","");
window.print();
location.reload();
}
// stampa con grafica per Banco - orizzontale. meno dati
function schedeBanco(){
$("div.col-sm-12.card.accordion.shuffle-item.concealed").addClass("hide");
$('div.card').attr("style","");
$('#grid').attr("style","");
window.print();
location.reload();
}
var test_array = [["Nome","Realtà Produttiva","Località","Referente della visita"]];
var anome=[];
var areale=[];
var aloco=[];
var aref=[];
var fname = "IJGResults";
var csvContent = "data:text/csv;charset=utf-8,";
function exportCsv(){
anome=$("div.col-sm-12.card.accordion.shuffle-item.filtered .nomeinfo");
areale=$("div.col-sm-12.card.accordion.shuffle-item.filtered .realeinfo");
aloco=$("div.col-sm-12.card.accordion.shuffle-item.filtered .locoinfo");
aref=$("div.col-sm-12.card.accordion.shuffle-item.filtered .refinfo");
for(i=0;i<anome.length;i++){
var one=anome[i];
var two=areale[i];
var three=aloco[i];
var four=aref[i];
//console.log(one.innerText);
one='"'+one.innerText+'"';
two='"'+two.innerText+'"';
three='"'+three.innerText+'"';
four='"'+four.innerText+'"';
var a=i+1;
//console.log(i+one);
//console.log(i+two);
//console.log(i+three);
console.log(i+four);
test_array[a] = new Array();
test_array[a].push(one);
test_array[a].push(two);
test_array[a].push(three);
test_array[a].push(four);
};
test_array.forEach(function(infoArray, index){
dataString = infoArray.join(",");
csvContent += index < anome.length ? dataString+ "\n" : dataString;
});
var encodedUri = encodeURI(csvContent);
window.open(encodedUri);
};
function exportCsvP(){
console.log("click");
};
</script>
</body>
</html>