Source for file searchSubgenusHost.php

Documentation is available at searchSubgenusHost.php

  1. <?php 
  2. /**
  3. * Suggestion List for sptool/inputspecimen and sptool/inputmixedspecimen
  4. * <br/><br/>
  5. * element SubgenusHost
  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.     
  17.     include('../config/head.php')
  18.  
  19.     $searchq        =    strip_tags($_GET['q']);
  20.     $getRecord_sql    =    'SELECT count(Subgenus) as number,Subgenus FROM sptooltaxa WHERE Subgenus LIKE "'.$searchq.'%" AND Synecology = "host" GROUP BY Subgenus LIMIT 50';
  21.     $getRecord        =    mysql_query($getRecord_sql);
  22.  
  23.     if(strlen($searchq)>0){
  24.   if(mysql_num_rows($getRecord)) {
  25.  
  26.     echo '<ul>';
  27.   $max mysql_num_rows($getRecord);
  28.   for ($i=0$i<=$max-1$i++{
  29.       $row=mysql_fetch_array($getRecord);
  30.       {
  31.       $s "<li id=A".$i." onclick='javascript:SelectSubgenusHost(this.innerHTML);'><a>" utf8_encode($row['Subgenus']" <strong>(" $row['number'")</strong></a></li>";
  32.       echo $s;
  33.  
  34.   }}
  35.   if ($max == '50')
  36.   echo "<li id=".$max."><span>...</span></li>";
  37.     echo '</ul>';
  38. }
  39.  
  40. ?>

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