Location: PHPKode > projects > Decider > decider/Selected_Quizes/selectedquiz.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><link rel="stylesheet" type="text/css" href="../common/styles.css" />
<script language="javascript">
//Ajax stuff here 

var toGetHint;

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) {

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 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;
		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);
		
		toGetHint = escape(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; 	
	}
}

var selected_quiz_req = getXmlHttpRequestObject();
function select_quiz(txt){
	if (selected_quiz_req.readyState == 4 ||selected_quiz_req.readyState == 0) {
		var str1 = escape(txt);
		selected_quiz_req .open("GET",'gethint.php?quiz=' + str1 + '&keyperson=' + toGetHint, true);
		selected_quiz_req.onreadystatechange = handleselect_quiz; 
		selected_quiz_req.send(null);	
	}		
}

function handleselect_quiz() {

	if (selected_quiz_req.readyState == 4) {
		
		str=selected_quiz_req.responseText; 
		document.getElementById("questions").innerHTML=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=="selectedquizhelp"){
		    str = "You can view the selected questions in above section for future references.";
			}
			
			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">Selected Questions View</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 id="client"  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" onchange="javascript:select_quiz(this.value);">
			<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 id="kpName" name="kpName" class="select" onChange="javascript:select_designation(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="" >

</td><td><img src="../common/HelpIcon.gif" height="30" width="30" type="" name="Submit"  id="selectedquizhelp" onClick="handleSearchSuggest(this.id)" class="pointer"><div id="help" class="length" > </div>
</td></tr>
</td></tr>
</table>
<br/>
<div class="topic">Selected Questions</div>
<table class="label">
<tr><td><span id="questions"></span></td></tr>
<tr><td></td>
<tr></tr>
</table>


</form>

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