Location: PHPKode > projects > Decider > decider/Fuzzy_Select_Quizes/gethint.php

<?php
//get the q parameter from URL
$q=$_GET["q"];//lookup all hints from array if length of q>0
require("../common/database.php");

//quering for Q_Id
$q_string="select distinct * from kid_qid leftouter join client_key_person where K_Id=Dkp_Id and Id like '".$q."%'";

$result=mysql_query($q_string,$link);

$q_ids;

 if (strlen($q) > 0) {
 
 	$dataset="";
 
 	$i=0;
	
  	while($row=mysql_fetch_array($result)){
   
      $q_ids[$i]=$row['Q_Id'];
      $dataset=$row['Q_Id'];
	  
	  //aquring key person id
	  $kid=$row['K_Id']; 
	  
      $i++;
	  
	  
//check boxes generating        
  	}
  	
	for($j=0;$j<count($q_ids);$j++){
  
  		//getting information from table fuzzy_keyperson
		//$fuzzy_check_query = "select weight,turn from fuzzy_keyperson where Q_Id='".$q_ids[$j]."' and Domain='".$domain."' and Kp_Id='".$kid."'";
		$fuzzy_check_query = "select weight,turn from fuzzy_keyperson where Q_Id='".$q_ids[$j]."' and Kp_Id='".$kid."'";
		$fuzzy_result = mysql_query($fuzzy_check_query, $link);
		$fuzzy_row = mysql_fetch_array($fuzzy_result);	
		$fuzzy_weight = $fuzzy_row['weight'];
		$fuzzy_turn =  $fuzzy_row['turn'];
		//----------------------------------------------
		

		//checking the weight corresponding to quiz 
  		if($fuzzy_weight>0.10 && $fuzzy_turn<100){
		
			//aquiring question for given quiz id
  			$q_string1 = "select Question from quiz where Id='".$q_ids[$j]."'";
  			$ques_result = mysql_query($q_string1,$link);
  			$row1 = mysql_fetch_array($ques_result);
			$dataset = $row1['Question'];
  			//-----------------------------------
  
 				echo '<input type="checkbox" id="'.$q_ids[$j].'" name="'.$q_ids[$j].'" ></input>'.$dataset."<br>";
 		}
 	}
	
	
}

?>

<html>
<body>

<input type="hidden" id="k_id" name="k_id" value="<?php echo $kid?>" >

</body>
</html>
Return current item: Decider