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

<% 
set baglanti = server.CreateObject("adodb.connection")
baglanti.open "Provider=Microsoft.Jet.oledb.4.0;Data Source=" & server.Mappath("../db/"&datayol&".mdb")
page = Request.Querystring("page")
durum = Request.Querystring("now")
id = Request.Querystring("id")
if page = "link" then
%>
<!--#include file="head.asp"-->
<div class="block small left">
			
				<div class="block_head">
					<div class="bheadl"></div>
					<div class="bheadr"></div>
					
					<h2>Yeni ekle</h2>	
				</div>		<!-- .block_head ends -->
				
				
				
				<div class="block_content">
				
	<form action="?page=cmd&now=add" method="post">
<p>
                    <label>Site adi:</label><br />
			<input type="text"  class="text" name="siteadi" size="70"></p>
            <p>
                    <label>Site url'si:</label><br />
            <input type="text"  class="text" name="url" value="http://www." size="70"></p>
			<input type="submit" name="guncelle"  class="submit large" value="Ekle">
		
</form><br />
					
				</div>		<!-- .block_content ends -->
				
				<div class="bendl"></div>
				<div class="bendr"></div>
				
			</div>		<!-- .block.small.left ends -->
			
			
			<div class="block small right">
			
				<div class="block_head">
					<div class="bheadl"></div>
					<div class="bheadr"></div>
					
					<h2>Mevcut siteler</h2>
				</div>		<!-- .block_head ends -->
				
				
				
				<div class="block_content">
				
	
					<ul>
                    <% Set kategori=Server.CreateObject("Adodb.Recordset")
	ksorgu="Select * from linkler order by siteadi asc"
	kategori.open ksorgu,baglanti,1,3 %>
	<% do while not kategori.eof %>
    
   <li>&nbsp;<a href="?page=del_onay&id=<%=kategori("id")%>" >Sil</a>&nbsp;&nbsp;&nbsp;<%=kategori("siteadi")%>&nbsp;&nbsp;&nbsp;<a href="<%=kategori("url")%>" target="_blank"><%=kategori("url")%></a></li> 
	<% kategori.movenext
	loop
	kategori.close
	Set kategori=Nothing %>
					</ul>
				
				</div>		<!-- .block_content ends -->
				
				<div class="bendl"></div>
				<div class="bendr"></div>
				
			</div>		<!-- .block.small.right ends -->
			
			
<% 
end if 
if page = "del_onay" then
%>
<!--#include file="head.asp"-->
<div class="block">
<div class="block_head">
<div class="bheadl"></div>
<div class="bheadr"></div>
<h2>Baglanti sil</h2>
</div>		<!-- .block_head ends -->
<div class="block_content">
<div class="message warning"><p>Baglantiyi silmek istediginizden eminmisiniz?</p></div>
			<form action="?page=cmd&now=del&id=<%=request("id")%>" method="post">
			<p>
			<a href="?page=cmd&now=del&id=<%=request("id")%>"><INPUT TYPE="submit" VALUE=" Evet "  class="submit small"></a>
            <INPUT type="Button" VALUE=" iptal " 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 -->
<%
end if
if page = "cmd" then
durum = request.querystring("now")
if durum = "" then
response.Write("")
elseif durum = "add" then
call add
elseif durum = "del" then
call del
end if

sub add 
set kategorie=Server.CreateObject("Adodb.Recordset")
sqlkategori="select * from linkler"
kategorie.open sqlkategori,baglanti,1,3
kategorie.addnew
kategorie("siteadi")=Request.form("siteadi")
kategorie("url")=Request.form("url")
kategorie.update
response.redirect "panel.asp?box=success&text=Link%20basariyla%20eklendi.&second=2&url=links.asp?page=link"
end sub

sub del
id=Request.QueryString("id")
set katsil=Server.CreateObject("Adodb.Recordset")
sq="delete * from linkler where id="&id&""
katsil.open sq,baglanti,1,3
response.redirect "panel.asp?box=success&text=Link%20basariyla%20silindi.&second=2&url=links.asp?page=link"
end sub

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