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

<% 
page=request.QueryString("page")
if page="notes" then
%>
<!--#include file ="head.asp"-->
<% if request.QueryString("read")<>"" then %>
<!--#include file ="../veriables.asp"-->
<%
Function Cevir(strVeri)
    If strVeri = "" Then Exit Function
	strveri = Replace(strveri, "Chr(13)", "<br>",1,-1,1)
	strveri = Replace(strveri, vbCrLf, "<BR>" & vbCrLf, 1, -1, 1 )
	cevir = strVeri
End Function

Function Cevircode(strVeri)
    If strVeri = "" Then Exit Function
	strveri = Replace(strveri, "Chr(13)", "<br>",1,-1,1)
	strVeri = Replace(strVeri, "&", "&amp;",1,-1,1)
	strVeri = Replace(strVeri, "<", "&lt;",1,-1,1)
	strVeri = Replace(strVeri, ">", "&gt;",1,-1,1)
	strveri = Replace(strveri, "`", "&#180;",1,-1,1)
	strveri = Replace(strveri, "*", "&#42;",1,-1,1)
	strveri = Replace(strveri, "'", "&#39;",1,-1,1)
	cevircode = strVeri
End Function
veri = SERVER.MAPPATH("../db/"&datayol&".mdb")
Baglan = "DBQ=" & veri &   ";Driver={Microsoft Access Driver (*.mdb)}"
Response.ContentType = "text/html" 
Response.Charset = "UTF-8" 
set baglanti = server.createobject("adodb.connection")
baglanti.open baglan
set rs = server.createobject("adodb.recordset")
sql = "select * from not WHERE ID =" & request("read")
rs.open sql, baglanti, 1, 3
session("message")= cevir(rs("mesaj"))
%>
<dIv class="block">

			

				<dIv class="block_head">

					<dIv class="bheadl"></dIv>

					<dIv class="bheadr"></dIv>


					<h2><%=rs("ad")%></h2>
                    <ul class="tabs">
						<li><a href="#html">html</a></li>
						<li><a href="#code">code</a></li>
					</ul>	

				</dIv>		<!-- .block_head ends -->

				

				

            <dIv class="block_content tab_content" id="html">
            
           	<p>
            <%=cevir(rs("mesaj"))%>
			</p>
            
            <hr />
            <p><b>Eklenme tarihi:</b> <%=rs("zaman")%><br /><b>islem:</b> <a href="?page=del_onay&id=<%= rs("id") %>" >Bu notu sil</a>&nbsp;|&nbsp;<a href="?page=edit&id=<%= rs("id") %>" >Düzenle</a>&nbsp;|&nbsp;<a href="contact.asp?page=reply&subject=Note:%20<%=rs("ad")%>" >Mesaj olarak gönder</a></p>

			</dIv>		<!-- .block_content ends -->
            
            <dIv class="block_content tab_content" id="code">
            
           	<p>
            <%=cevircode(rs("mesaj"))%>
			</p>
            
            <hr />
            <p><b>Eklenme tarihi:</b> <%=rs("zaman")%><br /><b>islem:</b> <a href="?page=del_onay&id=<%= rs("id") %>" >Bu notu sil</a>&nbsp;|&nbsp;<a href="?page=edit&id=<%= rs("id") %>" >Düzenle</a></p>

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

				

				<dIv class="bendl"></dIv>

				<dIv class="bendr"></dIv>

				

			</dIv>		<!-- .block.small.rIght ends -->



<% end if %>



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

  <dIv class="block">

			

				<dIv class="block_head">

					<dIv class="bheadl"></dIv>

					<dIv class="bheadr"></dIv>

					

					<h2>notlar</h2>
                    <ul class="tabs">
						<li><a href="#notes">Notlar (<%=rs.recordcount%>)</a></li>
                        <li><a href="#addnew">Yeni +</a></li>
					</ul>		

				</dIv>		<!-- .block_head ends -->

				

				

            <dIv class="block_content tab_content" id="notes">
            
           
            
            
         		<style type="text/css">
				tr.menuon {background: url(images/); color: #666666; } tr.menuoff { background: url(images/bg-blog-tr.jpg); color: #191919; }
				td a { 
				width: 100%; 
  				height: 100%; 
				display: block; 
				overflow: hidden; 
				} 
				</style>

<table wIdth=100% border=0 cellspacIng=3 cellpaddIng=0 alIgn=center>

<tr bgcolor="#cccccc" class=hIghlIghts>
<td alIgn="center" wIdth="10"><Img src="Images/bg-note.png" border=0></td>
<td colspan=3 wIdth="25%">Notlar</td><td colspan=4 wIdth="75%">Eklenme tarIhI</td>
<td alIgn="center" wIdth="10"><Img src="Images/del-icon.png" border=0></td>
</tr>

<%
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
%>


<tr class="menuoff" onMouseOver="className='menuon';"  onMouseOut="className='menuoff';">

<td alIgn="center" wIdth=""10""><a href="?page=edit&id=<%= rs("id") %>" ><IMG src="Images/bg-note.png" border=0></a></td>

<td colspan="3"><a href="note.asp?page=notes&read=<%=rs("ID")%>"><%=rs("ad")%></a></td>

<td colspan="4"><%=rs("zaman")%></td>

<td  wIdth="10"><a href="?page=del_onay&id=<%= rs("id") %>" ><Img src="Images/del-icon.png" border=0></a></td>

</tr>


<%
rs.MoveNext
Next
end if
%>



</table>






<div class="pagination right">
<%
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=notes&now=1" title="ilk Sayfa">««</a>
<a href="?page=notes&now=<%=intGecerliSayfa-1%>" title="Önceki Sayfa">«</a>
<%Else%><a>««</a> <a>«</a><%
End If
For i = intSayfaAltSiniri to intSayfaUstSiniri
If CInt(i) = CInt(intGecerliSayfa) Then
Response.Write " <a  class=""active""><b>"
Else %>
<a href="?page=notes&now=<%=i%>" title="<%=i%>. Sayfa">
<%
End If
Response.Write i &"</a></b>"
Next
If CInt(intGecerliSayfa) <>CInt(intSayfaSayisi) Then %>
<a href="?page=notes&now=<%=intGecerliSayfa+1%>" title="Sonraki Sayfa">»</a>
<a href="?page=notes&now=<%=intSayfaSayisi%>" title="Son Sayfa">»»</a><%else%> <a>»</a> <a>»»</a><%
End If
%>
</div>		<!-- .pagination ends -->

                        
                        






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

				<dIv class="block_content tab_content" id="addnew">
                
                
           
<form action="?page=add" method="post">

<input type="hidden" name="b_hit" value="0" />

<p>
<label>Baslik:</label><br />
<input class="text" type="text" name="ad" />
</p>


<p>
<label>Not:</label><br />
<textarea name="mesaj" ></textarea></p>
<p>


<input class="submit mid" type="submit" value="Notu Ekle" />

<INPUT type="Button" VALUE=" iptal " OnClick='history.go( -1 );return true;'  class="submit small">

</form>


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

				<dIv class="bendl"></dIv>

				<dIv class="bendr"></dIv>

				

			</dIv>		<!-- .block.small.rIght 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>Not s&#305;l</h2>
</div>		<!-- .block_head ends -->
<div class="block_content">
<div class="message warning"><p>Notu silmek istediginizden eminmisiniz?</p></div>
			<form action="?page=del&id=<%=request("id")%>" method="post">
			<p>
			<a href="?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="add" then
%>

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

Response.ContentType = "text/html" 
Response.Charset = "UTF-8" 
ad=request.form("ad")
mesaj=request.form("mesaj")
zaman = now()

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

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

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

rs.addnew
rs("ad") = ad
rs("mesaj") = mesaj
rs("zaman") = now()

rs.update
rs.close

response.redirect "panel.asp?box=success&text=Not%20basariyla%20eklendi.&second=2&url=note.asp?page=notes"
response.end
set obj = Nothing

else

response.redirect "panel.asp?box=warning&text=Lutfen%20tum%20alanlari%20doldurunuz.&second=2&url=note.asp?page=addnew"
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 not where id="
SQL = SQL & id
set rs = server.createobject("adodb.recordset")
rs.open sql, baglanti, 1, 3
response.redirect "panel.asp?box=success&text=Not%20basariyla%20silindi.&second=2&url=note.asp?page=notes"
response.end

elseif page = "edit" then
Set Bag = Server.CreateObject("ADODB.Connection")
Bag.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../db/"&datayol&".mdb")
Set Rs=Server.CreateObject("Adodb.Recordset")
id=request("id")
if request("update")<>"" then
mesaj=request("mesaj")
ad=request("ad")
Rs.ActiveConnection = bag
Sorgu="SELECT * FROM not WHERE id="& id &""
rs.open Sorgu,bag,3,2
    rs.update "ad",ad
	rs.update "mesaj",mesaj
rs.close
set rs=nothing 
response.redirect "panel.asp?box=success&text=Not%20basariyla%20duzenlendi.&second=2&url=note.asp?page=notes"
else
end if
Set Bag = Server.CreateObject("ADODB.Connection")
Bag.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../db/"&datayol&".mdb")
Set Rs=Server.CreateObject("Adodb.Recordset")
Rs.ActiveConnection = bag
Rs.Open="Select * from not WHERE id =" & request("id")
%>
<!--#include file="head.asp"-->
<dIv class="block">
<dIv class="block_head">
<dIv class="bheadl"></dIv>
<dIv class="bheadr"></dIv>
<h2>Not duzenle</h2>	

</dIv>

	
				<div class="block_content">
<%
Set Bag = Server.CreateObject("ADODB.Connection")
Bag.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../db/"&datayol&".mdb")
Set Rs=Server.CreateObject("Adodb.Recordset")
Rs.ActiveConnection = bag
Rs.Open="Select * from not WHERE id =" & request("id")
%>
<form action="?page=edit" method="post">

<p>
<label>Baslik:</label><br />
<input class="text" type="text" value="<%Response.Write RS("ad")%>" name="ad" />
</p>


<p>
<label>Not:</label><br />
<textarea name="mesaj" ><%Response.Write RS("mesaj")%></textarea></p>

<input type="hidden" name="update" value="1">
<input type="hidden" name="id" value="<%Response.Write RS("id")%>" />

<input class="submit mid" type="submit" value="Duzenle" />
<INPUT type="Button" VALUE=" iptal " OnClick='history.go( -1 );return true;'  class="submit small">

<%
rs.close
set rs=nothing
bag.close
set bag=nothing
%>
</form>
<br />
</dIv>		<!-- .block_content ends -->
<dIv class="bendl"></dIv>
<dIv class="bendr"></dIv>
</dIv>		<!-- .block.small.rIght ends -->

<!--#include file ="foot.asp"-->
<%
else
response.redirect "panel.asp?box=warning&text=Boyle%20bir%20sayfa%20yok.&second=2&url=../default.asp"
end if
%>
