Beispiel #1
0
 /**
  * SEARCH VIA ATTRIBUTES
  */
 function q_execAttributeQuery()
 {
     // Definition of search parameters with external methods
     if (isset($_REQUEST['externalSearchDefinition'])) {
         $this->qLayerName = $_REQUEST['layerName'];
         $this->qSearchLayerType = $_REQUEST['layerType'];
         $fldName = $_REQUEST['fldName'];
         $this->qStr = $_REQUEST['qStr'];
         pm_logDebug(3, $_REQUEST, "Parameters for REQUEST array \nfile: query.php->q_execAttributeQuery \n");
         // Default using search.xml definitions
     } else {
         $searchitem = $_REQUEST['searchitem'];
         foreach ($_REQUEST as $key => $val) {
             if ($key != "findlist" && $key != "searchitem") {
                 $searchArray[$key] = urldecode($val);
                 //utf8_encode($val);
             }
         }
         $search = new XML_search($this->map, $_SESSION['PM_SEARCH_CONFIGFILE']);
         $searchParams = $search->getSearchParameters($this->map, $searchitem, $searchArray);
         $this->qLayerName = $searchParams['layerName'];
         $this->qSearchLayerType = $searchParams['layerType'];
         $fldName = $searchParams['firstFld'];
         $this->qStr = $searchParams['qStr'];
         pm_logDebug(2, $searchArray, "Parameters for searchArray \nfile: query.php->q_execAttributeQuery \n");
         pm_logDebug(2, $searchParams, "Parameters for searchParams \nfile: query.php->q_execAttributeQuery");
     }
     // Return layer type
     $this->qLayer = $this->map->getLayerByName($this->qLayerName);
     //$this->qSearchLayerType = $this->qLayer->connectiontype;
     // Get group and glayer objects
     $GroupGlayer = PMCommon::returnGroupGlayer($this->qLayerName);
     $this->grp = $GroupGlayer[0];
     $this->glayer = $GroupGlayer[1];
     $this->XYLayerProperties = $this->glayer->getXYLayerProperties();
     $this->layerEncoding = $this->glayer->getLayerEncoding();
     if ($this->qSearchLayerType == "shape" || $this->qSearchLayerType == "ms" || $this->qSearchLayerType == "oracle") {
         if ($layFilter = $this->qLayer->getFilterString()) {
             $mapLayerFilterItem = $this->qLayer->filteritem;
             if ($layFilter[0] == '/') {
                 $operator = '=~';
             } else {
                 $operator = '=';
             }
             $this->qStr = "(\"[{$mapLayerFilterItem}]\" {$operator} {$layFilter} AND ({$this->qStr}) )";
             pm_logDebug(3, $this->qStr, "query string including FILTER -- query.php->q_execAttributeQuery");
         }
         if ($this->qSearchLayerType == "oracle") {
             @$this->qLayer->queryByAttributes(null, $this->qStr, MS_MULTIPLE);
         } else {
             @$this->qLayer->queryByAttributes($fldName, $this->qStr, MS_MULTIPLE);
         }
     }
 }