Location: PHPKode > scripts > Create Your Own Directory > cms/HRAS/users/viewprofile.php
<?php
include "../login/A-header.php";
include "../login/authheader.php";
if($block != true)
{
?>
<div id=hioxmenu style="visibility: hidden; position: absolute; left: 200px; top: 200px; ">
<table width=200 height=50 style="background-color: #F8F8FF; filter: alpha(opacity=80); -moz-opacity:.80; opacity:.80;">
<tr><td align=center style="font-size: 13px; font-family: arial, verdana, san-serif; ">
<textarea id=message rows=4 style="border: 0px; background-color: #F8F8FF;"></textarea></td></tr><tr><td><div align=center>
<input type=button name=fupdate value=ok id=okk onClick=remove()></div></td></tr>
</table>
</div>
<script language="javascript">
function remove()
{
var ss= document.getElementById("hioxmenu");
ss.style.visibility ="hidden";
var x=document.getElementsByTagName("Input");
	      for(i=0;i<x.length;i++){
		x.item(i).removeAttribute("disabled");
 		 }
}
</script>
<?php
$name = $_GET['name'];
$em=$_SESSION['email'];
$uid=0;
require_once "../../auth/config.php";
$str="select * from user where status like 'activate' and email like '$em'";
//echo"$str";
	$result = mysql_query($str);
		
	if($line =mysql_fetch_array($result, MYSQL_ASSOC))
	{
		$uid = $line['UserId'];
		$name = ucwords($line['UserName']);
		$address = $line['Address'];
		$len=strlen($address); 
		$address = nl2br($address);
		$email = $line['email'];
		$acton = $line['ActivateON'];
		$add = "";
		for($xx = 0; $xx<strlen($address); $xx++)
		{
			$chra = substr($address,$xx,1);	
			$ss = ord($chra);
			if($ss != 10 && $ss != 13) 
			$add = $add.$chra;
			else
			$add = $add." ";
		}
		$address = $add;
		
		//$ipadd = $line['ipadd'];
		//$country =$line['country'];
		//$city = $line['city'];
		//$phoneno = $line['phoneno'];
		//$website = $line['website'];
		
	}
?>
<html>
<head>
<title>
</title>
<style>
.jambo{color:#ff0000; background-color: #ffdede; font-size: 12px; font-family: arial,verdana, san-serif;	}
</style>

<script language="javascript">
var browser = navigator.appName;
function createRequestObject(){
	var request_o; //declare the variable to hold the object.
	if(browser == "Microsoft Internet Explorer"){
		/* Create the object using MSIE's method */
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		/* Create the object using other browser's method */
		request_o = new XMLHttpRequest();
	}
	return request_o; //return the object
}

var httpa;
var formid, oldval, fname1;

function testAjax(tnam,tid,tval,ffnam,td)
{
	
	httpa = createRequestObject(); 
	var str="ajax1.php?id="+tid+"&name="+tnam+"&value="+tval+"&fname="+ffnam+"&fid="+td;
	httpa.open('get', str);
	//alert(oldval);
	httpa.onreadystatechange = handleResponse;
	/* Send the data. We use something other than null when we are sending using the POST
	method. */
	httpa.send(null);
}

function handleResponse() {
	if(httpa.readyState == 4){
		var response = httpa.responseText;
		//document.write(response);
		var cc = "field"+formid;
		var cbobject= document.getElementById(cc);
		var hmenu = document.getElementById("hioxmenu");
		var me    = document.getElementById("message");	
		if(response){
			var posx  = findPosX(cbobject);
			var posy = findPosY(cbobject);

			hmenu.style.left = posx;
			hmenu.style.top = posy;
			me.value=response;
			hmenu.style.visibility = "visible";
			//alert(formid);
			//alert(oldval);
			revert(formid,oldval);
		}
	}
}

function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

  function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }

function newvalue(xtt,whata,id,fname)
{	
	var xy = xtt;
	var xx = "field"+xtt;
	var img2 = "ref"+xtt;
	var img3 = "sav"+xtt;
	var cbobject= document.getElementById(xx);
	cbobject.removeChild(cbobject.firstChild);
	cbobject.removeChild(cbobject.lastChild);
	cbobject.removeChild(cbobject.lastChild);
	var child2;
	var child3;
	if(browser == "Microsoft Internet Explorer"){
		var ss = "<INPUT type=image src=../../image/refresh.gif onmousedown=\"revert("+xtt+",'"+whata+"')\" height=14 border=1>";
		child2 = document.createElement(ss);
		var ss2 = "<INPUT type=image src=../../image/save.gif onmousedown=\"save('"+whata+"',"+id+","+xtt+",'"+fname+"')\" height=14 border=1>";
		child3 = document.createElement(ss2);
	}else{
		child2 = document.createElement("INPUT");
		child2.type = "image";
		child2.src = "../../image/refresh.gif";
		var sadsad = "revert("+xtt+",'"+whata+"')";
		child2.setAttribute("onmousedown",sadsad);
		child2.height = 14;
		child2.border = 1;
		child3 = document.createElement("INPUT");
		child3.type = "image";
		child3.src = "../../image/save.gif";
		var sdfd = "save('"+whata+"',"+id+","+xtt+",'"+fname+"')";
		child3.setAttribute('onMouseDown',sdfd);
		child3.height = 14;
		child3.border = 1;
	}
	cbobject.appendChild(child2);
	cbobject.appendChild(child3);
	
	if(fname!="Address")
	{	
		var sdfs = document.createElement('input');
		sdfs.setAttribute("type","text");
		sdfs.setAttribute('class','jambo');
		sdfs.setAttribute('id','name');
		cbobject.insertBefore(sdfs,cbobject.childNodes[0]);
	}else{
			while(cbobject.firstChild.nodeName != "IMG"){
			 //alert(cbobject.firstChild.nodeName+"-"+cbobject.firstChild.nodeValue);
			 cbobject.removeChild(cbobject.firstChild); 
		}
 			
		var sdfs = document.createElement('textarea');
		sdfs.setAttribute('id','name');
		
		sdfs.style.backgroundColor='#FFCC80';
		sdfs.style.color='efefef';

		//sdfs.setAttribute('style','background-color: #FFCC80;');
		//sdfs.setAttribute('style','color: ffffff;');
		sdfs.setAttribute('rows',6);
		sdfs.setAttribute('cols',30);
		cbobject.insertBefore(sdfs,cbobject.childNodes[0]);
		fname1="Address";
	}
	//return false;
	
}

function revert(xx,yy)
{	
		
	var cc = "field"+xx;
	var cbobject= document.getElementById(cc);
	if(fname1!="Address"){	
	var texta = document.createTextNode(yy);
	cbobject.removeChild(cbobject.firstChild); 
	cbobject.insertBefore(texta,cbobject.childNodes[0]);
}else{
	//alert(cbobject.firstChild.nodeName+cbobject.firstChild.nodeValue);
	while(cbobject.firstChild.nodeName != "IMG" ){
	cbobject.removeChild(cbobject.firstChild); 
	}
	var yy1=yy.replace(/<br>/g,"<br />");
	var arr=yy1.split("<br />");
	for( var i=(arr.length)-1; i>=0;i--){
	//alert(arr[i]);
	var texta = document.createTextNode(arr[i]);
	cbobject.insertBefore(texta,cbobject.childNodes[0]);
	if(i>0){
		var texta = document.createElement("br");
		}
		cbobject.insertBefore(texta,cbobject.childNodes[0]);
	}
}
	return false;
}
function save(nam,id,yy,fnam)
{	
	var cc = "field"+yy;
	var cbobject= document.getElementById(cc);
	var val = cbobject.childNodes[0].value;
     	var len=val.length;
	var x=document.getElementsByTagName("Input");
      for(i=0;i<x.length;i++){
		x.item(i).setAttribute("disabled","true");
  	}  
	document.getElementById("okk").disabled=false;
	testAjax(nam,id,val,fnam,yy);
}
</script>
<!-- main center -->
<br>
<table align=center width=50%  height=25% bgcolor=#ffffff cellpadding=0 cellspacing=0 style="border-width: 1px; border-style: solid; border-color: 	GREEN;">
<tr><td align=center style="font-size: 15px; color:#006400; font-family: arial,verdana,san-serif;" > 
<strong><B>PROFILE</B></strong></td></tr>
<tr width=100%>
<td align=left class=row1> 
<table align=center width=98% cellpadding=2px cellspacing=2 px width=100% border=0 class=tablea >
<?php																	
echo "<tr><td height=30 width=25% class=headerrow><strong>Name</strong></td><td class=trow id=field1> $name <img width=10 height=1 border=0>
<input type='image' id=new1 src='../../image/edit.gif' onMouseUp=\"return newvalue('1','$name','$id','UserName')\" height=14 border=0>
<input type=hidden><input type=hidden>
</td></tr>";

echo "<tr><td width=25% height=30 class=headerrow><strong>E-Mail</strong></td><td class=trow1 id=field2> $email <img width=10 height=1 border=0>
<input type='image' id=new2 name=nnew2 src='../../image/edit.gif' onMouseDown=\"newvalue('2','$email','$id','email')\" height=14 border=0>
<input type=hidden><input type=hidden>
</td></tr>";


echo "<tr><td width=25% height=30 class=headerrow><strong>Address</strong></td><td class=trow id=field3> $address <img width=10 height=1 border=0>
<input type='image' id=new3 name=nnew3 src='../../image/edit.gif' onMouseDown=\"newvalue('3','$address','$id','address')\" height=14 border=0>
<input type=hidden><input type=hidden></td></tr>";

echo "<tr><td width=25% height=30 class=headerrow><strong>ActivationOn</strong></td><td class=trow id=field3> $acton <img width=10 height=1 border=0>
<input type='image' id=new4 name=nnew4 src='../../image/edit.gif' onMouseDown=\"newvalue('4','$acton','$id','acton')\" height=14 border=0>
<input type=hidden><input type=hidden></td></tr>";


//echo "<tr><td width=25% height=30  class=headerrow><strong>IP</strong></td><td class=trow1 id=field8> $ipadd <img width=10 height=1 border=0>";

?>
</table>
<br>
</td></tr>
</table>
<br><br>
<?php
include "../login/A-footer.php";
}
?>
­­­­­
Return current item: Create Your Own Directory