$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);
                            }
                        }
                        echo application_getMessage($poi);
                    }
                } else {
                    echo application_getMessage(msg_failed);
                }
 /**
  * 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);
     }
 }