2,7d1 < if (file_exists("csv.php")) { < include "csv.php"; < } else if (file_exists("../csv.php")) { < include "../csv.php"; < } < 90,91d83 < < 100,131d91 < echo "var ready=false, x=-1, y=-1, elemLeft=0, elemTop=0, ir=-1, ic=-1, talkingpoint=''; \n"; < < < echo "var data, chart, pardata = (location.search.split('data=')[1] ? location.search.split('data=')[1].split('&')[0] : ''), paramdata=decodeURIComponent(pardata); \n"; < < $GETtp=""; < if (isset($_GET['tp'])) $GETtp = urldecode($_GET['tp']); < if (isset($_POST['tp'])) $GETtp = urldecode($_POST['tp']); < if ($GETtp != "") echo "\n talkingpoint=String.fromCharCode(10) + String.fromCharCode(10) + " . '"' . str_replace("`", '" + String.fromCharCode(10) + "', str_replace("\n", '" + String.fromCharCode(10) + "', $GETtp)) . '"' . " + String.fromCharCode(10) + String.fromCharCode(10); \n"; < < $GETr = ""; < $GETc = ""; < if (isset($_GET['r'])) $GETr = urldecode($_GET['r']); < if (isset($_POST['r'])) $GETr = urldecode($_POST['r']); < if (isset($_GET['c'])) $GETc = urldecode($_GET['c']); < if (isset($_POST['c'])) $GETc = urldecode($_POST['c']); < if ($GETr != "") echo "\n ir=eval('" . $GETr . "'); \n"; < if ($GETc != "") echo "\n ic=eval('" . $GETc . "'); \n"; < < $GETx = ""; < $GETy = ""; < if (isset($_GET['x'])) $GETx = urldecode($_GET['x']); < if (isset($_POST['x'])) $GETx = urldecode($_POST['x']); < if (isset($_GET['y'])) $GETy = urldecode($_GET['y']); < if (isset($_POST['y'])) $GETy = urldecode($_POST['y']); < if ($GETx != "" && $GETy != "") { < echo "\n x=eval('" . $GETx . "'); \n"; < echo "\n y=eval('" . $GETy . "'); \n"; < } < < < 172c132 < } else if (isset($_POST['popularity']) && (isset($_POST['isMobile']) || isset($_POST['wouldlikeyoutoseekpermission']))) { --- > } else if (isset($_POST['popularity']) && (isset($_POST['isMobile']))) { 186,188d145 < < echo " var colnames= '" . $GETcountry . "," . str_replace("'", "", $GETpopularity) . "'; \n"; < 192d148 < echo " var sliceid = 0; /" . "/ thanks to https://gist.github.com/alexrainman/bb8d49357250df0859c0 \n"; 217c173 < echo " data = new google.visualization.DataTable(); \n"; --- > echo " var data = new google.visualization.DataTable(); \n"; 229c185 < echo ' data = google.visualization.arrayToDataTable([ ' . "\n"; --- > echo ' var data = google.visualization.arrayToDataTable([ ' . "\n"; 234c190 < echo " chart = new google.visualization.GeoChart(document.getElementById('chart_div')); \n"; --- > echo " var chart = new google.visualization.GeoChart(document.getElementById('chart_div')); \n"; 238a195 > echo " var sliceid = 0; /" . "/ thanks to https://gist.github.com/alexrainman/bb8d49357250df0859c0 \n"; 280,558c237 < $GETonclick = ""; < if (isset($_GET['onclick'])) $GETonclick = urldecode($_GET['onclick']); < if (isset($_POST['onclick'])) $GETonclick = urldecode($_POST['onclick']); < if ($GETonclick != "") { < echo "google.visualization.events.addListener(chart, 'ready', function() { ready=true; }); \n"; < echo "google.visualization.events.addListener(chart, 'select', myselectfunction); \n function myselectfunction() { < if (ready) { < var relist=['remail',''],ire,ansbits,avblurb=talkingpoint,ioffset=0,ans=null,doit=true,kl,lk, thisnum, num=0,message = '', dparts, colparts=colnames.split(','), colav=new Array(), predparts, postdparts, diffcolnames=colnames,diffvalues, str; < selection = chart.getSelection(); < sliceid = selection[0].row; < < for (var i = 0; i < selection.length; i++) { < var item = selection[i]; < if ((eval(ir) >= 0 && eval(ic) < 0)) { < if (eval(ir) >= 0 && eval(ic) < 0) { < //alert(999); < item.row=ir; < //item.column=ic; < //alert(9999); < ir=-1; < ic=-1; < } else { < ir=item.row; < //ic=item.column; < //document.title=ir + ',' + ic; < } < //document.title=str; < message=document.head.innerHTML.replace('[' + String.fromCharCode(39),'[ ' + String.fromCharCode(39)).replace('[' + String.fromCharCode(39),', [' + String.fromCharCode(39)).substring(ioffset); < while (message.indexOf(', [') != -1) { < message=message.replace(', [',',['); < } < dparts=message.split(',['); < //document.title=''; < colav.push(0.0); < for (kl=1; kl= eval(1 + item.row)) { < postdparts=dparts[eval(1 + item.row)].replace(']',',').split(','); < if (eval(postdparts.length) >= eval(1 + item.column)) { < if (eval(colparts.length) == 2) { < if (1 == 1) { < avblurb+='Show this as Pie Chart=P' + String.fromCharCode(10) + String.fromCharCode(10); < avblurb+='Comma Separated Values Spreadsheet Export=filename.csv' + String.fromCharCode(10) + '' + String.fromCharCode(10) + 'Email with or without Talking Point=fillin.email@address This is when the improvement started. Robert' + String.fromCharCode(10) + '' + String.fromCharCode(10); < avblurb+='Change data as required below (keeping it the same or being blank or choosing Cancel leaves the status quo)'; < ans=prompt('For ' + colparts[0] + ' ' + postdparts[0].replace(']','') + ' you clicked ' + colparts[1] + ' of ' + postdparts[1].replace(']','') + avblurb, paramdata); < if (ans != null) { < if (ans != '' && ans != paramdata) { < if ((ans.toLowerCase() + '~').indexOf('.csv~') != -1 && ans.toLowerCase().indexOf('&') == -1) ans=paramdata + '&csv=' + ans; < ansbits=ans.split(' '); < if (ansbits[0].indexOf('@') != -1) { < if (document.getElementById('altemail')) { < document.getElementById('altemail').value=ansbits[0]; < document.getElementById('remail').href=document.getElementById('remail').href.replace('mt=','mt=' + ansbits[0] + '&junk=youshallneverfindthis').replace('get=','mt=' + ansbits[0] + '&junk=youshallneverfindthis'); < } < if (document.getElementById('email')) relist[1]='email'; < for (ire=0; ire<2; ire++) { < if (relist[ire] != '') { < document.getElementById(relist[ire]).href=document.getElementById(relist[ire]).href.replace('fillin.email@address', ansbits[0]); < if (document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('&r=') + item.row) == -1) document.getElementById(relist[ire]).href+=encodeURIComponent('&r=') + item.row; < //if (document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('&c=') + item.column) == -1) document.getElementById(relist[ire]).href+=encodeURIComponent('&c=') + item.column; < if (ansbits.length > 1) { < ans=ans.replace(ansbits[0] + ' ',''); < while (ans.indexOf(' ') != -1) { < ans=ans.replace(' ','%20'); < } < while (ans.indexOf('?') != -1) { < ans=ans.replace('?','%3f'); < } < while (ans.indexOf('&') != -1) { < ans=ans.replace('&','%26'); < } < if (document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('&tp=')) == -1 && document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('?tp=')) == -1) { < document.getElementById(relist[ire]).href+=encodeURIComponent('&tp=') + encodeURIComponent(ans); < } else if (document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('&tp=')) != -1) { < document.getElementById(relist[ire]).href=document.getElementById(relist[ire]).href.replace(encodeURIComponent('&tp='), encodeURIComponent('&tp=') + encodeURIComponent(ans) + String.fromCharCode(96)); < } else if (document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('?tp=')) != -1) { < document.getElementById(relist[ire]).href=document.getElementById(relist[ire]).href.replace(encodeURIComponent('?tp='), encodeURIComponent('?tp=') + encodeURIComponent(ans) + String.fromCharCode(96)); < } < while (document.getElementById(relist[ire]).href.indexOf(' ') != -1) { < document.getElementById(relist[ire]).href=document.getElementById(relist[ire]).href.replace(' ','%20'); < } < //alert(document.getElementById(relist[ire]).href); < } < document.getElementById(relist[ire]).click(); < } < } < } else if (ans.substring(0,1).toLowerCase() == 'p') { < location.href=document.URL.replace('/GeoChart', '/PieChart').replace('geo_chart.php', 'pie_chart.php'); < } else { < location.href=document.URL.replace(pardata, ourencodeURIComponent(ans)); < } < } < } < } else { < alert('In ' + colparts[0] + ' ' + postdparts[0].replace(']','') + ' you clicked ' + colparts[item.column] + ' of ' + str + ' while ' + colparts[eval(3 - item.column)] + ' were ' + postdparts[eval(3 - item.column)].replace(']','') + ' the difference being ' + eval(eval(postdparts[1].replace(']','')) - eval(postdparts[2].replace(']',''))) + avblurb); < } < } < } < } < } else if ((item.row != null && item.column != null) || (eval(ir) >= 0 && eval(ic) >= 0)) { < if (eval(ir) >= 0 && eval(ic) >= 0) { < //alert(999); < item.row=ir; < item.column=ic; < //alert(9999); < ir=-1; < ic=-1; < } else { < ir=item.row; < ic=item.column; < //document.title=ir + ',' + ic; < } < str = data.getFormattedValue(item.row, item.column); < message += '{row:' + item.row + ',column:' + item.column + '} = ' + str; < } else if ((item.row != null) || (eval(ir) >= 0 && eval(ic) < 0)) { < if (eval(ir) >= 0 && eval(ic) < 0) { < //alert(999); < item.row=ir; < //item.column=ic; < //alert(9999); < ir=-1; < //ic=-1; < } else { < ir=item.row; < //ic=item.column; < //document.title=ir + ',' + ic; < } < str = data.getFormattedValue(item.row, 0); < //document.title=str; < //document.title=str; < message=document.head.innerHTML.replace('[' + String.fromCharCode(39),'[ ' + String.fromCharCode(39)).replace('[' + String.fromCharCode(39),', [' + String.fromCharCode(39)).substring(ioffset); < while (message.indexOf(', [') != -1) { < message=message.replace(', [',',['); < } < dparts=message.split(',['); < //document.title=''; < colav.push(0.0); < for (kl=1; kl= eval(1 + item.row)) { < postdparts=dparts[eval(1 + item.row)].replace(']',',').split(','); < if (eval(postdparts.length) >= eval(1 + item.column)) { < if (eval(colparts.length) == 2) { < if (1 == 1) { < avblurb+='Show this as Pie Chart=P' + String.fromCharCode(10) + String.fromCharCode(10); < avblurb+='Comma Separated Values Spreadsheet Export=filename.csv' + String.fromCharCode(10) + '' + String.fromCharCode(10) + 'Email with or without Talking Point=fillin.email@address This is when the improvement started. Robert' + String.fromCharCode(10) + '' + String.fromCharCode(10); < avblurb+='Change data as required below (keeping it the same or being blank or choosing Cancel leaves the status quo)'; < ans=prompt('For ' + colparts[0] + ' ' + postdparts[0].replace(']','') + ' you clicked ' + colparts[1] + ' of ' + postdparts[1].replace(']','') + avblurb, paramdata); < if (ans != null) { < if (ans != '' && ans != paramdata) { < if ((ans.toLowerCase() + '~').indexOf('.csv~') != -1 && ans.toLowerCase().indexOf('&') == -1) ans=paramdata + '&csv=' + ans; < ansbits=ans.split(' '); < if (ansbits[0].indexOf('@') != -1) { < if (document.getElementById('altemail')) { < document.getElementById('altemail').value=ansbits[0]; < document.getElementById('remail').href=document.getElementById('remail').href.replace('mt=','mt=' + ansbits[0] + '&junk=youshallneverfindthis').replace('get=','mt=' + ansbits[0] + '&junk=youshallneverfindthis'); < } < if (document.getElementById('email')) relist[1]='email'; < for (ire=0; ire<2; ire++) { < if (relist[ire] != '') { < document.getElementById(relist[ire]).href=document.getElementById(relist[ire]).href.replace('fillin.email@address', ansbits[0]); < if (document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('&r=') + item.row) == -1) document.getElementById(relist[ire]).href+=encodeURIComponent('&r=') + item.row; < //if (document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('&c=') + item.column) == -1) document.getElementById(relist[ire]).href+=encodeURIComponent('&c=') + item.column; < if (ansbits.length > 1) { < ans=ans.replace(ansbits[0] + ' ',''); < while (ans.indexOf(' ') != -1) { < ans=ans.replace(' ','%20'); < } < while (ans.indexOf('?') != -1) { < ans=ans.replace('?','%3f'); < } < while (ans.indexOf('&') != -1) { < ans=ans.replace('&','%26'); < } < if (document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('&tp=')) == -1 && document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('?tp=')) == -1) { < document.getElementById(relist[ire]).href+=encodeURIComponent('&tp=') + encodeURIComponent(ans); < } else if (document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('&tp=')) != -1) { < document.getElementById(relist[ire]).href=document.getElementById(relist[ire]).href.replace(encodeURIComponent('&tp='), encodeURIComponent('&tp=') + encodeURIComponent(ans) + String.fromCharCode(96)); < } else if (document.getElementById(relist[ire]).href.indexOf(encodeURIComponent('?tp=')) != -1) { < document.getElementById(relist[ire]).href=document.getElementById(relist[ire]).href.replace(encodeURIComponent('?tp='), encodeURIComponent('?tp=') + encodeURIComponent(ans) + String.fromCharCode(96)); < } < while (document.getElementById(relist[ire]).href.indexOf(' ') != -1) { < document.getElementById(relist[ire]).href=document.getElementById(relist[ire]).href.replace(' ','%20'); < } < //alert(document.getElementById(relist[ire]).href); < } < document.getElementById(relist[ire]).click(); < } < } < } else if (ans.substring(0,1).toLowerCase() == 'p') { < location.href=document.URL.replace('/GeoChart', '/PieChart').replace('geo_chart.php', 'pie_chart.php'); < } else { < location.href=document.URL.replace(pardata, ourencodeURIComponent(ans)); < } < } < } < } else { < alert('In ' + colparts[0] + ' ' + postdparts[0].replace(']','') + ' you clicked ' + colparts[item.column] + ' of ' + str + ' while ' + colparts[eval(3 - item.column)] + ' were ' + postdparts[eval(3 - item.column)].replace(']','') + ' the difference being ' + eval(eval(postdparts[1].replace(']','')) - eval(postdparts[2].replace(']',''))) + avblurb); < } < } < } < } < < } else if ((item.column != null) || (eval(ir) < 0 && eval(ic) >= 0)) { < if (eval(ir) >= 0 && eval(ic) < 0) { < //alert(999); < //item.row=ir; < item.column=ic; < //alert(9999); < //ir=-1; < ic=-1; < } else { < //ir=item.row; < ic=item.column; < //document.title=ir + ',' + ic; < } < str = data.getFormattedValue(0, item.column); < message += '{row:none, column:' + item.column + '}; value (row 0) = ' + str; < } < } < if (message == '') { < message = 'nothing'; < } < if (1 == 2) console.log('You selected ' + message); < } < ir=-1; < ic=-1; < } < //); < "; < } < < echo " chart.draw(data, {" . $newextras . "}); \n"; < if ($GETr != "" && $GETc == "") echo " chart.setSelection([{'row': " . $GETr . ", 'column': null}]); setTimeout(myselectfunction,4100); \n"; < if ($GETr == "" && $GETc != "") echo " chart.setSelection([{'row': null, 'column': " . $GETc . "}]); setTimeout(myselectfunction,4100); \n"; < if ($GETr != "" && $GETc != "") echo " chart.setSelection([{'row': " . $GETr . ", 'column': " . $GETc . "}]); setTimeout(myselectfunction,4100); \n"; < echo " } \n"; --- > echo " chart.draw(data, {" . $newextras . "}); \n } \n"; 644c323 < echo ' title = prompt("Enter Geo Map Title (prefix by a Region Code (eg. IT) (followed by ;) before title as an available option, suffix by &onclick=y for added onclick functionality)", "' . $GETtitle . '"); ' . "\n"; --- > echo ' title = prompt("Enter Geo Map Title (prefix by a Region Code (eg. IT) (followed by ;) before title as an available option)", "' . $GETtitle . '"); ' . "\n";