Source for file searchHiTaxClass2.php

Documentation is available at searchHiTaxClass2.php

  1. <?php 
  2. /**
  3. * Suggestion List for sptool/inputspecimen, sptool/inputmixedspecimen
  4. * <br/><br/>
  5. * element formClass2
  6. * @author Gabriele Droege, DNA Bank Network <contact@dnabank-network.org>
  7. * @version 2.0
  8. * @package Ajax
  9. * @copyright Copyright © 2011 DNA Bank Network http://www.dnabank-network.org<br>The contents of this file are subject to the Mozilla Public License Version 1.1
  10. * @filesource
  11. * @license http://www.mozilla.org/MPL/ MPL
  12. */    
  13.   /**
  14.   * calling connection to database
  15.   */    
  16.     include('../config/head.php'); 
  17.  
  18.     $searchq        =    strip_tags($_GET['q']);
  19.     $getRecord_sql    =    'SELECT count(HigherTaxon) as number,HigherTaxon FROM sptoolhighertaxon WHERE HigherTaxon LIKE "'.$searchq.'%" AND TaxonRank = "classis" GROUP BY HigherTaxon LIMIT 50';
  20.     $getRecord        =    mysql_query($getRecord_sql);
  21.  
  22.     if(strlen($searchq)>0){
  23.   if(mysql_num_rows($getRecord)) {
  24.  
  25.     echo '<ul>';
  26.   $max = mysql_num_rows($getRecord);
  27.   for ($i=0; $i<=$max-1; $i++) {
  28.       $row=mysql_fetch_array($getRecord);
  29.       {
  30.       $s = "<li id=A".$i." onclick='javascript:SelectHiTaxClass2(this.innerHTML);'><a>" . utf8_encode($row['HigherTaxon']) . " <strong>(" . $row['number'] . ")</strong></a></li>";
  31.       echo $s;
  32.  
  33.   }}
  34.   if ($max == '50')
  35.   echo "<li id=".$max."><span>...</span></li>";
  36.     echo '</ul>';
  37. }
  38.  
  39. } ?>

Documentation generated on Tue, 29 Nov 2011 10:45:13 +0100 by phpDocumentor 1.4.3