Location: PHPKode > projects > Decider > decider/Discussion/forum.html
<!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
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);
		
		//alert(str);
		//document.getElementById("org").innerHTML="akila";	
	}		
}

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 handeling

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;		 
	}
}
//end of handling kp and their disignation.
//start of answer view....

var select_answerview_req = getXmlHttpRequestObject();

function select_answerview(txt){
	if (select_answerview_req.readyState == 4 ||select_answerview_req.readyState == 0) {
		var str2 = escape(txt);
		//alert("hello");
		//alert(txt);
		select_answerview_req.open("GET",'selectans.php?kp=' + str2, true);
		select_answerview_req.onreadystatechange = handleselect_ans; 
		select_answerview_req.send(null);
	}		
}

function handleselect_ans(){

	if (select_answerview_req.readyState == 4) {

		str=select_answerview_req.responseText;
		
		 document.getElementById("viewans").innerHTML=str;			 
	}

}
//end of answer view

//start of forum view
var select_forumview_req = getXmlHttpRequestObject();

function select_feedback(txt){
	if (select_forumview_req.readyState == 4 ||select_forumview_req.readyState == 0) {
		var str3 = escape(txt);
						//alert(txt);
		select_forumview_req.open("GET",'selectforum.php?client=' + str3, true);
		select_forumview_req.onreadystatechange = handleselect_feedback; 
		select_forumview_req.send(null);
		
	}		

}

function handleselect_feedback(){
	if (select_forumview_req.readyState == 4) {
		str=select_forumview_req.responseText;
		document.getElementById("feedbackview").innerHTML=str;			
		//alert("my response"+str); 
	}

}
//end of forum view

//-------------------------------
//this is a ajax part of changing comments
var add_comment_req = getXmlHttpRequestObject();

function insertconmment(txt){

	//alert(txt);
	if (add_comment_req.readyState == 4 ||add_comment_req.readyState == 0) {
		var str3 = escape(txt);
		var str4=document.getElementById("client").value;	
		//alert(str3 + str4)			
		add_comment_req.open("GET",'insertcomment.php?forum_field='+ str3 + '&client='+ str4, true);
		add_comment_req.onreadystatechange = handle_change; 
		add_comment_req.send(null);
		
	}		

}

function handle_change(){
	
	if (add_comment_req.readyState == 4) {
		str=add_comment_req.responseText;
		//alert(str);
		document.getElementById("forum_field").value='';
		document.getElementById("feedbackview").innerHTML=str;			
		//alert("my response"+str); 
	}

}


//---------------------------------
/*



*/
var clientval = getXmlHttpRequestObject();
/*
function set_client(txt){
	if (clientval.readyState == 4 ||clientval.readyState == 0) {
		var str = escape(txt);
		//alert(txt);
		clientval.open("GET",'client.php?clientname=' + str, true);
		clientval.onreadystatechange = handle_client; 
		clientval.send(null);
		
	}		
}

function handle_client(){
	if (clientval.readyState == 4) {
		str=clientval.responseText;
		//alert(str);
		document.getElementById("org1").value=str;			 
	}
}
*/

</script>
</head>

<body>

<form action="forumtab.php" method="post" id="forum">

<!-- <input type="hidden" id="org" name="org" value="">
<input type="text" id="org1" name="org1" class="select" disabled value="" > -->

<table>

	<tr><td align="center" height="40" width="10"></td> </tr>

	<tr><td class="label">Organization Name</td><td>

<select id="client"  name="client" class="select" onChange="javascript:select_client_kp(this.value),select_feedback(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>
				
				<?
			 }
			 
			?>
	</select>

</td></tr>
<tr><td class="label">Person Name:</td><td>
<select id="kpName" name="kpName" class="select" onChange="javascript:select_designation(this.value),select_answerview(this.value);">
<option value="">-select-</option>
</select></td><tr><td class="label">Designation:</td><td>
<input type="text" id="designation" name="designation" class="textbox1" disabled value="" >
</td></tr>

</table>
<h3 class="topic">Answer View</h3><br>
<table id="viewans"></table>

<form action="" method="post" id="forum">
<h3 class="topic">Analyst Feedback</h3>
<table border=1 id="feedbackview"></table>

<hr>
<h5 class="topic">Add your Comments:</h5><br>
<textarea name="forum_field", id="forum_field" cols="50" rows="10" class="textboxarea"></textarea>

<label></label>

<input type="button" onClick="javascript:insertconmment(forum_field.value);" name="ADD" value="    ADD    " id="ADD" class="button">
<input type="reset" name="reset" value="Reset" class="button">
</form>

</form>

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