<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="../common/styles.css" />
<script language="javascript">
var select_answer_req = getXmlHttpRequestObject();
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?");
}
}
function select_answer(txt) {
//alert(txt);
if (select_answer_req.readyState == 4 ||select_answer_req.readyState == 0) {
var str = escape(txt);
select_answer_req .open("GET",'select_answer.php?client=' + str, true);
select_answer_req .onreadystatechange =select_answerview;
select_answer_req.send(null);
}
}
function select_answerview() {
if (select_answer_req.readyState == 4) {
//no_of_kp=document.getElementById("no_of_kp").value;
//alert("no of kp=");
// str = select_domainkp_req.responseText.split("\n");
str=select_answer_req.responseText;
//str2=str + '<input type="submit" value="Ok" class="button" name="add">';
//alert(str2);
document.getElementById("inians").innerHTML=str;
}
}
//end of Ajax stuff
</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=="initialanwerviewhelp"){
str = "You can view the answers that have been given by clients to above initial questions. Just select the organization name. Answers will be flashing to your screen";
}
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" >Initial Answer View</div>
<table>
<tr><td align="center" height="30" width="10"></td> </tr>
<tr><td class="label">Client Organization Name</td><td><select id="client_Name" name="client_Name" class="select" onchange="javascript:select_answer(this.value);">
<option selected >-select-</option>
<?php
require("../common/database.php");
$result = mysql_query( "SELECT * FROM client");
while($row=mysql_fetch_array($result)){
?>
<option value="<?php echo $row['Name']?>"><?php echo $row['Name']?></option>
<?php
}
?>
</select></td><td><img src="../common/HelpIcon.gif" height="30" width="30" type="" name="Submit" id="initialanwerviewhelp" onClick="handleSearchSuggest(this.id)" class="pointer"><div id="help" class="length" > </div>
</td></tr></table>
<br/>
<div class="topic">Initial Answers</div>
<table id="inians" class="label"></table>
</body>
</html>