<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="inc_ayarlar.asp"-->
<!--#include file="inc_fonksiyonlar.asp"-->
<%
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' MyDesign Haber
' http://www.mydesign.gen.tr
' Anketler Sayfası Kodları
' Son Düzenleme: 30 Eylül 2008 (v0.6)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'// Sayfanın önbellekten alnması önleniyor
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "No-Store"
'// Değişkenler Tanımlanıyor
Dim SQL
Dim intToplam
Dim intLooper
Dim intOySayisi
Dim intGenislik
Dim intSecenek
Dim intAnketID
Dim intGenislik2
Dim strOrderBy2
Dim intOySayisi2
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Anketler - <%=strSiteAdi%></title>
<!--#include file="inc/head.asp"-->
<link rel="stylesheet" type="text/css" href="<%=strScriptYolu%>inc/stil.css" />
<meta name="generator" content="MyDesign Haber <%=strVersiyon%>" />
<!--
Uygulama: MyDesign Haber
Versiyon: <%=strVersiyon%>
Download: http://www.mydesign.gen.tr
-->
<script type="text/javascript" src="<%=strScriptYolu%>inc/ajax.js"></script>
<!--#include file="inc/ajax.asp"-->
</head>
<body>
<table id="main" cellpadding="0" border="0" cellspacing="0">
<tr>
<td colspan="3" id="son-dakika"><!--#include file="blok/son_dakika.asp"--></td></tr>
<tr>
<td colspan="3" id="ust"><!--#include file="inc/ust.asp"--></td></tr>
<tr>
<td colspan="3" id="bant"><!--#include file="inc/ust_menu.asp"--></td></tr>
<tr>
<td id="sol">
<div id="kategoriler">
<h3>KATEGORİLER</h3>
<ul>
<li><a href="<%=strScriptYolu%>">Anasayfa</a></li>
<% Call KategoriListele("", "", "<li>", "</li>", 0, False, "", "", "", "") %>
</ul>
</div>
<!--#include file="blok/arama.asp"-->
<!--#include file="blok/en_cok_okunanlar.asp"-->
<!--#include file="blok/en_son_yorumlananlar.asp"-->
</td>
<td id="orta"><%
Response.Write "<h1>Anketler</h1>"
'// Formdan Veriler Alınıyor
intSecenek = Temizle(Request.Form("anket_secenek"))
intAnketID = Temizle(Request.Form("AnketID"))
If intAnketID <> "" AND IsNumeric(intAnketID) AND intSecenek <> "" AND IsNumeric(intSecenek) Then
'// Veri, sayıysa veritabanı kontrolü yapılıyor
SQL = "SELECT tblAnketSorular.Aktif, tblAnketSorular.Soru, tblAnketSecenekler.Oy, tblAnketSecenekler.Anket_ID, tblAnketSecenekler.Secenek_ID "
SQL = SQL & " FROM tblAnketSorular, tblAnketSecenekler "
SQL = SQL & " WHERE tblAnketSorular.Oy = "& strDBTrue &" AND tblAnketSorular.Anket_ID = tblAnketSecenekler.Anket_ID AND tblAnketSorular.Anket_ID = "& intAnketID
SQL = SQL & " AND tblAnketSecenekler.Secenek_ID = "& intSecenek &" And tblAnketSorular.Aktif = "& strDBTrue
kdGenel.Open SQL, adoCon, 1, 3
If Not kdGenel.EOF Then
intCerezAnketID = Temizle(Request.Cookies(strCerezAdi)("Anket"& kdGenel("Anket_ID")))
If intCerezAnketID <> "" Then
Response.Write "Daha önce oy kullandınız."
Else
Call OyEkle(intSecenek)
Response.Cookies(strCerezAdi)("Anket"& intAnketID) = intSecenek
Response.Cookies(strCerezAdi).Expires = Date() + 30
Response.Redirect "anketler.asp"
End If
kdGenel.Close
End If
End If
kdGenel.open "SELECT * FROM tblAnketSorular WHERE Aktif = "& strDBTrue &" ORDER BY tarih DESC", adoCon, 1, 3
If kdGenel.EOF Then
Response.Write "<p>Henüz anket oluşturulmadı.</p>"
Else
Response.Write "<table width=""100%"" cellpadding=""0"" cellspacing=""0""><tr>"
intLooper = 1
Do While Not kdGenel.Eof
Response.Write "<td style=""width:50%; vertical-align:top; padding:3px;"
If intLooper Mod 2 = 0 Then Response.Write "background:url("& strScriptYolu &"img/orta_aralik.gif) top left repeat-y; padding-left:15px;"
Response.Write """>"
intCerezAnketID = Temizle(Request.Cookies(strCerezAdi)("Anket"& kdGenel("Anket_ID")))
If intCerezAnketID <> "" Then
kdFonksiyon.Open "SELECT * FROM tblAnketSorular WHERE Anket_ID = "& kdGenel("Anket_ID") &" ORDER BY Tarih DESC", adoCon, 1, 3
If Not kdFonksiyon.Eof Then
kdYardimci.Open "SELECT SUM(Oy) AS Toplam FROM tblAnketSecenekler WHERE Anket_ID = "& kdFonksiyon("Anket_ID") &"", adoCon, 1, 3
intOySayisi2 = CInt(kdYardimci("Toplam"))
kdYardimci.Close
If DBBool(kdFonksiyon("Sonuc")) = strDBTrue Then strOrderBy2 = " ORDER BY Oy DESC"
kdYardimci.Open "SELECT * FROM tblAnketSecenekler WHERE Anket_ID = "& kdFonksiyon("Anket_ID") & strOrderBy2 &"", adoCon, 1, 3
If Not kdYardimci.Eof Then
Response.Write "<p class=""anket-baslik-2"">"& kdFonksiyon("Soru") &"</p>"
Do While Not kdYardimci.Eof
If kdYardimci("Oy") = 0 Then
intGenislik2 = 0
Else
intGenislik2 = kdYardimci("Oy")*100/intOySayisi2
End If
If DBBool(kdFonksiyon("Sonuc")) = strDBTrue Then %>
<p><div class="oy_bg_2"><img src="<%=strScriptYolu%>img/oy_sol.gif" /><img src="<%=strScriptYolu%>img/oy.gif" height="7" width="<%=186*(intGenislik2)/100%>" alt="%<%=Round(intGenislik2,0)%>" /><img src="<%=strScriptYolu%>img/oy_sag.gif" /></div>
<%=kdYardimci("Secenek")%><br />
<span class="yuzde_2">%<%=Round(intGenislik2,0)%> | <%=kdYardimci("Oy")%> Oy</span></p><%
Else
Response.Write "<p><div class=""oy_bg_2""> </div>"& kdYardimci("Secenek") &"</p>"
End If
kdYardimci.Movenext
Loop
If DBBool(kdFonksiyon("Sonuc")) = strDBFalse Then Response.Write "<p><em>Anket sonucu gösterimi kapatılmıştır.</em></p>"
End If
kdYardimci.Close
End If
kdFonksiyon.Close
Else
If DBBool(kdGenel("Oy")) = strDBTrue Then
kdYardimci.Open "SELECT * FROM tblAnketSecenekler WHERE Anket_ID = "& kdGenel("Anket_ID") &"", adoCon, 1, 3
If Not kdYardimci.Eof Then %>
<div id="anket-sonuc<%=kdGenel("Anket_ID")%>">
<form action="anketler.asp" method="post" style="margin:0; padding:0; display:inline;">
<input type="hidden" style="display:none;" name="AnketID" id="AnketID" value="<%=kdGenel("Anket_ID")%>" />
<p class="anket-baslik"><%=kdGenel("Soru")%></p><%
Do While Not kdYardimci.Eof %>
<input type="radio" id="anket_secenek" value="<%=kdYardimci("Secenek_ID")%>" name="anket_secenek" /> <label for="anket_secenek_<%=kdYardimci("Secenek_ID")%>"><%=kdYardimci("Secenek")%></label><br /><%
kdYardimci.Movenext
Loop %>
<p><input type="submit" value=" Oy Ver " class="buton" /></p>
</form>
</div><%
End If
kdYardimci.Close
Else
Call AnketSonuc(kdGenel("Anket_ID"))
End If
End If
Response.Write "</td>"
If intLooper Mod 2 = 0 Then
Response.Write "</tr></tr><td colspan=""2"" style=""background:url("& strScriptYolu &"img/bg/yatay_ayrac.gif) bottom left repeat-x;""> </td></tr><tr>"
End If
intLooper = intLooper + 1
kdGenel.Movenext
Loop
Response.Write "</table>"
End If
kdGenel.Close %>
</td>
<td id="sag">
<!--#include file="blok/yazarlar.asp"-->
<!--#include file="blok/galeri.asp"-->
<!--#include file="blok/anket.asp"-->
</td>
</tr>
<tr>
<td colspan="3" id="alt">
<p><%=strCopyright%><br /><a href="<%=strScriptYolu%>rss.asp" target="_blank">RSS Kaynağı</a> | <a href="<%=strScriptYolu%>yonetim.asp" target="_blank">Yazar Girişi</a></p>
<!--#include file="inc/alt.asp"-->
<%
' Bu kısmı değiştirmek lisans anlaşmasına aykırıdır
Response.Write "<p>Altyapı: <a href=""http://www.mydesign.gen.tr"" target=""_blank"" title=""MyDesign | Kod Arşivi"">MyDesign Haber Sistemi</a></p>"
' Bu kısmı değiştirmek lisans anlaşmasına aykırıdır
%>
</td>
</tr>
</table>
</body>
</html>
Bu sayfanın orta kısmı hariç sağ sol üst alt menünün kodlarını ayırabilirmisiniz.Yani henüz anket oluşturmadınız yazan yere bişiler eklemek istiyorum tarihçe vs. ama kodları ayrıştıramadım.Ayrıştıran olursa çok yardımı olur.Şimdiden teşekkürler...
<% Option Explicit %>
<!--#include file="inc_ayarlar.asp"-->
<!--#include file="inc_fonksiyonlar.asp"-->
<%
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' MyDesign Haber
' http://www.mydesign.gen.tr
' Anketler Sayfası Kodları
' Son Düzenleme: 30 Eylül 2008 (v0.6)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'// Sayfanın önbellekten alnması önleniyor
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "No-Store"
'// Değişkenler Tanımlanıyor
Dim SQL
Dim intToplam
Dim intLooper
Dim intOySayisi
Dim intGenislik
Dim intSecenek
Dim intAnketID
Dim intGenislik2
Dim strOrderBy2
Dim intOySayisi2
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Anketler - <%=strSiteAdi%></title>
<!--#include file="inc/head.asp"-->
<link rel="stylesheet" type="text/css" href="<%=strScriptYolu%>inc/stil.css" />
<meta name="generator" content="MyDesign Haber <%=strVersiyon%>" />
<!--
Uygulama: MyDesign Haber
Versiyon: <%=strVersiyon%>
Download: http://www.mydesign.gen.tr
-->
<script type="text/javascript" src="<%=strScriptYolu%>inc/ajax.js"></script>
<!--#include file="inc/ajax.asp"-->
</head>
<body>
<table id="main" cellpadding="0" border="0" cellspacing="0">
<tr>
<td colspan="3" id="son-dakika"><!--#include file="blok/son_dakika.asp"--></td></tr>
<tr>
<td colspan="3" id="ust"><!--#include file="inc/ust.asp"--></td></tr>
<tr>
<td colspan="3" id="bant"><!--#include file="inc/ust_menu.asp"--></td></tr>
<tr>
<td id="sol">
<div id="kategoriler">
<h3>KATEGORİLER</h3>
<ul>
<li><a href="<%=strScriptYolu%>">Anasayfa</a></li>
<% Call KategoriListele("", "", "<li>", "</li>", 0, False, "", "", "", "") %>
</ul>
</div>
<!--#include file="blok/arama.asp"-->
<!--#include file="blok/en_cok_okunanlar.asp"-->
<!--#include file="blok/en_son_yorumlananlar.asp"-->
</td>
<td id="orta"><%
Response.Write "<h1>Anketler</h1>"
'// Formdan Veriler Alınıyor
intSecenek = Temizle(Request.Form("anket_secenek"))
intAnketID = Temizle(Request.Form("AnketID"))
If intAnketID <> "" AND IsNumeric(intAnketID) AND intSecenek <> "" AND IsNumeric(intSecenek) Then
'// Veri, sayıysa veritabanı kontrolü yapılıyor
SQL = "SELECT tblAnketSorular.Aktif, tblAnketSorular.Soru, tblAnketSecenekler.Oy, tblAnketSecenekler.Anket_ID, tblAnketSecenekler.Secenek_ID "
SQL = SQL & " FROM tblAnketSorular, tblAnketSecenekler "
SQL = SQL & " WHERE tblAnketSorular.Oy = "& strDBTrue &" AND tblAnketSorular.Anket_ID = tblAnketSecenekler.Anket_ID AND tblAnketSorular.Anket_ID = "& intAnketID
SQL = SQL & " AND tblAnketSecenekler.Secenek_ID = "& intSecenek &" And tblAnketSorular.Aktif = "& strDBTrue
kdGenel.Open SQL, adoCon, 1, 3
If Not kdGenel.EOF Then
intCerezAnketID = Temizle(Request.Cookies(strCerezAdi)("Anket"& kdGenel("Anket_ID")))
If intCerezAnketID <> "" Then
Response.Write "Daha önce oy kullandınız."
Else
Call OyEkle(intSecenek)
Response.Cookies(strCerezAdi)("Anket"& intAnketID) = intSecenek
Response.Cookies(strCerezAdi).Expires = Date() + 30
Response.Redirect "anketler.asp"
End If
kdGenel.Close
End If
End If
kdGenel.open "SELECT * FROM tblAnketSorular WHERE Aktif = "& strDBTrue &" ORDER BY tarih DESC", adoCon, 1, 3
If kdGenel.EOF Then
Response.Write "<p>Henüz anket oluşturulmadı.</p>"
Else
Response.Write "<table width=""100%"" cellpadding=""0"" cellspacing=""0""><tr>"
intLooper = 1
Do While Not kdGenel.Eof
Response.Write "<td style=""width:50%; vertical-align:top; padding:3px;"
If intLooper Mod 2 = 0 Then Response.Write "background:url("& strScriptYolu &"img/orta_aralik.gif) top left repeat-y; padding-left:15px;"
Response.Write """>"
intCerezAnketID = Temizle(Request.Cookies(strCerezAdi)("Anket"& kdGenel("Anket_ID")))
If intCerezAnketID <> "" Then
kdFonksiyon.Open "SELECT * FROM tblAnketSorular WHERE Anket_ID = "& kdGenel("Anket_ID") &" ORDER BY Tarih DESC", adoCon, 1, 3
If Not kdFonksiyon.Eof Then
kdYardimci.Open "SELECT SUM(Oy) AS Toplam FROM tblAnketSecenekler WHERE Anket_ID = "& kdFonksiyon("Anket_ID") &"", adoCon, 1, 3
intOySayisi2 = CInt(kdYardimci("Toplam"))
kdYardimci.Close
If DBBool(kdFonksiyon("Sonuc")) = strDBTrue Then strOrderBy2 = " ORDER BY Oy DESC"
kdYardimci.Open "SELECT * FROM tblAnketSecenekler WHERE Anket_ID = "& kdFonksiyon("Anket_ID") & strOrderBy2 &"", adoCon, 1, 3
If Not kdYardimci.Eof Then
Response.Write "<p class=""anket-baslik-2"">"& kdFonksiyon("Soru") &"</p>"
Do While Not kdYardimci.Eof
If kdYardimci("Oy") = 0 Then
intGenislik2 = 0
Else
intGenislik2 = kdYardimci("Oy")*100/intOySayisi2
End If
If DBBool(kdFonksiyon("Sonuc")) = strDBTrue Then %>
<p><div class="oy_bg_2"><img src="<%=strScriptYolu%>img/oy_sol.gif" /><img src="<%=strScriptYolu%>img/oy.gif" height="7" width="<%=186*(intGenislik2)/100%>" alt="%<%=Round(intGenislik2,0)%>" /><img src="<%=strScriptYolu%>img/oy_sag.gif" /></div>
<%=kdYardimci("Secenek")%><br />
<span class="yuzde_2">%<%=Round(intGenislik2,0)%> | <%=kdYardimci("Oy")%> Oy</span></p><%
Else
Response.Write "<p><div class=""oy_bg_2""> </div>"& kdYardimci("Secenek") &"</p>"
End If
kdYardimci.Movenext
Loop
If DBBool(kdFonksiyon("Sonuc")) = strDBFalse Then Response.Write "<p><em>Anket sonucu gösterimi kapatılmıştır.</em></p>"
End If
kdYardimci.Close
End If
kdFonksiyon.Close
Else
If DBBool(kdGenel("Oy")) = strDBTrue Then
kdYardimci.Open "SELECT * FROM tblAnketSecenekler WHERE Anket_ID = "& kdGenel("Anket_ID") &"", adoCon, 1, 3
If Not kdYardimci.Eof Then %>
<div id="anket-sonuc<%=kdGenel("Anket_ID")%>">
<form action="anketler.asp" method="post" style="margin:0; padding:0; display:inline;">
<input type="hidden" style="display:none;" name="AnketID" id="AnketID" value="<%=kdGenel("Anket_ID")%>" />
<p class="anket-baslik"><%=kdGenel("Soru")%></p><%
Do While Not kdYardimci.Eof %>
<input type="radio" id="anket_secenek" value="<%=kdYardimci("Secenek_ID")%>" name="anket_secenek" /> <label for="anket_secenek_<%=kdYardimci("Secenek_ID")%>"><%=kdYardimci("Secenek")%></label><br /><%
kdYardimci.Movenext
Loop %>
<p><input type="submit" value=" Oy Ver " class="buton" /></p>
</form>
</div><%
End If
kdYardimci.Close
Else
Call AnketSonuc(kdGenel("Anket_ID"))
End If
End If
Response.Write "</td>"
If intLooper Mod 2 = 0 Then
Response.Write "</tr></tr><td colspan=""2"" style=""background:url("& strScriptYolu &"img/bg/yatay_ayrac.gif) bottom left repeat-x;""> </td></tr><tr>"
End If
intLooper = intLooper + 1
kdGenel.Movenext
Loop
Response.Write "</table>"
End If
kdGenel.Close %>
</td>
<td id="sag">
<!--#include file="blok/yazarlar.asp"-->
<!--#include file="blok/galeri.asp"-->
<!--#include file="blok/anket.asp"-->
</td>
</tr>
<tr>
<td colspan="3" id="alt">
<p><%=strCopyright%><br /><a href="<%=strScriptYolu%>rss.asp" target="_blank">RSS Kaynağı</a> | <a href="<%=strScriptYolu%>yonetim.asp" target="_blank">Yazar Girişi</a></p>
<!--#include file="inc/alt.asp"-->
<%
' Bu kısmı değiştirmek lisans anlaşmasına aykırıdır
Response.Write "<p>Altyapı: <a href=""http://www.mydesign.gen.tr"" target=""_blank"" title=""MyDesign | Kod Arşivi"">MyDesign Haber Sistemi</a></p>"
' Bu kısmı değiştirmek lisans anlaşmasına aykırıdır
%>
</td>
</tr>
</table>
</body>
</html>
Bu sayfanın orta kısmı hariç sağ sol üst alt menünün kodlarını ayırabilirmisiniz.Yani henüz anket oluşturmadınız yazan yere bişiler eklemek istiyorum tarihçe vs. ama kodları ayrıştıramadım.Ayrıştıran olursa çok yardımı olur.Şimdiden teşekkürler...