Please select either Institution (Code) or use free text! Data have not been saved! "; }
if($formCollectionCodeList != "" and $formCollectionCode != "")
{ echo "Please select either Collection (Code) or use free text! Data have not been saved! "; }
if($formInstitutionCodeList == "" and $formInstitutionCode == "" and !isset($NoInstCodeAvailable))
{ echo "Please select either Institution (Code) or the checkbox! Data have not been saved! "; }
if($formCollectionCodeList == "" and $formCollectionCode == "" and !isset($NoCollCodeAvailable))
{ echo "Please select either Institution (Code) or the checkbox! Data have not been saved! "; }
if($formSpecimenNumber == "" and !isset($NoSpecimenAvailable))
{ echo "Please complete either Specimen Number or select the checkbox! Data have not been saved! "; }
if($formImageLink == "" and !isset($NoImagesAvailable))
{ echo "Please complete either an Image Link or select the checkbox! Data have not been saved! "; }
if($formGenusList != "" and $formGenus != "")
{ echo "Please select either Genus or use free text! Data have not been saved! "; }
if($formSubgenusList != "" and $formSubgenus != "")
{ echo "Please select either Subgenus or use free text! Data have not been saved! "; }
if($formLongitude != "" and $formLongitude1 != "")
{ echo "Please select either decimal or sexagesimal type! Data have not been saved! "; }
if($formLatitude != "" and $formLatitude1 != "")
{ echo "Please select either decimal or sexagesimal type! Data have not been saved! "; }
if($formCountryList != "" and $formOceanList != "")
{ echo "Please select either a Country or a Sea/Ocean! Data have not been saved! "; }
$testempty1 = array_sum($_POST['formHigherTaxonList']);
foreach($_POST['formHigherTaxon'] as $Test123)
{
if($Test123 == "") {$testempty2 == "false"; }
else $testempty2 == "true";}
if(empty($formCountryList) and empty($formOceanList) and empty($formCollectionDate) and empty($formCollector))
{ echo "Please complete 'Label and Gathering'! Data have not been saved! "; }
if($testempty1 == 0 and $testempty2 == "false")
{ echo "Please complete 'Higher Taxon'! Data have not been saved! "; }
/*if($testempty1 > 0 and $_POST['formHigherTaxon'] != "")
{ echo "Please select either a Higher Taxon from list or use free text! Data have not been saved! "; } */
else {
if($formCountryList!="")
{
$resultCountry = mysql_query ("SELECT tablecountryisocode.ID_Country, " .
"tablecountryisocode.IsoCode, " .
"tablecountryisocode.Country, " .
"tablecontinentorocean.ContinentOrOcean " .
"FROM tablecountryisocode " .
"LEFT JOIN tablecontinentorocean ON tablecountryisocode.ID_Continent = tablecontinentorocean.ID_Continent " .
"WHERE tablecountryisocode.ID_Country = '$formCountryList'");
while($row = mysql_fetch_object($resultCountry))
{$IsoCode = $row->IsoCode;
$Country = $row->Country;
$Continent = $row->ContinentOrOcean; }
}
if($formOceanList!="")
{
$resultOcean = mysql_query ("SELECT tableseasandoceans.ID_SeasAndOceans, " .
"tableseasandoceans.SeasAndOceans, " .
"tablecontinentorocean.ContinentOrOcean " .
"FROM tableseasandoceans " .
"LEFT JOIN tablecontinentorocean ON tableseasandoceans.ID_Continent = tablecontinentorocean.ID_Continent " .
"WHERE tableseasandoceans.ID_SeasAndOceans = '$formOceanList'");
while($row = mysql_fetch_object($resultOcean))
{ $Ocean = $row->SeasAndOceans;
$Continent = $row->ContinentOrOcean; }
}
if($formInstitutionCodeList!="")
{
$resultInstitutionCode = mysql_query ("SELECT ID_Gathering, InstitutionCode_Specimen FROM tableofflinegathering " .
"WHERE ID_Gathering = '$formInstitutionCodeList'");
while($row = mysql_fetch_object($resultInstitutionCode))
{$formInstitutionCode = $row->InstitutionCode_Specimen; }
}
if($formCollectionCodeList!="")
{
$resultCollectionCode = mysql_query ("SELECT ID_Gathering, CollectionCode_Specimen FROM tableofflinegathering " .
"WHERE ID_Gathering = '$formCollectionCodeList'");
while($row = mysql_fetch_object($resultCollectionCode))
{$formCollectionCode = $row->CollectionCode_Specimen; }
}
if($formLongitude1 != "" or $formLongitude != "")
{
$TestLong = explode("°", $formLongitude);
$TestLong1 = explode("°", $formLongitude1);
if($TestLong[0] != "") { $Longitude = $formLongitude; }
if($TestLong1[0] != "") { $Longitude = $formLongitude1; }
$degree = explode("°", $Longitude);
$degreeResult = $degree[0];
$Rest1 = $degree[1];
$minute = explode("'", $Rest1);
$minuteResult = $minute[0];
$secondResult = $minute[1];
$Result = ((($secondResult / 60) + $minuteResult) / 60);
$formLongitude = $degreeResult+($minuteResult/60)+($secondResult/3600);
//echo $formLongitude;
}
if($formLatitude1 != "" or $formLatitude != "")
{ $TestLat = explode("°", $formLatitude);
$TestLat1 = explode("°", $formLatitude1);
if($TestLat[0] != "") { $Latitude = $formLatitude; }
if($TestLat1[0] != "") { $Latitude = $formLatitude1; }
$degree = explode("°", $Latitude);
$degreeResult1 = $degree[0];
$Rest2 = $degree1[1];
$minute1 = explode("'", $Rest2);
$minuteResult1 = $minute1[0];
$secondResult1 = $minute1[1];
$Result1 = ((($secondResult1 / 60) + $minuteResult1) / 60);
$formLatitude = $degreeResult1+($minuteResult1/60)+($secondResult1/3600);
//echo $formLatitude;
}
if($radioPreferred == 'taxa1')
{$PreferredFlag1 = '1'; }
if($radioPreferred != 'taxa1')
{$PreferredFlag1 = '0'; }
if($radioPreferred == 'taxa2')
{$PreferredFlag2 = '1'; }
if($radioPreferred != 'taxa2')
{$PreferredFlag2 = '0'; }
if($radioPreferred == 'taxa3')
{$PreferredFlag3 = '1'; }
if($radioPreferred != 'taxa3')
{$PreferredFlag3 = '0'; }
if($radioPreferred == 'taxa4')
{$PreferredFlag4 = '1'; }
if($radioPreferred != 'taxa4')
{$PreferredFlag4 = '0'; }
if($formSpecimenNumber != "")
{
$Exist = mysql_query("SELECT ID_Gathering FROM tableofflinegathering " .
"WHERE UnitID_Specimen = '$formSpecimenNumber' " .
" AND InstitutionCode_Specimen = '$formInstitutionCode' " .
" AND CollectionCode_Specimen = '$formCollectionCode'");
if(mysql_affected_rows())
{ echo "Dieses Specimen wurde bereits gespeichert! Bitte überprüfen Sie folgende Angaben: Specimen Number: ".$formSpecimenNumber." Institution Code: ".$formInstitutionCode." Collection Code: ".$formCollectionCode." "; } }
if(!mysql_affected_rows() or $NoSpecimenAvailable != "")
{
$LocalityText = "";
if($formRegion != "")
{ $LocalityText .= $formRegion.", "; }
if($formLocality != "")
{ $LocalityText .= $formLocality; }
$sqlLocality = addslashes($formLocality);
$sqlBiotope = addslashes($formBiotope);
$sqlDepth = addslashes($formDepth);
$sqlLongitude = addslashes($formLongitude);
$sqlLatitude = addslashes($formLatitude);
$sqlCollector = addslashes($formCollector);
$sqlExpedition = addslashes($formExpedition);
$sqlTitleLabel = addslashes($formTitleLabel);
$sqlCollectionCode = addslashes($formCollectionCode);
$sqlInstitutionCode = addslashes($formInstitutionCode);
$sqlSpecimenNumber = addslashes($formSpecimenNumber);
$result1 = "INSERT INTO tableofflinegathering (UnitID_Specimen, InstitutionCode_Specimen, CollectionCode_Specimen, TitleLabel, ExpeditionDetails, ContinentOrOcean, CountryName, CountryISO2, SeasAndOceans, Region, Locality, Biotope, Depth, LongitudeDecimal, LatitudeDecimal, Altitude, GatheringDate, GatheringAgent, GatheringNo, ID_Sex, ID_BasisOfRecord, Protected, Admission, ID_Type, Created_Who) " .
"VALUES ('$sqlSpecimenNumber','$sqlInstitutionCode','$sqlCollectionCode','$sqlTitleLabel','$sqlExpedition','$Continent','$Country','$IsoCode','$Ocean','$formRegion','$sqlLocality','$sqlBiotope','$sqlDepth','$sqlLongitude','$sqlLatitude','$formAltitude','$formCollectionDate','$sqlCollector','$formCollectionNo','$formSex','$formBasisOfRecord','$radioProtect','$radioAdmission','$formType','$log')";
$sql1 = mysql_query($result1);
$IDOfflineGathering = mysql_insert_id();
if($formImageLink!="")
{ $result1a = "INSERT INTO tableofflineimages (ImageLink, ID_OfflineGathering, Created_Who) " .
"VALUES ('$formImageLink','$IDOfflineGathering','$log')";
$sql1a = mysql_query($result1a);
#######################################Error 1a###############################################################
if(!$sql1a)
{ $msg = $result1a."\n";
$msg .= "####Error 1a####";
trigger_error($msg, E_USER_ERROR);
include ("Errorreport.php"); }
#############################################################################################################
}
foreach ($_POST['formImageLink2'] as $ImageLink)
{
if(!empty($ImageLink)) {
$result1b = "INSERT INTO tableofflineimages (ImageLink, ID_OfflineGathering, Created_Who) " .
"VALUES ('$ImageLink','$IDOfflineGathering','$log')";
$sql1b = mysql_query($result1b);
#######################################Error 1b###############################################################
if(!$sql1b)
{ $msg = $result1b."\n";
$msg .= "####Error 1b####";
trigger_error($msg, E_USER_ERROR);
include ("Errorreport.php"); }
#############################################################################################################
} }
if($formGenusList!="")
{
$resultGenus = mysql_query ("SELECT Genus FROM tablecachetaxonidentified WHERE ID_TaxonIdentified = '".$formGenusList."'");
while($row = mysql_fetch_object($resultGenus))
{$formGenus = $row->Genus; }
}
if($formSubgenusList!="")
{
$resultSubgenus = mysql_query ("SELECT Subgenus FROM tablecachetaxonidentified WHERE ID_TaxonIdentified = '".$formSubgenusList."'");
while($row = mysql_fetch_object($resultSubgenus))
{$formSubgenus = $row->Subgenus; }
}
$NameAuthorYear = $formGenus;
if($formSubgenus) { $NameAuthorYear .= " ".$formSubgenus; }
if($formFirstEpithet) { $NameAuthorYear .= " ".$formFirstEpithet; }
if($formRank) { $NameAuthorYear .= " ".$formRank; }
if($formSecondEpithet) { $NameAuthorYear .= " ".$formSecondEpithet; }
if($formAuthor) { $NameAuthorYear .= " ".$formAuthor; }
if($formAuthorYear) { $NameAuthorYear .= ", ".$formAuthorYear; }
#######################################Error 1###############################################################
if(!$sql1)
{ $msg = $result1."\n";
$msg .= "####Error 1####";
trigger_error($msg, E_USER_ERROR);
include ("Errorreport.php");
}
#############################################################################################################
if($sql1)
{
$sqlAuthor = addslashes($formAuthor);
$sqlNameAuthorYear = addslashes($NameAuthorYear);
$sqlIdentifier = addslashes($formIdentifier);
$result2 = "INSERT INTO tableofflinetaxa (ID_Gathering, Genus, Subgenus, FirstEpithet, Author, Year, Rank, SecondEpithet, NameAuthorYear, Identifier, IdentificationDate, PreferredFlag, EntryNameFlag, Notes, Created_Who)" .
"VALUES ('$IDOfflineGathering','$formGenus','$formSubgenus','$formFirstEpithet','$sqlAuthor','$formAuthorYear','$formRank','$formSecondEpithet','$sqlNameAuthorYear','$sqlIdentifier','$formIdentificationDate','$PreferredFlag1','1','$formIdentNotes','$log')";
$sql2 = mysql_query($result2);
$IDOfflineTaxa = mysql_insert_id();
}
#######################################Error 2###############################################################
if(!$sql2)
{ $msg = $result2."\n";
$msg .= "####Error 2####";
trigger_error($msg, E_USER_ERROR);
include ("Errorreport.php");
$delete = mysql_query("DELETE FROM tableofflinegathering WHERE ID_Gathering = '$IDOfflineGathering'"); }
#############################################################################################################
if($sql2)
{
foreach($_POST['formHigherTaxon'] as $index2 => $HigherTaxaFree)
{
if(!empty($HigherTaxaFree)) {
$Rank = $_POST['hiddenHigherTaxon'][$index2];
$result3 = "INSERT INTO tableofflinehighertaxon (ID_Taxa, HigherTaxon, TaxonRank, Created_Who) " .
"VALUES ('$IDOfflineTaxa','$HigherTaxaFree','$Rank','$log')";
$sql3 = mysql_query($result3);
}
}
foreach($_POST['formHigherTaxonList'] as $index => $HigherTaxa)
{
if(!empty($HigherTaxa)) {
$resultHigherTaxon = mysql_query("SELECT HigherTaxon FROM tablecachehighertaxa WHERE ID_HigherTaxon = '$HigherTaxa'");
while($row = mysql_fetch_object($resultHigherTaxon))
{ $HigherTaxon = $row->HigherTaxon; }
if(!empty($HigherTaxon)) {
$Rank = $_POST['hiddenHigherTaxon'][$index];
$result3 = "INSERT INTO tableofflinehighertaxon (ID_Taxa, HigherTaxon, TaxonRank, Created_Who) " .
"VALUES ('$IDOfflineTaxa','$HigherTaxon','$Rank','$log')";
$sql3 = mysql_query($result3);
}
}
}
} //if($sql2)
#######################################Error 3###############################################################
if(!$sql3)
{ echo "Please complete 'Higher Taxon'! ";
$msg = $result3."\n";
$msg .= "####Error 3####";
trigger_error($msg, E_USER_ERROR);
include ("Errorreport.php");
$delete1 = mysql_query("DELETE FROM tableofflinegathering WHERE ID_Gathering = '$IDOfflineGathering'");
$delete2 = mysql_query("DELETE FROM tableofflinetaxa WHERE ID_Gathering = '$IDOfflineGathering'"); }
#############################################################################################################
/*-- Add further identifications No.1 ----------------#
# #
# #
# #
#-----------------------------------------------------*/
if(!empty($Add1))
{
if($formGenusList1!="")
{
$resultGenus = mysql_query ("SELECT Genus FROM tablecachetaxonidentified WHERE ID_TaxonIdentified = '".$formGenusList1."'");
while($row = mysql_fetch_object($resultGenus))
{$formGenus1 = $row->Genus; }
}
if($formSubgenusList1!="")
{
$resultSubgenus = mysql_query ("SELECT Subgenus FROM tablecachetaxonidentified WHERE ID_TaxonIdentified = '".$formSubgenusList1."'");
while($row = mysql_fetch_object($resultSubgenus))
{$formSubgenus1 = $row->Subgenus; }
}
$NameAuthorYear1 = $formGenus1;
if($formSubgenus1) { $NameAuthorYear1 .= " ".$formSubgenus1; }
if($formFirstEpithet1) { $NameAuthorYear1 .= " ".$formFirstEpithet1; }
if($formRank1) { $NameAuthorYear1 .= " ".$formRank1; }
if($formSecondEpithet1) { $NameAuthorYear1 .= " ".$formSecondEpithet1; }
if($formAuthor1) { $NameAuthorYear1 .= " ".$formAuthor1; }
if($formAuthorYear1) { $NameAuthorYear1 .= ", ".$formAuthorYear1; }
if($sql1)
{
$sqlAuthor1 = addslashes($formAuthor1);
$sqlNameAuthorYear1 = addslashes($NameAuthorYear1);
$sqlIdentifier1 = addslashes($formIdentifier1);
$result4 = "INSERT INTO tableofflinetaxa (ID_Gathering, Genus, Subgenus, FirstEpithet, Author, Year, Rank, SecondEpithet, NameAuthorYear, Identifier, IdentificationDate, PreferredFlag, Notes, Created_Who)" .
"VALUES ('$IDOfflineGathering','$formGenus1','$formSubgenus1','$formFirstEpithet1','$sqlAuthor1','$formAuthorYear1','$formRank1','$formSecondEpithet1','$sqlNameAuthorYear1','$sqlIdentifier1','$formIdentificationDate1','$PreferredFlag2','$formIdentNotes2','$log')";
$sql4 = mysql_query($result4);
$IDOfflineTaxa1 = mysql_insert_id();
}
#######################################Error 4###############################################################
if(!$sql4)
{ $msg = $result4."\n";
$msg .= "####Error 4####";
trigger_error($msg, E_USER_ERROR);
include ("Errorreport.php");
$delete = mysql_query("DELETE FROM tableofflinegathering WHERE ID_Gathering = '$IDOfflineGathering'"); }
#############################################################################################################
if($sql4)
{
foreach($_POST['formHigherTaxon1'] as $index2 => $HigherTaxaFree1)
{
if(!empty($HigherTaxaFree1)) {
$Rank1 = $_POST['hiddenHigherTaxon1'][$index2];
$result5 = "INSERT INTO tableofflinehighertaxon (ID_Taxa, HigherTaxon, TaxonRank, Created_Who) " .
"VALUES ('$IDOfflineTaxa1','$HigherTaxaFree1','$Rank1','$log')";
$sql5 = mysql_query($result5);
}
}
foreach($_POST['formHigherTaxonList1'] as $index => $HigherTaxa1)
{
if(!empty($HigherTaxa1)) {
$resultHigherTaxon = mysql_query("SELECT HigherTaxon FROM tablecachehighertaxa WHERE ID_HigherTaxon = '$HigherTaxa1'");
while($row = mysql_fetch_object($resultHigherTaxon))
{ $HigherTaxon1 = $row->HigherTaxon; }
if(!empty($HigherTaxon1)) {
$Rank1 = $_POST['hiddenHigherTaxon1'][$index];
$result5 = "INSERT INTO tableofflinehighertaxon (ID_Taxa, HigherTaxon, TaxonRank, Created_Who) " .
"VALUES ('$IDOfflineTaxa1','$HigherTaxon1','$Rank1','$log')";
$sql5 = mysql_query($result5);
}
}}
#######################################Error 5###############################################################
if(!$sql5)
{ $msg = $result5."\n";
$msg .= "####Error 5####";
trigger_error($msg, E_USER_ERROR);
include ("Errorreport.php");
$delete1 = mysql_query("DELETE FROM tableofflinegathering WHERE ID_Gathering = '$IDOfflineGathering'");
$delete2 = mysql_query("DELETE FROM tableofflinetaxa WHERE ID_Gathering = '$IDOfflineGathering'"); }
#############################################################################################################
} //if($sql4)
}//if(!empty($Add1)
/*-- Add further identifications No.2 ----------------#
# #
# #
# #
#-----------------------------------------------------*/
if(!empty($Add2))
{
if($formGenusList2!="")
{
$resultGenus = mysql_query ("SELECT Genus FROM tablecachetaxonidentified WHERE ID_TaxonIdentified = '".$formGenusList2."'");
while($row = mysql_fetch_object($resultGenus))
{$formGenus1 = $row->Genus; }
}
if($formSubgenusList2!="")
{
$resultSubgenus = mysql_query ("SELECT Subgenus FROM tablecachetaxonidentified WHERE ID_TaxonIdentified = '".$formSubgenusList2."'");
while($row = mysql_fetch_object($resultSubgenus))
{$formSubgenus2 = $row->Subgenus; }
}
$NameAuthorYear2 = $formGenus2;
if($formSubgenus2) { $NameAuthorYear2 .= " ".$formSubgenus2; }
if($formFirstEpithet2) { $NameAuthorYear2 .= " ".$formFirstEpithet2; }
if($formRank2) { $NameAuthorYear2 .= " ".$formRank2; }
if($formSecondEpithet2) { $NameAuthorYear2 .= " ".$formSecondEpithet2; }
if($formAuthor2) { $NameAuthorYear2 .= " ".$formAuthor2; }
if($formAuthorYear2) { $NameAuthorYear2 .= ", ".$formAuthorYear2; }
if($sql1)
{
$sqlAuthor2 = addslashes($formAuthor2);
$sqlNameAuthorYear2 = addslashes($NameAuthorYear2);
$sqlIdentifier2 = addslashes($formIdentifier2);
$result6 = "INSERT INTO tableofflinetaxa (ID_Gathering, Genus, Subgenus, FirstEpithet, Author, Year, Rank, SecondEpithet, NameAuthorYear, Identifier, IdentificationDate, PreferredFlag, Notes, Created_Who)" .
"VALUES ('$IDOfflineGathering','$formGenus2','$formSubgenus2','$formFirstEpithet2','$sqlAuthor2','$formAuthorYear2','$formRank2','$formSecondEpithet2','$sqlNameAuthorYear2','$sqlIdentifier2','$formIdentificationDate2','$PreferredFlag3','$formIdentNotes3','$log')";
$sql6 = mysql_query($result6);
$IDOfflineTaxa2 = mysql_insert_id();
}
#######################################Error 6###############################################################
if(!$sql6)
{ $msg = $result6."\n";
$msg .= "####Error 6####";
trigger_error($msg, E_USER_ERROR);
include ("Errorreport.php");
$delete = mysql_query("DELETE FROM tableofflinegathering WHERE ID_Gathering = '$IDOfflineGathering'"); }
#############################################################################################################
if($sql6)
{
foreach($_POST['formHigherTaxon2'] as $index2 => $HigherTaxaFree2)
{
if(!empty($HigherTaxaFree2)) {
$Rank2 = $_POST['hiddenHigherTaxon2'][$index2];
$result8 = "INSERT INTO tableofflinehighertaxon (ID_Taxa, HigherTaxon, TaxonRank, Created_Who) " .
"VALUES ('$IDOfflineTaxa2','$HigherTaxaFree2','$Rank2','$log')";
$sql8 = mysql_query($result3);
}
}
foreach($_POST['formHigherTaxonList2'] as $index => $HigherTaxa2)
{
if(!empty($HigherTaxa2)) {
$resultHigherTaxon = mysql_query("SELECT HigherTaxon FROM tablecachehighertaxa WHERE ID_HigherTaxon = '$HigherTaxa2'");
while($row = mysql_fetch_object($resultHigherTaxon))
{ $HigherTaxon2 = $row->HigherTaxon; }
if(!empty($HigherTaxon2)) {
$Rank2 = $_POST['hiddenHigherTaxon2'][$index];
$result8 = "INSERT INTO tableofflinehighertaxon (ID_Taxa, HigherTaxon, TaxonRank, Created_Who) " .
"VALUES ('$IDOfflineTaxa2','$HigherTaxon2','$Rank2','$log')";
$sql8 = mysql_query($result8);
}
}}
#######################################Error 8###############################################################
if(!$sql8)
{ $msg = $result8."\n";
$msg .= "####Error 8####";
trigger_error($msg, E_USER_ERROR);
include ("Errorreport.php");
$delete1 = mysql_query("DELETE FROM tableofflinegathering WHERE ID_Gathering = '$IDOfflineGathering'");
$delete2 = mysql_query("DELETE FROM tableofflinetaxa WHERE ID_Gathering = '$IDOfflineGathering'");
}
#############################################################################################################
}//if(!empty($Add2)
/*-- Add further identifications No.3 ----------------#
# #
# #
# #
#-----------------------------------------------------*/
if(!empty($Add3))
{
if($formGenusList3!="")
{
$resultGenus = mysql_query ("SELECT Genus FROM tablecachetaxonidentified WHERE ID_TaxonIdentified = '".$formGenusList3."'");
while($row = mysql_fetch_object($resultGenus))
{$formGenus3 = $row->Genus; }
}
if($formSubgenusList3!="")
{
$resultSubgenus = mysql_query ("SELECT Subgenus FROM tablecachetaxonidentified WHERE ID_TaxonIdentified = '".$formSubgenusList3."'");
while($row = mysql_fetch_object($resultSubgenus))
{$formSubgenus3 = $row->Subgenus; }
}
$NameAuthorYear3 = $formGenus3;
if($formSubgenus3) { $NameAuthorYear3 .= " ".$formSubgenus3; }
if($formFirstEpithet3) { $NameAuthorYear3 .= " ".$formFirstEpithet3; }
if($formRank3) { $NameAuthorYear3 .= " ".$formRank3; }
if($formSecondEpithet3) { $NameAuthorYear3 .= " ".$formSecondEpithet3; }
if($formAuthor3) { $NameAuthorYear3 .= " ".$formAuthor3; }
if($formAuthorYear3) { $NameAuthorYear3 .= ", ".$formAuthorYear3; }
if($sql1)
{
$sqlAuthor3 = addslashes($formAuthor3);
$sqlNameAuthorYear3 = addslashes($NameAuthorYear3);
$sqlIdentifier3 = addslashes($formIdentifier3);
$result9 = "INSERT INTO tableofflinetaxa (ID_Gathering, Genus, Subgenus, FirstEpithet, Author, Year, Rank, SecondEpithet, NameAuthorYear, Identifier, IdentificationDate, PreferredFlag, Notes, Created_Who)" .
"VALUES ('$IDOfflineGathering','$formGenus3','$formSubgenus3','$formFirstEpithet3','$sqlAuthor3','$formAuthorYear3','$formRank3','$formSecondEpithet3','$sqlNameAuthorYear3','$sqlIdentifier3','$formIdentificationDate3','$PreferredFlag4','$formIdentNotes4','$log')";
$sql9 = mysql_query($result9);
$IDOfflineTaxa3 = mysql_insert_id();
}
#######################################Error 9###############################################################
if(!$sql9)
{ $msg = $result9."\n";
$msg .= "####Error 9####";
trigger_error($msg, E_USER_ERROR);
include ("Errorreport.php");
$delete = mysql_query("DELETE FROM tableofflinegathering WHERE ID_Gathering = '$IDOfflineGathering'");
}
#############################################################################################################
if($sql9)
{
foreach($_POST['formHigherTaxon3'] as $index2 => $HigherTaxaFree3)
{
if(!empty($HigherTaxaFree3)) {
$Rank3 = $_POST['hiddenHigherTaxon3'][$index2];
$result10 = "INSERT INTO tableofflinehighertaxon (ID_Taxa, HigherTaxon, TaxonRank, Created_Who) " .
"VALUES ('$IDOfflineTaxa3','$HigherTaxaFree3','$Rank','$log')";
$sql10 = mysql_query($result10);
}
}
foreach($_POST['formHigherTaxonList3'] as $index => $HigherTaxa3)
{
if(!empty($HigherTaxa3)) {
$resultHigherTaxon = mysql_query("SELECT HigherTaxon FROM tablecachehighertaxa WHERE ID_HigherTaxon = '$HigherTaxa3'");
while($row = mysql_fetch_object($resultHigherTaxon))
{ $HigherTaxon3 = $row->HigherTaxon; }
if(!empty($HigherTaxon3)) {
$Rank3 = $_POST['hiddenHigherTaxon'][$index];
$result10 = "INSERT INTO tableofflinehighertaxon (ID_Taxa, HigherTaxon, TaxonRank, Created_Who) " .
"VALUES ('$IDOfflineTaxa3','$HigherTaxon3','$Rank3','$log')";
$sql10 = mysql_query($result10);
}
}}
#######################################Error 10###############################################################
if(!$sql10)
{ $msg = $result10."\n";
$msg .= "####Error 10####";
trigger_error($msg, E_USER_ERROR);
include ("Errorreport.php");
$delete1 = mysql_query("DELETE FROM tableofflinegathering WHERE ID_Gathering = '$IDOfflineGathering'");
$delete2 = mysql_query("DELETE FROM tableofflinetaxa WHERE ID_Gathering = '$IDOfflineGathering'");
}
#############################################################################################################
} //if($sql8)
}//if(!empty($Add3)
/*------------------------ END FURTHER IDENTIFICATIONS -------------------------------------------------*/
}
} //else
}
if ($sql1 and $sql2 and $sql3)
{ echo "Data have been saved! Specimen Number: ".$formSpecimenNumber." Institution Code: ".$formInstitutionCode." Collection Code: ".$formCollectionCode." Taxon Name: ".$NameAuthorYear." "; }
}//if ($formSubmitSave)
?>
|
|
|
|
|
|