<?php 
/**
* Suggestion List for sptool/inputspecimen, sptool/inputmixedspecimen
* <br/><br/>
* element formClass4
* @author Gabriele Droege, DNA Bank Network <contact@dnabank-network.org>
* @version 2.0
* @package Ajax
* @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
* @filesource
* @license http://www.mozilla.org/MPL/ MPL
*/	
  /**
  * calling connection to database
  */		
	include('../config/head.php'); 

	$searchq		=	strip_tags($_GET['q']);
	$getRecord_sql	=	'SELECT count(HigherTaxon) as number,HigherTaxon FROM sptoolhighertaxon WHERE HigherTaxon LIKE "'.$searchq.'%" AND TaxonRank = "classis" GROUP BY HigherTaxon LIMIT 50';
	$getRecord		=	mysqli_query($GLOBALS["___mysqli_ston"], $getRecord_sql);

	if(strlen($searchq)>0){
  if(mysqli_num_rows($getRecord)) {

	echo '<ul>';
  $max = mysqli_num_rows($getRecord);
  for ($i=0; $i<=$max-1; $i++) {
      $row=mysqli_fetch_array($getRecord);
      {
      $s = "<li id=A".$i." onclick='javascript:SelectHiTaxClass4(this.innerHTML);'><a>" . $row['HigherTaxon'] . " <strong>(" . $row['number'] . ")</strong></a></li>";
      echo $s;

  }}
  if ($max == '50')
  echo "<li id=".$max."><span>...</span></li>";
	echo '</ul>';
}

} ?>