<!--#include file="sifre.asp"-->
<!--#include file="bag.asp"-->
<html>

<head>
<meta http-equiv="Content-Language" content="tr">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1254">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-6">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9">
<title>Admin Paneli</title>
<link href="../style.css" rel="stylesheet" type="text/css" />
</head>
<!--#include file="db.asp"-->
<body background="images/arka.gif">
<%
siralama=Request.QueryString("siralama")
tip=Request.QueryString("tip")
sayi=Request.QueryString("sayi")

	if siralama="1" then
		sira="isim"
	elseif siralama="2" then
		sira="hit"
	else
		sira="id"
	end if

	if tip="1" then
		t="desc"
	elseif tip="2" then
		t="asc"
	else
		t="desc"
	end if

	if sayi="1" then
		s="25"
	elseif sayi="2" then
		s="50"
	elseif sayi="3" then
		s="100"
	else
		s="25"
	end if
%>
<table border="0" width="100%" id="table1" cellpadding="0" style="border-collapse: collapse">
	<tr>
		<td height="22" background="../tema/<%=sitetema%>/tablo_bg.jpg"><center>
          <span class="Menu stil4" style="color: #FFFFFF; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 11px">
          <%
id=Request.QueryString("id")
if not id="" then
if not isnumeric(id)=false then
set ktg = Server.CreateObject("ADODB.Recordset")
SQL = "Select id,isim from galeri_kat where id = "&id&""
ktg.open SQL,data,1,3
if not ktg.eof then
%>
&nbsp;&nbsp;&nbsp;&nbsp;<%=ktg("isim")%>, Kategorisine Ait
          <%
end if
ktg.close : set ktg = nothing
end if
end if
%>
		  Resimler</span>
                                                                                </center></td>
  </tr>
</table>
<div align="center">
	<table border="0" width="99%" id="table2" cellpadding="0" style="border-collapse: collapse" class="tablo">
<form action="" method="get">
		<tr>
			<td>
		<input type="hidden" value="<%=id%>" name="id">
		<select name="siralama" size="1" class="alan">
        <option value="1"<%if sira="isim" then%> selected<%End if%>>İsme Göre</option>
        <option value="2"<%if sira="id" then%> selected<%End if%>>Tarihe Göre</option>
        </select><select name="tip" size="1" class="alan">
        <option value="1"<%if t="desc" then%> selected<%End if%>>Artan</option>
        <option value="2"<%if t="asc" then%> selected<%End if%>>Azalan</option>
        </select><select name="sayi" size="1" class="alan">
        <option value="1"<%if s="25" then%> selected<%End if%>>25</option>
        <option value="2"<%if s="50" then%> selected<%End if%>>50</option>
        <option value="3"<%if s="100" then%> selected<%End if%>>100</option>
        </select><input type="submit" value="Sırala" class="dugme">
			</td>
		</tr>
</form>
	</table>
</div>
<div align="center">
<table border="0" width="99%" id="table2" style="border-collapse: collapse" class="tablo">
  <tr>
		<td height="24" class="metinkalin" width="46"><font class="yazi">ID</font></td>
	  <td width="94" height="24" class="metinkalin"><div align="center">Resim</div></td>
	  <td width="726" height="24" class="metinkalin"><font class="yazi">İsim</font></td>
	  <td width="111" height="24" class="metinkalin"><div align="center"><font class="yazi">Onay</font></div></td>
	  <td height="24" class="metinkalin" width="220"><div align="center"><font class="yazi">İşlem</font></div></td>
	</tr>
    <tr>
	  <td height="20" colspan="5" class="<%=stil%>"><img src="../tema/<%=sitetema%>/bg_cizgi.gif" width="100%" height="8"></td>
    </tr>
	
<% response.buffer = "true" %>

<%
if (Request.QueryString("resim"))="sil" then
id=request.querystring("id")
data.Execute("DELETE FROM galeri where id like '"&id&"'")
Response.Redirect Request.ServerVariables("HTTP_REFERER")
End if

set zd_msg = Server.CreateObject("Adodb.Recordset")
if isnumeric(id)=false or id="" then
SQL = "Select * from galeri order by "&sira&" "&t&""
else
SQL = "Select * from galeri where kat_id="&id&" order by "&sira&" "&t&""
end if
zd_msg.open SQL,data,1,3

adet = zd_msg.recordcount
if not zd_msg.eof then

sayfa = Request.QueryString("sayfa")
    if isnumeric(sayfa)=false then
        Response.redirect "index.asp"
    Else
if sayfa="" then sayfa=1
zd_msg.pagesize = (s)
sayfa_sayisi = zd_msg.pagecount
if Cint(sayfa)<1 then sayfa=1
if Cint(sayfa_sayisi) < Cint(sayfa) then sayfa=sayfa_sayisi
zd_msg.absolutepage = sayfa
mode = 2
for i=1 to zd_msg.pagesize
if zd_msg.eof then
exit for
end if
	if mode=1 then
	stil="tablo1"
	else
	stil=""
	end if
%>
	<tr>
		<td width="46" height="20" class="<%=stil%>"><font class="yazi"><font class="yazi"><%=zd_msg("id")%></font></font></td>
	  <td width="94" height="20" class="<%=stil%>">
        <div align="center">
        <% 
		ss = InStr(1,zd_msg("url_kucuk"), "galeri_resimleri")
		if ss<>0 then%>
		 <img src="<%=siteurl%>/<%=zd_msg("url_kucuk")%>" width="75" height="50" border="0">
		<%else%>
		  <img src="<%=zd_msg("url_kucuk")%>" width="75" height="50" border="0">
		<%end if%>
</div></td>
		<td width="726" valign="top" class="<%=stil%>"><a href="resim_duz.asp?resim=duzenle&id=<%=zd_msg("id")%>"><%=zd_msg("isim")%></a></td>
			  <td width="104" valign="middle" class="<%=stil%>"><div align="center">
        <% if zd_msg("onay")=1 then %>
        <img src="images/true.gif" border="0">
        <% else %>
        <img src="images/false.gif" border="0">
        <% end if %>
	  </div></td>
		<td width="220" height="20" class="<%=stil%>"><div align="center"><a href="resim_duz.asp?resim=duzenle&id=<%=zd_msg("id")%>"><img src="images/duzenle.gif" width="70" height="20" border="0"></a><br>
		  <br>
      <a href="?resim=sil&id=<%=zd_msg("id")%>" onclick="return confirm('Silmek İstediğinizden Emin Misiniz?');"><img src="images/sil.gif" width="70" height="20" border="0"></a></div></td>
	</tr>
	<tr>
	  <td height="20" colspan="5" class="<%=stil%>"><img src="../tema/<%=sitetema%>/bg_cizgi.gif" width="100%" height="8"></td>
    </tr>
    
<%
	zd_msg.movenext
	if mode=2 then
	mode=1
	else
	mode=2
	end if
%>
<% next %> 
	</table>
</div>
<table width="99%" border="0" class="tablo" id="table1" cellpadding="0" style="border-collapse: collapse" align="center">
		<tr>
			<td colspan="3" align="center"><font class="yazi">Toplam <%=adet%> Kayıt, <%=sayfa_sayisi%> Sayfada Gösterilmektedir.</font></td>
			</tr>
		<tr>
			<td align="center" valign="center">
<%
If sayfa > 1 Then
response.write "<b><a href=""?sayfa=1&siralama="&siralama&"&tip="&tip&"&sayi="&sayi&"&id="&id&""" title=""ilk sayfa"">««</a></b> "
a = sayfa -1
Response.Write "<b><a href=""?sayfa=" & a & "&siralama="&siralama&"&tip="&tip&"&sayi="&sayi&"&id="&id&""" title=""Önceki"">«</a></b> "
End If
If sayfa + 10 > sayfa_sayisi Then
b = sayfa_sayisi 
Elseif sayfa_sayisi < 10 Then
sayfa_sayisi = 1
Else
b = sayfa + 10
End If
If sayfa < 10 Then
c = 1
Else
c = sayfa - 10
End If
if c < 1 then 
c = 1
end if
For j = c To b
If j = CInt(sayfa) Then
Response.Write "<font class=""yazi"">[<b>" & j & "</b>] </font>"
Else
Response.Write "<b><a href=""?sayfa=" & j & "&siralama="&siralama&"&tip="&tip&"&sayi="&sayi&"&id="&id&""">" & j & "</a></b> "
End If
Next
if Cint(sayfa) < sayfa_sayisi then
a = sayfa + 1
Response.Write "<b><a href=""?sayfa=" & a & "&siralama="&siralama&"&tip="&tip&"&sayi="&sayi&"&id="&id&""" title=""Sonraki"">»</a></b> "
Response.Write "<b><a href=""?sayfa=" & sayfa_sayisi & "&siralama="&siralama&"&tip="&tip&"&sayi="&sayi&"&id="&id&""" title=""Son Sayfa"">»»</a></b>"
End If
zd_msg.close : set zd_msg = nothing
%>
			</td>
		</tr>
	</table>
</div>
<% End if %>
<% Else %>
<font class="yazi"><center spry:hover="metinyazi">
  Kayıt Bulunamadı.
</center></font>
<% End if %>
