Edit D:\rfid\libsystem\page\statistics\js\tableExport.js
(function(a){a.fn.extend({tableExport:function(g){var n={separator:",",ignoreColumn:[],tableName:"yourTableName",type:"csv",pdfFontSize:14,pdfLeftMargin:20,escape:"true",htmlContent:"false",consoleLog:"false"};var g=a.extend(n,g);var d=this;if(n.type=="csv"||n.type=="txt"){var f="";a(d).find("thead").find("tr").each(function(){f+="\n";a(this).filter(":visible").find("th").each(function(t,u){if(a(this).css("display")!="none"){if(n.ignoreColumn.indexOf(t)==-1){f+='"'+k(a(this))+'"'+n.separator}}});f=a.trim(f);f=a.trim(f).substring(0,f.length-1)});a(d).find("tbody").find("tr").each(function(){f+="\n";a(this).filter(":visible").find("td").each(function(t,u){if(a(this).css("display")!="none"){if(n.ignoreColumn.indexOf(t)==-1){f+='"'+k(a(this))+'"'+n.separator}}});f=a.trim(f).substring(0,f.length-1)});if(n.consoleLog=="true"){console.log(f)}var c="base64,"+a.base64.encode(f);window.open("data:application/"+n.type+";filename=exportData;"+c)}else{if(n.type=="sql"){var f="INSERT INTO `"+n.tableName+"` (";a(d).find("thead").find("tr").each(function(){a(this).filter(":visible").find("th").each(function(t,u){if(a(this).css("display")!="none"){if(n.ignoreColumn.indexOf(t)==-1){f+="`"+k(a(this))+"`,"}}});f=a.trim(f);f=a.trim(f).substring(0,f.length-1)});f+=") VALUES ";a(d).find("tbody").find("tr").each(function(){f+="(";a(this).filter(":visible").find("td").each(function(t,u){if(a(this).css("display")!="none"){if(n.ignoreColumn.indexOf(t)==-1){f+='"'+k(a(this))+'",'}}});f=a.trim(f).substring(0,f.length-1);f+="),"});f=a.trim(f).substring(0,f.length-1);f+=";";if(n.consoleLog=="true"){console.log(f)}var c="base64,"+a.base64.encode(f);window.open("data:application/sql;filename=exportData;"+c)}else{if(n.type=="json"){var e=[];a(d).find("thead").find("tr").each(function(){var u="";var t=[];a(this).filter(":visible").find("th").each(function(v,w){if(a(this).css("display")!="none"){if(n.ignoreColumn.indexOf(v)==-1){t.push(k(a(this)))}}});e.push(t)});var o=[];a(d).find("tbody").find("tr").each(function(){var u="";var t=[];a(this).filter(":visible").find("td").each(function(v,w){if(a(this).css("display")!="none"){if(n.ignoreColumn.indexOf(v)==-1){t.push(k(a(this)))}}});o.push(t)});var q=[];q.push({header:e,data:o});if(n.consoleLog=="true"){console.log(JSON.stringify(q))}var c="base64,"+a.base64.encode(JSON.stringify(q));window.open("data:application/json;filename=exportData;"+c)}else{if(n.type=="xml"){var h='<?xml version="1.0" encoding="utf-8"?>';h+="<tabledata><fields>";a(d).find("thead").find("tr").each(function(){a(this).filter(":visible").find("th").each(function(t,u){if(a(this).css("display")!="none"){if(n.ignoreColumn.indexOf(t)==-1){h+="<field>"+k(a(this))+"</field>"}}})});h+="</fields><data>";var m=1;a(d).find("tbody").find("tr").each(function(){h+='<row id="'+m+'">';var t=0;a(this).filter(":visible").find("td").each(function(u,v){if(a(this).css("display")!="none"){if(n.ignoreColumn.indexOf(u)==-1){h+="<column-"+t+">"+k(a(this))+"</column-"+t+">"}}t++});m++;h+="</row>"});h+="</data></tabledata>";if(n.consoleLog=="true"){console.log(h)}var c="base64,"+a.base64.encode(h);window.open("data:application/xml;filename=exportData;"+c)}else{if(n.type=="excel"||n.type=="doc"||n.type=="powerpoint"){var b="<table>";a(d).find("thead").find("tr").each(function(){b+="<tr>";a(this).filter(":visible").find("th").each(function(t,u){if(a(this).css("display")!="none"){if(n.ignoreColumn.indexOf(t)==-1){b+="<td>"+k(a(this))+"</td>"}}});b+="</tr>"});var m=1;a(d).find("tbody").find("tr").each(function(){b+="<tr>";var t=0;a(this).filter(":visible").find("td").each(function(u,v){if(a(this).css("display")!="none"){if(n.ignoreColumn.indexOf(u)==-1){b+="<td>"+k(a(this))+"</td>"}}t++});m++;b+="</tr>"});b+="</table>";if(n.consoleLog=="true"){console.log(b)}var i="<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:x='urn:schemas-microsoft-com:office:"+n.type+"' xmlns='http://www.w3.org/TR/REC-html40'>";i+="<head>";i+="<!--[if gte mso 9]>";i+="<xml>";i+="<x:ExcelWorkbook>";i+="<x:ExcelWorksheets>";i+="<x:ExcelWorksheet>";i+="<x:Name>";i+="{worksheet}";i+="</x:Name>";i+="<x:WorksheetOptions>";i+="<x:DisplayGridlines/>";i+="</x:WorksheetOptions>";i+="</x:ExcelWorksheet>";i+="</x:ExcelWorksheets>";i+="</x:ExcelWorkbook>";i+="</xml>";i+="<![endif]-->";i+="</head>";i+="<body>";i+=b;i+="</body>";i+="</html>";var c="base64,"+a.base64({data:i,type:0});window.open("data:application/vnd.ms-"+n.type+";filename=exportData.doc;"+c)}else{if(n.type=="png"){html2canvas(a(d),{onrendered:function(u){var t=u.toDataURL("image/png");window.open(t)}})}else{if(n.type=="pdf"){var r=new jsPDF("p","pt","a4",true);r.setFontSize(n.pdfFontSize);var l=n.pdfLeftMargin;a(d).find("thead").find("tr").each(function(){a(this).filter(":visible").find("th").each(function(t,v){if(a(this).css("display")!="none"){if(n.ignoreColumn.indexOf(t)==-1){var u=l+(t*50);r.text(u,20,k(a(this)))}}})});var p=20;var j=1;var s=0;a(d).find("tbody").find("tr").each(function(t,u){rowCalc=t+1;if(rowCalc%26==0){r.addPage();j++;p=p+10}s=(p+(rowCalc*10))-((j-1)*280);a(this).filter(":visible").find("td").each(function(v,x){if(a(this).css("display")!="none"){if(n.ignoreColumn.indexOf(v)==-1){var w=l+(v*50);r.text(w,s,k(a(this)))}}})});r.output("datauri")}}}}}}}function k(t){if(n.htmlContent=="true"){content_data=t.html().trim()}else{content_data=t.text().trim()}if(n.escape=="true"){content_data=escape(content_data)}return content_data}}})})(jQuery);
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de