'; if (isset($_GET['jigsaw'])) { //$mapstyle = ''; $mapstyle = 'usemap="#sh80879"'; $rhs = 'background-color:red;'; $two='opacity:0.1;z-index:20;'; //$bodystuff = ' onclick="fomc(event);" onmousemove="fomm(event);" onmousedown="fomd(event);"'; $bodystuff = ' ontouchdown="fomd(event);" onmousedown="fomd(event);"'; $astyle = "\n" . '' . "\n"; $downbot = str_replace('', "\n" . '', $downbot); $mapstuff = ' onclick="ffoc(this.id);" '; } if (isset($_GET['ajaxindiaplusstate'])) { if (file_exists(dirname(__FILE__) . "/" . str_replace(" ", "+", strtolower(urldecode($_GET['ajaxindiaplusstate']))) . ".smalltalk")) { echo "

Thanks to Wikipedia ...

" . file_get_contents(dirname(__FILE__) . "/" . str_replace(" ", "+", strtolower(urldecode($_GET['ajaxindiaplusstate']))) . ".smalltalk"); exit; } } else if (isset($_GET['indiaplusstate'])) { if (file_exists(dirname(__FILE__) . "/" . str_replace(" ", "+", strtolower(urldecode($_GET['indiaplusstate']))) . ".smalltalk")) { $divinfo = "

Thanks to Wikipedia ...

" . file_get_contents(dirname(__FILE__) . "/" . str_replace(" ", "+", strtolower(urldecode($_GET['indiaplusstate']))) . ".smalltalk"); } } $bubblechart = ""; $treemapchart = ""; $mapchart = ""; $piechart = ""; $columnchart = ""; $timelinechart = ""; $numstates = 0; $wording = array(); $coordstring = array(); $urls = array(); $blurbs = array(); $literacy = array(); $population = array(); $density = array(); $latis = array(); $longis = array(); $cols = array("#afeeee", "#ffe4b5", "#d3d3d3", "#ffdead", "#eee8aa", "#ffebcd", "#fff8dc", "#ffa500", "#faebd7", "#f8f8ff", "#f0fff0", "#fffafa", "#ffffe0", "#e0ffff", "#fff0f5", "#e6e6fa", "#f5f5f5", "#fffacd", "#f0ffff", "#fffff0", "#f5fffa", "#ffefd5", "#f0e68c", "#ffe4c4", "#fdf5e6", "#fffaf0"); // $mobilefishstring = ' click map  . idize("Tamil Nadu") .  . idize("Kerala") .  . idize("Goa") .  . idize("Jammu and Kashmir") .  . idize("Himachal Pradesh") .  . idize("Punjab") .  . idize("Uttarakhand") .  . idize("National Capital Territory of New Delhi") .  . idize("Haryana") .  . idize("Uttar Pradesh") .  . idize("Bihar") .  . idize("Jharkhand") .  . idize("West Bengal") .  . idize("Sikkim") .  . idize("Arunachal Pradesh") .  . idize("Tripura") .  . idize("Meghalaya") .  . idize("Assam") .  . idize("Odisha") .  . idize("Chhattisgarh") .  . idize("Telangana") .  . idize("Andhra Pradesh") .  . idize("Karnataka") .  . idize("Maharashtra") .  . idize("Madhya Pradesh") .  . idize("Gujarat") .  . idize("Rajasthan") .  . idize("Mizoram") .  . idize("Manipur") .  . idize("Nagaland") . '; function hrefize($t) { if (isset($_GET['jigsaw'])) return ''; return str_replace('""','"',str_replace('href=h', 'href="h', ($t . '"'))); } function idize($t) { return '"' . $t . '" id="sR' . str_replace("Jammu_and_Kashmir", "JAK", str_replace("National_Capital_Territory_of_New_Delhi", "NCTND", str_replace(" ", "_", str_replace("+", "_", $t)))) . '"'; } function tableize($t) { if ($t == "") return $t; return "" . str_replace("", "", str_replace("", "", $t)))) . "

Google Chart ideas below ...

" . ""; } function randomize($midtoend) { $retval = $midtoend; $newmidbit = '" points="'; $newlastbit = str_replace($newmidbit, '', $midtoend); $newmidbit = '" class="draggable" onclick="oc(event);" onmousedown="omd(event);" onmousemove="omm(event);" ondragstart="drag(event)" draggable="true" points="'; $xoff = rand(0, 300); $yoff = rand(0, 800); $newstartbit = "_" . $xoff . "_" . $yoff; $xylist = explode(",", $newlastbit); $retval = $newstartbit . $newmidbit . ($xylist[0] + $xoff); for ($ip=1; $ip 1) { for ($ii=(sizeof($huhs) - 1); $ii>=1; $ii--) { if (strtolower(str_replace("file", "http", strtolower(substr($huhs[$ii], 0, 4)))) == "http") { $outth = $outth; } else if (substr($huhs[$ii], 0, 1) != "/" && substr($huhs[$ii], 0, 1) != "'" && substr($huhs[$ii], 0, 1) != '"') { $outth = str_replace($huhs[$ii], $udirname . $huhs[$ii], $outth); } else if (substr($huhs[$ii], 1, 1) != "/" && substr($huhs[$ii], 0, 1) != "'" && substr($huhs[$ii], 0, 1) != '"') { $outth = str_replace($huhs[$ii], substr($udirname, 0, (strlen($udirname) - 1)) . $huhs[$ii], $outth); } } } } } return $outth; } function nextnumber($inst) { $startfound = false; $endfound = false; $cn = "00"; $jh = 0; while (!$endfound && $jh < strlen($inst)) { if (!$startfound && (substr($inst, $jh, 1) == ">" || substr($inst, $jh, 1) == ">") && substr($inst, ($jh + 1), 1) >= "0" && substr($inst, ($jh + 1), 1) <= "9") { $startfound = true; //file_put_contents(dirname(__FILE__) . "/xxx.zz", file_get_contents(dirname(__FILE__) . "/xxx.zz") . "yes" . $cn . "\n"); $cn = ""; } else if ($startfound && ((substr($inst, $jh, 1) >= "0" && substr($inst, $jh, 1) <= "9") || substr($inst, $jh, 1) == ".")) { $cn .= substr($inst, $jh, 1); //file_put_contents(dirname(__FILE__) . "/xxx.zz", file_get_contents(dirname(__FILE__) . "/xxx.zz") . $cn . "\n"); } else if ($startfound && substr($inst, $jh, 1) == "/") { $endfound = true; } else if ($startfound && substr($inst, $jh, 1) == "%") { $endfound = true; } else if ($startfound && substr($inst, $jh, 1) == "&") { $endfound = true; } else if ($startfound && (substr($inst, $jh, 1) >= "A" && substr($inst, $jh, 1) <= "Z")) { $endfound = true; } else if ($startfound && (substr($inst, $jh, 1) >= "a" && substr($inst, $jh, 1) <= "z")) { $endfound = true; } else if ($startfound && substr($inst, $jh, 1) == " ") { $endfound = true; } else if ($startfound && substr($inst, $jh, 1) == "<") { $endfound = true; } $jh++; } //file_put_contents(dirname(__FILE__) . "/xxx.zz", file_get_contents(dirname(__FILE__) . "/xxx.zz") . $cn . "\n"); return $cn; } function nextdate($inst) { $startfound = false; $endfound = false; $cn = "00"; $day = "1"; $month = "1"; $jh = 0; while (!$endfound && $jh < strlen($inst)) { if (!$startfound && (substr($inst, $jh, 1) == ">" || substr($inst, $jh, 1) == ">") && substr($inst, ($jh + 1), 1) >= "0" && substr($inst, ($jh + 1), 1) <= "9") { $startfound = true; $dateis = explode(" ", str_replace(" ", " ", str_replace("<", " ", str_replace(" ", " ", substr($inst, ($jh + 1)))))); if (sizeof($dateis) >= 3) { $endfound = true; $day = $dateis[0]; $month = $dateis[1]; if ($dateis[1] == "Jan" || $dateis[1] == "January") $month = "1"; if ($dateis[1] == "Feb" || $dateis[1] == "February") $month = "2"; if ($dateis[1] == "Mar" || $dateis[1] == "March") $month = "3"; if ($dateis[1] == "Apr" || $dateis[1] == "April") $month = "4"; if ($dateis[1] == "May" || $dateis[1] == "May") $month = "5"; if ($dateis[1] == "Jun" || $dateis[1] == "June") $month = "6"; if ($dateis[1] == "Jul" || $dateis[1] == "July") $month = "7"; if ($dateis[1] == "Aug" || $dateis[1] == "August") $month = "8"; if ($dateis[1] == "Sep" || $dateis[1] == "September") $month = "9"; if ($dateis[1] == "Oct" || $dateis[1] == "October") $month = "10"; if ($dateis[1] == "Nov" || $dateis[1] == "November") $month = "11"; if ($dateis[1] == "Dec" || $dateis[1] == "December") $month = "12"; if (substr($month,0,1) < "1" || substr($month,0,1) > "9") return $dateis[0] . ",1,1"; return $dateis[2] . "," . $month . "," . $day; } //file_put_contents(dirname(__FILE__) . "/xxx.zz", file_get_contents(dirname(__FILE__) . "/xxx.zz") . "yes" . $cn . "\n"); $cn = ""; } else if ($startfound && ((substr($inst, $jh, 1) >= "0" && substr($inst, $jh, 1) <= "9") || substr($inst, $jh, 1) == ".")) { $cn .= substr($inst, $jh, 1); //file_put_contents(dirname(__FILE__) . "/xxx.zz", file_get_contents(dirname(__FILE__) . "/xxx.zz") . $cn . "\n"); } else if ($startfound && substr($inst, $jh, 1) == "/") { $endfound = true; } else if ($startfound && substr($inst, $jh, 1) == "%") { $endfound = true; } else if ($startfound && substr($inst, $jh, 1) == "&") { $endfound = true; } else if ($startfound && (substr($inst, $jh, 1) >= "A" && substr($inst, $jh, 1) <= "Z")) { $endfound = true; } else if ($startfound && (substr($inst, $jh, 1) >= "a" && substr($inst, $jh, 1) <= "z")) { $endfound = true; } else if ($startfound && substr($inst, $jh, 1) == " ") { $endfound = true; } else if ($startfound && substr($inst, $jh, 1) == "<") { $endfound = true; } $jh++; } //file_put_contents(dirname(__FILE__) . "/xxx.zz", file_get_contents(dirname(__FILE__) . "/xxx.zz") . $cn . "\n"); return $cn; } function processmap($inmap) { global $numstates, $wording, $coordstring, $urls, $blurbs, $mapchart, $columnchart, $timelinechart, $piechart, $treemapchart, $bubblechart, $downbot, $cols, $two, $literacy, $population, $density, $latis, $longis; $suffix = "
"; $atitle = explode(' title="', $inmap); for ($i=1; $i 0) { $mapchart = "\n"; } else { $mapchart = "\n"; } } else { $mapchart = "\n"; } } for ($i=1; $i 1) { //file_put_contents(dirname(__FILE__) . "/aa.z", str_replace(".", "_", $lats[1])); $alatlong = explode("_", $lats[1]); $latlong = explode("_", str_replace(".", "_", $lats[1])); if (sizeof($latlong) >= 6) { if ($alatlong[1] == "S") { $xlat = (0.0 - $alatlong[0]); if ($alatlong[3] == "W") { $xlong = (0.0 - $alatlong[2]); } else if ($latlong[3] == "E") { $xlong = (0.0 + $alatlong[2]); } } else if ($alatlong[1] == "N") { $xlat = (0.0 + $alatlong[0]); if ($alatlong[3] == "W") { $xlong = (0.0 - $alatlong[2]); } else if ($alatlong[3] == "E") { $xlong = (0.0 + $alatlong[2]); } } else if ($latlong[2] == "S") { $xlat = (0.0 - $latlong[0]) + ($latlong[1] / 60.0); if ($latlong[5] == "W") { $xlong = (0.0 - $latlong[3]) + ($latlong[4] / 60.0); } else if ($latlong[5] == "E") { $xlong = (0.0 + $latlong[3]) + ($latlong[4] / 60.0); } } else if ($latlong[2] == "N") { $xlat = (0.0 + $latlong[0]) + ($latlong[1] / 60.0); if ($latlong[5] == "W") { $xlong = (0.0 - $latlong[3]) + ($latlong[4] / 60.0); } else if ($latlong[5] == "E") { $xlong = (0.0 + $latlong[3]) + ($latlong[4] / 60.0); } } else if ($latlong[3] == "S") { $xlat = (0.0 - $latlong[0]) + ($latlong[1] / 60.0) + ($latlong[2] / 3600.0); } else if ($latlong[3] == "N") { $xlat = (0.0 + $latlong[0]) + ($latlong[1] / 60.0) + ($latlong[2] / 3600.0); } if ($latlong[7] == "W") { $xlong = (0.0 - $latlong[4]) + ($latlong[5] / 60.0) + ($latlong[6] / 3600.0); } else if ($latlong[7] == "E") { $xlong = (0.0 + $latlong[4]) + ($latlong[5] / 60.0) + ($latlong[6] / 3600.0); } if ($xlat != 0.0 && $xlong != 0.0) $mapchart = str_replace("", "", $mapchart); //file_put_contents(dirname(__FILE__) . "/a.z", $lats[0] . " ... " . $lats[3] . " ... " . $xlat . " , " . $xlong); } } $estdates = explode(">Establish", $blurbs[sizeof($urls) - 1]); $preareas = explode(">Area", $blurbs[sizeof($urls) - 1]); $lits = explode("Literacy<", $blurbs[sizeof($urls) - 1]); $dens = explode("Density<", $blurbs[sizeof($urls) - 1]); $prepops = explode(">Population", $blurbs[sizeof($urls) - 1]); if (sizeof($prepops) > 1) { $pops = explode(">Urban", $prepops[1]); if (sizeof($pops) == 1) { $pops = explode("Total", $prepops[1]); } else { $ptwo = 2; $apops = explode("Total", $prepops[1]); if (sizeof($apops) > 1) { if (strlen($apops[0]) < strlen($pops[0])) { $ptwo = 1; $pops = explode("Total", $prepops[1]); } } if ($ptwo == 2) $popsrural = explode(">Rural", $prepops[1]); } } else { $pops = explode("Total", "ngfdhgfdg"); } if (sizeof($dens) == 1 && sizeof($pops) >= 2) { $prepops = explode(">Area", $blurbs[sizeof($urls) - 1]); if (sizeof($prepops) > 1) { $dtwo = 2; $dens = explode("Total", $prepops[1]); // calculate density as population / area } } //file_put_contents(dirname(__FILE__) . "/x.z", file_get_contents(dirname(__FILE__) . "/x.z") . $wording[sizeof($urls) - 1] . " " . sizeof($lits) . " " . sizeof($dens) . " " . sizeof($pops) . "\n"); if (sizeof($estdates) > 1) { if ($timelinechart == "") { $timelinechart = "\n
\n"; } $timelinechart = str_replace("data=,", "", str_replace("\" />", ",[newDate(" . nextdate(substr($estdates[1],11)) . "),1,~" . str_replace(" ", "%20", $wording[sizeof($urls) - 1]) . "~,~Establishment%20Date~,1,~" . str_replace(" ", "%20", $wording[sizeof($urls) - 1]) . "~,~Establishment%20Date~]\" />", $timelinechart)); } if (sizeof($preareas) > 1) { $areatots = explode("Total", $preareas[1]); if (sizeof($areatots) > 1) { if ($columnchart == "") { $columnchart = "\n\n
\n"; //$columnchart = "\n
\n"; //$columnchart = "\n
\n"; } $columnchart = str_replace("\" />", ",[~" . $wording[sizeof($urls) - 1] . "~," . nextnumber($areatots[1]) . "]\" />", $columnchart); } } if (sizeof($pops) >= 2 && (sizeof($lits) < 2 || sizeof($dens) < 2)) { $population[sizeof($urls) - 1] = nextnumber($pops[1]); if ($ptwo == 2) $population[sizeof($urls) - 1] += nextnumber($popsrural[1]); if ($piechart == "") { //http://www.rjmprogramming.com.au/PHP/PieChart/pie_chart.php?title=Population%20by%20Region%20in%20India&task=Population&desc=Percentage&data=,%20[~Tamil%20Nadu~,10]%20,%20[~Odisha~,90] $piechart = "\n
\n"; } $piechart = str_replace("\" />", ", [~" . $wording[sizeof($urls) - 1] . "~,0] \" />", $piechart); } else if (sizeof($pops) >= 1 && (sizeof($lits) < 2 || sizeof($dens) < 2)) { $population[sizeof($urls) - 1] = nextnumber($pops[0]); if ($piechart == "") { //http://www.rjmprogramming.com.au/PHP/PieChart/pie_chart.php?title=Population%20by%20Region%20in%20India&task=Population&desc=Percentage&data=,%20[~Tamil%20Nadu~,10]%20,%20[~Odisha~,90] $piechart = "\n
\n"; } $piechart = str_replace("\" />", ", [~" . $wording[sizeof($urls) - 1] . "~,0] \" />", $piechart); } else if (sizeof($lits) >= 2 && sizeof($dens) >= 2 && sizeof($pops) >= 2) { $population[sizeof($urls) - 1] = nextnumber($pops[1]); if ($ptwo == 2) $population[sizeof($urls) - 1] += nextnumber($popsrural[1]); $tpop += $population[sizeof($urls) - 1]; $ipop++; //file_put_contents(dirname(__FILE__) . "/xx.zz", file_get_contents(dirname(__FILE__) . "/xx.zz") . $wording[sizeof($urls) - 1] . " pop " . $literacy[sizeof($urls) - 1] . " " . $density[sizeof($urls) - 1] . " " . $population[sizeof($urls) - 1] . "\n"); $density[sizeof($urls) - 1] = nextnumber($dens[1]); if ($dtwo == 2 && 2 == 2) { $dd = $density[sizeof($urls) - 1]; $density[sizeof($urls) - 1] = ((0.01 + $population[sizeof($urls) - 1]) / $dd); } //file_put_contents(dirname(__FILE__) . "/xx.zz", file_get_contents(dirname(__FILE__) . "/xx.zz") . $wording[sizeof($urls) - 1] . " dens " . $literacy[sizeof($urls) - 1] . " " . $density[sizeof($urls) - 1] . " " . $population[sizeof($urls) - 1] . "\n"); $literacy[sizeof($urls) - 1] = nextnumber($lits[1]); if ($bubblechart == "") { $bubblechart = "\n
\n"; } //http://www.rjmprogramming.com.au/PHP/TreemapChart/treemap_chart.php?title=Literacy%20versus%20Population%20Density%20in%202011%20in%20India&label=%27India%27&value=%27Region%27,%20%27Literacy%20%28%%29%27,%20%27Population%20Density%20%28per%20square%20km%29%27&data=,%20[~India~,null,0,0]%20,%20[~Kerala~,%27India%27,10,10]%20,%20[~Tamil%20Nadu~,%27India%27,20,20] if ($treemapchart == "") { $treemapchart = "\n
\n"; } if ($piechart == "") { //http://www.rjmprogramming.com.au/PHP/PieChart/pie_chart.php?title=Population%20by%20Region%20in%20India&task=Population&desc=Percentage&data=,%20[~Tamil%20Nadu~,10]%20,%20[~Odisha~,90] $piechart = "\n
\n"; } //$bubblechart = str_replace("' />", ",%20[~~," . $literacy[sizeof($urls) - 1] . "," . $density[sizeof($urls) - 1] . ",%27" . str_replace(" ", "%20", $wording[sizeof($urls) - 1]) . "%27," . $population[sizeof($urls) - 1] . "]%20' />", $bubblechart); $bubblechart = str_replace("\" />", ", [~~," . $literacy[sizeof($urls) - 1] . "," . $density[sizeof($urls) - 1] . ",'" . $wording[sizeof($urls) - 1] . "'," . $population[sizeof($urls) - 1] . "] \" />", $bubblechart); $treemapchart = str_replace("\" />", ", [~" . $wording[sizeof($urls) - 1] . "~,'India'," . $literacy[sizeof($urls) - 1] . "," . $density[sizeof($urls) - 1] . "] \" />", $treemapchart); $piechart = str_replace("\" />", ", [~" . $wording[sizeof($urls) - 1] . "~,0] \" />", $piechart); //file_put_contents(dirname(__FILE__) . "/xx.zz", file_get_contents(dirname(__FILE__) . "/xx.zz") . $wording[sizeof($urls) - 1] . " " . $literacy[sizeof($urls) - 1] . " " . $density[sizeof($urls) - 1] . " " . $population[sizeof($urls) - 1] . "\n"); } if (1 == 2) { try { $doc = new DOMDocument(); $doc->preserveWhiteSpace = FALSE; $before = libxml_use_internal_errors(true); $doc->loadHTML($blurbs[sizeof($urls) - 1]); libxml_use_internal_errors($before); $docb = true; foreach ($doc->getElementsByClassName("infobox") as $link) { file_put_contents(dirname(__FILE__) . "/" . str_replace(" ", "+", strtolower($wording[sizeof($urls) - 1])) . ".smalltalk", $link->C14N()); } } catch (Exception $e) { throw new Exception( 'Something really wrong', 0, $e); } } else if (!file_exists(dirname(__FILE__) . "/" . str_replace(" ", "+", strtolower($wording[sizeof($urls) - 1])) . ".smalltalk")) { $idiv = explode("infobox", relative_to_absolute($blurbs[sizeof($urls) - 1])); if (sizeof($idiv) > 1) { $aprefix = '
", $idiv[1]); $jdiv = explode("", $idiv[1]); $jdivs = explode("
strlen($jdiv[0]) && strlen($jdivt[0]) > strlen($jdivs[0])) { file_put_contents(dirname(__FILE__) . "/" . str_replace(" ", "+", strtolower($wording[sizeof($urls) - 1])) . ".smalltalk", $aprefix . $jdivt[0] . "
"); } else if (strlen($jdivs[0]) < strlen($jdiv[0])) { file_put_contents(dirname(__FILE__) . "/" . str_replace(" ", "+", strtolower($wording[sizeof($urls) - 1])) . ".smalltalk", $aprefix . $jdiv[0] . ""); } else { file_put_contents(dirname(__FILE__) . "/" . str_replace(" ", "+", strtolower($wording[sizeof($urls) - 1])) . ".smalltalk", $aprefix . $jdivs[0] . ""); } } } } for ($i=1; $i', "\n" . '', $downbot); } else { $downbot = str_replace('', "\n" . '', $downbot); } $coords = explode(',', $coordstring[sizeof($coordstring) - 1]); $x = $coords[0]; $rjj = 1.0; for ($ii=2; $ii<(sizeof($coords) - 2); $ii+=2) { $x = ($rjj * $x + $coords[$ii]) / (1.0 + $rjj); $rjj = $rjj + 1.0; } $y = $coords[1]; $rjj = 1.0; for ($ii=3; $ii<(sizeof($coords) - 2); $ii+=2) { $y = ($rjj * $y + $coords[$ii]) / (1.0 + $rjj); $rjj = $rjj + 1.0; } $presuffix = " onmouseout='yehbut();' onmouseover='zok=1; url=\"" . str_replace("=%22", "=%22Famous+People+from+", $urls[sizeof($coordstring) - 1]) . "\"; parseurl(); setTimeout(xget, 4000); ' "; $aid = "id=aR" . str_replace("Jammu_and_Kashmir", "JAK", str_replace("National_Capital_Territory_of_New_Delhi", "NCTND", str_replace(" ", "_", str_replace("+", "_", $wording[sizeof($coordstring) - 1])))); $ss=""; if (isset($_GET['jigsaw'])) $ss="border:5px solid green;font-weight:bold;padding: 4 4 4 4;"; $suffix = str_replace("", "" . str_replace("National Capital Territory of New Delhi", "NCTND", $wording[sizeof($coordstring) - 1]) . "", $suffix); } return str_replace('img src', 'img style="' . $two . ';" src', $inmap) . $suffix; } ?> Political Map of India - Thanks to http://www.mapsofindia.com/free-download/free-download-india-political-maps.html \n"; } else { echo "
  • Hover over Indian map states for Famous People and/or Wikipedia information to right (thanks)
  • Click/touch Indian map state for Web information on new webpage
\n"; } ?>

India

  • Click/touch on Indian state at right for today's jigsaw
  • Click/touch Indian map for where that state is positioned ... get to 30