'); fclose($file_handle); if (file_exists("../GeoChart/geo_chart.php")) { $file_handle = fopen("../GeoChart/GeoChart_" . $timesuff . ".html", "w"); fwrite($file_handle, '
'); fclose($file_handle); } $lastgo = "   Last" . "  Email  W?  H?  -"; if (isset($_GET['isMobile'])) { $lastgo .= '   Another?' . $lastgo . "\n"; } else { $lastgo .= '   Another?'; } } else if (strlen($inst) > 0 && file_exists("TestIntensityChart_" . $rma . ".url")) { $file_handle = fopen("TestIntensityChart_" . $rma . ".url", "r"); $rma=fgets($file_handle); fclose($file_handle); $timesuff = date("Y-m-d-H-i-s"); while (file_exists("IntensityChart_" . $rma . "_" . $timesuff . ".html")) { $timesuff = date("Y-m-d-H-i-s"); } $file_handle = fopen("IntensityChart_" . $timesuff . ".html", "w"); fwrite($file_handle, '
'); fclose($file_handle); if (file_exists("../GeoChart/geo_chart.php")) { $file_handle = fopen("../GeoChart/GeoChart_" . $timesuff . ".html", "w"); fwrite($file_handle, '
'); fclose($file_handle); } $rma = "   Last" . "  Email  W?  H?"; if (isset($_GET['isMobile'])) { $rma .= '

   Another?' . $lastgo . "\n"; } else { $rma .= '

   Another?'; } $lastgo = $rma; } return $rma; } function retval($inv) { if (strpos($inv, "E-") !== false) return "0"; return $inv; } echo '' . "\n"; echo ' ' . "\n"; echo 'Intensity Map - RJM Programming - http://www.rjmprogramming.com.au (Copyright © 2013 rjmprogramming.com.au all rights reserved.)' . "\n"; echo '' . "\n"; echo '' . "\n"; echo '' . "\n"; echo ' \n"; echo ' ' . " \n"; //echo " \n"; echo "
\n"; if (isset($_GET['isMobile'])) { echo "

" . $GETtitle . " Intensity Map

\n"; } else { echo "

" . $GETtitle . " Intensity Map

\n"; } if (!isset($_GET['isMobile']) || isset($_GET['population'])) { echo '
' . "\n"; if (isset($_GET['isMobile'])) { echo ' Another intensity map?' . $lastgo . "\n"; } else { echo ' Another intensity map?' . $lastgo . "\n"; } } if (!isset($_GET['population'])) { if (isset($_GET['isMobile'])) { echo '
' . "\n"; echo '
' . "\n"; echo '
' . "\n"; echo '' . "\n"; echo '' . "\n"; echo '' . "\n"; echo '' . "\n"; echo '' . "\n"; echo '' . "\n"; echo '' . "\n"; echo '
Title
Via
Basis1
Basis2
' . server_remote_addr('1') . '
' . "\n"; echo '
' . "\n"; //echo '
' . "\n"; if (strpos($lastgo, "Another") === false) { if (isset($_GET['isMobile'])) { echo ' Another intensity map?' . $lastgo . "\n"; } else { echo ' Another intensity map?' . $lastgo . "\n"; } } } echo '<' . 'script' . ' type="text/javascript">' . "\n "; if (!isset($_GET['isMobile'])) { //echo '<' . 'script type="text/javascript">' . "\n"; echo ' setTimeout(prelater, 2 * 1000);' . "\n"; //echo '<' . '/' . 'script>' . "\n"; } echo ' function clearit() { ' . "\n" . ' if (document.getElementById("data").style.backgroundColor.indexOf("yellow") != (0 - 1)) document.getElementById("data").value=""; ' . "\n"; echo ' if (document.getElementById("title").style.backgroundColor.indexOf("yellow") != (0 - 1)) document.getElementById("title").value=""; ' . "\n"; echo ' if (document.getElementById("width").style.backgroundColor.indexOf("yellow") != (0 - 1)) document.getElementById("width").value=""; ' . "\n"; echo ' if (document.getElementById("height").style.backgroundColor.indexOf("yellow") != (0 - 1)) document.getElementById("height").value=""; ' . "\n"; echo ' if (document.getElementById("country").style.backgroundColor.indexOf("yellow") != (0 - 1)) document.getElementById("country").value=""; ' . "\n"; echo ' if (document.getElementById("population").style.backgroundColor.indexOf("yellow") != (0 - 1)) document.getElementById("population").value=""; ' . "\n"; echo ' if (document.getElementById("area").style.backgroundColor.indexOf("yellow") != (0 - 1)) document.getElementById("area").value=""; ' . "\n" . ' } ' . "\n"; echo "function prelater() { \n later('','','','','','',''); \n } \n function later(t,w,h,c,p,a,m) { \n" . ' var datalineprefix = " "; ' . "\n"; echo ' var datalinesuffix = ""; ' . "\n"; echo ' var extra = ""; ' . "\n"; echo ' var thisline = 1; ' . "\n"; echo ' var totalleft = 100.0; ' . "\n"; echo ' var title = ""; ' . "\n"; echo ' var width = "' . $GETwidth . '"; ' . "\n"; echo ' var height = "' . $GETheight . '"; ' . "\n"; echo ' var country = ""; ' . "\n"; echo ' var population = ""; ' . "\n"; echo ' var area = ""; ' . "\n"; echo ' if ((t.length + w.length + h.length + c.length + p.length + a.length) == 0) { ' . "\n"; echo ' title = prompt("Enter Intensity Map Title", "' . $GETtitle . '"); ' . "\n"; echo ' } ' . "\n"; echo ' if ((t.length + w.length + h.length + c.length + p.length + a.length) != 0) { ' . "\n"; echo ' title = t; ' . "\n"; echo ' width = w; ' . "\n"; echo ' height = h; ' . "\n"; echo ' country = c; ' . "\n"; echo ' population = p; ' . "\n"; echo ' area = a; ' . "\n"; echo ' } else if (title != null) { ' . "\n"; echo ' if (1 == 2) { ' . "\n"; echo ' width = prompt("Enter Intensity Map Width", "' . $GETwidth . '"); ' . "\n"; echo ' height = prompt("Enter Intensity Map Height", "' . $GETheight . '"); ' . "\n"; echo ' } ' . "\n"; echo ' country = prompt("Enter Country Label", "' . $GETcountry . '"); ' . "\n"; echo ' population = prompt("Enter " + country + " first Measure", "' . $GETpopulation . '"); ' . "\n"; echo ' area = prompt("Enter " + country + " second Measure", "' . $GETarea . '"); ' . "\n"; echo ' } ' . "\n"; echo ' var datac = ""; ' . "\n"; echo ' var sq = "' . "'" . '"; ' . "\n"; echo ' datalineprefix = prompt("Enter " + country + " Name " + thisline, ""); if (datalineprefix == null) { datalineprefix=""; } ' . "\n"; echo ' while (datalineprefix.length != 0 && (population.indexOf("ercent") == (0 - 1) || population.indexOf(" ercent ") != (0 - 1) || (population.indexOf("ercent") != (0 - 1) && totalleft > 0))) { ' . "\n"; echo ' if (datalinesuffix.length != 0) datalineprefix = prompt("Enter " + country + " Name " + 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 (population.indexOf("ercent") != (0 - 1) && population.indexOf(" ercent ") == (0 - 1)) extra = " (for " + totalleft + " enter nothing or hit Cancel button)"; ' . "\n"; echo ' datalinesuffix = prompt("Enter " + population.replace(" ercent ", "") + "," + area.replace(" ercent ", "") + " " + thisline + extra, "0,0"); ' . "\n"; echo ' if (datalinesuffix == null && population.indexOf("ercent") != (0 - 1) && population.indexOf(" ercent ") == (0 - 1)) datalinesuffix = totalleft; ' . "\n"; echo ' if (datalinesuffix == null) datalinesuffix = "0,0"; ' . "\n"; /* echo ' if (datalinesuffix.length == 0) { ' . "\n"; echo ' datalinesuffix = eval(totalleft); ' . "\n"; echo ' totalleft = 0; ' . "\n"; echo ' } else if (eval(totalleft) == eval(datalinesuffix) && population.indexOf("ercent") != (0 - 1) && population.indexOf(" ercent ") == (0 - 1)) { ' . "\n"; echo ' totalleft = 0; ' . "\n"; echo ' } else if (eval(datalinesuffix) > eval(totalleft) && population.indexOf("ercent") != (0 - 1) && population.indexOf(" ercent ") == (0 - 1)) { ' . "\n"; echo ' datalinesuffix = eval(totalleft); ' . "\n"; echo ' totalleft = 0; ' . "\n"; echo ' } else if (eval(datalinesuffix) > eval(totalleft) && population.indexOf("ercent") == (0 - 1) && population.indexOf(" ercent ") == (0 - 1)) { ' . "\n"; echo ' population = population + " 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 (!isset($_GET['isMobile'])) { echo ' window.location = "./intensity_chart.php?title=" + title + m + "&width=" + width + "&height=" + height + "&country=" + country + "&area=" + area.replace(" ercent ", "") + "&population=" + population.replace(" ercent ", "") + "&data=" + datac; ' . "\n"; } else { echo ' window.location = "./intensity_chart.php?isMobile=y&title=" + title + m + "&width=" + width + "&height=" + height + "&country=" + country + "&area=" + area.replace(" ercent ", "") + "&population=" + population.replace(" ercent ", "") + "&data=" + datac; ' . "\n"; } echo "} \n"; // . "} \n"; echo '' . "\n"; } echo '
Menu' . "\n"; //if (!isset($_GET['isMobile'])) { // echo '<' . 'script type="text/javascript">' . "\n"; // echo 'setTimeout(prelater, 2 * 1000);' . "\n"; // echo '<' . '/' . 'script>' . "\n"; //} ?>