<% Response.Buffer = True %>
[an error occurred while processing this directive]
<%
If Session("Level") = "1" OR Session("Level") = "3" OR Session("Level") = "7" Then
act = Request.QueryString("action")
If act = "all" Then
call All
ElseIf act = "RegisterNew" Then
call Reg_New
ElseIf act = "DeleteCat" Then
call Del
ElseIf act = "OrganizeCat" Then
call Organize_Cat
ElseIf act = "UpdateCat" Then
call update_cat
ElseIf act = "Articles" Then
call articles
ElseIF act = "WaitApprove" Then
call wait_approve
ElseIF act = "NoCats" Then
call no_cats
ElseIF act = "NewCat" Then
call new_cat
End If
Sub no_cats
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.open "Select * FROM ARTICLES WHERE a_approved = True",Connection,3,3
%>
<%
End Sub
Sub new_cat
%>
<%
End Sub
Sub wait_approve
Set o = Server.CreateObject("ADODB.RecordSet")
o.open "Select * FROM ARTICLES WHERE a_approved = False",Connection,3,3
%>
<%
End Sub
Sub All
Set rs = Connection.Execute("Select * FROM ARTICLE_CATS ORDER BY cat_name ASC") %>
<%
End Sub
Sub Reg_New
Set ent = Server.CreateObject("ADODB.RecordSet")
eSQL = "Select * FROM ARTICLE_CATS"
ent.open eSQL,Connection,1,3
name = duz(Request.Form("cat_name"))
If name="" Then
Response.Write "
Lütfen Kategori Adını Yazınız..."
ELSE
ent.AddNew
ent("cat_name") = name
ent.Update
Response.Redirect "?action=all"
END IF
End Sub
Sub Organize_Cat
id = Request.QueryString("catid")
Set rs = Connection.Execute("Select * FROM ARTICLE_CATS WHERE cat_id = "&id&"")
%>
<%
End Sub
Sub update_cat
id = Request.QueryString("catid")
Set ent = Server.CreateObject("ADODB.RecordSet")
eSQL = "Select * FROM ARTICLE_CATS WHERE cat_id = "&id&""
ent.open eSQL,Connection,1,3
name = Request.Form("cat_name")
If name="" Then
Response.Write "
Lütfen Kategori Adını Yazınız..."
ELSE
ent("cat_name") = name
ent.Update
Response.Redirect "?action=all"
END IF
End Sub
Sub Del
id = Request.QueryString("catid")
Set delete = Server.CreateObject("ADODB.RecordSet")
delSQL = "DELETE * FROM ARTICLE_CATS WHERE cat_id = "&id&""
delete.open delSQL,Connection,1,3
Set delete2 = Server.CreateObject("ADODB.RecordSet")
delSQL2 = "DELETE * FROM ARTICLES WHERE cat_id = "&id&""
delete2.open delSQL2,Connection,1,3
Response.Redirect "?action=all"
End Sub
Sub articles
p = Request.QueryString("page")
If p = "arts" Then
id = Request.QueryString("catid")
Set rs = Connection.Execute("Select * FROM ARTICLES WHERE cat_id = "&id&" AND a_approved = True")
%>
| Başlık | İşlem |
<% do while not rs.eof %>
| <%=duz(rs("a_title"))%> |
">Düzenle - ">Sil |
<%
rs.MoveNext
Loop
%>
<%
ElseIf p = "New" Then
Set lcats = Connection.Execute("Select * FROM ARTICLE_CATS")
%>
<%
ElseIf p = "Organize" Then
id = Request.QueryString("aid")
Set lcats = Connection.Execute("Select * FROM ARTICLE_CATS")
Set pr = Connection.Execute("Select * FROM ARTICLES WHERE aid ="&id&"")
%>
<%
ElseIf p = "Update" Then
id = Request.QueryString("aid")
title = Request.Form("atitle")
article = Request.Form("aarticle")
cat = Request.Form("acat")
If title="" Then
Response.Write "
Lütfen Makale Başlığını Yazınız"
ElseIf article="" Then
Response.Write "
Lütfen Makaleyi Yazınız"
ELSE
Set pent = Server.CreateObject("ADODB.RecordSet")
peSQL = "Select * FROM ARTICLES where aid = "&id&""
pent.open peSQL,Connection,1,3
pent("a_title") = title
pent("a_article") = article
pent("cat_id") = cat
pent.Update
Response.Redirect "?action=Articles&page=arts&catid="&pent("cat_id")&""
END IF
ElseIF p = "NewReg" Then
title = Request.Form("atitle")
article = Request.Form("aarticle")
cat = Request.Form("acat")
If title="" Then
Response.Write "
Lütfen Makale Başlığını Yazınız"
ElseIf article="" Then
Response.Write "
Lütfen Makaleyi Yazınız"
ElseIf cat="" Then
Response.Write "
Lütfen Kategori Seçiniz"
ELSE
Set pent = Server.CreateObject("ADODB.RecordSet")
peSQL = "Select * FROM ARTICLES"
pent.open peSQL,Connection,1,3
pent.AddNew
pent("a_title") = title
pent("a_article") = article
pent("hit") = 0
pent("cat_id") = cat
pent("a_date") = Date()
pent("a_writer") = Session("Member")
pent("point") = 0
pent("a_approved") = True
pent.Update
Response.Redirect "?action=all"
END IF
ElseIf p = "Delete" Then
id = Request.QueryString("aid")
Set delPrg = Server.CreateObject("ADODB.RecordSet")
dpSQL = "DELETE * FROM ARTICLES WHERE aid = "&id&""
delPrg.open dpSQL,Connection,1,3
Response.Redirect Request.ServerVariables("HTTP_REFERER")
ElseIf p = "Approve" Then
id = Request.QueryString("aid")
Set upd = Connection.Execute("UPDATE ARTICLES SET a_approved = True WHERE aid = "&id&"")
Response.Redirect Request.ServerVariables("HTTP_REFERER")
End If
Response.Write "
<< Geri"
End Sub
End If
%>