Exemplo n.º 1
0
<?php

include_once '../../../config/symbini.php';
include_once $serverRoot . '/classes/OccurrenceEditorManager.php';
$collId = $_REQUEST['collid'];
$fieldName = $_REQUEST['fieldname'];
$oldValue = $_REQUEST['oldvalue'];
$buMatch = array_key_exists('bumatch', $_REQUEST) ? $_REQUEST['bumatch'] : 0;
$ouid = array_key_exists('ouid', $_REQUEST) ? $_REQUEST['ouid'] : 0;
$retCnt = '';
if ($fieldName) {
    $occManager = new OccurrenceEditorManager();
    $occManager->setCollId($collId);
    if ($ouid) {
        $occManager->setQueryVariables(array('ouid' => $ouid));
    } else {
        $occManager->setQueryVariables();
    }
    $occManager->setSqlWhere();
    $retCnt = $occManager->getBatchUpdateCount($fieldName, $oldValue, $buMatch);
}
echo $retCnt;
Exemplo n.º 2
0
 if ($action == "Add New Determination") {
     $statusStr = $occManager->addDetermination($_POST, $isEditor);
     $tabTarget = 1;
 } elseif ($action == "Submit Determination Edits") {
     $statusStr = $occManager->editDetermination($_POST);
     $tabTarget = 1;
 } elseif ($action == "Delete Determination") {
     $statusStr = $occManager->deleteDetermination($_POST['detid']);
     $tabTarget = 1;
 }
 //Only full editors can perform following actions
 if ($isEditor == 1 || $isEditor == 2) {
     if ($action == 'Add Record') {
         $statusStr = $occManager->addOccurrence($_POST);
         if (strpos($statusStr, 'SUCCESS') !== false) {
             $occManager->setQueryVariables();
             $qryCnt = $occManager->getQueryRecordCount();
             $qryCnt++;
             if ($goToMode) {
                 //Go to new record
                 $occIndex = $qryCnt;
             } else {
                 //Stay on record and get $occId
                 $occId = $occManager->getOccId();
             }
         }
     } elseif ($action == 'Delete Occurrence') {
         $statusStr = $occManager->deleteOccurrence($occId);
         if (strpos($statusStr, 'SUCCESS') !== false) {
             $occId = 0;
             $occManager->setOccId(0);