\n"; echo " \n"; echo " \n"; echo "

" . $GETtitle . " Column Chart

\n"; echo " \n"; echo " \n"; echo " \n"; } else { echo ' data0 = "";' . "\n"; echo " google.load('visualization', '1', {packages:['corechart']}); " . "\n"; echo ' google.setOnLoadCallback(drawChart); ' . "\n"; echo ' function drawChart() { ' . "\n"; echo ' data = google.visualization.arrayToDataTable([ ' . "\n"; echo " ['" . $GETlabel . "','" . str_replace(",", "','", str_replace("'", "", $GETvalue)) . "'] \n"; echo str_replace("~,", "',", str_replace("[~", "['", str_replace(",]", ",0]", str_replace(",,", ",0,", str_replace(",]", ",0]", $GETdata))))); echo " ]);\n"; echo " var options = { \n"; echo " title: '" . $GETtitle . "', \n"; echo " hAxis: {title: '" . $GETlabel . "', titleTextStyle: {color: 'red'}}" . " \n"; echo " }; \n"; echo " chart = new google.visualization.ColumnChart(document.getElementById('chart_div')); \n"; 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,ioffset=0,ans=null,doit=true,avblurb=talkingpoint,kl,lk, thisnum, num=0,message = '', dparts, colparts=colnames.split(','), colav=new Array(), predparts, postdparts, diffcolnames=colnames,diffvalues; var selection = chart.getSelection(); for (var i = 0; i < selection.length; i++) { var item = selection[i]; 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; } var str = data.getFormattedValue(item.row, item.column); //document.title=str; message=document.head.innerHTML.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) == 3) { if (1 == 1) { avblurb+='Show this as Line Chart=L' + String.fromCharCode(10); avblurb+='Show this as Bar Chart=B' + String.fromCharCode(10); avblurb+='Show this as Area Chart=A' + String.fromCharCode(10) + String.fromCharCode(10) + '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('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, 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 (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'; if (ansbits[0].indexOf('@') != -1) { 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() == 'l') { if (pardata == '') { location.href=iftoobig('',(document.URL + '?title=" . urlencode(str_replace(",","`",$GETtitle)) . '&label=' . urlencode($GETlabel) . '&onclick=y&value=' . urlencode($GETvalue) . "&data=' + ourencodeURIComponent(paramdata)).replace('/ColumnChart', '/LineChart').replace('column_chart.php', 'line_chart.php')); } else { location.href=document.URL.replace('/ColumnChart', '/LineChart').replace('column_chart.php', 'line_chart.php'); } } else if (ans.substring(0,1).toLowerCase() == 'a') { if (pardata == '') { location.href=iftoobig('',(document.URL + '?title=" . urlencode(str_replace(",","`",$GETtitle)) . '&label=' . urlencode($GETlabel) . '&onclick=y&value=' . urlencode($GETvalue) . "&data=' + ourencodeURIComponent(paramdata)).replace('/ColumnChart', '/AreaChart').replace('column_chart.php', 'area_chart.php')); } else { location.href=document.URL.replace('/ColumnChart', '/AreaChart').replace('column_chart.php', 'area_chart.php'); } } else if (ans.substring(0,1).toLowerCase() == 'b') { if (pardata == '') { location.href=iftoobig('',(document.URL + '?title=" . urlencode(str_replace(",","`",$GETtitle)) . '&label=' . urlencode($GETlabel) . '&onclick=y&value=' . urlencode($GETvalue) . "&data=' + ourencodeURIComponent(paramdata)).replace('/ColumnChart', '/BarChart').replace('column_chart.php', 'bar_chart.php')); } else { location.href=document.URL.replace('/ColumnChart', '/BarChart').replace('column_chart.php', 'bar_chart.php'); } } else if (pardata == '') { //alert(document.URL + ' ?title=" . urlencode(str_replace(",","`",$GETtitle)) . '&label=' . urlencode($GETlabel) . '&onclick=y&value=' . urlencode($GETvalue) . "&data=' + ourencodeURIComponent(ans)); location.href=iftoobig('',document.URL + '?title=" . urlencode(str_replace(",","`",$GETtitle)) . '&label=' . urlencode($GETlabel) . '&onclick=y&value=' . urlencode($GETvalue) . "&data=' + ourencodeURIComponent(ans)); } else { //alert('PardAta=' + pardata); location.href=iftoobig('',document.URL.replace(pardata, ourencodeURIComponent(ans))); //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 { predparts=dparts[eval(1 + item.row)].split(']'); diffvalues=('~' + predparts[0] + '~').replace('~' + postdparts[0].replace(']','') + ',','~'); if (eval(0 + item.column) == 1) { diffvalues=diffvalues.replace('~' + str + ',','').replace(/~/g,''); } else if (eval(colparts.length) == eval(1 + item.column)) { diffvalues=diffvalues.replace(',' + str + '~','').replace(/~/g,''); } else { diffvalues=diffvalues.replace(',' + str + ',',',').replace(/~/g,''); } diffcolnames=('~' + colnames + '~').replace('~' + colparts[0] + ',','~').replace('~' + colparts[eval(0 + item.column)] + ',','').replace(',' + colparts[eval(0 + item.column)] + '~','').replace(',' + colparts[eval(0 + item.column)] + ',',',').replace(/~/g,''); if (1 == 1) { avblurb+='Show this as Line Chart=L' + String.fromCharCode(10); avblurb+='Show this as Bar Chart=B' + String.fromCharCode(10); avblurb+='Show this as Area Chart=A' + String.fromCharCode(10) + String.fromCharCode(10) + 'Comma Separated Values Spreadsheet Export=filename.csv' + 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('In ' + colparts[0] + ' ' + postdparts[0].replace(']','') + ' you clicked ' + colparts[item.column] + ' of ' + str + ' while (' + diffcolnames + ') were (' + diffvalues + ').' + 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 (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'; if (ansbits[0].indexOf('@') != -1) { 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() == 'l') { if (pardata == '') { location.href=iftoobig('',(document.URL + '?title=" . urlencode(str_replace(",","`",$GETtitle)) . '&label=' . urlencode($GETlabel) . '&onclick=y&value=' . urlencode($GETvalue) . "&data=' + ourencodeURIComponent(paramdata)).replace('/ColumnChart', '/LineChart').replace('column_chart.php', 'line_chart.php')); } else { location.href=document.URL.replace('/ColumnChart', '/LineChart').replace('column_chart.php', 'line_chart.php'); } } else if (ans.substring(0,1).toLowerCase() == 'a') { if (pardata == '') { location.href=iftoobig('',(document.URL + '?title=" . urlencode(str_replace(",","`",$GETtitle)) . '&label=' . urlencode($GETlabel) . '&onclick=y&value=' . urlencode($GETvalue) . "&data=' + ourencodeURIComponent(paramdata)).replace('/ColumnChart', '/AreaChart').replace('column_chart.php', 'area_chart.php')); } else { location.href=document.URL.replace('/ColumnChart', '/AreaChart').replace('column_chart.php', 'area_chart.php'); } } else if (ans.substring(0,1).toLowerCase() == 'b') { if (pardata == '') { location.href=iftoobig('',(document.URL + '?title=" . urlencode(str_replace(",","`",$GETtitle)) . '&label=' . urlencode($GETlabel) . '&onclick=y&value=' . urlencode($GETvalue) . "&data=' + ourencodeURIComponent(paramdata)).replace('/ColumnChart', '/BarChart').replace('column_chart.php', 'bar_chart.php')); } else { location.href=document.URL.replace('/ColumnChart', '/BarChart').replace('column_chart.php', 'bar_chart.php'); } } else if (pardata == '') { //alert(document.URL + ' ?title=" . urlencode(str_replace(",","`",$GETtitle)) . '&label=' . urlencode($GETlabel) . '&onclick=y&value=' . urlencode($GETvalue) . "&data=' + ourencodeURIComponent(ans)); location.href=iftoobig('',document.URL + '?title=" . urlencode(str_replace(",","`",$GETtitle)) . '&label=' . urlencode($GETlabel) . '&onclick=y&value=' . urlencode($GETvalue) . "&data=' + ourencodeURIComponent(ans)); } else { //alert('PardatA=' + pardata); location.href=iftoobig('',document.URL.replace(pardata, ourencodeURIComponent(ans))); //location.href=document.URL.replace(pardata, ourencodeURIComponent(ans)); } } } } else { alert('In ' + colparts[0] + ' ' + postdparts[0].replace(']','') + ' you clicked ' + colparts[item.column] + ' of ' + str + ' while (' + diffcolnames + ') were (' + diffvalues + ').' + avblurb); } } } } message += '{row:' + item.row + ',column:' + item.column + '} = ' + str; } else if (item.row != null) { var str = data.getFormattedValue(item.row, 0); message += '{row:' + item.row + ', column:none}; value (col 0) = ' + str; } else if (item.column != null) { var str = data.getFormattedValue(0, item.column); message += '{row:none, column:' + item.column + '}; value (row 0) = ' + str; } } if (message == '') { message = 'nothing'; } //document.title='2 ' + message; if (1 == 2) console.log('You selected ' + message); } } //); "; } echo " chart.draw(data, options); \n"; if ($GETr != "" && $GETc == "" && (!isset($_GET['cca']) && !isset($_POST['cca']))) echo " chart.setSelection([{'row': " . $GETr . ", 'column': null}]); setTimeout(myselectfunction,4100); \n"; if ($GETr == "" && $GETc != "" && (!isset($_GET['cca']) && !isset($_POST['cca']))) echo " chart.setSelection([{'row': null, 'column': " . $GETc . "}]); setTimeout(myselectfunction,4100); \n"; if ($GETr != "" && $GETc != "" && (!isset($_GET['cca']) && !isset($_POST['cca']))) echo " chart.setSelection([{'row': " . $GETr . ", 'column': " . $GETc . "}]); setTimeout(myselectfunction,4100); \n"; echo " } \n"; echo " \n"; echo " \n"; if ($GETonclick != "") { echo " \n"; } else { echo " \n"; } $statistics=""; $sarr=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]; $narr=[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]; $clprefix=""; $cl=-1; $cpos=0; if ($GETmode == 'Both' || $GETmode == 'Statistics') { $thing_names=explode(",", $GETvalue); $date_items=explode("~", $GETdata); $data_items=explode("~,", $GETdata); $matrix = array(array()); $rowarray = array(); $colarray = array(); $num_columns_is=sizeof($data_items) + 4; //$statistics=$GETdata . "\n" . $GETvalue . "\n" . $GETlabel . "\n" . $GETtitle; $subjideas=explode(" of ", $GETtitle); $subjidea="Vehicle"; if (sizeof($subjideas) > 1) { $subjidea=explode(" ",$subjideas[1])[0]; } $statistics.="

"; $arow=""; for ($icpos=0; $icpos<$num_columns_is; $icpos++) { if (($icpos % sizeof($sarr)) == 0 && $icpos != 0) { $cl++; $clprefix=$sarr[$cl]; } if ($clprefix != "") $narr[sizeof($narr)]=0.0; $arow = str_replace("", "" . $clprefix . $sarr[($icpos % sizeof($sarr))] . "", $arow); if (($icpos + 1) == sizeof($thing_names)) { for ($jcpos=1; $jcpos<=5; $jcpos++) { if ((($icpos + $jcpos) % sizeof($sarr)) == 0) { $cl++; $clprefix=$sarr[$cl]; } if (1 == 4) $arow = str_replace("", "" . $clprefix . $sarr[(($icpos + $jcpos) % sizeof($sarr))] . "", $arow); } } } $statistics=str_replace("", $arow . "", $statistics); $arow="1" . $GETtitle . ""; $statistics=str_replace("", $arow . "", $statistics); $arow="2" . $subjidea . ""; $cl=2; for ($icpos=0; $icpos<(-1 + sizeof($data_items)); $icpos++) { $arow = str_replace("", "" . str_replace(",","",str_replace("[","",str_replace("~","",str_replace(" ","",$date_items[2 * $icpos + 1])))) . "", $arow); } $arow = str_replace("", "Total",$arow); $arow = str_replace("", "Average",$arow); $arow = str_replace("", "Median",$arow); $arow = str_replace("", "Mode",$arow); $statistics=str_replace("", $arow . "", $statistics); $aarow=""; $bbrow=""; $ccrow=""; $ddrow=""; $firsthuh=""; for ($icpos=0; $icpos<(-1 + sizeof($data_items)); $icpos++) { $firsthuh.="?"; } for ($icpos=0; $icpos" . ($icpos + 3) . ""; $aarow="" . ($icpos + 4) . ""; $bbrow="" . ($icpos + 5) . ""; $ccrow="" . ($icpos + 6) . ""; $ddrow="" . ($icpos + 7) . ""; $arow = str_replace("", "" . $thing_names[$icpos] . "", $arow); $aarow = str_replace("", "Total", $aarow); $bbrow = str_replace("", "Average", $bbrow); $ccrow = str_replace("", "Median", $ccrow); $ddrow = str_replace("", "Mode", $ddrow); for ($jcpos=0; $jcpos<(-1 + sizeof($data_items)); $jcpos++) { $rowarray[sizeof($rowarray)] = (float)str_replace(",","",str_replace("[","",str_replace("~","",str_replace(" ","",explode(",",str_replace("]",",",$data_items[$jcpos + 1]))[$icpos])))); $matrix[$icpos][$jcpos] = (float)str_replace(",","",str_replace("[","",str_replace("~","",str_replace(" ","",explode(",",str_replace("]",",",$data_items[$jcpos + 1]))[$icpos])))); $narr[$jcpos] += (float)str_replace(",","",str_replace("[","",str_replace("~","",str_replace(" ","",explode(",",str_replace("]",",",$data_items[$jcpos + 1]))[$icpos])))); $sumis += (float)str_replace(",","",str_replace("[","",str_replace("~","",str_replace(" ","",explode(",",str_replace("]",",",$data_items[$jcpos + 1]))[$icpos])))); $movavg = ($movavg * $jcpos + (float)str_replace(",","",str_replace("[","",str_replace("~","",str_replace(" ","",explode(",",str_replace("]",",",$data_items[$jcpos + 1]))[$icpos])))) ) / (1 + $jcpos); $arow = str_replace("", "" . str_replace(",","",str_replace("[","",str_replace("~","",str_replace(" ","",explode(",",str_replace("]",",",$data_items[$jcpos + 1]))[$icpos])))) . "", $arow); $aarow = str_replace("", "" . $secondhuh . "", $aarow); $bbrow = str_replace("", "" . $secondhuh . "", $bbrow); $ccrow = str_replace("", "" . $secondhuh . "", $ccrow); $ddrow = str_replace("", "" . $secondhuh . "", $ddrow); $secondhuh=substr($secondhuh,1); } $arow = str_replace("", "" . $sumis . "", $arow); $arow = str_replace("", "" . $movavg . "", $arow); sort($rowarray, SORT_NUMERIC); $arow = str_replace("", "" . $rowarray[(int)(sizeof($rowarray) / 2)] . "", $arow); // median $sofar = $rowarray[0]; $lastnum = $rowarray[0]; $thissofarnum = 1; $sofarnum = 1; for ($imore=1; $imore $sofarnum) { $sofar = $rowarray[$imore]; $sofarnum = $thissofarnum; } else { $thissofarnum = 1; } $lastnum = $rowarray[$imore]; } } $arow = str_replace("", "" . $sofar . "", $arow); // mode $aarow = str_replace("", "", $aarow); //$aarow = str_replace("", "", $aarow); //$aarow = str_replace("", "", $aarow); //$aarow = str_replace("", "", $aarow); $bbrow = str_replace("", "", $bbrow); //$bbrow = str_replace("", "", $bbrow); //$bbrow = str_replace("", "", $bbrow); //$bbrow = str_replace("", "", $bbrow); $ccrow = str_replace("", "", $ccrow); //$ccrow = str_replace("", "", $ccrow); //$ccrow = str_replace("", "", $ccrow); //$ccrow = str_replace("", "", $ccrow); $ddrow = str_replace("", "", $ddrow); //$ddrow = str_replace("", "", $ddrow); //$ddrow = str_replace("", "", $ddrow); //$ddrow = str_replace("", "", $ddrow); $statistics=str_replace("", $arow . "", $statistics); if ((1 + $icpos) == sizeof($thing_names)) { $secondhuh=$firsthuh; for ($iicpos=0; $iicpos<(-1 + sizeof($data_items)); $iicpos++) { $colarray = array(); for ($jjcpos=0; $jjcpos $sofarnum) { $sofar = $colarray[$imore]; $sofarnum = $thissofarnum; } else { $thissofarnum = 1; } $lastnum = $colarray[$imore]; } } $ddrow = str_replace($secondhuh, "" . $sofar, $ddrow); // temporary $secondhuh=substr($secondhuh,1); } $statistics=str_replace("", $aarow . "", $statistics); $statistics=str_replace("", $bbrow . "", $statistics); $statistics=str_replace("", $ccrow . "", $statistics); $statistics=str_replace("", $ddrow . "", $statistics); } } } if ($GETmode == 'Both') { echo "

" . $GETtitle . " Statistics Table and Column Chart

\n"; echo '
' . $statistics . '
' . " \n"; } else if ($GETmode != 'Statistics') { echo "

" . $GETtitle . " Column Chart

\n"; echo '
' . " \n"; } else { echo "

" . $GETtitle . " Statistics Table

\n"; echo '
' . $statistics . '
' . " \n"; } } echo 'Another column chart to show differences for?' . " \n"; echo '<' . 'script' . '>' . "\n " . " function later() { \n"; if ((!isset($_GET['value']) && !isset($_POST['value'])) || $data0 == "") { if (isset($_GET['data'])) $data0 = "&data0=" . $_GET['data']; if (isset($_POST['data'])) $data0 = "&data0=" . $_POST['data']; echo ' var datalineprefix = " "; ' . "\n"; echo ' var datalinesuffix = ""; ' . "\n"; echo ' var extra = ""; ' . "\n"; echo ' var thisline = 1; ' . "\n"; echo ' var ii = 0; ' . "\n"; echo ' var thisdef = "0"; ' . "\n"; echo ' var totalleft = 100.0; ' . "\n"; if (isset($_GET['data']) || isset($_POST['data'])) { echo " var title = '" . $GETtitle . "'; " . "\n"; } else { echo ' var title = prompt("Enter Column Chart Title (suffix by &onclick=y for added onclick functionality, and/or suffix by &mode=Statistics for a spreadsheet type display or &mode=Both for both types of display)", "' . $GETtitle . '"); ' . "\n"; } echo ' if (title != null) { ' . "\n"; if (isset($_GET['data']) || isset($_POST['data'])) { echo " var label = '" . $GETlabel . "'; " . "\n"; echo " var value = '" . $GETvalue . "'; " . "\n"; } else { echo ' var label = prompt("Enter Column Concept", "' . $GETlabel . '"); ' . "\n"; echo ' var value = prompt("Enter Column " + label + " Measure(s) (separated by ,)", "' . $GETvalue . '"); ' . "\n"; } echo ' if (value.indexOf(",") != (0 - 1)) { ' . "\n"; echo ' for (ii=0; ii 0))) { ' . "\n"; echo ' if (datalinesuffix.length != 0) datalineprefix = prompt("Enter " + label + " " + thisline + " (for no more hit Cancel button)", ""); ' . "\n"; echo ' if (datalineprefix == null) { ' . "\n"; echo ' datalineprefix = ""; ' . "\n"; echo ' totalleft = 0; ' . "\n"; echo ' } else if (datalineprefix.length != 0) { ' . "\n"; echo ' extra = ""; ' . "\n"; echo ' if (value.indexOf("ercent") != (0 - 1) && value.indexOf(" ercent ") == (0 - 1)) extra = " (for " + totalleft + " enter nothing or hit Cancel button)"; ' . "\n"; echo ' datalinesuffix = prompt("Enter " + value.replace(" ercent ", "") + " " + thisline + extra, thisdef); ' . "\n"; echo ' if (datalinesuffix == null && value.indexOf("ercent") != (0 - 1) && value.indexOf(" ercent ") == (0 - 1)) datalinesuffix = totalleft; ' . "\n"; echo ' if (datalinesuffix == null) datalinesuffix = "0"; ' . "\n"; echo ' if (datalinesuffix.length == 0) { ' . "\n"; echo ' datalinesuffix = eval(totalleft); ' . "\n"; echo ' totalleft = 0; ' . "\n"; echo ' } else if (eval(totalleft) == eval(datalinesuffix) && value.indexOf("ercent") != (0 - 1) && value.indexOf(" ercent ") == (0 - 1)) { ' . "\n"; echo ' totalleft = 0; ' . "\n"; echo ' } else if (eval(datalinesuffix) > eval(totalleft) && value.indexOf("ercent") != (0 - 1) && value.indexOf(" ercent ") == (0 - 1)) { ' . "\n"; echo ' datalinesuffix = eval(totalleft); ' . "\n"; echo ' totalleft = 0; ' . "\n"; echo ' } else if (eval(datalinesuffix) > eval(totalleft) && value.indexOf("ercent") == (0 - 1) && value.indexOf(" ercent ") == (0 - 1)) { ' . "\n"; echo ' value = value + " ercent "; ' . "\n"; echo ' } else { ' . "\n"; echo ' totalleft = eval(totalleft) - eval(datalinesuffix); ' . "\n"; echo ' } ' . "\n"; echo ' datac = datac + ", [~" + datalineprefix + "~," + datalinesuffix + "] "; ' . "\n"; echo ' thisline++; ' . "\n"; echo ' } ' . "\n"; echo ' } ' . "\n"; if (strpos($data0, "data0=") !== false) { echo ' window.location = "./column_chart_diff.php?title=" + title + yonclick + "&label=" + label + "&value=" + value.replace(" ercent ", "") + "' . $data0 . '&data=" + datac; ' . "\n"; } else { echo ' window.location = "./column_chart.php?title=" + title + yonclick + "&label=" + label + "&value=" + value.replace(" ercent ", "") + "' . $data0 . '&data=" + datac; ' . "\n"; } echo "} \n" . "} \n"; } else { echo " } \n"; } echo '' . "\n"; ?>