/**
  * 
  */
 function getGroupItems($aUserid, $aParentGroupId)
 {
     $items = array();
     $pois = array();
     $files = array();
     $qry = "SELECT * FROM `tab_grp_item` WHERE ((usrid = {$aUserid}) AND (itemid = {$aParentGroupId}))";
     $result = $this->executeQuery($qry);
     if ($result != NULL) {
         while ($row = mysql_fetch_row($result)) {
             if ($row != null) {
                 $itemtype = strtolower($row[3]);
                 switch ($itemtype) {
                     case "file":
                         $fl1 = new File();
                         $this->parse_ItemLink($fl1, $row, $result);
                         array_push($files, $fl1);
                         break;
                     case "poi":
                         $poi = new Poi();
                         $this->parse_ItemLink($poi, $row, $result);
                         array_push($pois, $poi);
                         break;
                 }
             }
         }
         if (count($pois) > 0) {
             $pf = new PoiFactory();
             $pf->addPois($aUserid, $pois, $items);
         }
         if (count($files) > 0) {
             $ff = new FileFactory();
             $ff->addFiles($aUserid, $files, $items);
         }
     }
     return $items;
 }
    $longtext		= $_GET['longtext'];
    $lat 		    = $_GET['lat'];
    $lon            = $_GET['lon'];
    $georssurl		= $_GET['georssurl'];
    $poilist		= $_GET['poilist'];
    $groupid		= $_GET['groupid'];
    $poiid	 		= $_GET['poiid'];
    $tagname 		= $_GET['tagname'];
    $zoomlevel 		= $_GET['zoomlevel'];
    //$itemtype       = $_GET['itmetype'];
    */
}
if (application_userisvalid()) {
    $usr = application_getvaliduser();
    if ($usr != null) {
        $pof = new PoiFactory();
        $js2 = new Services_JSON();
        //msg_createpoi
        if ($action == msg_createpoi) {
            if (!$pof->poiExistsByPos($usr->getUid(), $lat, $lon)) {
                if ($pof->createPoi($usr->getUid(), $poiname, $description, $lat, $lon, $zoomlevel, $tagname, "Poi")) {
                    $poi = $pof->getPoiById($usr->getUid(), $pof->lastid);
                    if ($poi != null) {
                        if (isset($groupname)) {
                            //add created poi into a group
                            $gf = new GroupFactory();
                            $grp = $gf->getGroupByName($usr->getUid(), $groupname);
                            if ($grp != null) {
                                $gf->addGroupItem($grp->itemid, $usr->getUid(), $poi->itemid, $poi->itemtype);
                            }
                        }
 /**
  * creates a example poi
  * @param $user Object
  */
 function createExamplePoi($user)
 {
     $pof = new PoiFactory();
     $gf = new Groupfactory();
     $pof->createPoi($user->getUid(), "Cologne City", "<b><a href=\"http://www.koeln.de\" target=\"_blank\">Cologne</a></b><br><a>cologne city<a>", "50.94317428566237", "6.958074772076103", "14", "standard_poi");
     $p1 = $pof->getPoi($user->getUid(), "Cologne City");
     $g1 = $gf->getGroupByName($user->getUid(), "Example Group");
     if ($p1 != null && $g1 != null) {
         $gf->addGroupItem($g1->itemid, $user->itemid, $p1->itemid, $p1->itemtype);
     }
 }