$mapManager = new MapInterfaceManager(); $datasetManager = new OccurrenceDataset(); if ($action == "loadlist") { $recordsetlist = $mapManager->getPersonalRecordsets($uid); $listHtml = ''; if ($recordsetlist) { foreach ($recordsetlist as $recList => $recSet) { $roleStr = "'" . $recSet['role'] . "'"; $listHtml .= '<input data-role="none" type="radio" name="dsid" value="' . $recSet['datasetid'] . '" onchange="loadRecordset(' . $recSet['datasetid'] . ',' . $roleStr . ');" ' . ($recSet['datasetid'] == $selset ? 'checked' : '') . '> <a href="../datasets/index.php" target="_blank" onclick="">' . $recSet['name'] . ($recSet['role'] == "DatasetReader" ? " (read-only)" : "") . '</a><br />'; } } echo $listHtml; } if ($action == "createset") { $newId = ''; $datasetManager->createDataset($newName, $newNotes, $uid); $newId = $datasetManager->getDsId(); echo $newId; } if ($action == "loadrecords") { $occArr = $mapManager->getOccurrences($dsId); if ($occArr) { echo json_encode($occArr); } else { echo "null"; } } if ($action == "addrecords") { $occAddArr = json_decode($selections, true); $datasetManager->addSelectedOccurrences($dsId, $occAddArr); }
include_once '../../config/symbini.php'; include_once $serverRoot . '/classes/OccurrenceDataset.php'; header("Content-Type: text/html; charset=" . $charset); if (!$SYMB_UID) { header('Location: ../../profile/index.php?refurl=../collections/datasets/index.php?' . $_SERVER['QUERY_STRING']); } $action = array_key_exists('submitaction', $_REQUEST) ? $_REQUEST['submitaction'] : ''; //Sanitize input variables if ($action && !preg_match('/^[a-zA-Z0-9\\s_]+$/', $action)) { $action = ''; } $datasetManager = new OccurrenceDataset(); $datasetManager->setSymbUid($SYMB_UID); $statusStr = ''; if ($action == 'Create New Dataset') { if (!$datasetManager->createDataset($_POST['name'], $_POST['notes'], $SYMB_UID)) { $statusStr = implode(',', $datasetManager->getErrorArr()); } } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?> "> <title><?php echo $defaultTitle; ?> Occurrence Dataset Manager</title> <link href="../../css/base.css?<?php