Logged in as: "; $log = $_SESSION['log']; echo $log; echo ". "; if(isset($_COOKIE['test']) or $_COOKIE['test']) { include ("shop.php"); } echo "
";} ?>

Search publications related to DNA samples or DNA vouchers of the DNA Bank Network

DNA Extraction No ">e.g. "DSM 214846", "DB 4404"
DNA Bank Number of referenced DNA samples/vouchers bracketed
Specimen/Strain No ">e.g. "DSM 14846", "B 10 0209309"
Year from"> to ">
Publication"> Full text search (Author, Title, Journal) e.g. Sahin Aragno: search for Sahin OR Aragno;
Sahin+Aragno: search for Sahin AND Aragno
50) // { $page = 50; } elseif($page<1) $page = 1; elseif(!is_numeric($page)) unset($page); $sql = ""; $sqlcreate = "CREATE TEMPORARY TABLE tmpPubIDs TYPE=HEAP "; if($_REQUEST['page']!= "") { $sqllimit = "LIMIT " . (($page-1) * $pagesize) . "," . (($page * $pagesize) + 1); } else { $sqllimit = "LIMIT " . ($pagesize + 1); } $tr = "="; $no = "!="; $lk = "like"; $bt = ">="; $st = "<="; if($_REQUEST['hitlist'] == "true" or $ShopTest == "true") {$parr = $_COOKIE; } if($_REQUEST['hitlist'] == "" and $ShopTest != "true") {$parr = $_POST; } array($parr); foreach ($parr as $var) { $i ++; if(preg_match('/[<>]/', $var)) { $testhtml = true; echo "Incorrect character (<,>). Please change your entry!"; } if($testhtml != true) { if(!empty($var) and $var!="Search" and key($parr)!="PHPSESSID") { switch (key($parr)) { case 'formYearFrom': $str = "tablecitations.Year ".$bt." '".addslashes($var)."' AND "; $description = " Publication Year >= "; if($_POST['formYearFrom']) {$value = $formYearFrom; } else {$value = $_COOKIE['formYearFrom'];} break; case 'formYearTo': $str = "tablecitations.Year ".$st." '".addslashes($var)."' AND "; $description = " Publication Year <= "; if($_POST['formYearTo']) {$value = $formYearTo; } else {$value = $_COOKIE['formYearTo'];} break; case 'formDnaBankNumber': $str = "tableciteddnas.UnitID_DNA ".$tr." '".addslashes($var)."' AND "; $description = " DNA Bank No = "; if($_POST['formDnaBankNumber']) {$value = $formDnaBankNumber; } else {$value = $_COOKIE['formDnaBankNumber'];} break; case 'formDNAbank': $str = "tableciteddnas.InstitutionCode_DNA ".$tr." '".addslashes($var)."' AND "; $description = " DNA Bank = "; if($_POST['formDNAbank']) {$value = $formDNAbank; } else {$value = $_COOKIE['formDNAbank'];} break; case 'formSpecUnitID': $str = "tableciteddnas.UnitID_Specimen ".$tr." '".addslashes($var)."' AND "; $description = " Specimen/Strain No = "; if($_POST['formSpecUnitID']) {$value = $formSpecUnitID; } else {$value = $_COOKIE['formSpecUnitID'];} break; case 'formPublication': if (strpos($var, "+") === false) { $Parts=explode(" ",$var); $str = "("; foreach($Parts as $Part){ $search .= "tablecitations.Citation ".$lk." '%".addslashes($Part)."%' OR "; } $test = strlen($str); $count = $test-5; $search1 = substr($search,0,$count); $str .= $search1.") AND"; } if (strpos($var, "+") !== false) { $Parts=explode("+",$var); $str = ""; foreach($Parts as $Part){ $str .= "tablecitations.Citation ".$lk." '%".addslashes($Part)."%' AND "; } } $description = " Publication contains "; if($_POST['formPublication']) {$value = $formPublication; } else {$value = $_COOKIE['formPublication'];} break; case 'page': break; } $where[$i] = $str; $descriptionall[$i] = $description; $valueall[$i] = $value; } next($parr); }} if(empty($str)) { echo ""; echo ""; echo "
New Search

No search key entered.
"; } else { foreach($where AS $a) $string .= $a; $l=strlen ($string); $max = $l-4; $where_str = substr($string, 0, $max); $wherestr = ' WHERE ' . $where_str; /******************************************************************************************************* * SQL-Befehl wird zusammengebaut aus den verschiedenen Such-Feldern der Formulare, * * Ansichtstyp "DNA" wird festgelegt (Trefferliste) * *******************************************************************************************************/ //abfrage mysql_query("DROP TABLE IF EXISTS tmpPubIDs"); $sqlType = "Dna"; $sql = $sqlcreate . $sql = "SELECT DISTINCT tablecitations.ID_Citation FROM tablecitations LEFT JOIN tableciteddnas ON tablecitations.ID_Citation = tableciteddnas.ID_Citation " . $wherestr." ORDER BY tablecitations.Year, tablecitations.Citation ".$sqllimit; //echo $sql; $result = mysql_query($sql); $sqlcount = "SELECT DISTINCT tablecitations.ID_Citation FROM tablecitations LEFT JOIN tableciteddnas ON tablecitations.ID_Citation = tableciteddnas.ID_Citation " . $wherestr; $resultcount = mysql_query($sqlcount); $gesamt = mysql_num_rows($resultcount); //echo $sqlcount; $log = addslashes($where_str); $sqllog = "INSERT INTO tablelog (Query, Resultcount) VALUES ('$log','$gesamt')"; $resultlog = mysql_query($sqllog); } $Pubcount=0; if(!empty($sql)) { // just in case it is still here: drop tmpDnaIDs mysql_query("DROP TABLE IF EXISTS tmpPubIDs"); mysql_query($sql); if(!mysql_affected_rows()) { if($sqlType=="Dna") { echo ""; echo ""; echo ""; echo "

No hits found for: "; foreach($descriptionall as $index => $descriptiontest) { $valuetest = $valueall[$index]; echo $descriptiontest."[".$valuetest."]"; } echo ".
"; } } else { /******************************************************************************************************* * Zusammenbauen der Ergebnisse allgemein * * * *******************************************************************************************************/ // Abfrage für TableDnaBankNumbers $result1 = mysql_query ("SELECT tablecitations.ID_Citation AS ID_Citation, " . " tablecitations.Citation AS Citation, " . " tablecitations.Link AS Link, " . " tablecitations.Year AS Year " . " FROM tablecitations, tmpPubIDs " . " WHERE tablecitations.ID_Citation = tmpPubIDs.ID_Citation"); if(!$result1) { echo ""; echo ""; echo ""; } else { if($sqlType=="Dna" and $gesamt != '0') { echo "
New Search
Change search
No hits found! Please change your current search!
"; $pagegesamt = mysql_num_rows($result1); echo ""; include("publicationpages.php"); echo ""; $Pubcount=0; echo ""; for ($i=1; $i<=$pagegesamt; $i++) { $row=mysql_fetch_array($result1); { $Pubcount++; if($Pubcount<=$pagesize) { $ID = $row['ID_Citation']; $Link = $row['Link']; $Citation = $row['Citation']; $sqlcite = "SELECT * FROM tableciteddnas WHERE tableciteddnas.ID_Citation = '$ID' ORDER BY UnitID_DNA"; $resultcite = mysql_query($sqlcite); echo ""; } } } echo ""; include("publicationpages.php"); echo "
".$gesamt; if($gesamt == 1) {echo " publication "; } else { echo " publications ";} echo "found for:"; foreach($descriptionall as $index => $descriptiontest) { $valuetest = $valueall[$index]; echo $descriptiontest."[".$valuetest."]"; } echo ". "; echo "

PublicationYearDNA Bank No
"; echo $Link ? build_href1($Link,$Citation) : $Citation; echo "".$row['Year'].""; while($row=mysql_fetch_object($resultcite)) { echo build_hrefcitation("Query.php", "sqlType=Detail&UnitID=".$row->UnitID_DNA."&CollCode=".$row->CollectionCode_DNA."&InstCode=".$row->InstitutionCode_DNA."&UnitIDS=".$row->UnitID_Specimen."&CollCodeS=".$row->CollectionCode_Specimen."&InstCodeS=".$row->InstitutionCode_Specimen, $row->UnitID_DNA) . "
"; } echo "

"; } echo ""; } }} } ?>