
<!--#include file="config.asp" -->
<!--#include file="inc_lang_eng.asp" -->
<!--#include file="includes/connect.asp"-->

<html><head>
<title></title>

<link href="../includes/matrimonial.css" rel="stylesheet" type="text/css">

</head>

<style>
.txtbox	{	font-family:verdana; font-size: 11px; height: 18px; width: 250px; border: 1px #838383 solid; background-color:#FFFFFF;	}
.cmbbox	{	font-family:verdana; font-size: 11px; height: 15px; width: 170px; background-color:#FFFFFF;	}
.button
	{
	color : #FFFFFF;
	font-family:verdana;
	font-size:11px;
	height: 20px;
	border: 1px #FFFFFF solid;
	background-color:#CD2530;
	cursor:hand;
	font-weight:bold;
	text-align: center;
	vertical-align: top;
	}

</style>

<body bgcolor="#e3e8d2" onLoad="document.frmNatterChat.txtMessage.focus()" topmargin="3">


		<%
			if request("mode")="clear" then
			
		 
Set rs1 = Server.CreateObject("ADODB.recordset")
 Set rs=Server.CreateObject("ADODB.recordset")
rs1.Open "SELECT * FROM tbl_user where user_id_pk="&request("id")&"",cn, 3,2
if rs1.eof<>true then
loginname=rs1("loginname")
end if
rs.Open "SELECT * FROM tbl_user where user_id_pk="&request("chatid")&"",cn, 3,2
if rs.eof<>true then
chatname=rs("loginname")


end if
			
			
			
			
	 strConnString.execute("delete from messages where username='"&loginname&"'")
	
 strConnString.execute("delete from tblshoutbox where username='"&loginname&"'")
 strConnString.execute("delete from users where username='"&loginname&"'")
 
 
 
response.Redirect "chat.asp?id="&request("id")&"&chatid="&request("chatid")
		end if
		if request.QueryString("mode")="chat" then
		session("username")=request("id")
varDate = now()
Set rs11=Server.CreateObject("ADODB.recordset")
rs11.Open "SELECT * FROM messages", strConnString, 3,2
	rs11.addnew
	rs11("username")=request("id")
	rs11("message")=request("txtMessage")
	rs11("style")= Request("sltStyle")
	rs11("colour")=Request("sltColour")
	rs11("timeofpost")=now()
	rs11("messageto")=request("chatid")
rs11.update
 Set rs1 = Server.CreateObject("ADODB.recordset")
 Set rs=Server.CreateObject("ADODB.recordset")
rs1.Open "SELECT * FROM tbl_user where loginname='"&request("chatid")&"'",cn, 3,2
if rs1.eof<>true then
user=rs1("user_id_pk")
end if
rs.Open "SELECT * FROM tbl_profiles where user_id_fk="&user&" and online=true",cn, 3,2

if rs.eof<>true then
user=rs("user_id_fk")
	
end if
response.Redirect "nchat10.asp?id="&request("id1")&"&chatid="&request("chatid1")

		end if%>
<table width="555" align="left" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="553" valign="top">
	<form action="nchat10.asp?mode=chat" method="POST" name="frmNatterChat" >
       <strong><%=application("lang_nchat_1")%></strong>
	    <%	 
Set rs1 = Server.CreateObject("ADODB.recordset")
 Set rs=Server.CreateObject("ADODB.recordset")
rs1.Open "SELECT * FROM tbl_user where user_id_pk="&request("id")&"",cn, 3,2
if rs1.eof<>true then
loginname=rs1("loginname")
end if
rs.Open "SELECT * FROM tbl_user where user_id_pk="&request("chatid")&"",cn, 3,2
if rs.eof<>true then
chatname=rs("loginname")


end if
%>

          <input type="text" name="txtMessage" class="txtbox" size= "250" style="color: <%=varColour%>" />
		  <input type="hidden" name="id1" class="cmbbox" size="55" value=<%=request("id")%>>
		   <input type="hidden" name="chatid1" class="cmbbox" size="55" value=<%=request("chatid")%>>
		   <input type="hidden" name="id" class="cmbbox" size="55" value=<%=loginname%>>
		   <input type="hidden" name="chatid" class="cmbbox" size="55" value=<%=chatname%>>
	       <input type="submit" value="Send" name="submit" class="button" style="cursor:hand;" />
      </form>
	  <strong><%=application("lang_nchat_2")%>	 </strong> 
	
          <select name="sltStyle" class="inputbtn">
            <option selected value="<%=varStyle%>"><%=application("lang_nchat_3")%></option>
            <option value="None"><%=application("lang_nchat_4")%></option>
            <option value="b" style="font-weight: bold;"><%=application("lang_nchat_5")%></option>
            <option value="i" style="font-style: italics;"><%=application("lang_nchat_6")%></option>
            <option value="u" style="text-decoration: underline;"><%=application("lang_nchat_7")%></option>
          </select>
          <strong>&nbsp;&nbsp;<%=application("lang_nchat_8")%></strong> 
          <select name="sltColour" class="inputbtn" onChange="txtMessage.style.color = this.value; return true;" $disb>
            <option selected value="<%=varColour%>" style="color: <%=varColour%>"><%=application("lang_nchat_9")%></option>
            <option value="#0066CC" style="color: #0066CC"><%=application("lang_nchat_10")%></option>
            <option value="#0000FF" style="color: #0000FF"><%=application("lang_nchat_11")%></option>
            <option value="#FFFF00" style="color: #FFFF00"><%=application("lang_nchat_12")%></option>
            <option value="#008000" style="color: #008000"><%=application("lang_nchat_13")%></option>
            <option value="#FF8000" style="color: #FF8000"><%=application("lang_nchat_14")%></option>
            <option value="#800080" style="color: #800080"><%=application("lang_nchat_15")%></option>
            <option value="#FF80C0" style="color: #FF80C0"><%=application("lang_nchat_16")%></option>
            <option value="#C0C0C0" style="color: #C0C0C0"><%=application("lang_nchat_17")%></option>
          </select>
   
	
        <a href="../matrimonial.asp?mode=logoff"  style="cursor:hand; text-decoration:none; " target="_blank" onClick="parent.close()" />Log Off </a>&nbsp; 
        <a href="nchat10.asp?mode=clear&id=<%=request("id")%>&chatid=<%=request("chatid")%>"   style="cursor:hand; text-decoration:none; " target="_parent"/>
    Clear All</a>	</td>
   
  </tr>
</table>
</body>
</html>