<%
Response.ContentType = "text/html" 
Response.Charset = "UTF-8" 
%>

<% 
page=request.QueryString("page")
if page="message" then
%>
		<!--#include file ="head.asp"-->
        
        
        
<!--#include file ="../veriables.asp"-->
<% 
Response.ContentType = "text/html" 
Response.Charset = "UTF-8" 
veri = SERVER.MAPPATH("../db/"&datayol&".mdb")
Baglan = "DBQ=" & veri &   ";Driver={Microsoft Access Driver (*.mdb)}"
set baglanti = server.createobject("adodb.connection")
baglanti.open baglan
sqlcumlesi = "UPDATE iletisimyazi Set okunma = true" 
baglanti.Execute sqlcumlesi 
set rs = server.createobject("adodb.recordset")
sql = "select * from iletisimyazi order by id desc"
rs.open sql, baglanti, 1, 3
%>

			<div class="block withsidebar">
			
				<div class="block_head">
					<div class="bheadl"></div>
					<div class="bheadr"></div>
					
					<h2>Gelen kutusu</h2>&nbsp;(<%=rs.recordcount%> mesaj)
                    <form action="?page=search" method="post">
						<input type="text" name="q" class="text" value=" isim veya mesaj ara" />
					</form>
				</div>		<!-- .block_head ends -->
				
				
				
				<div class="block_content">
					
					<div class="sidebar">
						<ul class="sidemenu">

				

<%
if not rs.eof then
intGecerliSayfa = Request.Querystring("now")
If intGecerliSayfa = "" OR IsNumeric(intGecerliSayfa) = False Then intGecerliSayfa = 1
rs.PageSize = 10
intSayfaSayisi= rs.PageCount
rs.AbsolutePage =intGecerliSayfa
For m = 1 to rs.PageSize
If rs.Eof Then Exit For
%>

<li><a href="#<%=rs("id")%>"><%=rs("isim")%></a></li>

<%
rs.MoveNext
Next

end if
%>
		</ul>
						
						<p>
<center>                     
<%
Aralik = 2
intSayfaAltSiniri = intGecerliSayfa - Aralik
intSayfaUstSiniri = intGecerliSayfa + Aralik
intSolGrupSayisi = 1 + Aralik
intSagAltSinir = intSayfaSayisi - Aralik

If (intSayfaUstSiniri >intSayfaSayisi) Then
intSayfaAltSiniri = intSayfaSayisi - (2 * Aralik)
intSayfaUstSiniri = intSayfaSayisi
End If

If (intSayfaAltSiniri <= 0) Then
intSayfaAltSiniri = 1
intSayfaUstSiniri = intSayfaAltSiniri + (2 * Aralik)
If intSayfaUstSiniri >= intSayfaSayisi Then intSayfaUstSiniri = intSayfaSayisi
End If

If intSolGrupSayisi >= intSayfaAltSiniri Then intSolGrupSayisi = intSayfaAltSiniri - 1
If intSagAltSinir <= intSayfaUstSiniri Then intSagAltSinir = intSayfaUstSiniri + 1

If intGecerliSayfa >1 Then %>
<a href= "?page=message&now=1" title="&#304;lk Sayfa">««</a>
<a href= "?page=message&now=<%=intGecerliSayfa-1%>" title="Önceki Sayfa">«</a>
<%Else%>«« «<%
End If
For i = intSayfaAltSiniri to intSayfaUstSiniri
If CInt(i) = CInt(intGecerliSayfa) Then
Response.Write " <b>"
Else %>
<a href= "?page=message&now=<%=i%>" title="<%=i%>. Sayfa">
<%
End If
Response.Write i &"</a></b>"
Next
If CInt(intGecerliSayfa) <>CInt(intSayfaSayisi) Then %>
<a href= "?page=message&now=<%=intGecerliSayfa+1%>" title="Sonraki Sayfa">»</a>
<a href= "?page=message&now=<%=intSayfaSayisi%>" title="Son Sayfa">»»</a><%else%> » »»<%
End If
%>
</center>

</p>
					</div>		<!-- .sidebar ends -->
					
                        
<% 
set rs = server.createobject("adodb.recordset")
sql = "select * from iletisimyazi order by id desc"
rs.open sql, baglanti, 1, 3
if rs.eof then
response.Write("<center><br>Yeni mesajiniz bulunmamaktadir.")
end if
do while not rs.eof %>



					<div class="sidebar_content" id="<%=rs("id")%>">
						<h3><%=rs("isim")%></h3>
                        <hr />
						<p><%=rs("mesaj")%></p>
                        <hr />
                        <p><b>Gönderen:</b> <%=rs("mail")%><br /><b>Tarih:</b> <%=rs("tarih")%><br /><b>&#304;p:</b> <%= rs("ip")%><br /><b>&#304;slem:</b> <a href="?page=del_onay&id=<%= rs("id") %>" >Sil</a>&nbsp;|&nbsp;<a href="?page=reply&mail=<%= rs("mail") %>" >Cevapla</a></p>
					</div>		<!-- .sidebar_content ends -->
                    
                    
<%
rs.MoveNext
loop
rs.close
set rs = nothing
%>

<%
baglanti.close
set baglant = nothing
%>
</div>		<!-- .block_content ends -->

				
				<div class="bendl"></div>
				<div class="bendr"></div>
				
			</div>		<!-- .block ends -->

<!--#include file ="foot.asp"-->

<%
elseif page = "sendbox" then
%>
		<!--#include file ="head.asp"-->
        
        
        
<!--#include file ="../veriables.asp"-->
<% 
Response.ContentType = "text/html" 
Response.Charset = "UTF-8" 
veri = SERVER.MAPPATH("../db/"&datayol&".mdb")
Baglan = "DBQ=" & veri &   ";Driver={Microsoft Access Driver (*.mdb)}"
set baglanti = server.createobject("adodb.connection")
baglanti.open baglan
set rs = server.createobject("adodb.recordset")
sql = "select * from gonderilenler order by id desc"
rs.open sql, baglanti, 1, 3
%>

			<div class="block withsidebar">
			
				<div class="block_head">
					<div class="bheadl"></div>
					<div class="bheadr"></div>
					
					<h2>Gönerilenler</h2>&nbsp;(<%=rs.recordcount%> mesaj)
                   
				</div>		<!-- .block_head ends -->
				
				
				
				<div class="block_content">
					
					<div class="sidebar">
						<ul class="sidemenu">

				

<%
if not rs.eof then
intGecerliSayfa = Request.Querystring("now")
If intGecerliSayfa = "" OR IsNumeric(intGecerliSayfa) = False Then intGecerliSayfa = 1
rs.PageSize = 10
intSayfaSayisi= rs.PageCount
rs.AbsolutePage =intGecerliSayfa
For m = 1 to rs.PageSize
If rs.Eof Then Exit For
%>

<li><a href="#<%=rs("id")%>"><%=rs("konu")%></a></li>

<%
rs.MoveNext
Next

end if
%>
		</ul>
						
						<p>
<center>                     
<%
Aralik = 2
intSayfaAltSiniri = intGecerliSayfa - Aralik
intSayfaUstSiniri = intGecerliSayfa + Aralik
intSolGrupSayisi = 1 + Aralik
intSagAltSinir = intSayfaSayisi - Aralik

If (intSayfaUstSiniri >intSayfaSayisi) Then
intSayfaAltSiniri = intSayfaSayisi - (2 * Aralik)
intSayfaUstSiniri = intSayfaSayisi
End If

If (intSayfaAltSiniri <= 0) Then
intSayfaAltSiniri = 1
intSayfaUstSiniri = intSayfaAltSiniri + (2 * Aralik)
If intSayfaUstSiniri >= intSayfaSayisi Then intSayfaUstSiniri = intSayfaSayisi
End If

If intSolGrupSayisi >= intSayfaAltSiniri Then intSolGrupSayisi = intSayfaAltSiniri - 1
If intSagAltSinir <= intSayfaUstSiniri Then intSagAltSinir = intSayfaUstSiniri + 1

If intGecerliSayfa >1 Then %>
<a href= "?page=sendbox&now=1" title="&#304;lk Sayfa">««</a>
<a href= "?page=sendbox&now=<%=intGecerliSayfa-1%>" title="Önceki Sayfa">«</a>
<%Else%>«« «<%
End If
For i = intSayfaAltSiniri to intSayfaUstSiniri
If CInt(i) = CInt(intGecerliSayfa) Then
Response.Write " <b>"
Else %>
<a href= "?page=sendbox&now=<%=i%>" title="<%=i%>. Sayfa">
<%
End If
Response.Write i &"</a></b>"
Next
If CInt(intGecerliSayfa) <>CInt(intSayfaSayisi) Then %>
<a href= "?page=sendbox&now=<%=intGecerliSayfa+1%>" title="Sonraki Sayfa">»</a>
<a href= "?page=sendbox&now=<%=intSayfaSayisi%>" title="Son Sayfa">»»</a><%else%> » »»<%
End If
%>
</center>

</p>
					</div>		<!-- .sidebar ends -->
					
                        
<% 
set rs = server.createobject("adodb.recordset")
sql = "select * from gonderilenler order by id desc"
rs.open sql, baglanti, 1, 3
if rs.eof then
response.Write("<center><br>Yeni mesajiniz bulunmamaktadir.")
end if
do while not rs.eof %>



					<div class="sidebar_content" id="<%=rs("id")%>">
						<h3><%=rs("konu")%></h3>
                        <hr />
						<p><%=rs("mesaj")%></p>
                        <hr />
                        <p><b>Gönderilen mail:</b> <%=rs("mail")%><br /><b>Gönerilme tarihi:</b> <%=rs("tarih")%><br /><b>Gönderen ip:</b> <%= rs("ip")%><br /><b>&#304;slem:</b> <a href="?page=del_onay_gonderilenler&id=<%= rs("id") %>" >Sil</a></p>
					</div>		<!-- .sidebar_content ends -->
                    
                    
<%
rs.MoveNext
loop
rs.close
set rs = nothing
%>

<%
baglanti.close
set baglant = nothing
%>
</div>		<!-- .block_content ends -->

				
				<div class="bendl"></div>
				<div class="bendr"></div>
				
			</div>		<!-- .block ends -->

<!--#include file ="foot.asp"-->

<%
elseif page = "search" then

%>
<!--#include file ="head.asp"-->
<!--#include file ="../veriables.asp"-->

<div class="block withsidebar">
			
				<div class="block_head">
					<div class="bheadl"></div>
					<div class="bheadr"></div>
					
					<h2>Gelen kutusu</h2>
                    <form action="?page=search" method="post">
						<input type="text" name="q" class="text" value="<%=Request.form("q")%>" />
					</form>
				</div>		<!-- .block_head ends -->
				
				
				
				<div class="block_content">
					<div class="sidebar">
						<ul class="sidemenu">
					
                        
<%
StrPath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../db/"&datayol&".mdb")

Set baglanti = Server.CreateObject("adodb.connection")
Baglanti.Open StrPath

arama = Request.form("q")

sql="select * from iletisimyazi Where isim like '%"&arama&"%' or mesaj like '%"&arama&"%' or mail like '%"&arama&"%'  order by id desc "
Set aramalar = Baglanti.ExeCute(sql)
%>
<% if aramalar.eof then %>
<% end if %>
<%
Do While not aramalar.eof
%>

<li><a href="#<%=aramalar("id")%>"><%=aramalar("isim")%></a></li>

<%
aramalar.Movenext
Loop

%>

</ul>
						
<p>
Tag : <%=Request.form("q")%>
</p>
					</div>		<!-- .sidebar ends -->

<%
StrPath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../db/"&datayol&".mdb")

Set baglanti = Server.CreateObject("adodb.connection")
Baglanti.Open StrPath

arama = Request.form("q")

sql="select * from iletisimyazi Where isim like '%"&arama&"%' or mesaj like '%"&arama&"%' or mail like '%"&arama&"%'  order by id desc "
Set aramalar = Baglanti.ExeCute(sql)
%>
<% if aramalar.eof then %>
<br><center>Sonu&#231; bulunamad&#305;.</center>
<% end if %>
<%
Do While not aramalar.eof
%>

<div class="sidebar_content" id="<%=aramalar("id")%>">
						<h3><%=aramalar("isim")%></h3>
                        <hr />
						<p><%=aramalar("mesaj")%></p>
                        <hr />
                           <p><b>Gönderen:</b> <%=aramalar("mail")%><br /><b>Tarih:</b> <%=aramalar("tarih")%><br /><b>&#304;p:</b> <%= aramalar("ip")%><br /><b>&#304;slem:</b> <a href="?page=del_onay&id=<%= aramalar("id") %>" >Sil</a>&nbsp;<a href="?page=reply&mail=<%= aramalar("mail") %>" >Cevapla</a></p>
					</div>		<!-- .sidebar_content ends -->

<%
aramalar.Movenext
Loop

aramalar.close
set aramalar = Nothing
Set Baglanti = Nothing
%>






</div>		<!-- .block_content ends -->

				
				<div class="bendl"></div>
				<div class="bendr"></div>
				
			</div>		<!-- .block ends -->

<!--#include file ="foot.asp"-->

<%
elseif page = "del_onay" then

%>
<!--#include file="head.asp"-->
<div class="block">
<div class="block_head">
<div class="bheadl"></div>
<div class="bheadr"></div>
<h2>Mesaj s&#305;l</h2>
</div>		<!-- .block_head ends -->
<div class="block_content">
<div class="message warning"><p>Mesaj&#305; silmek istediginizden eminmisiniz?</p></div>
			<form action="contact.asp?page=del&id=<%=request("id")%>" method="post">
			<p>
			<a href="contact.asp?page=del&id=<%=request("id")%>"><INPUT TYPE="submit" VALUE=" Evet "  class="submit small"></a>
            <INPUT type="Button" VALUE=" &#305;ptal " OnClick='history.go( -1 );return true;'  class="submit mid">
			</p>
			</form>
</div>		<!-- .block_content ends -->
<div class="bendl"></div>
<div class="bendr"></div>
</div>		<!-- .block ends -->
<!--#include file ="foot.asp"-->
<%
elseif page = "del_onay_gonderilenler" then
%>
<!--#include file="head.asp"-->
<div class="block">
<div class="block_head">
<div class="bheadl"></div>
<div class="bheadr"></div>
<h2>Mesaj s&#305;l</h2>
</div>		<!-- .block_head ends -->
<div class="block_content">
<div class="message warning"><p>Mesaj&#305; silmek istediginizden eminmisiniz?</p></div>
			<form action="contact.asp?page=del_gonderilenler&id=<%=request("id")%>" method="post">
			<p>
			<a href="contact.asp?page=del_gonderilenler&id=<%=request("id")%>"><INPUT TYPE="submit" VALUE=" Evet "  class="submit small"></a>
            <INPUT type="Button" VALUE=" &#305;ptal " OnClick='history.go( -1 );return true;'  class="submit mid">
			</p>
			</form>
</div>		<!-- .block_content ends -->
<div class="bendl"></div>
<div class="bendr"></div>
</div>		<!-- .block ends -->
<!--#include file ="foot.asp"-->
<%
elseif page="save" then
%>

<!--#include file ="../veriables.asp"-->
<% 
Response.CharSet = "iso-8859-9"    
veri = SERVER.MAPPATH("../db/"&datayol&".mdb")
Baglan = "DBQ=" & veri &   ";Driver={Microsoft Access Driver (*.mdb)}"

Session.LCID = 1055
Session.CodePage = 1254

isim=request.form("isim")
mail=request.form("mail")
mesaj=request.form("mesaj")
ip = request.servervariables("remote_host")

set baglanti = server.CreateObject("adodb.connection")
baglanti.open "Provider=Microsoft.Jet.oledb.4.0;Data Source=" & server.Mappath("../db/"&datayol&".mdb")
Set Guncelle = Server.CreateObject("Adodb.Recordset")
sql="Select * From Admin"
Guncelle.Open sql,Baglanti,1,3
captcha = Guncelle("captcha")
Guncelle.close
set Guncelle=nothing
if captcha = "acik" then
if request.form("tplm") = "" then
response.redirect "../contact.asp?run=error&isim=" & Request.Form("isim") & "&mail=" & Request.Form("mail") & "&mesaj=" & Request.Form("mesaj")
response.end
end if
if int(session("tplm")) = int(request.form("tplm")) then
response.Write "asd"
else
response.redirect "../contact.asp?run=error&isim=" & Request.Form("isim") & "&mail=" & Request.Form("mail") & "&mesaj=" & Request.Form("mesaj")
response.end
end if
end if

if isim <>"" and mail <>"" and mesaj <>"" then

set baglanti = server.createobject("adodb.connection")
baglanti.open baglan

set rs = server.createobject("adodb.recordset")
sql = "select * from iletisimyazi"
rs.open sql, baglanti, 1, 3

rs.addnew
rs("isim") = isim
rs("mail") = mail
rs("mesaj") = mesaj
rs("ip") = ip
rs("tarih") = now()
rs("okunma") = "false"

rs.update
rs.close

Function tr(gelenveri)
gelenveri = LCase(gelenveri)
gelenveri = Replace(gelenveri ,Chr(208),"g",1,-1,0)
gelenveri = Replace(gelenveri ,Chr(240),"g",1,-1,0)
gelenveri = Replace(gelenveri ,Chr(222),"s",1,-1,0)
gelenveri = Replace(gelenveri ,Chr(254),"s",1,-1,0)
gelenveri = Replace(gelenveri ,Chr(199),"c",1,-1,0)
gelenveri = Replace(gelenveri ,Chr(231),"c",1,-1,0)
gelenveri = Replace(gelenveri ,Chr(221),"i",1,-1,0)
gelenveri = Replace(gelenveri ,Chr(236),"i",1,-1,0)
gelenveri = Replace(gelenveri ,Chr(237),"i",1,-1,0)
gelenveri = Replace(gelenveri ,Chr(214),"o",1,-1,0)
gelenveri = Replace(gelenveri ,Chr(246),"o",1,-1,0)
gelenveri = Replace(gelenveri ,Chr(252),"u",1,-1,0)
gelenveri = Replace(gelenveri ,Chr(220),"u",1,-1,0)
gelenveri = Replace(gelenveri ,"'","",1,-1,0)
tr = gelenveri 
End Function

%>
<!--#include file ="../veriables.asp"-->
<%

icerik = "<meta http-equiv = Content-Type content = text/html; charset = utf-8>"
icerik = icerik & sitename & " - iletisim formu<br><br>"
icerik = icerik & "<b> Ad Soyad: </b> " & tr(request.form("isim")) & "<br>"
icerik = icerik & "<b> E-Posta : </b> " & tr(request.form("mail")) & "<br>"
icerik = icerik & "<b> Ip : </b> " & request.servervariables("remote_host") & "<br><br>"
icerik = icerik & "<b> Tarih : </b> " & now() & "<br>"
icerik = icerik & "<b> Mesaj : </b> " & tr(request.form("mesaj")) & "<br>"

Set obj = Server.CreateObject("Persits.MailSender")
	
obj.Host = mserv
obj.From = request.form("mail")
obj.AddAddress posta
obj.Subject = "iletisim bildirim"
obj.Body = icerik
obj.IsHTML = True

on error resume next
obj.Send

response.redirect "../contact.asp?run=thanks&name=" & request.form("isim")
response.end
set obj = Nothing

else

response.redirect "../contact.asp?run=error&isim=" & Request.Form("isim") & "&mail=" & Request.Form("mail") & "&mesaj=" & Request.Form("mesaj")
response.end
end if

%>


<%
elseif page="del" then
%>

<!--#include file ="../veriables.asp"-->
<%
veri = SERVER.MAPPATH("../db/"&datayol&".mdb")
Baglan = "DBQ=" & veri &   ";Driver={Microsoft Access Driver (*.mdb)}"

set id = Request.QueryString("id")
set baglanti = server.createobject("adodb.connection")
baglanti.open baglan
SQL = "delete from iletisimyazi where id="
SQL = SQL & id
set rs = server.createobject("adodb.recordset")
rs.open sql, baglanti, 1, 3
response.redirect "panel.asp?box=success&text=Mesaj%20basariyla%20silindi.&second=2&url=contact.asp?page=message"
response.end


elseif page="del_gonderilenler" then
%>

<!--#include file ="../veriables.asp"-->
<%
veri = SERVER.MAPPATH("../db/"&datayol&".mdb")
Baglan = "DBQ=" & veri &   ";Driver={Microsoft Access Driver (*.mdb)}"

set id = Request.QueryString("id")
set baglanti = server.createobject("adodb.connection")
baglanti.open baglan
SQL = "delete from gonderilenler where id="
SQL = SQL & id
set rs = server.createobject("adodb.recordset")
rs.open sql, baglanti, 1, 3
response.redirect "panel.asp?box=success&text=Mesaj%20basariyla%20silindi.&second=2&url=contact.asp?page=sendbox"
response.end



elseif page="reply" then
%>

<!--#include file="head.asp"-->

	<div class="block">
			
				<div class="block_head">
					<div class="bheadl"></div>
					<div class="bheadr"></div>
					
					<h2><% if request.QueryString("mail")<>"" then%>Cevapla<%else%>Yeni ileti<%end if%></h2>	
				</div>		<!-- .block_head ends -->
				
				
				
				<div class="block_content">
<script type="text/javascript" src="js/jquery-1.2.1.pack.js"></script>
<script type="text/javascript">
function lookup(inputString) {
	if(inputString.length == 0) {
		// herhangi bir deger girilmemisse sonuc kutuyu gösterme
		$('#suggestions').hide();
	} else {
		$.post("emails_get.asp", {queryString: ""+inputString+""}, function(data){
			//emails_get.asp sayfasindan dönen sonuç sifirdan büyükse sonuc kutusunu göster
			if(data.length >0) {
				$('#suggestions').show();
				$('#autoSuggestionsList').html(data);
			}
			else
			$('#suggestions').hide();
		});
	}
}

function fill(thisValue) {
	$('#inputString').val(thisValue);
	setTimeout("$('#suggestions').hide();", 200);
}
</script>
<style type="text/css">
h3 { margin: 0px; padding: 0px;	 }
.suggestionsBox { position:absolute; left: 42%; margin: -47px 0px 0px 0px; width: 250px; background-color: #212427; -moz-border-radius: 7px; -webkit-border-radius: 7px; border: 2px solid #000; color: #fff; }
.suggestionList { margin: 3px 5px 0px 6px; padding: 0px; }
.suggestionList li { margin: 0px 0px 3px 0px; padding: 0px; cursor: pointer; }
.suggestionList li:hover { background-color: #269ce7; }
</style>
		<form action="?page=reply_send" method="post">
  <p>
							<label>Kime:</label><br />
							<input name="mail" type="text" value="<%=request.QueryString("mail")%>" id="inputString" onKeyUp="lookup(this.value);" class="text small" />
						</p>
                        <div class="suggestionsBox" id="suggestions" style="display: none;">
						<div class="suggestionList" id="autoSuggestionsList">
						&nbsp;
						</div>
						</div>
                        <p>
							<label>Konu:</label><br />
							<input name="subject" type="text" class="text small" value="<%=request.QueryString("subject")%>"/>
						</p>
		<p>
                    <label>Mesaj&#305;n&#305;z:</label><br />
			<textarea name="body" class="wysiwyg"><% if request.QueryString("subject")<>"" then response.write session("message") end if%></textarea></p>
            <p>* Eklenti i&#231;in bkz: Seçenekler > Upload manager > Mail files up</p>
            <p><input type="submit" class="submit mid" name="send" value="G&#246;nder"><INPUT type="Button" VALUE=" &#305;ptal " OnClick='history.go( -1 );return true;'  class="submit small"></p>
            
                
        </form>
         
            
            
            		</div>		<!-- .block_content ends -->
				
				<div class="bendl"></div>
				<div class="bendr"></div>
				
			</div>		<!-- .block.small.left ends -->
<!--#include file ="foot.asp"-->
<%
elseif page="reply_send" then %>
<!--#include file ="../veriables.asp"-->
<%
Set objEmail = Server.CreateObject("Persits.MailSender")
gonderilen = request.form("mail")
objEmail.Charset = "ISO-8859-9"
objEmail.Username = posta
objEmail.Password = pospass
objEmail.Host = "mail." & sitename
objEmail.From = posta
objEmail.AddAddress gonderilen
objEmail.Subject = request.Form("subject")
objEmail.Body = request.Form("body")
objEmail.IsHTML = True
on error resume next
objEmail.Send
 
Set objEmail = Nothing

Response.CharSet = "iso-8859-9"    
veri = SERVER.MAPPATH("../db/"&datayol&".mdb")
Baglan = "DBQ=" & veri &   ";Driver={Microsoft Access Driver (*.mdb)}"
set baglanti = server.createobject("adodb.connection")
baglanti.open baglan

set rs = server.createobject("adodb.recordset")
sql = "select * from gonderilenler"
rs.open sql, baglanti, 1, 3


Session.LCID = 1055
Session.CodePage = 1254

konu=request.form("subject")
mail=request.form("mail")
mesaj=request.form("body")
ip = request.servervariables("remote_host")

if konu <>"" and mail <>"" and mesaj <>"" then
'kayit

rs.addnew
rs("konu") = konu
rs("mail") = mail
rs("mesaj") = mesaj
rs("ip") = ip
rs("tarih") = now()

rs.update
rs.close
end if

if request.form("mail")<>"" then 

%>
<!--#include file ="../veriables.asp"-->
<%

StrPath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../db/"&datayol&".mdb")

Set baglantim = Server.CreateObject("adodb.connection")
Baglantim.Open StrPath

postam=request.form("mail")

sql="select * from emails Where mail like '%"&postam&"%'" 
Set aramalar = Baglantim.ExeCute(sql)
if aramalar.eof then

set rs = server.createobject("adodb.recordset")
sql = "select * from emails"
rs.open sql, baglanti, 1, 3


Session.LCID = 1055
Session.CodePage = 1254

mail=request.form("mail")

rs.addnew
rs("mail") = mail

rs.update
rs.close
end if
end if
response.redirect "panel.asp?box=success&text=Mail%20basariyla%20gonderildi.&second=2&url=contact.asp?page=message"

else
response.redirect "panel.asp?box=warning&text=Boyle%20bir%20sayfa%20yok.&second=2&url=../?page=contact"
end if

%>
