Location: PHPKode > projects > Decider > decider/Select_Quizes/selectionquiz.php
<html>
<head><link rel="stylesheet" type="text/css" href="../common/styles.css" />

<script language="javascript">
//Ajax stuff here
function getXmlHttpRequestObject() {
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest();
	} else if(window.ActiveXObject) {
		return new ActiveXObject("Microsoft.XMLHTTP");
	} else {
		alert("Your Browser Sucks!\nIt's about time to upgrade don't you think?");
	}
}

var select_clientkp_req = getXmlHttpRequestObject();

function select_client_kp(txt) {
	//alert(txt);
if (select_clientkp_req.readyState == 4 ||select_clientkp_req.readyState == 0) {
		var str = escape(txt);
						
		select_clientkp_req.open("GET",'selectkp.php?client=' + str, true);
		select_clientkp_req.onreadystatechange = handleselect_clientkp; 
		select_clientkp_req.send(null);
		
	}		
}

function select_quiz(str)
{
xmlHttp=getXmlHttpRequestObject()
var url="gethint.php"
url=url+"?q="+str
url=url+"&sid="+Math.random()

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChanged() { 

	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById("questions").innerHTML=xmlHttp.responseText; 
	} 
} 

function handleselect_clientkp() {

	if (select_clientkp_req.readyState == 4) {
		str=select_clientkp_req.responseText;
		//alert(str);
		 document.getElementById("kpName").innerHTML=str;		 
	}
}
//end of key person name

var select_clientdesig_req = getXmlHttpRequestObject();
function select_designation(txt){
	if (select_clientdesig_req.readyState == 4 ||select_clientdesig_req.readyState == 0) {
		var str1 = escape(txt);
						//alert(txt);
		select_clientdesig_req.open("GET",'selectkpdesi.php?kp=' + str1, true);
		select_clientdesig_req.onreadystatechange = handleselect_kpdesig; 
		select_clientdesig_req.send(null);
		
	}		

}

function handleselect_kpdesig() {

	if (select_clientdesig_req.readyState == 4) {
			str=select_clientdesig_req.responseText;
			 
		 document.getElementById("designation").value=str;	
			 
	}
}


</script>
<!-- help code-->
<script language="javascript">
var id;
var txtname;
function handleSearchSuggest(txt) {
var str;

			id=txt;
			txtname=txt;		
			var ss = document.getElementById("help");
			ss.innerHTML = '';
			if(id=="selectquizhelp"){
		    str = "You can select questions from question bank to interview identified key persons. Just select the organization name, key person name and the turn ";
			}
			
			var suggest = '<div onmouseover="javascript:helpOver(this);" ';
			suggest += 'onmouseout="javascript:helpOut(this);" ';
			suggest += 'onclick="javascript:closeBox(this.innerHTML);" ';
			suggest += 'class="suggest_link">'+ str + '</div>';
			ss.innerHTML += suggest;
			}

//Mouse over function
function helpOver(div_value) {
	div_value.className = 'help_over';
}
//Mouse out function
function helpOut(div_value) {
	div_value.className = 'help_out';
}
//Click function
function closeBox(value) {
	document.getElementById("help").innerHTML = '';
}

</script>
</head>

<body>

<div class="topic">Question Selection</div>
<form action="selectionquiztab.php" method="post" id="forum">
<table>

<tr><td align="center" height="40" width="10"></td> </tr>
	
<tr><td class="label">Organization Name</td><td>

<select  name="client" id="client" class="select" onChange="javascript:select_client_kp(this.value); " >

	<option>-select-</option>
		<?php
		require("../common/database.php");
		 $result = mysql_query( "SELECT Name FROM client");
			 while($row=mysql_fetch_array($result)){
		?>
				<option value="<?php echo $row['Name']?>"><?php echo $row['Name']?></option>
				
			<?php
			 }
			 
			?>
</select>
	

</td>
<td class="label">Turn</td><td> <select  id="turn" name="turn" class="select">
<option value="-select-">-select-</option>
			<?php
			for($i=1;$i<100;$i++){
			?>
			<option value="<?php echo $i;?>"><?php echo $i;?></option>
			<?php
			}
			?>
				</select></td></tr>
<tr><td class="label">Person Name</td><td>
<select name="kpName" id="kpName" class="select" onChange="javascript:select_designation(this.value);select_quiz(this.value);">



<option>-select-</option>
</select></td></tr><tr><td class="label">Designation</td><td>

<input type="text" id="designation" name="designation" class="textbox1" disabled >
<input type="hidden" id="no_of_quiz" name="no_of_quiz" value="" >

<!-- Akila edited
<input type="hidden" id="k_id" name="dkp_id" value="">
-->

</td><td><img src="../common/HelpIcon.gif" height="30" width="30" type="" name="Submit"  id="selectquizhelp" onClick="handleSearchSuggest(this.id)" class="pointer"><div id="help" class="length" > </div>
</td></tr>
<!--<tr><td class="topic">Select Question:</td><td><img src="../common/HelpIcon.gif" height="30" width="30" type="" name="Submit"  id="selectquizhelp" onClick="handleSearchSuggest(this.id)" class="pointer"><div id="help" class="length" > </div>
--></td></tr>
</table>
<br/>
<div class="topic">Select Question</div>
<table class="label">
<tr><td><span id="questions"></span></td></tr>
</table>
<table>
<tr><td></td>
<tr></tr>
<td><td>
<input type="submit" value="  Select  " class="button" name="select" id="select">
</tr>
</table>
</form>

</body>
</html>

Return current item: Decider