1<?php
2require_once ('getWikiData.php');
3require_once ('getContinent.php');
4require_once ('getErrors.php');
5
6$countyCode=$_GET["county"];
7if ($countyCode != 'undefined') {
8  $countryCode=$_GET["ctry"];
9  $q=$_GET["q"];
10  $topic=$_GET["p"];
11  //
12  // get Continent
13  list ($continent, $country) = getContinent($countryCode);
14
15  $html = '<h1> '.ucwords($topic).'</h1>';
16  $html .= '<h2 class="indent">' . $countyCode . '</h2>';
17
18  $county = convToFile($countyCode);
19  $region = convToFile($q);
20  $countryCode = strtolower($countryCode);
21  $namespace = $topic;
22  $path = $topic . ':earth:' . $continent . ':' . $countryCode. ':' . $region . ':' . $county;
23
24  $wikiData = pullInWikiData($path, $namespace, $topic);
25  if ($wikiData != '')
26    $html .= $wikiData;
27  else
28      $html .=  '<p>'. htmlentities($exploreErrors['editPg']['en'], ENT_NOQUOTES) . htmlentities($exploreErrors['ckBack']['en'], ENT_NOQUOTES) .'</p> ';
29  $html  .= '<br /><p><a href="doku.php?id='.$path.'"><input type="button" class="button" value="Go to Edit" title="Go To Edit" /></a></p>';
30  $html .= htmlentities($exploreErrors['update']['en'], ENT_NOQUOTES);
31
32} else {
33  $html = '<p>'. $exploreErrors['unDefn']['en'] .'</p>';
34}
35
36  echo $html;
37
38?>