<?php include_once '../../config/symbini.php'; include_once $serverRoot . '/classes/OccurrenceDownload.php'; include_once $serverRoot . '/classes/OccurrenceManager.php'; include_once $serverRoot . '/classes/DwcArchiverOccurrence.php'; header("Cache-Control: no-cache, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); $schema = array_key_exists("schema", $_POST) ? $_POST["schema"] : "symbiota"; $cSet = array_key_exists("cset", $_POST) ? $_POST["cset"] : ''; $stArrCollJson = array_key_exists("jsoncollstarr", $_REQUEST) ? $_REQUEST["jsoncollstarr"] : ''; $stArrSearchJson = array_key_exists("starr", $_REQUEST) ? $_REQUEST["starr"] : ''; $dlManager = new OccurrenceDownload(); $dwcaHandler = new DwcArchiverOccurrence(); $occurManager = new OccurrenceManager(); if ($stArrCollJson && $stArrSearchJson) { $stArrSearchJson = str_replace("%apos;", "'", $stArrSearchJson); $collStArr = json_decode($stArrCollJson, true); $searchStArr = json_decode($stArrSearchJson, true); $stArr = array_merge($searchStArr, $collStArr); $occurManager->setSearchTermsArr($stArr); } if ($schema == "backup") { $collid = $_POST["collid"]; if ($collid && is_numeric($collid)) { //check permissions due to sensitive localities not being redacted if ($isAdmin || array_key_exists("CollAdmin", $userRights) && in_array($collid, $userRights["CollAdmin"])) { $dwcaHandler->setSchemaType('backup'); $dwcaHandler->setCharSetOut($cSet); $dwcaHandler->setVerbose(0); $dwcaHandler->setIncludeDets(1);
<?php include_once '../config/symbini.php'; include_once $serverRoot . '/classes/OccurrenceDownload.php'; $format = isset($_REQUEST['format']) && $_REQUEST['format'] ? $_REQUEST['format'] : 'rss'; $days = isset($_REQUEST['days']) ? $_REQUEST['days'] : 0; $limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : 0; $activityManager = new OccurrenceDownload(); header('Content-Description: ' . $GLOBALS['DEFAULT_TITLE'] . ' Data Entry Activity'); header('Content-Type: ' . ($format == 'json' ? 'application/json' : 'text/xml')); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Cache-Control: no-cache"); header("Pragma: no-cache"); echo $activityManager->getDataEntryActivity($format, $days, $limit);
$dlManager->setDelimiter($format); $dlManager->setZipFile($zip); $dlManager->addCondition('decimalLatitude', 'NOTNULL', ''); $dlManager->addCondition('decimalLongitude', 'NOTNULL', ''); if (array_key_exists('targetcollid', $_POST) && $_POST['targetcollid']) { $dlManager->addCondition('collid', 'EQUALS', $_POST['targetcollid']); } if (array_key_exists('processingstatus', $_POST) && $_POST['processingstatus']) { $dlManager->addCondition('processingstatus', 'EQUALS', $_POST['processingstatus']); } if (array_key_exists('customfield1', $_POST) && $_POST['customfield1']) { $dlManager->addCondition($_POST['customfield1'], $_POST['customtype1'], $_POST['customvalue1']); } $dlManager->downloadData(); } elseif ($schema == 'checklist') { $dlManager = new OccurrenceDownload(); if (array_key_exists("publicsearch", $_POST) && $_POST["publicsearch"]) { $occurManager = new OccurrenceManager(); $dlManager->setSqlWhere($occurManager->getSqlWhere()); } $dlManager->setSchemaType($schema); $dlManager->setCharSetOut($cSet); $dlManager->setDelimiter($format); $dlManager->setZipFile($zip); $taxonFilterCode = array_key_exists("taxonFilterCode", $_POST) ? $_POST["taxonFilterCode"] : 0; $dlManager->setTaxonFilter($taxonFilterCode); $dlManager->downloadData(); } else { //Is an occurrence download $dwcaHandler = new DwcArchiverOccurrence(); $dwcaHandler->setCharSetOut($cSet);
if (!is_numeric($collid)) { $collid = 0; } if (!is_numeric($displayMode)) { $displayMode = 0; } $customField1 = array_key_exists('customfield1', $_REQUEST) ? $_REQUEST['customfield1'] : ''; $customType1 = array_key_exists('customtype1', $_REQUEST) ? $_REQUEST['customtype1'] : ''; $customValue1 = array_key_exists('customvalue1', $_REQUEST) ? $_REQUEST['customvalue1'] : ''; $customField2 = array_key_exists('customfield2', $_REQUEST) ? $_REQUEST['customfield2'] : ''; $customType2 = array_key_exists('customtype2', $_REQUEST) ? $_REQUEST['customtype2'] : ''; $customValue2 = array_key_exists('customvalue2', $_REQUEST) ? $_REQUEST['customvalue2'] : ''; $customField3 = array_key_exists('customfield3', $_REQUEST) ? $_REQUEST['customfield3'] : ''; $customType3 = array_key_exists('customtype3', $_REQUEST) ? $_REQUEST['customtype3'] : ''; $customValue3 = array_key_exists('customvalue3', $_REQUEST) ? $_REQUEST['customvalue3'] : ''; $dlManager = new OccurrenceDownload(); $collMeta = $dlManager->getCollectionMetadata($collid); $isEditor = false; if ($IS_ADMIN || array_key_exists("CollAdmin", $userRights) && in_array($collid, $userRights["CollAdmin"])) { $isEditor = true; } $advFieldArr = array('family' => 'Family', 'sciname' => 'Scientific Name', 'identifiedBy' => 'Identified By', 'typeStatus' => 'Type Status', 'catalogNumber' => 'Catalog Number', 'otherCatalogNumbers' => 'Other Catalog Numbers', 'occurrenceId' => 'Occurrence ID (GUID)', 'recordedBy' => 'Collector/Observer', 'recordNumber' => 'Collector Number', 'associatedCollectors' => 'Associated Collectors', 'eventDate' => 'Collection Date', 'verbatimEventDate' => 'Verbatim Date', 'habitat' => 'Habitat', 'substrate' => 'Substrate', 'occurrenceRemarks' => 'Occurrence Remarks', 'associatedTaxa' => 'Associated Taxa', 'verbatimAttributes' => 'Description', 'reproductiveCondition' => 'Reproductive Condition', 'establishmentMeans' => 'Establishment Means', 'lifeStage' => 'Life Stage', 'sex' => 'Sex', 'individualCount' => 'Individual Count', 'samplingProtocol' => 'Sampling Protocol', 'country' => 'Country', 'stateProvince' => 'State/Province', 'county' => 'County', 'municipality' => 'Municipality', 'locality' => 'Locality', 'decimalLatitude' => 'Decimal Latitude', 'decimalLongitude' => 'Decimal Longitude', 'geodeticDatum' => 'Geodetic Datum', 'coordinateUncertaintyInMeters' => 'Uncertainty (m)', 'verbatimCoordinates' => 'Verbatim Coordinates', 'georeferencedBy' => 'Georeferenced By', 'georeferenceProtocol' => 'Georeference Protocol', 'georeferenceSources' => 'Georeference Sources', 'georeferenceVerificationStatus' => 'Georeference Verification Status', 'georeferenceRemarks' => 'Georeference Remarks', 'minimumElevationInMeters' => 'Elevation Minimum (m)', 'maximumElevationInMeters' => 'Elevation Maximum (m)', 'verbatimElevation' => 'Verbatim Elevation', 'disposition' => 'Disposition'); ?> <html> <head> <title>Occurrence Export Manager</title> <link href="<?php echo $clientRoot; ?> /css/base.css?<?php echo $CSS_VERSION;