Open($userInfo); $featureSrvc = $site->CreateService(MgServiceType::FeatureService); $resId = new MgResourceIdentifier($resName); $schemaName = substr(strrchr($schemaName, "/"), 1); $classDef = $featureSrvc->GetClassDefinition($resId, $schemaName, $className); $geomName = $classDef->GetDefaultGeometryPropertyName(); $featureReader = $featureSrvc->SelectFeatures($resId, $className, null); // Calculate total number of entries. while($featureReader->ReadNext()) $totalEntries++; $featureReader->Close(); $currentPage = ceil(($index+$maxEntries)/$maxEntries); $maxPage = ceil($totalEntries/$maxEntries); $lastEntry = ($maxPage-1)*$maxEntries; $propertyList = $classDef->GetProperties(); echo '

' . sprintf(DisplayHeadings::ClassName, $className) . '

'; echo 'Total Entries: ' . $totalEntries . '

'; if($totalEntries>$maxEntries) { DisplayPaging($index, $resName, $schemaName, $className, $sessionId, $maxEntries, $currentPage, $maxPage, $lastEntry); echo '

'; } echo ''; for($i=0; $i<$propertyList->GetCount(); $i++) { $propertyDef = $propertyList->GetItem($i); $property = $propertyList->GetItem($i)->GetName(); if(($property!=$geomName)&&($propertyDef->GetPropertyType()==100)) { echo ''; $propertyNameTypeList[$listIndex][0] = $property; $propertyNameTypeList[$listIndex++][1] = $propertyList->GetItem($i)->GetDataType(); } } echo ''; try { $featureReader = $featureSrvc->SelectFeatures($resId, $className, null); // Find the correct index on featureReader $count = $index; while($count--!=0) $featureReader->ReadNext(); // Output property values for($j=0; $j<$maxEntries;$j++) { echo ''; if($featureReader->ReadNext()==false) break; for($k=0; $k' . $property . ''; else echo ''; } catch (MgException $joinE) { // To allow display for a left outer join. The secondary class records // can be null if it contains less data than the primary class. } } echo ''; } $featureReader->Close(); } catch (MgException $schemaE) { // To prevent error msg when same className is found in multiple schemas } echo '
' . $property . '
' . FormText::EmptyString . '

'; if($totalEntries>$maxEntries) DisplayPaging($index, $resName, $schemaName, $className, $sessionId, $maxEntries, $currentPage, $maxPage, $lastEntry); } catch (MgSessionExpiredException $s) { echo ErrorMessages::SessionExpired; } catch (MgException $e) { echo $e->GetMessage(); } ?>