100)
$page = 100;
elseif($page<1)
$page = 1;
elseif(!is_numeric($page))
unset($page);
// Variablen vordefinieren
$sql = "";
$sqlcreate = "CREATE TEMPORARY TABLE tmpDnaIDs TYPE=HEAP ";
if(isset($page))
$sqllimit = "LIMIT " . (($page-1) * $pagesize) . "," . ($pagesize + 1);
else
$sqllimit = "LIMIT " . ($pagesize + 1);
if($formSubmitUpdate or $formSubmitVerify)
{ include("update.php"); }
else {
if($formSubmitSave)
{
$version = phpversion();
$result1 = mysql_query
("SELECT tablednabanknumbers.ID_DNA, " .
" tablednabanknumbers.Dna_Bank_Number, " .
" tablednabanknumbers.ID_Cache AS Cache, " .
" tablednabanknumbers.Extraction_Date, " .
" tablednabanknumbers.NoExtractDate, " .
" tablednabanknumbers.Degradation_Date, " .
" tablednabanknumbers.Concentration, " .
" tablednabanknumbers.Absorbance280, " .
" tablednabanknumbers.Absorbance230, " .
" tablednabanknumbers.Quantity_Aliquots, " .
" tablednabanknumbers.Stock_Gone, " .
" tablednabanknumbers.Source_Gone, " .
" tablednabanknumbers.Notes, " .
" tablednabanknumbers.Block_Until, " .
" tablednabanknumbers.Block_General, " .
" tablednabanknumbers.Number_Aliquots, " .
" tablednabanknumbers.Backup_Aliquot, " .
" tablednabanknumbers.ID_Type, " .
" tablednabanknumbers.ID_Tissue, " .
" tablednabanknumbers.ID_RelationDNA_Voucher, " .
" tablednabanknumbers.ID_Preservation, " .
" tablednabanknumbers.ID_Extraction_Method, " .
" tablednabanknumbers.ID_Purification, " .
" tablednabanknumbers.ID_Degradation, " .
" tablednabanknumbers.ID_Extraction_Staff, " .
" tablednabanknumbers.ID_Provided_By_People, " .
" tablednabanknumbers.ID_Location_Stock, " .
" tabletype.Type, " .
" tabletissue.Tissue, " .
" tablerelationdna_voucher.RelationDNA_Voucher, " .
" tablepreservation.Preservation, " .
" tableextractionmethod.Method AS Extraction_Method, " .
" tablepurification.Method AS Purification_Method, " .
" tabledegradation.Degradation, " .
" tablecache.UnitID_Specimen, " .
" tablecache.CollectionCode_Specimen, " .
" tablecache.InstitutionCode_Specimen, " .
" tablecache.ContinentOrOcean, " .
" tablecache.CountryName, " .
" tablecache.CountryISO2, " .
" tablecache.GatheringAgent, " .
" tablecache.GatheringDate, " .
" tablecache.LocalityText, " .
" tablecache.Altitude, " .
" tablecache.LongitudeDecimal, " .
" tablecache.LatitudeDecimal, " .
" tablecache.Gathering_Other, " .
" tablecache.TypeStatus, " .
" tablecache.Created_When AS Created_WhenCache, " .
" tablecache.Created_Who AS Created_WhoCache, " .
" tablecache.ID_Dataset_Specimen, " .
" tablecachetaxonidentified.ID_TaxonIdentified, " .
" tablecachetaxonidentified.Genus, " .
" tablecachetaxonidentified.Subgenus, " .
" tablecachetaxonidentified.FirstEpithet, " .
" tablecachetaxonidentified.SecondEpithet, " .
" tablecachetaxonidentified.Rank, " .
" tablecachetaxonidentified.HybridFlag, " .
" tablecachetaxonidentified.Other, " .
" tablecachetaxonidentified.NameAuthorYear, " .
" tablecachetaxonidentified.PreferredFlag, " .
" tablecachetaxonidentified.Created_When AS Created_WhenIdentified, " .
" tablecachetaxonidentified.Created_Who AS Created_WhoIdentified, " .
" tablecachehighertaxa.ID_HigherTaxon, " .
" tablecachehighertaxa.HigherTaxon, " .
" tablecachehighertaxa.TaxonRank, " .
" tablecachehighertaxa.Created_When AS CreatedWhenHigher, " .
" tablecachehighertaxa.Created_Who AS CreatedWhoHigher, " .
" tablecacheimages.ID_Images, " .
" tablecacheimages.Images, " .
" tablecacheimages.Created_When AS Created_WhenImages, " .
" tablecacheimages.Created_Who AS Created_WhoImages " .
" FROM tablednabanknumbers
LEFT JOIN tablecache ON tablednabanknumbers.ID_Cache = tablecache.ID_Cache
LEFT JOIN tablecachetaxonidentified ON tablecache.ID_Cache = tabletaxonidentified.ID_Cache
LEFT JOIN tablecachehighertaxa ON tablecachetaxonidentified.ID_TaxonIdentified = tablecachehighertaxa.ID_CacheTaxonidentified
LEFT JOIN tablecacheimages ON tablecache.ID_Cache = tablecacheimages.ID_Cache
LEFT JOIN tabletype ON tablednabanknumbers.ID_Type = tabletype.ID_Type
LEFT JOIN tabletissue ON tablednabanknumbers.ID_Tissue = tabletissue.ID_Tissue
LEFT JOIN tablerelationdna_voucher ON tablednabanknumbers.ID_RelationDNA_Voucher = tablerelationdna_voucher.ID_RelationDNA_Voucher
LEFT JOIN tablepreservation ON tablednabanknumbers.ID_Preservation = tablepreservation.ID_Preservation
LEFT JOIN tableextractionmethod ON tablednabanknumbers.ID_Extraction_Method = tableextractionmethod.ID_Method
LEFT JOIN tablepurification ON tablednabanknumbers.ID_Purification = tablepurification.ID_Purification
LEFT JOIN tabledegradation ON tablednabanknumbers.ID_Degradation = tabledegradation.ID_Degradation " .
" WHERE tablednabanknumbers.ID_DNA = '$ID_DNA'");
while($row = mysql_fetch_object($result1))
{
$ID_TaxonIdentified_old = $row->ID_TaxonIdentified;
$Dna_Bank_Number_old = $row->Dna_Bank_Number;
$ID_Cache_old = $row->Cache;
$Extraction_Date_old = $row->Extraction_Date;
$NoExtractDate_old = $row->NoExtractDate;
$Degradation_Date_old = $row->Degradation_Date;
$Concentration_old = $row->Concentration;
$Absorbance280_old = $row->Absorbance280;
$Absorbance230_old = $row->Absorbance230;
$Quantity_Aliquots_old = $row->Quantity_Aliquots;
$Stock_Gone_old = $row->Stock_Gone;
$Source_Gone_old = $row->Source_Gone;
$Backup_Aliquot_old = $row->Backup_Aliquot;
$Notes_old = $row->Notes;
$Block_Until_old = $row->Block_Until;
$BlockGeneral_old = $row->Block_General;
$Number_Aliquots_old = $row->Number_Aliquots;
$Type_old = $row->Type;
$ID_Type_old = $row->ID_Type;
$Tissue_old = $row->Tissue;
$ID_Tissue_old = $row->ID_Tissue;
$RelationDNA_Voucher_old = $row->RelationDNA_Voucher;
$ID_RelationDNA_Voucher_old = $row->ID_RelationDNA_Voucher;
$Preservation_old = $row->Preservation;
$ID_Preservation_old = $row->ID_Preservation;
$Extraction_Method_old = $row->Extraction_Method;
$ID_Extraction_Method_old = $row->ID_Extraction_Method;
$Purification_Method_old = $row->Purification_Method;
$ID_Extraction_Staff_old = $row->ID_Extraction_Staff;
$ID_Purification_Method_old = $row->ID_Purification;
$Degradation_old = $row->Degradation;
$ID_Degradation_old = $row->ID_Degradation;
$ID_Provided_By_People_old = $row->ID_Provided_By_People;
$ID_Location_Stock_old = $row->ID_Location_Stock;
$UnitID_Specimen_old = $row->UnitID_Specimen;
$CollectionCode_Specimen_old = $row->CollectionCode_Specimen;
$InstitutionCode_Specimen_old = $row->InstitutionCode_Specimen;
$ContinentOrOcean_old = $row->ContinentOrOcean;
$CountryName_old = $row->CountryName;
$CountryISO2_old = $row->CountryISO2;
$GatheringAgent_old = $row->GatheringAgent;
$GatheringDate_old = $row->GatheringDate;
$LocalityText_old = $row->LocalityText;
$Altitude_old = $row->Altitude;
$LongitudeDecimal_old = $row->LongitudeDecimal;
$LatitudeDecimal_old = $row->LatitudeDecimal;
$Gathering_Other_old = $row->Gathering_Other;
$TypeStatus_old = $row->TypeStatus;
$Created_WhenCache_old = $row->Created_WhenCache;
$Created_WhoCache_old = $row->Created_WhoCache;
$ID_Dataset_Specimen_old = $row->ID_Dataset_Specimen;
$ID_TaxonIdentified_old = $row->ID_TaxonIdentified;
$Genus_old = $row->Genus;
$Subgenus_old = $row->Subgenus;
$FirstEpithet_old = $row->FirstEpithet;
$SecondEpithet_old = $row->SecondEpithet;
$Rank_old = $row->Rank;
$HybridFlag_old = $row->HybridFlag;
$Other_old = $row->Other;
$NameAuthorYear_old = $row->NameAuthorYear;
$PreferredFlag_old = $row->PreferredFlag;
$Created_WhenIdentified_old = $row->Created_WhenIdentified;
$Created_WhoIdentified_old = $row->Created_WhoIdentified;
$ID_HigherTaxon_old = $row->ID_HigherTaxon;
$HigherTaxon_old = $row->HigherTaxon;
$TaxonRank_old = $row->TaxonRank;
$Created_WhenHigher_old = $row->Created_WhenHigher;
$Created_WhoHigher_old = $row->Created_WhoHigher;
$ID_Images_old = $row->ID_Images;
$Images_old = $row->Images;
$Created_WhenImages_old = $row->Created_WhenImages;
$Created_WhoImages_old = $row->Created_WhoImages;
}
$result2 = mysql_query
("SELECT ID_DNA " .
"FROM tablednabanknumbers " .
"WHERE ID_Cache = '$ID_Cache_old' " .
" AND ID_DNA != '$ID_DNA'");
// Test, if there are other DNA samples from this specimen, if not -> delete specimen from cache
$test = mysql_num_rows($result2);
if($test == 0)
{
$sql1 = "INSERT INTO table_log_cache (ID_Cache, ID_Dataset_Specimen, UnitID_Specimen, CollectionCode_Specimen, InstitutionCode_Specimen, ContinentOrOcean, CountryName, CountryISO2, GatheringAgent, GatheringDate, LocalityText, Altitude, LongitudeDecimal, LatitudeDecimal, Gathering_Other, TypeStatus, Update_Created_Who, Source_Created_When, Source_Created_Who) " .
"(SELECT tablecache.ID_Cache, " .
"'$ID_Dataset_Specimen_old', " .
"'$UnitID_Specimen_old', " .
"'$CollectionCode_Specimen_old', " .
"'$InstitutionCode_Specimen_old', " .
"'$ContinentOrOcean_old', " .
"'$CountryName_old', " .
"'$CountryISO2_old', " .
"'$GatheringAgent_old', " .
"'$GatheringDate_old', " .
"'$LocalityText_old', " .
"'$Altitude_old', " .
"'$LongitudeDecimal_old', " .
"'$LatitudeDecimal_old', " .
"'$Gathering_Other_old', " .
"'$TypeStatus_old', " .
"'$log', " .
"'$Created_WhenCache_old', " .
"'$Created_WhoCache_old' " .
"FROM tablecache " .
"WHERE tablecache.ID_Cache = '$ID_Cache_old')";
$ID_Cache_log = mysql_insert_id();
$result1 = mysql_query($sql1);
if($result1)
{
$sql2 = "INSERT INTO table_log_cachetaxonidentified (ID_CacheTaxonIdentified, ID_Cache, Genus, Subgenus, FirstEpithet, SecondEpithet, Rank, HybridFlag, Other, NameAuthorYear, PreferredFlag, Update_Created_Who, Source_Created_When, Source_Created_Who, ID_Log_Cache) " .
"(SELECT tablecachetaxonidentified.ID_TaxonIdentified, " .
"tablecachetaxonidentified.ID_Cache, " .
"'$Genus_old', " .
"'$Subgenus_old', " .
"'$FirstEpithet_old', " .
"'$SecondEpithet_old', " .
"'$Rank_old', " .
"'$HybridFlag_old', " .
"'$Other_old', " .
"'$NameAuthorYear_old', " .
"'$PreferredFlag_old', " .
"'$log', " .
"'$Created_WhenIdentified_old', " .
"'$Created_WhoIdentified_old', " .
"'$ID_Cache_log' " .
"FROM tablecachetaxonidentified " .
"WHERE tablecachetaxonidentified.ID_Cache = '$ID_Cache_old')";
$ID_Cache_TaxonIdentified_log = mysql_insert_id();
$result2 = mysql_query($sql2);
$sql3 = "INSERT INTO table_log_cacheimages (ID_CacheImages, ID_Cache, Images, Update_Created_Who, Source_Created_When, Source_Created_Who, ID_Log_Cache) " .
"(SELECT tablecacheimages.ID_Images, " .
"'$ID_Cache_old', " .
"'$Images_old', " .
"'$log', " .
"'$Created_WhenImages_old', " .
"'$Created_WhoImages_old' " .
"FROM tablecacheimages " .
"WHERE tablecacheimages.ID_Cache = '$ID_Cache_old')";
$result3 = mysql_query($sql3);
if($result2)
{
} // if($result2)
} //if($result1)
//Speichern in table_log_cache etc.
//Speichern in table_log_dnabanknumbers
//dann erst Löschen in tablecache etc,
//dann erst speichern des neuen Specimens
//dann erste UPDATE von tablednabanknumbers
$sql1 = "DELETE FROM tablecacheimages WHERE ID_Cache = '$ID_Cache'";
$sql2 = "DELETE FROM tablecachehighertaxa WHERE ID_CacheTaxonIdentified = '$ID_TaxonIdentified'";
$sql3 = "DELETE FROM tablecachetaxonidentified WHERE ID_Cache = '$ID_Cache'";
$sql4 = "DELETE FROM tablecache WHERE ID_Cache = '$ID_Cache'";
$result1 = mysql_query($sql1);
$result2 = mysql_query($sql2);
$result3 = mysql_query($sql3);
if($result2 and $result3)
{
$result4 = mysql_query($sql4); }
#######################################Error 1###############################################################
if(!$result1)
{ $msg = $sql1."\n";
$msg .= "####Error 1####";
trigger_error($msg, E_USER_ERROR); }
#############################################################################################################
#######################################Error 2###############################################################
if(!$result2)
{ $msg = $sql2."\n";
$msg .= "####Error 2####";
trigger_error($msg, E_USER_ERROR); }
#############################################################################################################
#######################################Error 3###############################################################
if(!$result3)
{ $msg = $sql3."\n";
$msg .= "####Error 3####";
trigger_error($msg, E_USER_ERROR); }
#############################################################################################################
#######################################Error 4###############################################################
if(!$result4)
{ $msg = $sql4."\n";
$msg .= "####Error 4####";
trigger_error($msg, E_USER_ERROR); }
#############################################################################################################
} //if($test = 0)
// Save new Specimen
$abfrage = urlencode($_POST['formSpecimenNumber']);
if(empty($formProviderIntern) and empty($formProviderExtern) and !empty($formSpecimenNumber))
{
unset($formProviderIntern);
unset($formProviderExtern);
echo 'Please select a Specimen database!';
}
else {
if(!empty($formProviderIntern) and !empty($formProviderExtern))
{
echo 'Please select either an "Internal" or "External" Specimen database!'; }
if(isset($_REQUEST['NoSpecimenAvailable']) and !empty($formSpecimenNumber))
{
echo 'Please complete neither a Specimen Number or select the checkbox!'; }
if(empty($formUnitID))
{
echo 'Please verify the selected specimen at first!'; }
else
{
$variable1 = $_POST[formUnitID];
$variable2 = $_POST[formSourceInstitutionID];
$variable3 = $_POST[formSourceID];
$variable4 = $_POST[formProviderExtern];
$variable5 = $_POST[formTest];
$variable6 = $_POST[formProviderIntern];
if($variable1 != "" and !$formSubmitVerify)
{
$mykey = key($variable1);
if(!empty($variable4))
{
$sql = mysql_query
("SELECT tabledataset.ID_Dataset AS ID_Dataset, " .
" tableschema.QueryPart1b AS QueryPart1b, " .
" tableschema.QueryPart1_1 AS QueryPart1_1, " .
" tableschema.QueryPart1_2b AS QueryPart1_2b, " .
" tableschema.QueryPart2 AS QueryPart2, " .
" tableschema.QueryPart3 AS QueryPart3, " .
" tableschema.QueryPart4 AS QueryPart4, " .
" tableschema.QueryPart5 AS QueryPart5, " .
" tableprovider.Provider AS Provider, " .
" tabledataset.Digir_Resource AS Digir_Resource, " .
" tabledataset.Digir_Source AS Digir_Source, " .
" tableprovider.Provider AS Provider, " .
" tableprovider.ID_Schema AS ID_Schema " .
" FROM tabledataset " .
" LEFT JOIN tableprovider ON tabledataset.ID_Provider = tableprovider.ID_Provider " .
" LEFT JOIN tableschema ON tableprovider.ID_Schema = tableschema.ID_Schema " .
" WHERE tabledataset.ID_Dataset = '$variable4'");
}
if(!empty($variable6))
{
$sql = mysql_query
("SELECT tabledataset.ID_Dataset AS ID_Dataset, " .
" tableschema.QueryPart1b AS QueryPart1b, " .
" tableschema.QueryPart1_1 AS QueryPart1_1, " .
" tableschema.QueryPart1_2b AS QueryPart1_2b, " .
" tableschema.QueryPart2 AS QueryPart2, " .
" tableschema.QueryPart3 AS QueryPart3, " .
" tableschema.QueryPart4 AS QueryPart4, " .
" tableschema.QueryPart5 AS QueryPart5, " .
" tableprovider.Provider AS Provider, " .
" tabledataset.Digir_Resource AS Digir_Resource, " .
" tabledataset.Digir_Source AS Digir_Source, " .
" tableprovider.Provider AS Provider, " .
" tableprovider.ID_Schema AS ID_Schema " .
" FROM tabledataset " .
" LEFT JOIN tableprovider ON tabledataset.ID_Provider = tableprovider.ID_Provider " .
" LEFT JOIN tableschema ON tableprovider.ID_Schema = tableschema.ID_Schema " .
" WHERE tabledataset.ID_Dataset = '$variable6'");
}
if(!empty($formProviderIntern) or !empty($formProviderExtern))
{
while($row = mysql_fetch_object($sql))
{
$ID_Dataset = $row->ID_Dataset;
$Provider = $row->Provider;
$QueryPart1b = $row->QueryPart1b;
$QueryPart1_1 = $row->QueryPart1_1;
$QueryPart1_2b = $row->QueryPart1_2b;
$QueryPart2 = $row->QueryPart2;
$QueryPart3 = $row->QueryPart3;
$QueryPart4 = $row->QueryPart4;
$QueryPart5 = $row->QueryPart5;
$Digir_Resource = $row->Digir_Resource;
$Digir_Source = $row->Digir_Source;
$ID_Schema = $row->ID_Schema;
}
$SourceUnitID = urlencode($variable1[$mykey]);
$SourceInstitutionCode = urlencode($variable2[$mykey]);
$SourceCode = urlencode($variable3[$mykey]);
$Digir_Resource1 = urlencode($Digir_Resource);
$Digir_Source1 = urlencode($Digir_Source);
}
if($abfrage != "" or isset($_REQUEST['NoSpecimenAvailable']))
{
if($variable6 != '1' and $variable6 != '')
{$test1 = 'true'; }
if($variable4 != '1' and $variable4 != '')
{$test2 = 'true'; }
if($test1 == 'true' or $test2 == 'true')
{
$file = $Provider.$QueryPart1b.$Digir_Resource1.$QueryPart1_1.$Digir_Source1.$QueryPart1_2b.$SourceUnitID.$QueryPart3.$SourceInstitutionCode.$QueryPart4.$SourceCode.$QueryPart5;
//echo $file;
if ($version > 5)
{$dom = new DOMDocument();
$dom->Load($file);}
if ($version < 5)
{$xml = file_get_contents($file);}
if($ID_Schema == 1) {
if ($version > 5)
{include ("Save_ABCD1.2.php");}
if($version < 5)
{include ("Save_ABCD1.2_php4.php");} }
if($ID_Schema == 2) {
if ($version > 5)
{include ("Save_ABCD2.06.php");}
if($version < 5)
{include ("Save_ABCD2.06_php4.php");} }
if($ID_Schema == 3) {
if ($version > 5)
{include ("Save_digir.php");}
if($version < 5)
{include ("Save_digir_php4.php");} }
if($ID_Schema == 4) {
{include ("Save_ABCD2.05.php");}
if($version < 5)
{include ("Save_ABCD2.05_php4.php");} }
}
}
if(empty($formUnitID[0]) and $ID_Dataset != '1' and $ID_Dataset != '')
{ echo "No hits. Please verify your entry and selection of specimen database. DNA data have not been saved!";}
if($formTest[0] != "")
{ echo "Please select a specimen or verify your entry!";}
}
if(empty($formTest[0])) {
if($formSpecimenNumber!="" or isset($_REQUEST['NoSpecimenAvailable']))
{
if($formProviderIntern!="" or $formProviderExtern!="")
{include ("Save_Specimen.php"); } }
if($error == "true")
{ $msg = "####Error in Save_Specimen.php####";
trigger_error($msg, E_USER_ERROR);
include ("Errorreport.php"); }
else {
$result2 = "UPDATE tablednabanknumbers SET ID_Cache = '$IDTableCache'";
$sql2 = mysql_query($result2);
}}}}
//4 Klammern ))))
}
/* FEHLERMELDUNG AUSGEBEN
$result = mysql_query($sql) or die($sql.' '.mysql_error()); */
if($formSubmitSearch or $_REQUEST['hitlist'] == "true")
{
$tr = "=";
$no = "!=";
$lk = "like";
$bt = ">=";
$st = "<=";
// $parr = $_POST;
if($_REQUEST['hitlist'] == "true")
{$parr = $_COOKIE; }
if($_REQUEST['hitlist'] == "")
{$parr = $_POST; }
array($parr);
foreach ($parr as $var)
{
$i ++;
if(!empty($var) and $var!="dd.mm.yyyy" and $var!="Search" and $var !="DB " and key($parr)!="PHPSESSID")
{
switch (key($parr))
{
case 'formSpecimenNumber':
$str = "tablecache.UnitID_Specimen ".$tr." '".$var."' AND ";
$description = " Specimen Number = ";
if($_POST['formSpecimenNumber']) {$value = $formSpecimenNumber; }
else {$value = $_COOKIE['formSpecimenNumber'];}
break;
case 'formProviderIntern':
$str = "tablecache.ID_Dataset_Specimen ".$tr." '".$var."' AND ";
$description = " Specimen Database = ";
$result = mysql_query("SELECT ID_Dataset, View FROM tabledataset WHERE ID_Dataset ".$tr." '".$var."'");
while($row = mysql_fetch_object($result))
{$value = $row->View; }
break;
case 'formProviderExtern':
$str = "tablecache.ID_Dataset_Specimen ".$tr." '".$var."' AND ";
$description = " Specimen Database = ";
$result = mysql_query("SELECT ID_Dataset, View FROM tabledataset WHERE ID_Dataset ".$tr." '".$var."'");
while($row = mysql_fetch_object($result))
{$value = $row->View; }
while($row = mysql_fetch_object($result))
{$value = $row->Provider; }
break;
case 'formHigherTaxon':
$str = "tablecachehighertaxa.HigherTaxon ".$lk." '%".$var."%' AND ";
$description = " Higher Taxon = ";
if($_POST['formHigherTaxon']) {$value = $formHigherTaxon;}
else {$value = $_COOKIE['formHigherTaxon'];}
break;
case 'formTaxonName':
$str = "tablecachetaxonidentified.NameAuthorYear ".$lk." '%".$var."%' AND ";
$description = " Taxon Name = ";
if($_POST['formTaxonName']) {$value = $formTaxonName;}
else {$value = $_COOKIE['formTaxonName'];}
break;
/* case 'formGeography':
$str = " (tablecache.ContinentOrOcean ".$lk." '%".$var."%' OR ";
$str .= "tablecache.CountryName ".$lk." '%".$var."%' OR ";
$str .= "tablecache.CountryISO2 ".$lk." '%".$var."%' OR ";
$str .= "tablecache.LocalityText ".$lk." '%".$var."%' ) AND ";
break; */
case 'formCountryList':
$resultCountry = mysql_query ("SELECT CountryName FROM tablecache WHERE ID_Cache = '".$var."'");
while($row = mysql_fetch_object($resultCountry))
{$List = $row->CountryName; }
$str = "tablecache.CountryName ".$tr." '".$List."' AND " ;
$description = " Country = ";
$value = $List;
break;
case 'formCountryListISO':
$resultCountry = mysql_query ("SELECT CountryISO2 FROM tablecache WHERE ID_Cache = '".$var."'");
while($row = mysql_fetch_object($resultCountry))
{$ListISO = $row->CountryISO2; }
$str = "tablecache.CountryISO2 ".$tr." '".$ListISO."' AND " ;
$description = " Country ISO Code = ";
$value = $ListISO;
break;
case 'formContinent':
$str = "tablecache.ContinentOrOcean ".$lk." '%".$var."%' AND ";
$description = " Continent or Ocean = ";
if($_POST['formContinent']) {$value = $formContinent;}
else {$value = $_COOKIE['formContinent'];}
break;
case 'formLocality':
$str = "tablecache.LocalityText ".$lk." '%".$var."%' AND ";
$description = " Locality = ";
if($_POST['formLocality']) {$value = $formLocality;}
else {$value = $_COOKIE['formLocality'];}
break;
case 'formLatFrom':
$str = "tablecache.LatitudeDecimal ".$bt." '".$var."' AND ";
$description = " Latitude >= ";
if($_POST['formLatFrom']) {$value = $formLatFrom;}
else {$value = $_COOKIE['formLatFrom'];}
break;
case 'formLatTo':
$str = "tablecache.LatitudeDecimal ".$st." '".$var."' AND ";
$description = " Latitude <= ";
if($_POST['formLatTo']) {$value = $formLatTo;}
else {$value = $_COOKIE['formLatTo'];}
break;
case 'formLongFrom':
$str = "tablecache.LongitudeDecimal ".$bt." '".$var."' AND ";
$description = " Longitude >= ";
if($_POST['formLongFrom']) {$value = $formLongFrom;}
else {$value = $_COOKIE['formLongFrom'];}
break;
case 'formLongFrom':
$str = "tablecache.LongitudeDecimal ".$st." '".$var."' AND ";
$description = " Longitude <= ";
if($_COOKIE['formLongFrom']) {$value = $formLongTo;}
else {$value = $_COOKIE['formLongFrom'];}
break;
case 'formDnaBankNumber':
$str = "tablednabanknumbers.DNA_Bank_Number ".$tr."'".$var."' AND ";
$description = " DNA Extraction No = ";
if($_POST['formDnaBankNumber']) {$value = $formDnaBankNumber;}
else {$value = $_COOKIE['formDnaBankNumber'];}
break;
case 'formRelation':
$str = "tablednabanknumbers.ID_RelationDNA_Voucher ".$tr."'".$var."' AND ";
$description = " Relation to Voucher = ";
$result = mysql_query("SELECT ID_RelationDNA_Voucher, RelationDNA_Voucher FROM tablerelationdna_voucher WHERE ID_RelationDNA_Voucher ".$tr." '".$var."'");
while($row = mysql_fetch_object($result))
{$value = $row->RelationDNA_Voucher; }
break;
case 'formType':
$str = "tablednabanknumbers.ID_Type ".$tr."'".$var."' AND ";
$description = " Type = ";
$result = mysql_query("SELECT ID_Type, Type FROM tabletype WHERE ID_Type ".$tr." '".$var."'");
while($row = mysql_fetch_object($result))
{$value = $row->Type; }
break;
case 'formPreservation':
$str = "tablednabanknumbers.ID_Preservation ".$tr."'".$var."' AND ";
$description = " Preservation = ";
$result = mysql_query("SELECT ID_Preservation, Preservation FROM tablepreservation WHERE ID_Preservation ".$tr." '".$var."'");
while($row = mysql_fetch_object($result))
{$value = $row->Preservation; }
break;
case 'formTissue':
$str = "tablednabanknumbers.ID_Tissue ".$tr."'".$var."' AND ";
$description = " Tissue = ";
$result = mysql_query("SELECT ID_Tissue, Tissue FROM tabletissue WHERE ID_Tissue ".$tr." '".$var."'");
while($row = mysql_fetch_object($result))
{$value = $row->Tissue; }
break;
case 'formExtractionMethod':
$str = "tablednabanknumbers.ID_Extraction_Method ".$tr."'".$var."' AND ";
$description = " Extraction Method = ";
$result = mysql_query("SELECT ID_Method, Method FROM tableextractionmethod WHERE ID_Method ".$tr." '".$var."'");
while($row = mysql_fetch_object($result))
{$value = $row->Method; }
break;
case 'formExtractionDateFrom':
if ($ExtractionDateFrom!="") {
$str = "tablednabanknumbers.Extraction_Date ".$bt."'".$ExtractionDateFrom."' AND ";
$description = " Extraction Date >= ";
if($_POST['formExtractionDateFrom']) {$value = $formExtractionDateFrom;}
else {$value = $_COOKIE['formExtractionDateFrom'];}
}
break;
case 'formExtractionDateTo':
if ($ExtractionDateTo!="") {
$str = "tablednabanknumbers.Extraction_Date ".$st."'".$ExtractionDateTo."' AND ";
$description = " Extraction Date <= ";
if($_POST['formExtractionDateTo']) {$value = $formExtractionDateTo;}
else {$value = $_COOKIE['formExtractionDateTo'];}
}
break;
case 'formNoExtractDate':
$str = "tablednabanknumbers.NoExtractDate ".$tr."'".$var."' AND ";
$description = " Extraction Date = ";
$value = "Not available";
break;
case 'formExtractionStaff':
$str = "tablednabanknumbers.ID_Extraction_Staff ".$tr."'".$var."' AND ";
$description = " Extraction Staff = ";
$result = mysql_query("SELECT ID_People, Name_All FROM tablepeople WHERE ID_People ".$tr." '".$var."'");
while($row = mysql_fetch_object($result))
{$value = $row->Name_All; }
break;
case 'formPurificationMethod':
$str = "tablednabanknumbers.ID_Purification ".$tr."'".$var."' AND ";
$description = " Purification Method = ";
$result = mysql_query("SELECT ID_Purification, Method FROM tablepurification WHERE ID_Purification ".$tr." '".$var."'");
while($row = mysql_fetch_object($result))
{$value = $row->Method; }
break;
case 'formAbsorbance280From':
$str = "tablednabanknumbers.Absorbance280 ".$bt."'".$var."' AND ";
$description = " Absorbance 280/260 >= ";
if($_POST['formAbsorbance280From']) {$value = $formAbsorbance280From;}
else {$value = $_COOKIE['formAbsorbance280From'];}
break;
case 'formAbsorbance280To':
$str = "tablednabanknumbers.Absorbance280 ".$st."'".$var."' AND ";
$description = " Absorbance 280/260 <= ";
if($_POST['formAbsorbance280To']) {$value = $formAbsorbance280To;}
else {$value = $_COOKIE['formAbsorbance280To'];}
break;
case 'formAbsorbance230From':
$str = "tablednabanknumbers.Absorbance230 ".$bt."'".$var."' AND ";
$description = " Absorbance 230/260 >= ";
if($_POST['formAbsorbance230From']) {$value = $formAbsorbance230From;}
else {$value = $_COOKIE['formAbsorbance230From'];}
break;
case 'formAbsorbance230To':
$str = "tablednabanknumbers.Absorbance230 ".$st."'".$var."' AND ";
$description = " Absorbance 230/260 <= ";
if($_POST['formAbsorbance230To']) {$value = $formAbsorbance230To;}
else {$value = $_COOKIE['formAbsorbance230To'];}
break;
case 'formConcentrationFrom':
$str = "tablednabanknumbers.Concentration ".$bt."'".$var."' AND ";
$description = " Concentration <= ";
if($_POST['formConcentrationFrom']) {$value = $formConcentrationFrom;}
else {$value = $_COOKIE['formConcentrationFrom'];}
break;
case 'formConcentrationTo':
$str = "tablednabanknumbers.Concentration ".$st."'".$var."' AND ";
$description = " Concentration >= ";
if($_POST['formConcentrationTo']) {$value = $formConcentrationTo;}
else {$value = $_COOKIE['formConcentrationTo'];}
break;
case 'formDegradation':
$str = "tablednabanknumbers.ID_Degradation ".$tr."'".$var."' AND ";
$description = " Quality = ";
$result = mysql_query("SELECT ID_Degradation, Degradation FROM tabledegradation WHERE ID_Degradation ".$tr." '".$var."'");
while($row = mysql_fetch_object($result))
{$value = $row->Degradation; }
break;
case 'formDegradationDateFrom':
if ($DegradationDateFrom!="") {
$str = "tablednabanknumbers.Degradation_Date ".$bt."'".$DegradationDateFrom."' AND ";
$description = " Quality Check Date >= ";
if($_POST['formDegradationDateFrom']) {$value = $formDegradationDateFrom;}
else {$value = $_COOKIE['formDegradationDateFrom'];}
}
break;
case 'formDegradationDateTo':
if ($DegradationDateTo!="") {
$str = "tablednabanknumbers.Degradation_Date ".$st."'".$DegradationDateTo."' AND ";
$description = " Quality Check Date <= ";
if($_POST['formDegradationDateTo']) {$value = $formDegradationDateTo;}
else {$value = $_COOKIE['formDegradationDateTo'];}
}
break;
case 'formNumberAliquots':
$str = "tablednabanknumbers.Number_Aliquots ".$tr."'".$var."' AND ";
$description = " Number of Aliquots = ";
if($_POST['formNumberAliquots']) {$value = $formNumberAliquots;}
else {$value = $_COOKIE['formNumberAliquots'];}
break;
case 'formQuantityAliquotsFrom':
$str = "tablednabanknumbers.Quantity_Aliquots ".$bt."'".$var."' AND ";
$description = " Volume Aliquot >= ";
if($_POST['formQuantityAliquotsFrom']) {$value = $formQuantityAliquotsFrom;}
else {$value = $_COOKIE['formQuantityAliquotsFrom'];}
break;
case 'formQuantityAliquotsTo':
$str = "tablednabanknumbers.Quantity_Aliquots ".$st."'".$var."' AND ";
$description = " Volume Aliquot <= ";
if($_POST['formQuantityAliquotsTo']) {$value = $formQuantityAliquotsTo;}
else {$value = $_COOKIE['formQuantityAliquotsTo'];}
break;
case 'radioAmplification':
$description = " Amplification success = ";
if($radioAmplification=="Yes" or $_COOKIE['radioAmplification']=="Yes") {
$str = "tablednabanknumbers.Amplification_Success ".$tr."'Yes' AND ";
$value = "Yes";}
if($radioAmplification=="No" or $_COOKIE['radioAmplification']=="No") {
$str = "tablednabanknumbers.Amplification_Success ".$tr."'No' AND ";
$value = "No";}
break;
case 'formAmplificationDateFrom':
if ($AmplificationDateFrom!="") {
$str = "tableamplifications.Amplification_Date ".$bt."'".$AmplificationDateFrom."' AND ";
$description = " Amplification Date >= ";
if($_POST['formAmplificationDateFrom']) {$value = $formAmplificationDateFrom;}
else {$value = $_COOKIE['formAmplificationDateFrom'];}
}
break;
case 'formAmplificationDateTo':
if ($AmplificationDateTo!="") {
$str = "tableamplifications.Amplification_Date ".$st."'".$AmplificationDateTo."' AND ";
$description = " Amplification Date <= ";
if($_POST['formAmplificationDateTo']) {$value = $formAmplificationDateTo;}
else {$value = $_COOKIE['formAmplificationDateTo'];}
}
break;
case 'formAmplificationStaff':
$str = "tableamplifications.ID_Amplification_Staff ".$tr."'".$var."' AND ";
$description = " Amplification Staff = ";
$result = mysql_query("SELECT ID_People, Name_All FROM tablepeople WHERE ID_People ".$tr." '".$var."'");
while($row = mysql_fetch_object($result))
{$value = $row->Name_All; }
break;
case 'formFragment':
$str = "tableamplifications.ID_Fragment ".$tr."'".$var."' AND ";
$description = " Fragment = ";
$result = mysql_query("SELECT ID_Fragment, Fragment FROM tablefragment WHERE ID_Fragment ".$tr." '".$var."'");
while($row = mysql_fetch_object($result))
{$value = $row->Fragment; }
break;
case 'formGenbankNumber':
$str = "tableamplifications.GenBankNumber ".$lk."'%".$var."%' AND ";
$description = " Gen Bank Accession No = ";
if($_POST['formGenbankNumber']) {$value = $formGenbankNumber;}
else {$value = $_COOKIE['formGenbankNumber'];}
break;
case 'radioGenBank':
$description = " Gen Bank Accession No = ";
if($radioGenBank=="Yes" or $_COOKIE['radioGenBank']=="Yes") {
$str = 'tablednabanknumbers.ID_DNA '.$tr.' tableamplifications.ID_DNA AND ';
$value = "existent";}
if($radioGenBank=="No" or $_COOKIE['radioGenBank']=="No") {
$str = "tablednabanknumbers.ID_DNA NOT IN (SELECT ID_DNA FROM tableamplifications) AND ";
$value = "not existent";}
break;
case 'formStockFridge':
$str = "tablelocation_stock.ID_Stock_Fridge ".$tr."'".$var."' AND ";
$description = " Stock Fridge = ";
if($_POST['formStockFridge']) {$value = $formStockFridge;}
else {$value = $_COOKIE['formStockFridge'];}
break;
case 'formStockRack':
$str = "tablelocation_stock.ID_Stock_Rack ".$tr."'".$var."' AND ";
$description = " Stock Rack = ";
if($_POST['formStockRack']) {$value = $formStockRack; }
else {$value = $_COOKIE['formStockRack'];}
break;
case 'formStockBox':
$str = "tablelocation_stock.ID_Stock_Box ".$tr."'".$var."' AND ";
$description = " Stock Box = ";
if($_POST['formStockBox']) {$value = $formStockBox;}
else {$value = $_COOKIE['formStockBox'];}
break;
case 'formProvider':
$str = "tablednabanknumbers.ID_Provided_By_People ".$tr."'".$var."' AND ";
$description = " Provided By = ";
$result = mysql_query("SELECT ID_People, Name_All FROM tablepeople WHERE ID_People ".$tr." '".$var."'");
while($row = mysql_fetch_object($result))
{$value = $row->Name_All; }
break;
case 'formAliquotsFridge':
$str = "tablealiquots.ID_Aliquots_Fridge ".$tr."'".$var."' AND ";
$description = " Aliquots Fridge = ";
if($_POST['formAliquotsFridge']) {$value = $formAliquotsFridge;}
else {$value = $_COOKIE['formAliquotsFridge'];}
break;
case 'formAliquotsRack':
$str = "tablealiquots.ID_Aliquots_Rack ".$tr."'".$var."' AND ";
$description = " Aliquots Rack = ";
if($_POST['formAliquotsRack']) {$value = $formAliquotsRack;}
else {$value = $_COOKIE['formAliquotsRack'];}
break;
case 'formAliquotsBox':
$str = "tablealiquots.ID_Aliquots_Box ".$tr."'".$var."' AND ";
$description = " Aliquots Box = ";
if($_POST['formAliquotsBox']) {$value = $formAliquotsBox;}
else {$value = $_COOKIE['formAliquotsBox'];}
break;
case 'radioSource':
$description = " Source material = ";
if($radioSource=="Yes" or $_COOKIE['radioSource']=="Yes") {
$str = "tablednabanknumbers.Source_Gone ".$tr."'1' AND ";
$value = "gone";}
if($radioSource=="No" or $_COOKIE['radioSource']=="No") {
$str = "tablednabanknumbers.Source_Gone ".$tr."'0' AND ";
$value = "available"; }
break;
case 'radioStock':
$description = " Stock material = ";
if($radioStock=="Yes" or $_COOKIE['radioStock']=="Yes") {
$str = "tablednabanknumbers.Stock_Gone ".$tr."'1' AND ";
$value ="gone"; }
if($radioStock=="No" or $_COOKIE['radioStock']=="No") {
$str = "tablednabanknumbers.Stock_Gone ".$tr."'0' AND ";
$value ="available"; }
break;
case 'radioBackup':
$description = " Backup Aliquot made = ";
if($radioBackup=="Yes" or $_COOKIE['radioBackup']=="Yes") {
$str = "tablednabanknumbers.Backup_Aliquot ".$tr."'1' AND ";
$value = "yes"; }
if($radioBackup=="No" or $_COOKIE['radioBackup']=="No") {
$str = "tablednabanknumbers.Backup_Aliquot ".$tr."'0' AND ";
$value = "no"; }
break;
case 'formBlockDateFrom':
if ($BlockDateFrom!="") {
$str = "tablednabanknumbers.Block_Until ".$bt."'".$BlockDateFrom."' AND ";
$description = " Block until >= ";
if($_POST['formBlockDateFrom']) {$value = $formBlockDateFrom;}
else {$value = $_COOKIE['formBlockDateFrom'];} }
break;
case 'formBlockDateTo':
if ($BlockDateTo!="") {
$str = "tablednabanknumbers.Block_Until ".$st."'".$BlockDateTo."' AND ";
$description = " Block until <= ";
if($_POST['formBlockDateTo']) {$value = $formBlockDateTo;}
else {$value = $_COOKIE['formBlockDateTo'];} }
break;
case 'formBlockGeneral':
$str = "tablednabanknumbers.Block_General ".$tr."'1' AND ";
$description = " Blocked in general = ";
$value ="yes";
break;
case 'formRequest':
$str = "tablerequest.ID_People ".$tr."'".$var."' AND ";
$description = " Requested By = ";
$result = mysql_query("SELECT ID_People, Name_All FROM tablepeople WHERE ID_People ".$tr." '".$var."'");
while($row = mysql_fetch_object($result))
{$value = $row->Name_All; }
break;
case 'formNotes':
$str = "tablednabanknumbers.Notes ".$lk."'%".$var."%' AND ";
$description = " Notes = ";
if($_POST['formNotes']) {$value = $formNotes;}
else {$value = $_COOKIE['formNotes'];}
break;
}
$where[$i] = $str;
$descriptionall[$i] = $description;
$valueall[$i] = $value;
}
next($parr);
}
if(empty($str))
{ echo ""; }
else {
foreach($where AS $a) $string .= $a;
$l=strlen ($string);
$max = $l-4;
$where_str = substr($string, 0, $max);
$wherestr = ' WHERE ' . $where_str;
//abfrage
mysql_query("DROP TABLE IF EXISTS tmpDnaIDs");
$sqlType = "Dna";
$sql = $sqlcreate .
$sql = "SELECT DISTINCT tablednabanknumbers.ID_DNA FROM tablednabanknumbers
LEFT JOIN tablecache ON tablednabanknumbers.ID_Cache = tablecache.ID_Cache
LEFT JOIN tablecachetaxonidentified ON tablecache.ID_Cache = tablecachetaxonidentified.ID_Cache
LEFT JOIN tablecachehighertaxa ON tablecachetaxonidentified.ID_TaxonIdentified = tablecachehighertaxa.ID_CacheTaxonidentified
LEFT JOIN tableamplifications ON tablednabanknumbers.ID_DNA = tableamplifications.ID_DNA
LEFT JOIN tablelocation_stock ON tablelocation_stock.ID_Location_Stock = tablednabanknumbers.ID_Location_Stock
LEFT JOIN tablealiquots ON tablednabanknumbers.ID_DNA = tablealiquots.ID_DNA
LEFT JOIN tablerequest ON tablednabanknumbers.ID_DNA = tablerequest.ID_DNA " .
$wherestr.$sqllimit;
$result = mysql_query($sql) or die($sql.' '.mysql_error());
} } //if($formSubmitSearch)
else
{
if($formSubmitSaveEdit)
{
//$log = $_SESSION["log"];
$Current_Date = date('Y-m-d H:i:s');
$result2a = mysql_query
("SELECT tablednabanknumbers.ID_DNA, " .
" tablepeople.Name_All " .
" FROM tablednabanknumbers, tablepeople " .
" WHERE tablednabanknumbers.ID_Extraction_Staff = tablepeople.ID_People " .
" AND tablednabanknumbers.ID_DNA = '$ID_DNA'");
while($row = mysql_fetch_object($result2a))
{ $Extraction_Staff_old = $row->Name_All; }
$result3a = mysql_query
("SELECT tablednabanknumbers.ID_DNA, " .
" tablepeople.Name_All " .
" FROM tablednabanknumbers, tablepeople " .
" WHERE tablednabanknumbers.ID_Provided_By_People = tablepeople.ID_People " .
" AND tablednabanknumbers.ID_DNA = '$ID_DNA'");
while($row = mysql_fetch_object($result3a))
{ $Provided_By_People_old = $row->Name_All; }
$result4a = mysql_query
("SELECT tablednabanknumbers.ID_DNA, " .
" tablestock_fridge.Stock_Fridge, " .
" tablestock_rack.Stock_Rack, " .
" tablestock_box.Stock_Box, " .
" tablelocation_stock.ID_Stock_Fridge, " .
" tablelocation_stock.ID_Stock_Rack, " .
" tablelocation_stock.ID_Stock_Box, " .
" tablelocation_stock.Rest_Quantity, " .
" tablelocation_stock.Stock_Barcode, " .
" tablelocation_stock.Stock_Position " .
" FROM tablednabanknumbers " .
" LEFT JOIN tablelocation_stock ON tablednabanknumbers.ID_Location_Stock = tablelocation_stock.ID_Location_Stock " .
" LEFT JOIN tablestock_fridge ON tablelocation_stock.ID_Stock_Fridge = tablestock_fridge.ID_Stock_Fridge " .
" LEFT JOIN tablestock_rack ON tablelocation_stock.ID_Stock_Rack = tablestock_rack.ID_Stock_Rack " .
" LEFT JOIN tablestock_box ON tablelocation_stock.ID_Stock_Box = tablestock_box.ID_Stock_Box " .
" WHERE tablednabanknumbers.ID_DNA = '$ID_DNA'");
while($row = mysql_fetch_object($result4a))
{ $Stock_Fridge = $row->Stock_Fridge;
$Stock_Rack = $row->Stock_Rack;
$Stock_Box = $row->Stock_Box;
$ID_Stock_Fridge_old = $row->ID_Stock_Fridge;
$ID_Stock_Rack_old = $row->ID_Stock_Rack;
$ID_Stock_Box_old = $row->ID_Stock_Box;
$Stock_Rest_old = $row->Rest_Quantity;}
//NORMAL:
$Location_Stock_old = "Fridge: " . $Stock_Fridge . " Rack: " . $Stock_Rack . " Box: " . $Stock_Box;
//ZSM München
//$Location_Stock_old = "Fridge: " . $Stock_Fridge . " Drawer: " . $Stock_Box . " Rack: " . $Stock_Rack . " Position: " . $Stock_Position . " Barcode: " . $Stock_Barcode;
$result6a = mysql_query
("SELECT tablednabanknumbers.Dna_Bank_Number, " .
"tablednabanknumbers.ID_Cache, " .
"tablednabanknumbers.Extraction_Date, " .
"tablednabanknumbers.NoExtractDate, " .
"tablednabanknumbers.Degradation_Date, " .
"tablednabanknumbers.Concentration, " .
"tablednabanknumbers.Absorbance280, " .
"tablednabanknumbers.Absorbance230, " .
"tablednabanknumbers.Quantity_Aliquots, " .
"tablednabanknumbers.Stock_Gone, " .
"tablednabanknumbers.Source_Gone, " .
"tablednabanknumbers.Notes, " .
"tablednabanknumbers.Block_Until, " .
"tablednabanknumbers.Block_General, " .
"tablednabanknumbers.Number_Aliquots, " .
"tablednabanknumbers.Backup_Aliquot, " .
"tablednabanknumbers.ID_Type, " .
"tablednabanknumbers.ID_Tissue, " .
"tablednabanknumbers.ID_RelationDNA_Voucher, " .
"tablednabanknumbers.ID_Preservation, " .
"tablednabanknumbers.ID_Extraction_Method, " .
"tablednabanknumbers.ID_Purification, " .
"tablednabanknumbers.ID_Degradation, " .
"tablednabanknumbers.ID_Extraction_Staff, " .
"tablednabanknumbers.ID_Provided_By_People, " .
"tablednabanknumbers.ID_Location_Stock, " .
"tabletype.Type, " .
"tabletissue.Tissue, " .
"tablerelationdna_voucher.RelationDNA_Voucher, " .
"tablepreservation.Preservation, " .
"tableextractionmethod.Method AS Extraction_Method, " .
"tablepurification.Method AS Purification_Method, " .
"tabledegradation.Degradation " .
"FROM tablednabanknumbers " .
"LEFT JOIN tabletype ON tablednabanknumbers.ID_Type = tabletype.ID_Type " .
"LEFT JOIN tabletissue ON tablednabanknumbers.ID_Tissue = tabletissue.ID_Tissue " .
"LEFT JOIN tablerelationdna_voucher ON tablednabanknumbers.ID_RelationDNA_Voucher = tablerelationdna_voucher.ID_RelationDNA_Voucher " .
"LEFT JOIN tablepreservation ON tablednabanknumbers.ID_Preservation = tablepreservation.ID_Preservation " .
"LEFT JOIN tableextractionmethod ON tablednabanknumbers.ID_Extraction_Method = tableextractionmethod.ID_Method " .
"LEFT JOIN tablepurification ON tablednabanknumbers.ID_Purification = tablepurification.ID_Purification " .
"LEFT JOIN tabledegradation ON tablednabanknumbers.ID_Degradation = tabledegradation.ID_Degradation " .
"WHERE tablednabanknumbers.ID_DNA = '$ID_DNA'");
while($row = mysql_fetch_object($result6a))
{ $Dna_Bank_Number_old = $row->Dna_Bank_Number;
$ID_Cache_old = $row->ID_Cache;
$Extraction_Date_old = $row->Extraction_Date;
$NoExtractDate_old = $row->NoExtractDate;
$Degradation_Date_old = $row->Degradation_Date;
$Concentration_old = $row->Concentration;
$Absorbance280_old = $row->Absorbance280;
$Absorbance230_old = $row->Absorbance230;
$Quantity_Aliquots_old = $row->Quantity_Aliquots;
$Stock_Gone_old = $row->Stock_Gone;
$Source_Gone_old = $row->Source_Gone;
$Backup_Aliquot_old = $row->Backup_Aliquot;
$Notes_old = $row->Notes;
$Block_Until_old = $row->Block_Until;
$BlockGeneral_old = $row->Block_General;
$Number_Aliquots_old = $row->Number_Aliquots;
$Type_old = $row->Type;
$ID_Type_old = $row->ID_Type;
$Tissue_old = $row->Tissue;
$ID_Tissue_old = $row->ID_Tissue;
$RelationDNA_Voucher_old = $row->RelationDNA_Voucher;
$ID_RelationDNA_Voucher_old = $row->ID_RelationDNA_Voucher;
$Preservation_old = $row->Preservation;
$ID_Preservation_old = $row->ID_Preservation;
$Extraction_Method_old = $row->Extraction_Method;
$ID_Extraction_Method_old = $row->ID_Extraction_Method;
$Purification_Method_old = $row->Purification_Method;
$ID_Extraction_Staff_old = $row->ID_Extraction_Staff;
$ID_Purification_Method_old = $row->ID_Purification;
$Degradation_old = $row->Degradation;
$ID_Degradation_old = $row->ID_Degradation;
$ID_Provided_By_People_old = $row->ID_Provided_By_People;
$ID_Location_Stock_old = $row->ID_Location_Stock; }
if(empty($formAmplificationID))
{}
else {
foreach ($formAmplificationID as $index => $AmplificationIDTest)
{
$LinkTest = $formLink[$index];
$GenBankNumberTest = $formGenBankNo[$index];
$FragmentIDTest = $formFragment[$index];
$Amplification_StaffIDTest = $formAmplificationStaff[$index];
$formAmplificationDate = $formAmplificationDate2[$index];
if($formAmplificationDate=="dd.mm.yyyy")
unset($formAmplificationDate);
else {
$AmplificationDate_split = explode (".", $formAmplificationDate);
$AmplificationDate = $AmplificationDate_split[2] . "-" . $AmplificationDate_split[1] . "-" . $AmplificationDate_split[0];
}
$Amplification_SuccessTest = $radioAmplification[$index];
$resultAmplification = mysql_query
("SELECT tablednabanknumbers.ID_DNA, " .
" tableamplifications.GenBankNumber AS GenBankNumber, " .
" tableamplifications.Link AS Link, " .
" tableamplifications.ID_Fragment, " .
" tablefragment.Fragment AS Fragment, " .
" tablepeople.ID_People AS ID_People, " .
" tablepeople.Name_All AS Name_All, " .
" tableamplifications.Amplification_Success, " .
" tableamplifications.Amplification_Date " .
" FROM tablednabanknumbers " .
" LEFT JOIN tableamplifications ON tablednabanknumbers.ID_DNA = tableamplifications.ID_DNA " .
" LEFT JOIN tablefragment ON tableamplifications.ID_Fragment = tablefragment.ID_Fragment " .
" LEFT JOIN tablepeople ON tableamplifications.ID_Amplification_Staff = tablepeople.ID_People " .
" WHERE tableamplifications.ID_Amplification = '$AmplificationIDTest' " .
" ORDER BY tableamplifications.ID_Amplification");
if(empty($AmplificationIDTest))
{}
else {
while($row = mysql_fetch_object($resultAmplification))
{
$GenBankNumber_old = $row->GenBankNumber;
$Link_old = $row->Link;
$Fragment_old = $row->Fragment;
$Amplification_Staff_old = $row->Name_All;
$AmplificationDate_old = $row->Amplification_Date;
$Amplification_Success_old = $row->Amplification_Success;
if ($row->Link != $LinkTest or $row->GenBankNumber != $GenBankNumberTest or $row->ID_Fragment != $FragmentIDTest or $row->ID_People != $Amplification_StaffIDTest or DatumsWandler($row->Amplification_Date) != $formAmplificationDate or $row->Amplification_Success != $Amplification_SuccessTest)
{
$result1 = "INSERT INTO table_log_amplifications (ID_Amplification, ID_DNA, Fragment, GenBankNumber, Link, Amplification_Staff, Amplification_Date, Amplification_Success, Update_Created_Who, Source_Created_Who, Source_Created_When) " .
" (SELECT tableamplifications.ID_Amplification, " .
"tableamplifications.ID_DNA, " .
"'$Fragment_old', " .
"'$GenBankNumber_old', " .
"'$Link_old', " .
"'$Amplification_Staff_old', " .
"'$AmplificationDate_old', " .
"'$Amplification_Success_old', " .
"'$log', " .
"tableamplifications.Created_Who, " .
"tableamplifications.Created_When " .
"FROM tableamplifications " .
"WHERE tableamplifications.ID_Amplification = '$AmplificationIDTest')";
$sql1 = mysql_query($result1);
#######################################Error 1###############################################################
if(!$sql1)
{ $msg = $result1."\n";
$msg .= "####Error 1####";
trigger_error($msg, E_USER_ERROR);
$test1 = "false1"; }
#############################################################################################################
if ($sql1)
{
$result2 = "UPDATE tableamplifications SET GenBankNumber = '$GenBankNumberTest', " .
"Link = '$LinkTest', " .
"ID_Fragment = '$FragmentIDTest', " .
"ID_Amplification_Staff = '$Amplification_StaffIDTest', " .
"Amplification_Date = '$AmplificationDate', " .
"Amplification_Success = '$Amplification_SuccessTest', " .
"Update_Who = '$log', " .
"Update_When = '$Current_Date' " .
"WHERE tableamplifications.ID_Amplification = '$AmplificationIDTest'";
$sql2 = mysql_query($result2);
#######################################Error 2###############################################################
if(!$sql2)
{ $msg = $result2."\n";
$msg .= "####Error 2####";
trigger_error($msg, E_USER_ERROR);
$test1 = "false2"; }
#############################################################################################################
}
}
} //while
}
} //foreach Ende $formGenBankID
}
$QuantityAliquots = array_sum($_POST['formRestQuantity']);
foreach ($formLocationAliquotsID as $index => $AliquotsID)
{
$AliquotsFridge = $formAliquotsFridge[$index];
$AliquotsRack = $formAliquotsRack[$index];
$AliquotsBox = $formAliquotsBox[$index];
$RestQuantity = $formRestQuantity[$index];
$SourceQuantity = $formSourceQuantity[$index];
$Positions = $_POST['PositionAliquot'][$index];
$resultAliquots = mysql_query
("SELECT tablednabanknumbers.ID_DNA, " .
" tablealiquots.Aliquot_Number, " .
" tablealiquots_fridge.Aliquots_Fridge, " .
" tablealiquots.ID_Aliquots_Fridge, " .
" tablealiquots_rack.Aliquots_Rack, " .
" tablealiquots.ID_Aliquots_Rack, " .
" tablealiquots_box.Aliquots_Box, " .
" tablealiquots.Rest_Quantity, " .
" tablealiquots.Origin_Quantity, " .
" tablealiquots.ID_Aliquots_Box, " .
" tablealiquots.Aliquot_Barcode, " .
" tablealiquots.Aliquot_Position " .
" FROM tablednabanknumbers " .
" LEFT JOIN tablealiquots ON tablednabanknumbers.ID_DNA = tablealiquots.ID_DNA " .
" LEFT JOIN tablealiquots_fridge ON tablealiquots.ID_Aliquots_Fridge = tablealiquots_fridge.ID_Aliquots_Fridge " .
" LEFT JOIN tablealiquots_rack ON tablealiquots.ID_Aliquots_Rack = tablealiquots_rack.ID_Aliquots_Rack " .
" LEFT JOIN tablealiquots_box ON tablealiquots.ID_Aliquots_Box = tablealiquots_box.ID_Aliquots_Box " .
" WHERE tablealiquots.ID_Aliquots = '$AliquotsID' " .
" ORDER BY tablealiquots.ID_Aliquots");
if(empty($AliquotsID))
{
$AliquotNumber = $formDnaBankNumber.'-A';
$result3a = "INSERT INTO tablealiquots (ID_DNA, ID_Aliquots_Box, ID_Aliquots_Rack, ID_Aliquots_Fridge, Origin_Quantity, Rest_Quantity, Aliquot_Number, Aliquot_Barcode, Aliquot_Position, Created_Who) " .
" VALUES('$ID_DNA','$AliquotsBox','$AliquotsRack','$AliquotsFridge','$SourceQuantity','$RestQuantity','$AliquotNumber','$Barcode','$Positions','$log')";
$sql3a = mysql_query($result3a);
$result3b = "UPDATE tablednabanknumbers SET Number_Aliquots = '1' " .
"WHERE tablednabanknumbers.ID_DNA = '$ID_DNA'";
$sql3b = mysql_query($result3b);
#######################################Error 3a/3b##############################################################
if(!$sql3a or !$sql3b)
{ $msg = $result3a."\n";
$msg .= $result3b."\n";
$msg .= "####Error 3a/3b####";
trigger_error($msg, E_USER_ERROR);
$test1 = "false1"; }
#############################################################################################################
}
else {
while($row = mysql_fetch_object($resultAliquots))
{
$Aliquot_Number_old = $row->Aliquot_Number;
$Aliquots_Fridge_old = $row->Aliquots_Fridge;
$Aliquots_Rack_old = $row->Aliquots_Rack;
$Aliquots_Box_old = $row->Aliquots_Box;
$Origin_Quantity_old = $row->Origin_Quantity;
$Rest_Quantity_old = $row->Rest_Quantity;
$Barcode_old = $row->Aliquot_Barcode;
$Position_old = $row->Aliquot_Position;
if ($row->ID_Aliquots_Fridge != $AliquotsFridge or $row->ID_Aliquots_Rack != $AliquotsRack or $row->ID_Aliquots_Box != $AliquotsBox or $Rest_Quantity_old != $RestQuantity or $Position_old != $Positions)
{
$result3 = "INSERT INTO table_log_aliquots (ID_Aliquots, ID_DNA, Aliquots_Box, Aliquots_Rack, Aliquots_Fridge, Aliquot_Number, Origin_Quantity, Rest_Quantity, Aliquot_Barcode, Aliquot_Position, Update_Created_Who, Source_Created_Who, Source_Created_When) " .
" (SELECT tablealiquots.ID_Aliquots, " .
"tablealiquots.ID_DNA, " .
"'$Aliquots_Box_old', " .
"'$Aliquots_Rack_old', " .
"'$Aliquots_Fridge_old', " .
"tablealiquots.Aliquot_Number, " .
"tablealiquots.Origin_Quantity, " .
"tablealiquots.Rest_Quantity, " .
"'$Barcode_old', " .
"'$Position_old', " .
"'$log', " .
"tablealiquots.Created_Who, " .
"tablealiquots.Created_When " .
"FROM tablealiquots " .
"WHERE tablealiquots.ID_Aliquots = '$AliquotsID')";
$sql3 = mysql_query($result3);
#######################################Error 3###############################################################
if(!$sql3)
{ $msg = $result3."\n";
$msg .= "####Error 3####";
trigger_error($msg, E_USER_ERROR);
$test1 = "false1"; }
#############################################################################################################
if ($sql3)
{
$result4 = "UPDATE tablealiquots SET ID_Aliquots_Fridge = '$AliquotsFridge', " .
"ID_Aliquots_Rack = '$AliquotsRack', " .
"ID_Aliquots_Box = '$AliquotsBox', " .
"Rest_Quantity = '$RestQuantity', " .
"Aliquot_Position = '$Positions', " .
"Update_Who = '$log', " .
"Update_When = '$Current_Date' " .
"WHERE tablealiquots.ID_Aliquots = '$AliquotsID'";
$sql4 = mysql_query($result4);
#######################################Error 4###############################################################
if(!$sql4)
{ $msg = $result4."\n";
$msg .= "####Error 4####";
trigger_error($msg, E_USER_ERROR);
$test1 = "false2"; }
#############################################################################################################
}
}
} //while
}
} //foreach Ende $formLocationAliquotsID
if ($Source_Gone == "SourceGone")
{$SourceGone = "1";}
if ($Stock_Gone == "StockGone")
{$StockGone = "1";}
if ($BlockGeneral == "BlockGeneral")
{$BlockGeneral = "1";}
if ($Backup_Aliquot == "Backup")
{$Backup = "1";}
if($formGenbankNumberA)
{
$result = "INSERT INTO tableamplifications (ID_DNA, ID_Fragment, GenBankNumber, Link, Amplification_Date, ID_Amplification_Staff, Amplification_Success, Created_Who)" .
"VALUES ('$ID_DNA','$formFragmentA','$formGenbankNumberA','$formGenbankLinkA','$AmplificationDateA','$formAmplificationStaffA','$radioAmplificationA','$log')";
$sql = mysql_query($result);
#######################################Error formGenbankNumberA###############################################################
if(!$sql)
{ $msg = $result."\n";
$msg .= "####Error formGenbankNumberA####";
trigger_error($msg, E_USER_ERROR);
include ("Errorreport.php"); }
#############################################################################################################
}
if($formGenbankNumberB)
{
$result = "INSERT INTO tableamplifications (ID_DNA, ID_Fragment, GenBankNumber, Link, Amplification_Date, ID_Amplification_Staff, Amplification_Success, Created_Who)" .
"VALUES ('$ID_DNA','$formFragmentB','$formGenbankNumberB','$formGenbankLinkB','$AmplificationDateB','$formAmplificationStaffB','$radioAmplificationB','$log')";
$sql = mysql_query($result);
#######################################Error formGenbankNumberB###############################################################
if(!$sql)
{ $msg = $result."\n";
$msg .= "####Error formGenbankNumberB####";
trigger_error($msg, E_USER_ERROR);
include ("Errorreport.php"); }
#############################################################################################################
}
if($formGenbankNumberC)
{
$result = "INSERT INTO tableamplifications (ID_DNA, ID_Fragment, GenBankNumber, Link, Amplification_Date, ID_Amplification_Staff, Amplification_Success, Created_Who)" .
"VALUES ('$ID_DNA','$formFragmentC','$formGenbankNumberC','$formGenbankLinkC','$AmplificationDateC','$formAmplificationStaffC','$radioAmplificationC','$log')";
$sql = mysql_query($result);
#######################################Error formGenbankNumberC###############################################################
if(!$sql)
{ $msg = $result."\n";
$msg .= "####Error formGenbankNumberC####";
trigger_error($msg, E_USER_ERROR);
include ("Errorreport.php"); }
#############################################################################################################
}
if($formGenbankNumberD)
{
$result = "INSERT INTO tableamplifications (ID_DNA, ID_Fragment, GenBankNumber, Link, Amplification_Date, ID_Amplification_Staff, Amplification_Success, Created_Who)" .
"VALUES ('$ID_DNA','$formFragmentD','$formGenbankNumberD','$formGenbankLinkD','$AmplificationDateD','$formAmplificationStaffD','$radioAmplificationD','$log')";
$sql = mysql_query($result);
#######################################Error formGenbankNumberD###############################################################
if(!$sql)
{ $msg = $result."\n";
$msg .= "####Error formGenbankNumberD####";
trigger_error($msg, E_USER_ERROR);
include ("Errorreport.php"); }
#############################################################################################################
}
if ($moreAliquots == "Aliquot")
$Aliquot = "1";
if(!$resultLastAliquotsNumber)
{ $letter = A; }
foreach ($_POST['x'] as $v => $value)
{
$rack = $_POST['y'][$v];
$box = $_POST['z'][$v];
$SourceQuantity = $_POST['formSourceQuantity2'][$v];
$Barcode = $_POST['BarcodeAliquot'][$v];
$Position = $_POST['PositionAliquot'][$v];
if ($Aliquot!="1")
{ unset($value);
unset($rack);
unset($box); }
else {
if($value=="")
{ unset($value);
unset($rack);
unset($box); }
else {
$resultLastAliquotsNumber = mysql_query("SELECT Aliquot_Number FROM tablealiquots WHERE ID_DNA = '$ID_DNA' ORDER BY Aliquot_Number DESC LIMIT 0,1");
while($row = mysql_fetch_object($resultLastAliquotsNumber))
{
$Number = $row->Aliquot_Number;
$array = explode("-",$Number);
$letter = $array[1]; }
$lettercount = $letter++;
$AliquotNumber = $formDnaBankNumber.'-'.$letter++;
$result10 = "INSERT INTO tablealiquots (ID_DNA, ID_Aliquots_Fridge, ID_Aliquots_Rack, ID_Aliquots_Box,
Aliquot_Number, Origin_Quantity, Rest_Quantity, Aliquot_Barcode, Aliquot_Position, Created_Who) " .
"VALUES ('$ID_DNA','$value','$rack','$box','$AliquotNumber','$SourceQuantity','$SourceQuantity','$Barcode','$Position','$log')";
$sql10 = mysql_query($result10);
#######################################Error 10###############################################################
if(!$sql10)
{ $msg = $result10."\n";
$msg .= "####Error 10####";
trigger_error($msg, E_USER_ERROR);
$test1 = "false2"; }
#############################################################################################################
} } }
$result10a = "SELECT ID_Aliquots FROM tablealiquots WHERE ID_DNA = '$ID_DNA'";
$sql10a = mysql_query($result10a);
$anzahl = mysql_num_rows($sql10a);
$result10b = "SELECT SUM(Rest_Quantity) as Summe FROM tablealiquots WHERE ID_DNA = '$ID_DNA'";
$sql10b = mysql_query($result10b);
while ($row = mysql_fetch_object($sql10b)) {
$Sum = $row->Summe;
}
$result10c = "UPDATE tablednabanknumbers SET Number_Aliquots = '$anzahl', Quantity_Aliquots = '$Sum'" .
"WHERE tablednabanknumbers.ID_DNA = '$ID_DNA'";
$sql10c = mysql_query($result10c);
#######################################Error 10c###############################################################
if(!$sql10c)
{ $msg = $result10c."\n";
$msg .= "####Error 10c####";
trigger_error($msg, E_USER_ERROR);
$test1 = "false2"; }
#############################################################################################################
$result11 = "INSERT INTO table_log_dnabanknumbers (ID_DNA, ID_Cache, Dna_Bank_Number, Extraction_Date, NoExtractDate, Degradation_Date, Concentration, Absorbance280, Absorbance230, Quantity_Aliquots, Stock_Gone, Source_Gone, Notes, Block_Until, Block_General, Number_Aliquots, Source_Created_When, Source_Created_Who, Type, Tissue, Preservation, Purification, Extraction_Method, Degradation, RelationDNA_Voucher, Extraction_Staff, Provided_By_People, Update_Created_Who, Location_Stock, Backup_Aliquot) " .
"(SELECT tablednabanknumbers.ID_DNA, " .
"'$ID_Cache_old', " .
"'$Dna_Bank_Number_old', " .
"'$Extraction_Date_old', " .
"'$NoExtractDate_old', " .
"'$Degradation_Date_old', " .
"'$Concentration_old', " .
"'$Absorbance280_old', " .
"'$Absorbance230_old', " .
"'$Quantity_Aliquots_old', " .
"'$Stock_Gone_old', " .
"'$Source_Gone_old', " .
"'$Notes_old', " .
"'$Block_Until_old', " .
"'$BlockGeneral_old', " .
"'$Number_Aliquots_old', " .
"tablednabanknumbers.Created_When, " .
"tablednabanknumbers.Created_Who, " .
"'$Type_old', " .
"'$Tissue_old', " .
"'$Preservation_old', " .
"'$Purification_Method_old', " .
"'$Extraction_Method_old', " .
"'$Degradation_old', " .
"'$RelationDNA_Voucher_old', " .
"'$Extraction_Staff_old', " .
"'$Provided_By_People_old', " .
"'$log', " .
"'$Location_Stock_old', " .
"'$Backup_Aliquot_old' " .
"FROM tablednabanknumbers " .
"WHERE tablednabanknumbers.ID_DNA = '$ID_DNA')";
$sql11 = mysql_query($result11);
$IDDnaLog=mysql_insert_id();
#######################################Error 11###############################################################
if(!$sql11)
{ $msg = $result11."\n";
$msg .= "####Error 11####";
trigger_error($msg, E_USER_ERROR);
$test1 = "false1"; }
#############################################################################################################
// "'$Amplification_Success_old', " .
// "'$Block_General_old', " .
if ($sql11)
{
$result12 = "UPDATE tablednabanknumbers SET DNA_Bank_Number = '$formDnaBankNumber', " .
"Extraction_Date = '$ExtractionDate', " .
"NoExtractDate = '$formNoExtractDate', " .
"Degradation_Date = '$DegradationDate', " .
"Concentration = '$formConcentration', " .
"Absorbance280 = '$formAbsorbance280', " .
"Absorbance230 = '$formAbsorbance230', " .
"Notes = '$formNotes', " .
"Block_Until = '$BlockDate', " .
"ID_Type = '$formType', " .
"ID_Tissue = '$formTissue', " .
"ID_RelationDNA_Voucher = '$formRelation', " .
"ID_Preservation = '$formPreservation', " .
"ID_Extraction_Method = '$formExtractionMethod', " .
"ID_Extraction_Staff = '$formExtractionStaff', " .
"ID_Purification = '$formPurificationMethod', " .
"ID_Degradation = '$formDegradation', " .
"ID_Provided_By_People = '$formProvidedBy', " .
"Stock_Gone = '$StockGone', " .
"Source_Gone = '$SourceGone', " .
"Block_General = '$BlockGeneral', " .
"Backup_Aliquot = '$Backup', " .
"Update_Who = '$log', " .
"Update_When = '$Current_Date' " .
"WHERE tablednabanknumbers.ID_DNA = '$ID_DNA'";
$sql12 = mysql_query($result12);
if(empty($ID_Stock_Fridge_old) or empty($ID_Stock_Rack_old) or empty($ID_Stock_Box_old))
{ $result13a = "INSERT INTO tablelocation_stock (ID_Stock_Fridge, ID_Stock_Rack, ID_Stock_Box, Origin_Quantity, Rest_Quantity, Created_Who) " .
"VALUES ('$formStockFridge','$formStockRack','$formStockBox','$formStockQuantity','$formStockRest','$log')";
$sql13a = mysql_query($result13a);
$ID_Location_Stock_New = mysql_insert_id();
$result13b = "UPDATE tablednabanknumbers SET ID_Location_Stock = '$ID_Location_Stock_New' " .
"WHERE tablednabanknumbers.ID_DNA = '$ID_DNA'";
$sql13b = mysql_query($result13b);
#######################################Error 13a/13b###############################################################
if(!$sql13a or !$sql13b)
{ $msg = $result13a."\n";
$msg .= $result13b. "\n";
$msg .= "####Error 13a/13b####";
trigger_error($msg, E_USER_ERROR);
$test1 = "false2"; }
#############################################################################################################
$result13 = "UPDATE tablelocation_stock SET ID_Stock_Fridge = '$formStockFridge', " .
"ID_Stock_Rack = '$formStockRack', " .
"ID_Stock_Box = '$formStockBox', " .
"Rest_Quantity = '$formStockRest', " .
"Stock_Position = '$formPositionStock', " .
"Update_Who = '$log', " .
"Update_When = '$Current_Date' " .
"WHERE tablelocation_stock.ID_Location_Stock = '$ID_Location_Stock_old'";
$sql13 = mysql_query($result13);
#######################################Error 12/13###############################################################
if(!$sql12 or !$sql13)
{ $msg = $result12."\n";
$msg .= $result13. "\n";
$msg .= "####Error 12/13####";
trigger_error($msg, E_USER_ERROR);
$test1 = "false2"; }
#############################################################################################################
}
mysql_query("DROP TABLE IF EXISTS tmpDnaIDs");
$sqlType = "Detail";
// $where_str = "test";
$sql = $sqlcreate .
$sql = "SELECT DISTINCT tablednabanknumbers.ID_DNA FROM tablednabanknumbers
LEFT JOIN tablecache ON tablednabanknumbers.ID_Cache = tablecache.ID_Cache
LEFT JOIN tablecachetaxonidentified ON tablecache.ID_Cache = tablecachetaxonidentified.ID_Cache
LEFT JOIN tablecachehighertaxa ON tablecachetaxonidentified.ID_TaxonIdentified = tablecachehighertaxa.ID_CacheTaxonidentified
LEFT JOIN tableamplifications ON tablednabanknumbers.ID_DNA = tableamplifications.ID_DNA
LEFT JOIN tablelocation_stock ON tablelocation_stock.ID_Location_Stock = tablednabanknumbers.ID_Location_Stock
LEFT JOIN tablealiquots ON tablednabanknumbers.ID_DNA = tablealiquots.ID_DNA
LEFT JOIN tablerequest ON tablednabanknumbers.ID_DNA = tablerequest.ID_DNA " .
"WHERE tablednabanknumbers.ID_DNA = '$ID_DNA' " . $sqllimit;
}
}
else {
mysql_query("DROP TABLE IF EXISTS tmpDnaIDs");
$sqlType = "Detail";
// $where_str = "test";
$sql = $sqlcreate .
$sql = "SELECT DISTINCT tablednabanknumbers.ID_DNA FROM tablednabanknumbers
LEFT JOIN tablecache ON tablednabanknumbers.ID_Cache = tablecache.ID_Cache
LEFT JOIN tablecachetaxonidentified ON tablecache.ID_Cache = tablecachetaxonidentified.ID_Cache
LEFT JOIN tablecachehighertaxa ON tablecachetaxonidentified.ID_TaxonIdentified = tablecachehighertaxa.ID_CacheTaxonidentified
LEFT JOIN tableamplifications ON tablednabanknumbers.ID_DNA = tableamplifications.ID_DNA
LEFT JOIN tablelocation_stock ON tablelocation_stock.ID_Location_Stock = tablednabanknumbers.ID_Location_Stock
LEFT JOIN tablealiquots ON tablednabanknumbers.ID_DNA = tablealiquots.ID_DNA
LEFT JOIN tablerequest ON tablednabanknumbers.ID_DNA = tablerequest.ID_DNA " .
"WHERE tablednabanknumbers.ID_DNA = '$ID_DNA' " . $sqllimit;
}
}
$Dnacount=0;
if(!empty($sql))
{
// just in case it is still here: drop tmpDnaIDs
mysql_query("DROP TABLE IF EXISTS tmpDnaIDs");
mysql_query($sql);
if(!mysql_affected_rows())
{
echo "New Search. | ";
echo "No hits found for:";
foreach($descriptionall as $index => $descriptiontest)
{ $valuetest = $valueall[$index];
echo $descriptiontest."[".$valuetest."]"; }
echo ". | ";
}
else
{
// Abfrage für TableDnaBankNumbers
$result1 = mysql_query
("SELECT tablednabanknumbers.ID_DNA AS ID_DNA, " .
" tablednabanknumbers.ID_Cache, " .
" tablednabanknumbers.Dna_Bank_Number AS DNA_Bank_Number, " .
" tablednabanknumbers.Extraction_Date AS Extraction_Date, " .
" tablednabanknumbers.NoExtractDate AS NoExtractDate, " .
" tablednabanknumbers.Absorbance280 AS Absorbance280, " .
" tablednabanknumbers.Absorbance230 AS Absorbance230, " .
" tablednabanknumbers.Concentration AS Concentration, " .
" tablednabanknumbers.Number_Aliquots AS Number_Aliquots, " .
" tablednabanknumbers.Quantity_Aliquots AS Quantity_All_Aliquots, " .
" tablednabanknumbers.Degradation_Date AS Degradation_Date, " .
" tablednabanknumbers.Created_Who AS Created_Who, " .
" tablednabanknumbers.Created_When AS Created_When, " .
" tablednabanknumbers.Stock_Gone AS Stock_Gone, " .
" tablednabanknumbers.Source_Gone AS Source_Gone, " .
" tablednabanknumbers.Block_Until AS Block_Until, " .
" tablednabanknumbers.Block_General AS Block_General, " .
" tablednabanknumbers.Notes AS Notes, " .
" tablednabanknumbers.Backup_Aliquot AS Backup_Aliquot, " .
" tablednabanknumbers.Update_Who AS Update_Who, " .
" tablednabanknumbers.Update_When AS Update_When, " .
" tablerelationdna_voucher.RelationDNA_Voucher AS RelationDNA_Voucher, " .
" tabletype.Type AS Type, " .
" tablepreservation.Preservation AS Preservation, " .
" tabletissue.Tissue AS Tissue, " .
" tableextractionmethod.Method AS Extraction_Method, " .
" tableextractionmethod.Company AS Extraction_Company, " .
" tablepurification.Method AS Purification_Method, " .
" tablepurification.Company AS Purificaton_Company, " .
" tabledegradation.Degradation AS Degradation, " .
" tablecache.ID_Dataset_Specimen AS ID_Dataset_Specimen, " .
" tablecache.UnitID_Specimen AS UnitID_Specimen, " .
" tablecache.CollectionCode_Specimen AS CollectionCode_Specimen, " .
" tablecache.InstitutionCode_Specimen AS InstitutionCode_Specimen, " .
" tablecache.ContinentOrOcean AS ContinentOrOcean, " .
" tablecache.CountryName AS CountryName, " .
" tablecache.CountryISO2 AS CountryISO2, " .
" tablecache.GatheringAgent AS GatheringAgent, " .
" tablecache.GatheringDate AS GatheringDate, " .
" tablecache.LocalityText AS LocalityText, " .
" tablecache.Altitude AS Altitude, " .
" tablecache.LongitudeDecimal AS LongitudeDecimal, " .
" tablecache.LatitudeDecimal AS LatitudeDecimal, " .
" tablecache.Gathering_Other AS Gathering_Other, " .
" tablecache.TypeStatus AS TypeStatus " .
" FROM tablednabanknumbers JOIN tmpDnaIDs " .
" LEFT JOIN tablecache ON tablednabanknumbers.ID_Cache = tablecache.ID_Cache " .
" LEFT JOIN tablerelationdna_voucher ON tablednabanknumbers.ID_RelationDNA_Voucher = tablerelationdna_voucher.ID_RelationDNA_Voucher " .
" LEFT JOIN tabletype ON tablednabanknumbers.ID_Type = tabletype.ID_Type " .
" LEFT JOIN tablepreservation ON tablednabanknumbers.ID_Preservation = tablepreservation.ID_Preservation " .
" LEFT JOIN tabletissue ON tablednabanknumbers.ID_Tissue = tabletissue.ID_Tissue " .
" LEFT JOIN tableextractionmethod ON tablednabanknumbers.ID_Extraction_Method = tableextractionmethod.ID_Method " .
" LEFT JOIN tablepurification ON tablednabanknumbers.ID_Purification = tablepurification.ID_Purification " .
" LEFT JOIN tablepeople ON tablednabanknumbers.ID_Extraction_Staff = tablepeople.ID_People " .
" LEFT JOIN tabledegradation ON tablednabanknumbers.ID_Degradation = tabledegradation.ID_Degradation " .
" WHERE tablednabanknumbers.ID_DNA = tmpDnaIDs.ID_DNA " .
" ORDER BY LENGTH(tablednabanknumbers.Dna_Bank_Number),tablednabanknumbers.DNA_Bank_Number");
// $result = mysql_query($result1) or die($result1.' '.mysql_error());
$result2 = mysql_query
("SELECT tablednabanknumbers.ID_DNA AS ID_DNA, " .
" tablednabanknumbers.ID_Cache, " .
" tablecache.ID_Cache, " .
" tablecachetaxonidentified.NameAuthorYear AS NameAuthorYear, " .
" tablecachetaxonidentified.PreferredFlag AS PreferredFlag " .
" FROM tablecache, tablecachetaxonidentified, tablednabanknumbers, tmpDnaIDs " .
" WHERE tablecachetaxonidentified.ID_Cache = tablecache.ID_Cache " .
" AND tablecache.ID_Cache = tablednabanknumbers.ID_Cache " .
" AND tablednabanknumbers.ID_DNA = tmpDnaIDs.ID_DNA");
// $result = mysql_query($result3) or die($result3.' '.mysql_error());
while($row = mysql_fetch_object($result2))
{
if(isset($PreferredFlag[$row->ID_DNA]))
{ $Flag = $PreferredFlag[$row->ID_DNA];
if($Flag == 'true' or $Flag == '1') {$Preferred = "(Preferred Taxon Name)";}
if($Flag != 'true' and $Flag != '1') {$Preferred = ""; }
}
else
{ $PreferredFlag[$row->ID_DNA] = ""; }
if(isset($NameAuthorYear[$row->ID_DNA]))
{ $NameAuthorYear[$row->ID_DNA] .= " " . $Preferred . ", Other Identifications: "; }
else
{ $NameAuthorYear[$row->ID_DNA] = ""; }
$tmp = $row->NameAuthorYear;
$NameAuthorYear[$row->ID_DNA] .= $tmp;
$tmp2 = $row->PreferredFlag;
$PreferredFlag[$row->ID_DNA] .= $tmp2;
}
$result3 = mysql_query
("SELECT tablednabanknumbers.ID_DNA AS ID_DNA, " .
" tablednabanknumbers.ID_Cache, " .
" tablecache.ID_Cache, " .
" tablecachetaxonidentified.ID_TaxonIdentified, " .
" tablecachehighertaxa.HigherTaxon AS HigherTaxon, " .
" tablecachehighertaxa.TaxonRank AS TaxonRank " .
" FROM tablecache, tablecachetaxonidentified, tablecachehighertaxa, tablednabanknumbers, tmpDnaIDs " .
" WHERE tablecachehighertaxa.ID_CacheTaxonIdentified = tablecachetaxonidentified.ID_TaxonIdentified " .
" AND tablecachetaxonidentified.ID_Cache = tablecache.ID_Cache " .
" AND tablecache.ID_Cache = tablednabanknumbers.ID_Cache " .
" AND tablednabanknumbers.ID_DNA = tmpDnaIDs.ID_DNA");
while($row = mysql_fetch_object($result3))
{
if(isset($TaxonRank[$row->ID_DNA]))
{ $TaxonRank[$row->ID_DNA] .= " "; }
else { $TaxonRank[$row->ID_DNA] = ""; }
if(isset($HigherTaxon[$row->ID_DNA]))
{
$HigherTaxon[$row->ID_DNA] .= " ";
}
else
{ $HigherTaxon[$row->ID_DNA] = ""; }
$tmp = $row->HigherTaxon;
$HigherTaxon[$row->ID_DNA] .= $tmp;
$tmp2 = $row->TaxonRank;
$TaxonRank[$row->ID_DNA] .= $tmp2;
}
$result3a = mysql_query
("SELECT tablednabanknumbers.ID_DNA AS ID_DNA, " .
" tablednabanknumbers.ID_Cache, " .
" tablecacheimages.ID_Cache, " .
" tablecacheimages.Images " .
" FROM tablecacheimages, tablednabanknumbers, tmpDnaIDs " .
" WHERE tablecacheimages.ID_Cache = tablednabanknumbers.ID_Cache " .
" AND tablednabanknumbers.ID_DNA = tmpDnaIDs.ID_DNA");
while($row = mysql_fetch_object($result3a))
{
if(isset($ImageLink[$row->ID_DNA]))
{ $ImageLink .= build_href1($row->Images,$row->Images) . " "; }
else
{$ImageLink .= build_href1($row->Images,$row->Images) . " "; }
}
$result5 = mysql_query
("SELECT tablednabanknumbers.ID_DNA, " .
" tablepeople.Name_All AS Name_All_Extraction " .
" FROM tablednabanknumbers,tablepeople, tmpDnaIDs " .
" WHERE tablednabanknumbers.ID_Extraction_Staff = tablepeople.ID_People " .
" AND tablednabanknumbers.ID_DNA = tmpDnaIDs.ID_DNA");
while($row = mysql_fetch_object($result5))
{ $Extraction_Staff = $row->Name_All_Extraction; }
$result6 = mysql_query
("SELECT tablednabanknumbers.ID_DNA, " .
" tablepeople.Name_All AS Name_All_Provided_By " .
" FROM tablednabanknumbers,tablepeople, tmpDnaIDs " .
" WHERE tablednabanknumbers.ID_Provided_By_People = tablepeople.ID_People " .
" AND tablednabanknumbers.ID_DNA = tmpDnaIDs.ID_DNA");
while($row = mysql_fetch_object($result6))
{ $Provided_By_People = $row->Name_All_Provided_By; }
$result8 = mysql_query
("SELECT tablednabanknumbers.ID_DNA, " .
" tablestock_box.Stock_Box AS Location_Box, " .
" tablestock_rack.Stock_Rack AS Location_Rack, " .
" tablestock_fridge.Stock_Fridge AS Location_Fridge, " .
" tablelocation_stock.Origin_Quantity AS Location_Volume, " .
" tablelocation_stock.Rest_Quantity AS Location_Rest, " .
" tablelocation_stock.Stock_Barcode AS Stock_Barcode, " .
" tablelocation_stock.Stock_Position AS Stock_Position " .
" FROM tablednabanknumbers JOIN tmpDnaIDs " .
" LEFT JOIN tablelocation_stock ON tablednabanknumbers.ID_Location_Stock = tablelocation_stock.ID_Location_Stock " .
" LEFT JOIN tablestock_box ON tablestock_box.ID_Stock_Box = tablelocation_stock.ID_Stock_Box " .
" LEFT JOIN tablestock_rack ON tablestock_rack.ID_Stock_Rack = tablelocation_stock.ID_Stock_Rack " .
" LEFT JOIN tablestock_fridge ON tablestock_fridge.ID_Stock_Fridge = tablelocation_stock.ID_Stock_Fridge " .
" WHERE tablednabanknumbers.ID_DNA = tmpDnaIDs.ID_DNA");
$result7 = mysql_query
("SELECT tablednabanknumbers.ID_DNA, " .
" tableamplifications.GenBankNumber AS GenBankNumber, " .
" tableamplifications.Link AS Link, " .
" tableamplifications.Amplification_Success AS Amplification_Success, " .
" tableamplifications.Amplification_Date AS Amplification_Date, " .
" tablefragment.Fragment AS Fragment, " .
" tablepeople.Name_All AS Amplification_Staff " .
" FROM tablednabanknumbers JOIN tmpDnaIDs " .
" LEFT JOIN tableamplifications ON tablednabanknumbers.ID_DNA = tableamplifications.ID_DNA " .
" LEFT JOIN tablefragment ON tableamplifications.ID_Fragment = tablefragment.ID_Fragment " .
" LEFT JOIN tablepeople ON tableamplifications.ID_Amplification_Staff = tablepeople.ID_People " .
" WHERE tablednabanknumbers.ID_DNA = tmpDnaIDs.ID_DNA");
while($row = mysql_fetch_object($result7))
{
if(isset($Amplification_Staff[$row->ID_DNA]))
{
$Amplification_Staff[$row->ID_DNA] .= " ";
}
else
{ $Amplification_Staff[$row->ID_DNA] = ""; }
if(isset($Amplification_Success[$row->ID_DNA]))
{
$Amplification_Success[$row->ID_DNA] .= " ";
}
else
{ $Amplification_Success[$row->ID_DNA] = ""; }
if(isset($Amplification_Date[$row->ID_DNA]))
{
$Amplification_Date[$row->ID_DNA] .= " ";
}
else
{ $Amplification_Date[$row->ID_DNA] = ""; }
if(isset($Link[$row->ID_DNA]))
{ if($formSubmitSaveEdit) {}
else { $Link[$row->ID_DNA] .= ""; }
$Link2 .= build_href1($row->Link,$row->GenBankNumber) . " ";
}
else
{
$Link[$row->ID_DNA] = "";
$Link2 .= build_href1($row->Link,$row->GenBankNumber) . " ";
}
if(isset($Fragment[$row->ID_DNA]))
{
$Fragment[$row->ID_DNA] .= " ";
}
else
{ $Fragment[$row->ID_DNA] = ""; }
if($formSubmitSaveEdit) {}
else {
$tmp = $row->Link;
$Link[$row->ID_DNA] .= $tmp; }
$tmp = $row->Fragment;
$Fragment[$row->ID_DNA] .= $tmp;
$tmp = $row->Amplification_Staff;
$Amplification_Staff[$row->ID_DNA] .= $tmp;
$tmp = $row->Amplification_Success;
$Amplification_Success[$row->ID_DNA] .= $tmp;
$tmp = DatumsWandler($row->Amplification_Date);
$Amplification_Date[$row->ID_DNA] .= $tmp;
}
while($row = mysql_fetch_object($result8))
{ $Location_Box = $row->Location_Box;
$Location_Rack = $row->Location_Rack;
$Location_Fridge = $row->Location_Fridge;
$Location_Volume = $row->Location_Volume;
$Location_Rest = $row->Location_Rest;
$Stock_Barcode = $row->Stock_Barcode;
$Stock_Position = $row->Stock_Position;
}
$result9 = mysql_query
("SELECT tablednabanknumbers.ID_DNA, " .
" tablealiquots_box.Aliquots_Box AS Aliquots_Box, " .
" tablealiquots_rack.Aliquots_Rack AS Aliquots_Rack, " .
" tablealiquots_fridge.Aliquots_Fridge AS Aliquots_Fridge, " .
" tablealiquots.Aliquot_Number AS Aliquot_Number, " .
" tablealiquots.Origin_Quantity AS Origin_Quantity, " .
" tablealiquots.Rest_Quantity AS Rest_Quantity, " .
" tablealiquots.Aliquot_Barcode AS Aliquot_Barcode, " .
" tablealiquots.Aliquot_Position AS Aliquot_Position " .
" FROM tablednabanknumbers JOIN tmpDnaIDs " .
" LEFT JOIN tablealiquots ON tablednabanknumbers.ID_DNA = tablealiquots.ID_DNA " .
" LEFT JOIN tablealiquots_box ON tablealiquots_box.ID_Aliquots_Box = tablealiquots.ID_Aliquots_Box " .
" LEFT JOIN tablealiquots_rack ON tablealiquots_rack.ID_Aliquots_Rack = tablealiquots.ID_Aliquots_Rack " .
" LEFT JOIN tablealiquots_fridge ON tablealiquots_fridge.ID_Aliquots_Fridge = tablealiquots.ID_Aliquots_Fridge " .
" WHERE tablednabanknumbers.ID_DNA = tmpDnaIDs.ID_DNA " .
" ORDER BY tablealiquots.Aliquot_Number");
while($row = mysql_fetch_object($result9))
{
if(isset($Aliquots_Box[$row->ID_DNA]))
{ $Aliquots_Box[$row->ID_DNA] .= " "; }
else
{ $Aliquots_Box[$row->ID_DNA] = ""; }
if(isset($Aliquots_Rack[$row->ID_DNA]))
{ $Aliquots_Rack[$row->ID_DNA] .= " "; }
else
{ $Aliquots_Rack[$row->ID_DNA] = ""; }
if(isset($Aliquots_Fridge[$row->ID_DNA]))
{ $Aliquots_Fridge[$row->ID_DNA] .= " "; }
else
{ $Aliquots_Fridge[$row->ID_DNA] = ""; }
if(isset($Aliquot_Number[$row->ID_DNA]))
{ $Aliquot_Number[$row->ID_DNA] .= " "; }
else
{ $Aliquot_Number[$row->ID_DNA] = ""; }
if(isset($Aliquot_Barcode[$row->ID_DNA]))
{ $Aliquot_Barcode[$row->ID_DNA] .= " "; }
else
{ $Aliquot_Barcode[$row->ID_DNA] = ""; }
if(isset($Aliquot_Position[$row->ID_DNA]))
{ $Aliquot_Position[$row->ID_DNA] .= " "; }
else
{ $Aliquot_Position[$row->ID_DNA] = ""; }
if(isset($Origin_Quantity[$row->ID_DNA]))
{ $Origin_Quantity[$row->ID_DNA] .= " "; }
else
{ $Origin_Quantity[$row->ID_DNA] = ""; }
if(isset($Rest_Quantity[$row->ID_DNA]))
{ $Rest_Quantity[$row->ID_DNA] .= " "; }
else
{ $Rest_Quantity[$row->ID_DNA] = ""; }
$tmp = $row->Aliquots_Box;
$Aliquots_Box[$row->ID_DNA] .= $tmp;
$tmp = $row->Aliquots_Rack;
$Aliquots_Rack[$row->ID_DNA] .= $tmp;
$tmp = $row->Aliquots_Fridge;
$Aliquots_Fridge[$row->ID_DNA] .= $tmp;
$tmp = $row->Aliquot_Number;
$Aliquot_Number[$row->ID_DNA] .= $tmp;
$tmp = $row->Aliquot_Barcode;
$Aliquot_Barcode[$row->ID_DNA] .= $tmp;
$tmp = $row->Aliquot_Position;
$Aliquot_Position[$row->ID_DNA] .= $tmp;
$tmp = $row->Origin_Quantity;
$Origin_Quantity[$row->ID_DNA] .= $tmp;
$tmp = $row->Rest_Quantity;
$Rest_Quantity[$row->ID_DNA] .= $tmp;
}
$result10 = mysql_query
("SELECT tablednabanknumbers.ID_DNA, " .
" tablerequest.Request_Date AS Request_Date, " .
" tablerequest.Request_Number_Aliquots AS Request_Number_Aliquots, " .
" tablerequest.Request_Notes AS Request_Notes, " .
" tablepeople.Name_All AS Customer " .
" FROM tablednabanknumbers JOIN tmpDnaIDs " .
" LEFT JOIN tablerequest ON tablednabanknumbers.ID_DNA = tablerequest.ID_DNA " .
" LEFT JOIN tablepeople ON tablerequest.ID_People = tablepeople.ID_People " .
" WHERE tablednabanknumbers.ID_DNA = tmpDnaIDs.ID_DNA");
while($row = mysql_fetch_object($result10))
{
if(isset($Request_Date[$row->ID_DNA]))
{ $Request_Date[$row->ID_DNA] .= "";
$DateRequest .= DatumsWandler($row->Request_Date) . " ";
}
else
{ $Request_Date[$row->ID_DNA] = "";
$DateRequest .= DatumsWandler($row->Request_Date) . " "; }
if(isset($Request_Number_Aliquots[$row->ID_DNA]))
{ $Request_Number_Aliquots[$row->ID_DNA] .= " "; }
else
{ $Request_Number_Aliquots[$row->ID_DNA] = ""; }
if(isset($Request_Notes[$row->ID_DNA]))
{ $Request_Notes[$row->ID_DNA] .= " "; }
else
{ $Request_Notes[$row->ID_DNA] = ""; }
if(isset($Customer[$row->ID_DNA]))
{ $Customer[$row->ID_DNA] .= " "; }
else
{ $Customer[$row->ID_DNA] = ""; }
$tmp = $row->Request_Date;
$Request_Date[$row->ID_DNA] .= $tmp;
$tmp = $row->Request_Number_Aliquots;
$Request_Number_Aliquots[$row->ID_DNA] .= $tmp;
$tmp = $row->Request_Notes;
$Request_Notes[$row->ID_DNA] .= $tmp;
$tmp = $row->Customer;
$Customer[$row->ID_DNA] .= $tmp; }
$result11 = mysql_query
("SELECT tablepublications_amplifications.ID_DNA, " .
" tablepublications_amplifications.Paper_Cache AS Paper_Cache, " .
" tablepublications_amplifications.Fragment AS FragmentPub, " .
" tablepublications.Link AS LinkPub " .
" FROM tablepublications_amplifications JOIN tmpDnaIDs " .
" LEFT JOIN tablepublications ON tablepublications_amplifications.ID_Publications = tablepublications.ID_Publications " .
" WHERE tablepublications_amplifications.ID_DNA = tmpDnaIDs.ID_DNA");
while($row = mysql_fetch_object($result11))
{
if(isset($Paper_Cache[$row->ID_DNA]))
{ $Paper_Cache[$row->ID_DNA] .= " "; }
else
{ $Paper_Cache[$row->ID_DNA] = ""; }
if(isset($FragmentPub[$row->ID_DNA]))
{ $FragmentPub[$row->ID_DNA] .= " "; }
else
{ $FragmentPub[$row->ID_DNA] = ""; }
if(isset($LinkPub[$row->ID_DNA]))
{ if($formSubmitSaveEdit) {}
else { $LinkPub[$row->ID_DNA] .= ""; }
$LinkPub2 .= build_href1($row->LinkPub,"document") . " ";
}
else
{
$LinkPub[$row->ID_DNA] = "";
$LinkPub2 .= build_href1($row->LinkPub,"document") . " ";
}
$tmp = $row->Paper_Cache;
$Paper_Cache[$row->ID_DNA] .= $tmp;
$tmp = $row->FragmentPub;
$FragmentPub[$row->ID_DNA] .= $tmp;
if($formSubmitSaveEdit) {}
else {
$tmp = $row->LinkPub;
$LinkPub[$row->ID_DNA] .= $tmp; }
}
if($sqlType=="Dna")
{
echo "New Search. | ";
$gesamt = mysql_num_rows($result1);
echo "".$gesamt;
if($gesamt == 1) {echo " entry "; } else { echo " entries ";}
echo "found for:";
foreach($descriptionall as $index => $descriptiontest)
{ $valuetest = $valueall[$index];
echo $descriptiontest."[".$valuetest."]"; }
echo ". | ";
echo "
| ";
$Dnacount=0;
echo "";
for ($i=1; $i<=$gesamt; $i++) {
$row=mysql_fetch_array($result1);
{
$Dnacount++;
if($Dnacount<=$pagesize)
{
$ID = $row['ID_DNA'];
echo "".$i.". | ".build_href("query.php",
"sqlType=Detail&ID_DNA=$ID",
$row['DNA_Bank_Number'] . ", " .
$row['UnitID_Specimen'] . ", " .
$row['CollectionCode_Specimen'] . ", " .
$row['InstitutionCode_Specimen'] . ", " .
$NameAuthorYear[$row['ID_DNA']]) . " | ";
}
} }
echo " ";
}
if($sqlType=="Detail")
{
echo "New Search. | ";
if($formSubmitSaveEdit)
{ echo "Back to Hitlist | ",
"";
if ($test1 == 'false1'){ include("ErrorreportLog.php"); }
if ($test1 == 'false2'){ include("Errorreport.php"); }
if ($test1 != 'false1' and $test1 != 'false2') { echo "Changes accepted."; }
echo " | "; }
else {
echo "Back to Hitlist | "; }
echo "
| ";
$Dnacount=0;
while($row = mysql_fetch_object($result1))
{
$Dnacount++;
$ID_Cache = $row->ID_Cache;
$test = mysql_query("SELECT tablednabanknumbers.ID_DNA, tablednabanknumbers.DNA_Bank_Number, " .
"tablednabanknumbers.Extraction_Date FROM tablednabanknumbers, tmpDnaIDs " .
"WHERE tablednabanknumbers.ID_Cache = '$ID_Cache' " .
" AND tablednabanknumbers.ID_DNA != tmpDnaIDs.ID_DNA " .
"ORDER BY LENGTH(tablednabanknumbers.DNA_Bank_Number),tablednabanknumbers.DNA_Bank_Number");
if($Dnacount<=$pagesize)
{
if($Amplification_Date[$row->ID_DNA] == '0000-00-00')
{ unset($Amplification_Date[$row->ID_DNA]); }
if($row->Extraction_Date == '0000-00-00')
{ unset($row->Extraction_Date); }
if($row->NoExtractDate == '1')
{ $NoExtractDate = "No Extraction Date available."; }
if($row->Degradation_Date == '0000-00-00')
{ unset($row->Degradation_Date); }
if($row->Block_Until == '0000-00-00')
{ unset($row->Block_Until); }
// Position Start Einfügen für "Ausgabe ZSM" - Datei: "Extra-ZSM Query-Ausgabe.php"
echo "",
"Voucher: | ",
"Taxon Name: | " . $NameAuthorYear[$row->ID_DNA] . " | ",
$HigherTaxon[$row->ID_DNA] ? "Higher Taxon: | " . $HigherTaxon[$row->ID_DNA] . " | " . $TaxonRank[$row->ID_DNA] . " | " : "",
$row->ContinentOrOcean ? "Continent/Ocean: | " . $row->ContinentOrOcean . " | " : "",
$row->CountryName ? "Country: | " . $row->CountryName . " | " : "",
$row->CountryISO2 ? "Country ISO Code: | " . $row->CountryISO2 . " | " : "",
$row->GatheringAgent ? "Collector(s): | " . $row->GatheringAgent . " | " : "",
$row->GatheringDate ? "Collection Date: | " . $row->GatheringDate . " | " : "",
$row->Gathering_Other ? "Collection: | " . $row->Gathering_Other . " | " : "",
$row->LocalityText ? "Locality: | " . $row->LocalityText . " | " : "",
$row->Altitude ? "Altitude: | " . $row->Altitude . " | " : "",
$row->LongitudeDecimal ? "Longitude: | " . $row->LongitudeDecimal . " | " : "",
$row->LatitudeDecimal ? "Latitude: | " . $row->LatitudeDecimal . " | " : "",
$ImageLink ? "Multimedia: | " . $ImageLink . " | " : "",
"Specimen Number/UnitID: | " . $row->UnitID_Specimen . " | ",
"Collection Code: | " . $row->CollectionCode_Specimen . " | ",
"Institution Code: | " . $row->InstitutionCode_Specimen . " | ",
$row->TypeStatus ? "Type Status: | " . $row->TypeStatus . " | " : "",
"
| ",
"";
if(mysql_num_rows($test))
{ echo "Other DNA Samples from this voucher: | ";
while($roww = mysql_fetch_object($test))
{ $Test_ID = $roww->ID_DNA;
echo "DNA Extraction Number: | ".build_hrefDNA("query.php","sqlType=Detail&ID_DNA=$Test_ID",$roww->DNA_Bank_Number)." | Extraction Date: | ".DatumsWandler($roww->Extraction_Date)." | "; }
echo "
| "; }
// build_href("query.php","sqlType=Detail&ID_DNA=$Test_ID",$roww->DNA_Bank_Number);
echo "DNA Sample: | ",
$row->RelationDNA_Voucher ? "Relation to Voucher: | " . $row->RelationDNA_Voucher . " | " : " | ",
"DNA Extraction Number: | " . $row->DNA_Bank_Number . " | ",
$row->Type ? "DNA Type: | " . $row->Type . " | " : " | ",
$row->Preservation ? "Preservation: | " . $row->Preservation . " | " : " | ",
$row->Tissue ? "Tissue: | " . $row->Tissue . " | " : " ",
$row->Source_Gone ? " | Source material gone: | Yes | " : " | ",
$Extraction_Staff || $row->Extraction_Method || $row->Extraction_Date || $row->NoExtractDate ? "Extraction Method/Date/Staff: | " . $row->Extraction_Method . " (" . $row->Extraction_Company . ") | " . DatumsWandler($row->Extraction_Date) . $NoExtractDate ." | " . $Extraction_Staff . " | " : "",
$row->Purification_Method ? "Purification Method: | " . $row->Purification_Method . " (" . $row->Purificaton_Company . ") | " : "",
$row->Absorbance280 || $row->Absorbance230 ? "Ratio of Absorbance: | " . $row->Absorbance280 . " OD260nm/OD280nm | " . $row->Absorbance230 . " OD260nm/OD230nm | " : "",
$row->Concentration ? "Concentration: | " . $row->Concentration . " ng/μl | " : "",
$row->Degradation ? "Quality/Check Date: | " . $row->Degradation . " | " . DatumsWandler($row->Degradation_Date) . " | " : "",
"Number of Aliquots: | " . $row->Number_Aliquots . " | Total volume (Aliquots): | " .$row->Quantity_All_Aliquots . " μl";
if(!$row->Number_Aliquots) { echo " (No Aliquots available)"; }
echo " | ",
$Amplification_Date[$row->ID_DNA] || $Amplification_Success[$row->ID_DNA] || $Amplification_Staff[$row->ID_DNA] ? "Amplification(s): | Amplification successful: " .$Amplification_Success[$row->ID_DNA] . " | Amplification Date: " . $Amplification_Date[$row->ID_DNA] . " | Amplification Staff: " . $Amplification_Staff[$row->ID_DNA] . " | Gen Bank No: " .$Link2 . " | Fragment: " .$Fragment[$row->ID_DNA] ." | " : "",
$Paper_Cache[$row->ID_DNA] ? "Publications: | Fragment: " . $FragmentPub[$row->ID_DNA] . " | Publication: " . $Paper_Cache[$row->ID_DNA] . " | " : "",
$LinkPub[$row->ID_DNA] ? " " . $LinkPub2 ." | " : " | ",
$Provided_By_People ? "DNA is Provided By: | " . $Provided_By_People . " | " : "",
$row->Block_Until ? "and Blocked until: | " . DatumsWandler($row->Block_Until) . " | " : "",
$row->Block_General ? "DNA is Blocked in General: | Yes | " : "",
$row->Stock_Gone ? "Stock material gone: | Yes | " : "",
$Location_Fridge || $LocationRack || $Location_Box ? "Location Stock: | Fridge: " . $Location_Fridge . " | Rack: " . $Location_Rack . " | Box: " . $Location_Box . " | Source volume (µl): " .$Location_Volume . " | Remaining volume (µl): " . $Location_Rest . " | " : "Location Stock: | No Stock made | ",
$Aliquots_Fridge[$row->ID_DNA] || $Aliquots_Rack[$row->ID_DNA] || $Aliquots_Box[$row->ID_DNA] ? "Location Aliquots: | Fridge: " . $Aliquots_Fridge[$row->ID_DNA] . " | Rack: " . $Aliquots_Rack[$row->ID_DNA] . " | Box: " . $Aliquots_Box[$row->ID_DNA] . " | Aliquot No: " . $Aliquot_Number[$row->ID_DNA] . " | Source volume (µl): " . $Origin_Quantity[$row->ID_DNA] . " | Remaining volume (µl): " . $Rest_Quantity[$row->ID_DNA] . " | " : "Location Aliquot: | No Aliquots made | ",
$row->Backup_Aliquot ? "Backup Aliquot made: | Yes | " : "Backup Aliquot made: | No | ",
$row->Notes ? "Notes: | " . $row->Notes . " | " : "",
$Customer[$row->ID_DNA] ? "Requests: | Customer: " . $Customer[$row->ID_DNA] . " | Date: " . $DateRequest . " | Aliquot No: " . $Request_Number_Aliquots[$row->ID_DNA] . " | Notes: " . $Request_Notes[$row->ID_DNA] . " | " : "",
"Dataset created by: | " . $row->Created_Who . " (" . DatumsWandler($row->Created_When) . ") | ",
$row->Update_Who ? "Dataset last modified by: | " . $row->Update_Who . " (" . DatumsWandler($row->Update_When) . ") | " : "",
"";
if($formSubmitSaveEdit)
{$result0 = "UPDATE tablednabanknumbers SET Lock_Who = '', Lock_When = '' WHERE tablednabanknumbers.ID_DNA = '$ID_DNA'";
$sql0 = mysql_query($result0);}
else {
$result10 = "SELECT ID_DNA, Lock_Who, Lock_When FROM tablednabanknumbers WHERE ID_DNA = '$ID_DNA'";
$sql10 = mysql_query($result10);
while($row = mysql_fetch_object($sql10))
{ $TestWho = $row->Lock_Who;
$TestWhen = $ow->Lock_When;}
if($TestWho == "")
{ echo " | "; }
if($TestWho != "")
{
$TestWhen2 = $TestWhen + "0000-00-00 00:30:00";
if($TestWhen2 >= $Current_Date)
{
if($TestWho != $log)
{echo "Dataset temporarily not editable."; }
}
if($TestWhen2 < $Current_Date or $TestWho == $log)
{ $result11 = "UPDATE tablednabanknumbers SET Lock_Who = '', Lock_When = '' WHERE tablednabanknumbers.ID_DNA = '$ID_DNA'";
$sql11 = mysql_query($result11);
echo "";
}
// Position Ende Einfügen für "Ausgabe ZSM" - Datei: "Extra-ZSM Query-Ausgabe.php"
} }
echo " ";
}
}
echo "\n";
}
mysql_query("DROP TABLE IF EXISTS tmpDnaIDs");
}
}
}
?>
|