* @version 2.0 * @package Search * @copyright Copyright © 2011 DNA Bank Network http://www.dnabank-network.org
The contents of this file are subject to the Mozilla Public License Version 1.1 * @filesource * @license http://www.mozilla.org/MPL/ MPL */ $sqlcheckTripleID = "SELECT ID_Cache FROM cachecollection WHERE UnitID_Specimen = '$sqlUnitID' AND CollectionCode_Specimen = '$sqlSourceName' AND InstitutionCode_Specimen = '$sqlSourceInstitutionCode'"; //echo $sqlcheckTripleID; $resultcheckTripleID = mysqli_query($GLOBALS["___mysqli_ston"], $sqlcheckTripleID); if(!mysqli_affected_rows($GLOBALS["___mysqli_ston"])) { echo "Specimen record identifiers differ from cached version! Go to Wiki for further assistance."; $sqlTripleID = "SELECT UnitID_Specimen, CollectionCode_Specimen, InstitutionCode_Specimen, GUID_Specimen FROM cachecollection WHERE ID_Cache = '$ID_Cache'"; $resultTripleID = mysqli_query($GLOBALS["___mysqli_ston"], $sqlTripleID); while($row = mysqli_fetch_object($resultTripleID)) { echo " ParameterCache DataCurrent Provider Data"; echo "UnitID"; if ($row->UnitID_Specimen != $sqlUnitID) { echo "".$row->UnitID_Specimen."".$sqlUnitID.""; } else { echo $row->UnitID_Specimen."".$sqlUnitID; } echo ""; echo "Collection Code"; if ($row->CollectionCode_Specimen != $sqlSoureName) { echo "".$row->CollectionCode_Specimen."".$sqlSourceName.""; } else { echo $row->CollectionCode_Specimen."".$sqlSourceName; } echo ""; echo "Institution Code"; if ($row->InstitutionCode_Specimen != $sqlSoureInstitutionCode) { echo "".$row->InstitutionCode_Specimen."".$sqlSourceInstitutionCode.""; } else { echo $row->InstitutionCode_Specimen."".$sqlSourceInstitutionCode; } echo ""; echo "Unit GUID"; if ($row->GUID_Specimen != $sqlUnitGUID) { echo "".$row->GUID_Specimen."".$sqlUnitGUID.""; } else { echo $row->GUID_Specimen."".$sqlUnitGUID; } echo ""; } } // if(!mysql_affected_rows($resultcheckTripleID)) else { // if(mysql_affected_rows($resultcheckTripleID)) = Check for Triple ID was fine if($sqlTypeStatus == '') { $sqlTypeStatus2 = 'IS NULL'; } else {$sqlTypeStatus2 = "= '".$sqlTypeStatus."'"; } $sqlcheckCollectingEvent = "SELECT * FROM cachecollection WHERE (CountryName = '$sqlCountryName' OR CountryISO2 = '$sqlISO2') AND Collectors = '$sqlPersonName' AND (CollectionDate = '$sqlCollectionDate' OR CollectionDateMin = '$sqlCollectionDateMin' OR CollectionDateMax = '$sqlCollectionDateMax') AND CollectorsNo = '$sqlCollectorsNo' AND Locality = '$sqlLocality' AND Altitude = '$sqlAltitude' AND Longitude = '$sqlLongitude' AND Latitude = '$sqlLatitude' AND TypeStatus = '$sqlTypeStatus2' AND ID_Cache = '$ID_Cache'"; $resultcheckCollectingEvent = mysqli_query($GLOBALS["___mysqli_ston"], $sqlcheckCollectingEvent); if(mysqli_affected_rows($GLOBALS["___mysqli_ston"])) { echo "Specimen record collecting event data or type status differ from cached version! Do you want to update the cached specimen record?"; if(mysqli_num_rows($test) > 0) // information coming from query.php line 2261 { echo "
This specimen record is related to ".mysqli_num_rows($test)." other DNA samples. (see below for list of samples)"; } $sqlCollectingEvent = "SELECT * FROM cachecollection WHERE ID_Cache = '$ID_Cache'"; $resultCollectingEvent = mysqli_query($GLOBALS["___mysqli_ston"], $sqlCollectingEvent); while($row = mysqli_fetch_object($resultCollectingEvent)) { echo " ParameterCache DataCurrent Provider Data"; echo "Country Name"; if ($row->CountryName != $sqlCountryName) { echo "".$row->CountryName."".$sqlCountryName.""; } else { echo $row->CountryName."".$sqlCountryName; } echo ""; echo "Country ISO Code"; if ($row->CountryISO2 != $sqlISO2) { echo "".$row->CountryISO2."".$sqlISO2.""; } else { echo $row->CountryISO2."".$sqlISO2; } echo ""; echo "Collectors"; if ($row->Collectors != $sqlPersonName) { echo "".$row->Collectors."".$sqlPersonName.""; } else { echo $row->Collectors."".$sqlPersonName; } echo ""; echo "Collector's Number"; if ($row->CollectorsNo != $sqlCollectorsNo) { echo "".$row->CollectorsNo."".$sqlCollectorsNo.""; } else { echo $row->CollectorsNo."".$sqlCollectorsNo; } echo ""; echo "Collection Date"; if ($row->CollectionDate != $sqlCollectionDate) { echo "".$row->CollectionDate."".$sqlCollectionDate.""; } else { echo $row->CollectionDate."".$sqlCollectionDate; } echo ""; echo "Collection Date Min"; if ($row->CollectionDateMin != $sqlCollectionDateMin) { echo "".$row->CollectionDateMin."".$sqlCollectionDateMin.""; } else { echo $row->CollectionDateMin."".$sqlCollectionDateMin; } echo ""; echo "Collection Date Max"; if ($row->CollectionDateMax != $sqlCollectionDateMax) { echo "".$row->CollectionDateMax."".$sqlCollectionDateMax.""; } else { echo $row->CollectionDateMax."".$sqlCollectionDateMax; } echo ""; echo "Locality"; if ($row->Locality != $sqlLocality) { echo "".$row->Locality."".$sqlLocality.""; } else { echo $row->Locality."".$sqlLocality; } echo ""; echo "Altitude"; if ($row->Altitude != $sqlAltitude) { echo "".$row->Altitude."".$sqlAltitude.""; } else { echo $row->Altitude."".$sqlAltitude; } echo ""; echo "Longitude | Latitude"; if (($row->Longitude != $sqlLongitude) or ($row->Latitude != $sqlLatitude)) { echo "".$row->Longitude." | ".$row->Latitude." ".$sqlLongitude." | ".$sqlLatitude.""; } else { echo $row->Longitude." | ".$row->Latitude."".$sqlLongitude." | ".$sqlLatitude; } echo ""; echo "Type Status"; if ($row->TypeStatus != $sqlTypeStatus) { echo "".$row->TypeStatus."".$sqlTypeStatus.""; } else { echo $row->TypeStatus."".$sqlTypeStatus; } echo ""; } } // if(!mysql_affected_rows($resultcheckCollectingEvent)) else { // if(mysql_affected_rows($resultcheckCollectingEvent)) = Check for Collecting Data and Type Status was fine if($sqlNameAuthorYearString != "") { foreach ($sqlNameAuthorYearString as $index => $NameAuthorYear) { $PreferredFlag = $sqlPreferredIdentificationFlag[$index]; $Genus = $sqlGenus[$index]; $Subgenus = $sqlSubgenus[$index]; $FirstEpithet = $sqlFirstEpithet[$index]; $SecondEpithet = $sqlSecondEpithet[$index]; if($PreferredFlag == '' and $PreferredFlag != '0') { $PreferredFlag = '1'; } if($sqlPreferredIdentificationFlag[$index] == '1' or $sqlPreferredIdentificationFlag[$index] == 'true') { $sqlCheckIdentification = "SELECT * FROM cachetaxonidentified WHERE Genus = '$Genus' AND Subgenus = '$Subgenus' AND FirstEpithet = '$FirstEpithet' AND SecondEpithet = '$SecondEpithet' AND NameAuthorYear = '$NameAuthorYear' AND (PreferredFlag = '1' OR PreferredFlag = 'true') AND FK_Cache = '$ID_Cache'"; $resultCheckIdentification = mysqli_query($GLOBALS["___mysqli_ston"], $sqlCheckIdentification); if(!mysqli_affected_rows($GLOBALS["___mysqli_ston"])) { echo "Preferred identification data differ from cached version! Do you want to update the cached specimen record? "; if(mysqli_num_rows($test) > 0) // information coming from query.php line 2261 { echo "
This specimen record is related to ".mysqli_num_rows($test)." other DNA samples. (see below for list of samples)"; } $sqlIdentification = "SELECT * FROM cachetaxonidentified WHERE FK_Cache = '$ID_Cache' AND (PreferredFlag = '1' OR PreferredFlag = 'true')"; $resultIdentification = mysqli_query($GLOBALS["___mysqli_ston"], $sqlIdentification); while($row = mysqli_fetch_object($resultIdentification)) { echo ""; if ($PreferredFlag = '1' or $PreferredFlag = 'true') { echo "ParameterCache DataCurrent Provider Data"; echo "Name Author Year"; if($row->NameAuthorYear != $NameAuthorYear) { echo "".$row->NameAuthorYear."".$NameAuthorYear.""; } else {echo $row->NameAuthorYear."".$NameAuthorYear; } echo ""; echo "Genus"; if($row->Genus != $Genus) { echo "".$row->Genus."".$Genus.""; } else { echo $row->Genus."".$Genus; } echo ""; echo "Subgenus"; if($row->Subgenus != $Genus) { echo "".$row->Subgenus."".$Subgenus.""; } else { echo $row->Subgenus."".$Subgenus; } echo ""; echo "First Epithet"; if($row->FirstEpithet != $FirstEpithet) { echo "".$row->FirstEpithet."".$FirstEpithet.""; } else { echo $row->FirstEpithet."".$FirstEpithet; } echo ""; echo "Second Epithet"; if($row->SecondEpithet != $SecondEpithet) { echo "".$row->SecondEpithet."".$SecondEpithet.""; } else { echo $row->SecondEpithet."".$SecondEpithet; } echo ""; echo "Preferred?"; if($row->PreferredFlag != $PreferredFlag) { echo "".$row->PreferredFlag."".$PreferredFlag.""; } else { echo $row->PreferredFlag."".$PreferredFlag; } echo ""; } // if ($PreferredFlag = '1' or $PreferredFlag = 'true') } // while($row = mysql_fetch_object($resultIdentification)) } //if(!mysql_affected_rows($resultCheckIdentification)) else { //if(mysql_affected_rows($resultCheckIdentification)) if(isset($sqlFileURI)) { foreach($sqlFileURI as $FileURI) { $sqlCheckMultimedia = "SELECT * FROM cachemultimedia WHERE Multimedia = '$FileURI' AND FK_Cache = '$ID_Cache'"; $resultCheckMultimedia = mysqli_query($GLOBALS["___mysqli_ston"], $sqlCheckMultimedia); } }// foreach($sqlFileURI as $FileURI) if(!mysqli_affected_rows($GLOBALS["___mysqli_ston"])) { echo "Multimedia urls differ from cached version! Do you want to update the cached specimen record? "; if(mysqli_num_rows($test) > 0) // information coming from query.php line 2261 { echo "
This specimen record is related to ".mysqli_num_rows($test)." other DNA samples. (see below for list of samples)"; } $sqlMultimedia = "SELECT * FROM cachemultimedia WHERE FK_Cache = '$ID_Cache'"; $resultMultimedia = mysqli_query($GLOBALS["___mysqli_ston"], $sqlMultimedia); echo ""; echo "ParameterCache Data"; while($row = mysqli_fetch_object($resultMultimedia)) { echo "File URI"; echo "".$row->Multimedia.""; } } // if(!mysql_affected_rows()) else { echo "Checked successfully: Original provider data are in accordance with cached data, updating not required."; } } //if(mysql_affected_rows($resultCheckIdentification)) = Check for Identification Data was fine } // if($sqlPreferredIdentificationFlag[$index] == '1' or $sqlPreferredIdentificationFlag[$index] == 'true') } // foreach ($sqlNameAuthorYearString as $NameAuthorYears => $index) } //if($sqlNameAuthorYearString != "") else { $sqlCheckIdentification = "SELECT * FROM cachetaxonidentified WHERE Genus = '$Genus1' AND Subgenus = '$Subgenus1' AND FirstEpithet = '$FirstEpithet1' AND SecondEpithet = '$SecondEpithet1' AND NameAuthorYear = '$NameAuthorYear1' AND (PreferredFlag = '1' OR PreferredFlag = 'true') AND FK_Cache = '$ID_Cache'"; //echo $sqlCheckIdentification; $resultCheckIdentification = mysqli_query($GLOBALS["___mysqli_ston"], $sqlCheckIdentification); if(mysqli_affected_rows($GLOBALS["___mysqli_ston"])) { echo "Preferred identification data differ from cached version! Do you want to update the cached specimen record? "; if(mysqli_num_rows($test) > 0) // information coming from query.php line 2261 { echo "
This specimen record is related to ".mysqli_num_rows($test)." other DNA samples. (see below for list of samples)"; } $sqlIdentification = "SELECT * FROM cachetaxonidentified WHERE FK_Cache = '$ID_Cache' AND (PreferredFlag = '1' OR PreferredFlag = 'true')"; $resultIdentification = mysqli_query($GLOBALS["___mysqli_ston"], $sqlIdentification); while($row = mysqli_fetch_object($resultIdentification)) { echo ""; if ($PreferredFlag = '1' or $PreferredFlag = 'true') { echo "ParameterCache DataCurrent Provider Data"; echo "Name Author Year"; if($row->NameAuthorYear != $NameAuthorYear1) { echo "".$row->NameAuthorYear."".$NameAuthorYear1.""; } else {echo $row->NameAuthorYear."".$NameAuthorYear1; } echo ""; echo "Genus"; if($row->Genus != $Genus1) { echo "".$row->Genus."".$Genus1.""; } else { echo $row->Genus."".$Genus1; } echo ""; echo "Subgenus"; if($row->Subgenus != $Genus1) { echo "".$row->Subgenus."".$Subgenus1.""; } else { echo $row->Subgenus."".$Subgenus1; } echo ""; echo "First Epithet"; if($row->FirstEpithet != $FirstEpithet1) { echo "".$row->FirstEpithet."".$FirstEpithet1.""; } else { echo $row->FirstEpithet."".$FirstEpithet1; } echo ""; echo "Second Epithet"; if($row->SecondEpithet != $SecondEpithet1) { echo "".$row->SecondEpithet."".$SecondEpithet1.""; } else { echo $row->SecondEpithet."".$SecondEpithet1; } echo ""; echo "Preferred?"; if($row->PreferredFlag != $PreferredFlag1) { echo "".$row->PreferredFlag."".$PreferredFlag1.""; } else { echo $row->PreferredFlag."".$PreferredFlag1; } echo ""; } // if ($PreferredFlag = '1' or $PreferredFlag = 'true') } // while($row = mysql_fetch_object($resultIdentification)) } //if(mysql_affected_rows($resultCheckIdentification)) = Check for Identification Data was fine else { //if(mysql_affected_rows($resultCheckIdentification)) echo "Checked successfully: GBIF provider data are in accordance with cached data, updating not required."; } } } // if(mysql_affected_rows($resultcheckCollectingEvent)) = Check for Collecting Data was fine } // if(mysql_affected_rows($resultcheckTripleID)) = Check for Triple ID was fine ?>