<?php session_start();
include("conn.php");
include("google/ip.php");
$sql="select username,id,userstate,companyname from chat_user where userid=".$_SESSION["chatid"]." order by userstate desc";
			mysql_query("set names 'utf8'",$dbconn);
			$result=mysql_query($sql,$dbconn);
			$rows=mysql_num_rows($result);
 ?>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo mysql_result($result,0,"companyname") ?> -- chat online</title>
<link href="temp.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">
if(window.ActiveXObject)
{
self.resizeTo(552,570)
}
else
{
self.resizeTo(532,590)
}
</script>
</head>

<body>
<div id="userchatboxstyle">
<div class="userchattop"><img src="etw-logo-1.jpg" alt="etw logo" width="114" height="59" /><div class="etwguestinfomation"><?php echo mysql_result($result,0,"companyname") ?></div></div>
<div class="etwchathistory" id="etwchatmessage">

</div>
   <input type="hidden" name="userid" value="<?php echo $_SESSION["chatid"] ?>" id="userid" />
   <input type="hidden" name="etwchatusername" id="etwchatusername" value="<?php echo mysql_result($result,0,"username") ?>" />
    <input type="hidden" name="etwchataddress" id="etwchataddress" />
    <div class="etwchatuserstate" id="etwchatuserstate"></div>
    <span id="setemailselect">
    <input type="text"  id="etwchatemail" value="Enter Your E-mail Address" onClick="noinfo(this)" onChange="checkemail()" />
    </span>
    <textarea  rows="5" id="etwchatcontent"></textarea>
    <input type="button" value="            Click!!!!Chat with me now                " class="etwchatsubmit" onClick="postdata()" />
</div>
<div id="hiddenalluser">
<?php
			for($i=0;$i<$rows;$i++)
			{
			if(mysql_result($result,$i,"userstate")==0)
			{
				echo "<a href='#' onclick=\"setchatusername('".mysql_result($result,$i,"username")."')\"><font color='#999'>offline:".mysql_result($result,$i,"username")."</font>[--You can leave message here,or send an e-mail to me,I will deal with it in 24 hours]</a><br />";
				}
				else
				{
					echo "<a href='#' onclick=\"setchatusername('".mysql_result($result,$i,"username")."')\"><font color='green'><b>online:".mysql_result($result,$i,"username")."</b></font></a><br />";
					}
			}
 ?>
</div>

<script type="text/javascript" src="js/temp.js"></script>
<script type="text/javascript">
window.setInterval(showdetail,1000)
setemail()
</script>
</body>
</html>
