<!--#include file ="../veriables.asp"-->
<%
Response.ContentType = "text/html" 
Response.Charset = "UTF-8" 
%>

<!-- #include file=../guvenlik.asp -->
<%
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
adminisim = Guncelle("isim")
admincodename = Guncelle("codename")
Guncelle.close
set Guncelle=nothing
baglanti.close
set baglanti = nothing
%>
<% 
veri = SERVER.MAPPATH("../db/"&datayol&".mdb")
Baglan = "DBQ=" & veri &   ";Driver={Microsoft Access Driver (*.mdb)}"
sayfa = request.QueryString("page")
if sayfa = "" then
%>
<!--#include file ="head.asp"-->
<div class="block">
<div class="block_head">
<div class="bheadl"></div>
<div class="bheadr"></div>
<h2>Duvarim</h2>
<ul>
<li>
<%
set baglanti = server.createobject("adodb.connection")
baglanti.open baglan
set rs = server.createobject("adodb.recordset")
sql = "select * from mesaj order by id desc"
rs.open sql, baglanti, 1, 3
response.write rs.recordcount
%> yazi
</li>
</ul>
</div>		<!-- .block_head ends -->
<div class="block_content">
<%
Function name(strVeri)
    If strVeri = "" Then Exit Function
	strVeri = Replace(strVeri, admincodename, adminisim,1,-1,1)
	name = strVeri
End Function
do while not rs.eof 
%>
<table cellpadding="0" cellspacing="0"><tr><td>
<% if rs("isim")=admincodename then %><img src="../resim_boyut_kare.asp?path=images/yorumhafzullah.jpg&bx=48" /><% else %><img src="../images/gravatar.png"><% end if %>
</td><td width="100%">
<b><%=name(rs("isim"))%></b><Br />
<%=cevirgulucuksuz(rs("mesaj"))%><br />
<a href="mywall.asp?page=del_onay&id=<%= rs("id") %>">Sil</a>&nbsp;&nbsp;ip : <%= rs("ip")%>
</td></tr></table>
<%
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 sayfa = "del_onay" then
%>
<!--#include file="head.asp"-->
<div class="block">
<div class="block_head">
<div class="bheadl"></div>
<div class="bheadr"></div>
<h2>Yaz&#305; sil</h2>
</div>		<!-- .block_head ends -->
<div class="block_content">
<div class="message warning"><p>Bu yaz&#305;y&#305; silmek istediginizden eminmisiniz?</p></div>
			<form action="mywall.asp?page=del&id=<%=request("id")%>" method="post">
			<p>
			<a href="mywall.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 sayfa = "del" then
set id = Request.QueryString("id")
set baglanti = server.createobject("adodb.connection")
baglanti.open baglan
SQL = "delete from mesaj where id="
SQL = SQL & id
set rs = server.createobject("adodb.recordset")
rs.open sql, baglanti, 1, 3
response.redirect "panel.asp?box=success&text=Yazi%20basariyla%20silindi.&second=2&url=mywall.asp"
response.end
elseif sayfa = "save" then


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

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

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

if mesaj <>"" and isim <>"" then
'kayit

rs.addnew
rs("isim") = isim
rs("mesaj") = mesaj
rs("tarih") = tarih
rs("ip") = ip

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 = sitename & " - duvar bildirim<br><br>"
		icerik = icerik & "<b> Ad Soyad: </b> " & tr(request.form("isim")) & "<br>"
		icerik = icerik & "<b> Tarih : </b> " & now() & "<br>"
		icerik = icerik & "<b> Ip : </b> " & request.servervariables("remote_host") & "<br><br>"
		icerik = icerik & "<b> Mesaj : </b> " & tr(request.form("mesaj")) & "<br>"

		Set obj = Server.CreateObject("Persits.MailSender")
		obj.Host = mserv
		obj.From = "bilgi@" & sitename
		obj.AddAddress posta
		obj.Subject = "Duvar bildirim"
		obj.Body = icerik
		obj.IsHTML = True

		on error resume next
		obj.Send

response.redirect "../mywall.asp?run=success"
response.end
		set obj = Nothing

else

response.redirect "../panel.asp?id=2"
response.end
end if


else
response.Redirect("mywall.asp")
end if
%>
