"; $datavalis=explode("=", ('' . $_SERVER['QUERY_STRING']))[1]; $bitsbetween=["?title=", "&onclick=y&task=", "&desc=", "&data="]; $bitsap=explode("__", explode("=", explode("?", ('?' . $_SERVER['QUERY_STRING']))[1])[0]); for ($iuy=0; $iuy", " method=POST>", $proposedform); $urlbase.=$bitsbetween[$iuy] . '' . str_replace(" ", "%20", str_replace("+"," ",urldecode($datavalis))); } else { $proposedform=str_replace(" method=POST>", " method=POST>", $proposedform); $urlbase.=$bitsbetween[$iuy] . '' . urlencode(str_replace("_", "%20", $bitsap[$iuy])); } } if (strlen($urlbase) > 800) { echo $proposedform; } else { header('Location: ' . $urlbase); } exit; } } $GETextraopts = ""; if (isset($_GET['extraopts'])) { $GETextraopts = str_replace("+"," ",urldecode($_GET['extraopts'])); } if (isset($_POST['extraopts'])) { $GETextraopts = str_replace("+"," ",urldecode($_POST['extraopts'])); } $bdivstart=""; $bdivend=""; $cdivc="background-color: yellow;"; $amwv=false; if ((strpos($_SERVER['HTTP_USER_AGENT'], 'Mobile/') !== false) && (strpos($_SERVER['HTTP_USER_AGENT'], 'Safari/') == false)) { $amwv=true; } $fraction_game_template=""; $myfnameis="ismapp"; $mobilebits=explode("&" . $myfnameis . "=", ("" . $_SERVER['QUERY_STRING'])); $dbval=""; if (sizeof($mobilebits) > 1) { $dbval = include_get_params(dirname(__FILE__) . '/../php_database.php?' . $myfnameis . '=' . explode("&", ($mobilebits[1] . "&"))[0]); } $dbval = include_get_params(dirname(__FILE__) . '/../php_database.php?' . $myfnameis . '='); if (($dbval != "" && isset($_GET['fraction']))) { $fraction_game_template="https://www.rjmprogramming.com.au/PHP/PieChart/pie_chart.php?title=Fraction%201/4&task=Part&desc=Percentage&onclick=y&data=,%20[~1/4~,25]%20,%20[~1/4~,25]%20,%20[~1/4~,25]%20,%20[~1/4~,25]"; } $select_prefix=""; $button_prefix=""; if ($dbval != "") { $njsuff=""; if (strpos($_SERVER['QUERY_STRING'], "nojwin") !== false) $njsuff="&nojwin=Y"; $button_prefix="  "; $button_prefix.="  "; $select_prefix=""; $select_prefix.=""; } function tzl($inwith) { $inwithtz=urldecode($inwith); if (strpos($inwithtz, "~http;") !== false) { // co-ordinates via net $inwithtz=read_and_array("http;" . explode("~",explode("~http;", $inwithtz)[1])[0], str_replace('pie_chart.php','pie_chart.php',str_replace('index.php','pie_chart.php',$_SERVER['REQUEST_URI']))); } else if (strpos($inwithtz, "~Http;") !== false) { // co-ordinates via net $inwithtz=read_and_array("http;" . explode("~",explode("~Http;", $inwithtz)[1])[0], str_replace('pie_chart.php','pie_chart.php',str_replace('index.php','pie_chart.php',$_SERVER['REQUEST_URI']))); } else if (strpos($inwithtz, "~HTTP;") !== false) { // co-ordinates via net $inwithtz=read_and_array("http;" . explode("~",explode("~HTTP;", $inwithtz)[1])[0], str_replace('pie_chart.php','pie_chart.php',str_replace('index.php','pie_chart.php',$_SERVER['REQUEST_URI']))); } else if (strpos($inwithtz, "~https;") !== false) { // co-ordinates via net $inwithtz=read_and_array("http;" . explode("~",explode("~https;", $inwithtz)[1])[0], str_replace('pie_chart.php','pie_chart.php',str_replace('index.php','pie_chart.php',$_SERVER['REQUEST_URI']))); } else if (strpos($inwithtz, "~Https;") !== false) { // co-ordinates via net $inwithtz=read_and_array("http;" . explode("~",explode("~Https;", $inwithtz)[1])[0], str_replace('pie_chart.php','pie_chart.php',str_replace('index.php','pie_chart.php',$_SERVER['REQUEST_URI']))); } else if (strpos($inwithtz, "~HTTPS;") !== false) { // co-ordinates via net $inwithtz=read_and_array("http;" . explode("~",explode("~HTTPS;", $inwithtz)[1])[0], str_replace('pie_chart.php','pie_chart.php',str_replace('index.php','pie_chart.php',$_SERVER['REQUEST_URI']))); } else if (strpos($inwithtz, "~http") !== false) { // co-ordinates via net $inwithtz=read_and_array("http" . explode("~",explode("~http", $inwithtz)[1])[0], str_replace('pie_chart.php','pie_chart.php',str_replace('index.php','pie_chart.php',$_SERVER['REQUEST_URI']))); } else if (strpos($inwithtz, "~Http") !== false) { // co-ordinates via net $inwithtz=read_and_array("http" . explode("~",explode("~Http", $inwithtz)[1])[0], str_replace('pie_chart.php','pie_chart.php',str_replace('index.php','pie_chart.php',$_SERVER['REQUEST_URI']))); } else if (strpos($inwithtz, "~HTTP") !== false) { // co-ordinates via net $inwithtz=read_and_array("HTTP" . explode("~",explode("~HTTP", $inwithtz)[1])[0], str_replace('pie_chart.php','pie_chart.php',str_replace('index.php','pie_chart.php',$_SERVER['REQUEST_URI']))); } else if (strpos(str_replace("https;","http;",substr(strtolower($inwithtz . " "),0,6)), "http;") !== false) { // co-ordinates longhand via prompt $inwithtz=read_and_array($inwithtz, str_replace('pie_chart.php','pie_chart.php',str_replace('index.php','pie_chart.php',$_SERVER['REQUEST_URI']))); } else if (strpos(str_replace("https:","http:",substr(strtolower($inwithtz . " "),0,6)), "http:") !== false) { // co-ordinates via URL via net $inwithtz=read_and_array($inwithtz, str_replace('pie_chart.php','pie_chart.php',str_replace('index.php','pie_chart.php',$_SERVER['REQUEST_URI']))); } else { if (isset($_POST['data'])) { echo "\n pardata=\"" . str_replace("+","%20",urlencode($inwith)) . "\"; \n"; echo "\n paramdata=\"" . str_replace('"','" + String.fromCharCode(34) + "',urldecode(str_replace("+","%20",$inwith))) . "\"; \n"; } return $inwith; } echo "\n pardata=\"" . urlencode($inwithtz) . "\"; "; echo "\n paramdata=\"" . str_replace('"','" + String.fromCharCode(34) + "',urldecode(str_replace("+","%20",$inwithz))) . "\"; \n"; // decodeURIComponent(pardata); \n"; return $inwithtz; } ?> Pie Chart - RJM Programming - //www.rjmprogramming.com.au (Copyright © 2013 rjmprogramming.com.au all rights reserved.) \n"; echo " \n"; if (!isset($_GET['desc']) && !isset($_POST['desc'])) { echo " \n"; } else { echo " \n"; } if ($amwv) { echo "

" . $GETtitle . " 🥧 Pie Chart 📊

\n"; } else { echo "

" . $GETtitle . " Pie Chart

\n"; } echo $bdivstart; ?>
Another pie chart? ' . "\n " . " function later() { \n" . ' var datalineprefix = " "; ' . "\n"; if (!isset($_GET['desc']) && !isset($_POST['desc']) && !isset($_GET['popularity']) && !isset($_POST['popularity'])) { echo ' var nfgval=0, fgval="", sfbits, fraction_game_template="", dlsa, dlp2="", exra = ""; ' . "\n"; echo ' var datalinesuffix = ""; ' . "\n"; echo ' var iof=0, extra = "", prefgval=location.search.split("val1=")[1] ? location.search.split("val1=")[1].split("&")[0] : null; ' . "\n"; echo ' var thisline = 1; ' . "\n"; echo ' var totalleft = 100.0; ' . "\n"; if ($fraction_game_template != "") { echo ' fraction_game_template="' . $fraction_game_template . '"; ' . "\n"; echo ' sfbits=fraction_game_template.split("&data=");' . "\n"; echo ' if (prefgval == null) prefgval = prompt("Enter Fraction as Numerator / Denominator ... eg. 1/4 ... Numerator should be less than or equal to Denominator", "1/4"); ' . "\n"; echo ' if (prefgval != null && fgval.indexOf("/") <= 0) { while (fgval.indexOf("/") <= 0) { if (prefgval != null) { fgval=prefgval; prefqval=null; } else { fgval = prompt("Enter Fraction as Numerator / Denominator ... eg. 1/4 ... Numerator should be less than or equal to Denominator", "1/4"); } if (fgval == null) fgval="1/4"; nfgval=fgval.split("/").length; if (nfgval != 2) { fgval=""; } else { if (eval(fgval.split("/")[0]) < 0 || eval(fgval.split("/")[1]) < 0 || eval(fgval.split("/")[0]) > eval(fgval.split("/")[1])) { fgval=""; } else { sfbits[0]=sfbits[0].replace("1/4",fgval); var num_count=0.0; var baseval=eval(fgval.split("/")[0]) / eval(fgval.split("/")[1]); fraction_game_template=sfbits[0] + "&fraction=y' . $njsuff . '&data="; var uptoone=0.0; while (uptoone < 1.0) { if ((eval(uptoone) + eval(baseval)) <= 1.0) { num_count+=eval(fgval.split("/")[0]); uptoone+=eval(baseval); fraction_game_template+=",%20[~" + fgval + "~," + eval(100.0 * baseval) + "]%20"; } else { fraction_game_template+=",%20[~" + ("" + eval(eval(fgval.split("/")[1] - num_count))) + ("/" + eval(fgval.split("/")[1])) + "%20(" + eval(1.0 - uptoone) + ")~," + eval(100.0 * eval(1.0 - uptoone)) + "]%20"; uptoone=1.0; } } } } } } ' . "\n"; echo ' if (allowed) window.location = fraction_game_template; ' . "\n"; } else { if ($dbval != "") { echo ' if (document.URL.indexOf("fraction=") != -1 || location.hash.indexOf("fraction=") != -1) { ' . "\n"; echo ' fraction_game_template="https://www.rjmprogramming.com.au/PHP/PieChart/pie_chart.php?title=Fraction%201/4&task=Part&desc=Percentage&onclick=y&data=,%20[~1/4~,25]%20,%20[~1/4~,25]%20,%20[~1/4~,25]%20,%20[~1/4~,25]"; ' . "\n"; echo ' sfbits=fraction_game_template.split("&data=");' . "\n"; echo ' if (prefgval == null) prefgval = prompt("Enter Fraction as Numerator / Denominator ... eg. 1/4 ... Numerator should be less than or equal to Denominator", "1/4"); ' . "\n"; echo ' if (prefgval != null && fgval.indexOf("/") <= 0) { while (fgval.indexOf("/") <= 0) { if (prefgval != null) { fgval=prefgval; prefqval=null; } else { fgval = prompt("Enter Fraction as Numerator / Denominator ... eg. 1/4 ... Numerator should be less than or equal to Denominator", "1/4"); } if (fgval == null) fgval="1/4"; nfgval=fgval.split("/").length; if (nfgval != 2) { fgval=""; } else { if (eval(fgval.split("/")[0]) < 0 || eval(fgval.split("/")[1]) < 0 || eval(fgval.split("/")[0]) > eval(fgval.split("/")[1])) { fgval=""; } else { sfbits[0]=sfbits[0].replace("1/4",fgval); var num_count=0.0; var baseval=eval(fgval.split("/")[0]) / eval(fgval.split("/")[1]); fraction_game_template=sfbits[0] + "&fraction=y' . $njsuff . '&data="; var uptoone=0.0; while (uptoone < 1.0) { if ((eval(uptoone) + eval(baseval)) <= 1.0) { num_count+=eval(fgval.split("/")[0]); uptoone+=eval(baseval); fraction_game_template+=",%20[~" + fgval + "~," + eval(100.0 * baseval) + "]%20"; } else { fraction_game_template+=",%20[~" + ("" + eval(eval(fgval.split("/")[1] - num_count))) + ("/" + eval(fgval.split("/")[1])) + "%20(" + eval(1.0 - uptoone) + ")~," + eval(100.0 * eval(1.0 - uptoone)) + "]%20"; uptoone=1.0; } } } } } } ' . "\n"; echo ' if (allowed) window.location = fraction_game_template; ' . "\n"; echo ' } else { ' . "\n"; echo ' var title = prompt("Enter Pie Chart Title (prefixes 2D or donut or background image URL or background image data URI ; separated (followed by ;) before title are available options, and suffix by &onclick=y for added onclick functionality, Email Attachment Title suffixes are &emailto=[emailTo] &emailsubject=[EmailSubject])", "My Daily Activities"); ' . "\n"; echo ' } ' . "\n"; } else { echo ' var title = prompt("Enter Pie Chart Title (prefixes 2d or donut or background image URL or background image data URI ; separated (followed by ;) before title are available options, and suffix by &onclick=y for added onclick functionality, Email Attachment Title suffixes are &emailto=[emailTo] &emailsubject=[EmailSubject])", "My Daily Activities"); ' . "\n"; } echo ' if (title != null) { if (title == "justmenu") { location.href="//www.rjmprogramming.com.au/PHP/butsel.php?justmenu=justmenu"; } ' . "\n"; echo ' var titles = title.split(";"); ' . "\n"; echo ' var task = prompt("Enter Activity Type", "Task"); ' . "\n"; echo ' var desc = prompt("Enter " + task + " Measure", "Percentage"); ' . "\n"; echo ' var datac = ""; ' . "\n"; echo ' var sq = "' . "'" . '"; ' . "\n"; echo " if (fti) { datalineprefix = ''; } else { datalineprefix = prompt('Enter ' + task + ' Type (can enter URL whose contents contains task,percentage sets or your own list entered here comma separated) ' + thisline + ' (optionally append with ' + '\\n\\n' + ',\"A tooltip (regarding {percent}) of some sort like {task}\" ' + '\\n\\n' + ' or maybe perhaps ' + '\\n\\n' + ',\"A tooltip (regarding {percent}) of some sort like {task}\"' + '\\n\\n' + ' as an example of what is possible with HTML included)', ''); } " . "\n"; echo ' if (datalineprefix != null) { datalineprefix=dlp(datalineprefix); iof=0; dlsa=datalineprefix.split(","); if (dlsa.length > 1 && (eval(-1 + iof + datalineprefix.indexOf(String.fromCharCode(39))) > eval(datalineprefix.indexOf(",")) && eval(-1 + iof + datalineprefix.indexOf(String.fromCharCode(34))) > eval(datalineprefix.indexOf(",")))) { while (eval(-1 + iof + datalineprefix.indexOf(String.fromCharCode(39))) > eval(datalineprefix.indexOf(",")) && eval(-1 + iof + datalineprefix.indexOf(String.fromCharCode(34))) > eval(datalineprefix.indexOf(","))) { datalineprefix=datalineprefix.replace(",", "%2C"); iof+=0; } } datalineprefix=datalineprefix.replace(/#/g, "%23"); if (datalineprefix.indexOf("{task}") != -1 && datalineprefix.indexOf(",") != -1) { dlsa=datalineprefix.split(","); if (dlsa.length > 1) { datalineprefix=datalineprefix.replace("{task}",encodeURIComponent(dlsa[0])).replace("{task}",encodeURIComponent(dlsa[0])); } } } ' . "\n"; echo ' while (datalineprefix.length != 0 && (desc.indexOf("ercent") == (0 - 1) || desc.indexOf(" ercent ") != (0 - 1) || (desc.indexOf("ercent") != (0 - 1) && totalleft > 0))) { ' . "\n"; echo ' if (datalinesuffix.length != 0) { ' . "\n"; //echo ' datalineprefix = prompt("Enter " + task + " Type " + thisline + " (for no more hit Cancel button)", ""); ' . "\n"; echo " if (fti) { datalineprefix = ''; } else { datalineprefix = prompt('Enter ' + task + ' Type (can enter URL whose contents contains task,percentage sets or your own list entered here comma separated) ' + thisline + ' (for no more please hit Cancel button and optionally append with ' + '\\n\\n' + ',\"A tooltip (regarding {percent}) of some sort like {task}\" ' + '\\n\\n' + ' or maybe perhaps ' + '\\n\\n' + ',\"A tooltip (regarding {percent}) of some sort like {task}\"' + '\\n\\n' + ' as an example of what is possible with HTML included)', ''); } " . "\n"; echo ' if (datalineprefix != null) { datalineprefix=dlp(datalineprefix); iof=0; dlsa=datalineprefix.split(","); if (dlsa.length > 1 && (eval(-1 + iof + datalineprefix.indexOf(String.fromCharCode(39))) > eval(datalineprefix.indexOf(",")) && eval(-1 + iof + datalineprefix.indexOf(String.fromCharCode(34))) > eval(datalineprefix.indexOf(",")))) { while (eval(-1 + iof + datalineprefix.indexOf(String.fromCharCode(39))) > eval(datalineprefix.indexOf(",")) && eval(-1 + iof + datalineprefix.indexOf(String.fromCharCode(34))) > eval(datalineprefix.indexOf(","))) { datalineprefix=datalineprefix.replace(",", "%2C"); iof+=0; } } datalineprefix=datalineprefix.replace(/#/g, "%23"); if (datalineprefix.indexOf("{task}") != -1 && datalineprefix.indexOf(",") != -1) { dlsa=datalineprefix.split(","); if (dlsa.length > 1) { datalineprefix=datalineprefix.replace("{task}",encodeURIComponent(dlsa[0])).replace("{task}",encodeURIComponent(dlsa[0])); } } } ' . "\n"; echo ' } ' . "\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 (desc.indexOf("ercent") != (0 - 1) && desc.indexOf(" ercent ") == (0 - 1)) extra = " (for " + totalleft + " enter nothing or hit Cancel button)"; ' . "\n"; echo ' if (fti) { datalinesuffix = ""; } else { datalinesuffix = prompt("Enter " + desc.replace(" ercent ", "") + " " + thisline + extra, "0"); } ' . "\n"; echo ' if (datalinesuffix == null && desc.indexOf("ercent") != (0 - 1) && desc.indexOf(" ercent ") == (0 - 1)) datalinesuffix = totalleft; ' . "\n"; echo ' if (datalinesuffix == null) datalinesuffix = "0"; ' . "\n"; echo ' if (datalinesuffix != null) datalineprefix = datalineprefix.replace("{percent}", datalinesuffix + "%"); ' . "\n"; echo ' if (datalinesuffix.length == 0) { ' . "\n"; echo ' datalinesuffix = eval(totalleft); ' . "\n"; echo ' totalleft = 0; ' . "\n"; echo ' } else if (eval(totalleft) == eval(datalinesuffix) && desc.indexOf("ercent") != (0 - 1) && desc.indexOf(" ercent ") == (0 - 1)) { ' . "\n"; echo ' totalleft = 0; ' . "\n"; echo ' } else if (eval(datalinesuffix) > eval(totalleft) && desc.indexOf("ercent") != (0 - 1) && desc.indexOf(" ercent ") == (0 - 1)) { ' . "\n"; echo ' datalinesuffix = eval(totalleft); ' . "\n"; echo ' totalleft = 0; ' . "\n"; echo ' } else if (eval(datalinesuffix) > eval(totalleft) && desc.indexOf("ercent") == (0 - 1) && desc.indexOf(" ercent ") == (0 - 1)) { ' . "\n"; echo ' desc = desc + " ercent "; ' . "\n"; echo ' } else { ' . "\n"; echo ' totalleft = eval(totalleft) - eval(datalinesuffix); ' . "\n"; echo ' } ' . "\n"; echo ' if (datalineprefix.indexOf(",") != -1 && (datalineprefix.indexOf(String.fromCharCode(39)) != -1 || datalineprefix.indexOf(String.fromCharCode(34)) != -1)) { exra=String.fromCharCode(39) + String.fromCharCode(39) + ","; datac = datac + ", [~" + datalineprefix.replace(",","~,").replace("<","%3C").replace(">","%3E").replace("<","%3C").replace(">","%3E").replace("<","%3C").replace(">","%3E").replace("<","%3C").replace(">","%3E").replace("<","%3C").replace(">","%3E").replace("<","%3C").replace(">","%3E").replace("<","%3C").replace(">","%3E").replace("<","%3C").replace(">","%3E") + "," + datalinesuffix + "] "; ' . "\n"; echo ' } else { if (exra != "") { exra=String.fromCharCode(39) + datalinesuffix + "%" + String.fromCharCode(39) + ","; } datac = datac + ", [~" + datalineprefix + "~," + exra + datalinesuffix + "] "; ' . "\n"; echo ' } ' . "\n" . ' thisline++; ' . "\n"; echo ' } ' . "\n"; echo ' } ' . "\n"; echo ' if (document.URL.indexOf("fraction=") != -1) { ' . "\n"; echo ' if (allowed) { var wl = toolong("./pie_chart.php?title=" + title + "&task=" + task + "&fraction=y" + nojwinextra + "&desc=" + desc.replace(" ercent ", "") + "&data=" + datac); if (wl != "#") { window.location=wl; } } ' . "\n"; echo ' } else { ' . "\n"; echo ' if (allowed) { var wl = toolong("./pie_chart.php?title=" + title + "&task=" + task + nojwinextra + "&desc=" + desc.replace(" ercent ", "") + "&data=" + datac); if (wl != "#") { window.location=wl; } } ' . "\n"; echo ' } ' . "\n"; echo "} \n"; } } echo "} \n"; //} echo " function xxdlp(thisris) { if (thisris != null) { var commacount=thisris.toLowerCase().replace(/\<\/td\>/g,' , ').indexOf(','); if (commacount != -1) { commacount=(thisris + ' ').substring(eval(1 + commacount)).toLowerCase().replace(/\<\/td\>/g,' , ').indexOf(','); } if (thisris.toLowerCase().replace('https:','http:').indexOf('http:') == 0) { fti=true; allowed=true; datac=thisris; //alert(99); } else if (commacount >= 0 && document.getElementById('myoptform') && document.getElementById('myoptsbutton')) { // myoptform post via myoptsbutton click var thatris=thisris; while (thatris.indexOf(String.fromCharCode(10)) != -1) { thatris=thatris.replace(String.fromCharCode(10), ','); } thatris=thatris.replace(/\,\,/g,','); fti=true; allowed=true; datac='http;' + thatris; thisris='http;' + thatris; //alert(199); } } return thisris; } \n"; echo "\n function fixmenu() { \n"; $mo="-1"; if (preg_match("/(android|ipad|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"])) $mo="-99"; // { echo " if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) || document.URL.indexOf('just' + 'menu') != " . $mo . ") { var oiagc=document.getElementById('iagc'); \n if (oiagc != null) { oiagc.style.width=600; oiagc.style.height=400; \n"; if (file_exists("../justmenuWebView.html")) { echo " if (document.URL.indexOf('https:') == 0) { oiagc.src='https://www.rjmprogramming.com.au/PHP/justmenuWebView.html' + button_select_to; if (1 == 2) { setTimeout(placemissing,2000); } } else { oiagc.src='//www.rjmprogramming.com.au/PHP/justmenuWebView.html' + button_select_to; if (1 == 2) { setTimeout(placemissing,2000); } } var oiagcs=document.getElementsByTagName('a'); \n for (var ity=0; ity' . "\n"; ?>