giris.asp(şifre
giriş) |
giris_kontrol.asp(şifre
kontrol) |
|
|
|
|
|
|
|
Topelm.htm(her
sayanın başında bulunan menu) |
|
|
|
|
|
|
|
|
baselm.asp(başlangıç
sayfası) |
|
|
|
|
|
|
|
|
Not
Kaydet/Değiştir/Sorgula |
||||||||
duyuruyap.asp |
duyuru.asp |
bilgigiris.asp |
yeni.asp(goster.asp) |
öğrencisorgula1.asp |
kisimsorgula1.asp |
uploadform.asp |
show.asp |
default.asp |
duyuru.txt |
|
kaydetbilgigiris.asp |
demo_db_edit.asp |
yeni1.asp(goster1.asp) |
yeni2.asp(goster2.asp) |
uploadexmle.asp |
file.asp |
new_post.asp |
|
|
|
demo_db_submit.asp |
demo_db_edit.asp |
demo_db_edit.asp |
upload.asp |
|
preview_message.asp |
|
|
|
|
demo_db_submit.asp |
demo_db_submit.asp |
|
|
forum_search.asp |
|
|
|
|
|
|
|
|
showmessage.asp |
|
|
|
|
|
|
|
|
Databaseclenaup.inc |
|
|
|
|
|
|
|
|
reply.asp |
|
|
|
|
|
|
|
|
readme.txt |
|
|
|
|
|
|
|
|
footer.inc |
|
|
|
|
|
|
|
|
validate.inc |
|
|
|
|
|
|
|
|
Database.inc |
***Yukarıdaki tablo öğretim elemanının ulaştığı bölümlerin hangi dosyalardan oluştuğunu göstermektedir
DUYURU MODÜLÜ
Duyuruyap.asp (Bir form aracılığı ile duyuruson.txt dosyasına duyuruları Kaydeder)
<!--#include virtual="../ygp/elm/topelm.htm"-->
<form name="form1" method="get" action="duyuruyap.asp">
<p> </p>
<table width="480" height="263" border="0" bgcolor="#b0c4de">
<tr>
<th scope="col"> <div align="left">
<p>
<textarea name="duyuruson" rows="10" cols="70"></textarea>
</p>
<p>
<input type="submit" name="Submit" value="Kaydet">
</p>
</div></th>
</tr>
</table>
<p> </p>
</form>
<%
Set dn=Server.CreateObject("Scripting.FileSystemObject")
Set Setdn=dn.OpenTextFile(Server.MapPath("duyuru.txt "), 8)
duyuruson=Request.QueryString("duyuruson")
Setdn.Writeline duyuruson
Setdn.Close
Set Setdn=Nothing
Set dn=Nothing
%>
Duyuru.asp (Duyuru.txt dosyasından yuyuruyap.asp taafından yazılmış bulunan satırları okur ve ekranda gösterir)
<%
Set dosya_nesnesi=Server.CreateObject("Scripting.FileSystemObject")
Set dosya_degiskeni=dosya_nesnesi.OpenTextFile(server.Mappath("duyuru.txt"), 1)
do while dosya_degiskeni.AtEndOfStream=false
Response.Write(dosya_degiskeni.Readline)
Response.Write("<br>")
loop
dosya_degiskeni.Close
Set dosya_degiskeni=Nothing
Set dosya_nesnesi=Nothing
%>
ÖĞRENCİ BİLGİLERİ GİRİŞ MODÜLÜ
Bilgigiris.asp (Öğretim elemanı bu sayfa sayesinde öğrencilere ait numara, ad, soyad, ve kısım numrası bilgilerini girer)
<form name="form2" method="get" action="kaydetbilgigiris.asp">
<table width="289" border="0" bgcolor="#b0c4de">
<tr>
<th width="84" class="style2" scope="col"><div align="left"><strong> Numara</strong></div></th>
<th width="189" scope="col">
<input type="number" name="Numara">
</th>
</tr>
<tr>
<td class="style2"><span class="style4">Adi</span></td>
<td>
<div align="center">
<input type="text" name="Adi">
</div></td>
</tr>
<tr>
<td class="style2"><span class="style4">Soyadi</span></td>
<td>
<div align="center">
<input type="text" name="Soyadi">
</div></td>
</tr>
<tr>
<td class="style2"><span class="style4">Kisim_no</span></td>
<td><div align="center">
<input type="number" name="Kisim_no">
</div></td>
</tr>
<tr>
<td height="28" colspan="2"><div align="center">
<input type="submit" name="Submit2" value="Kaydet">
</div></td>
</tr>
</table>
</form>
Kaydetbilgigiris.asp (Bu dosya ile veritabanına öğrencinin bilgileri kaydedilir)
<%
Numara=Request.QueryString("Numara")
Adi=Request.QueryString("Adi")
Soyadi=Request.QueryString("Soyadi")
Kisim_no=Request.QueryString("Kisim_no")
strSQL= "INSERT into ogrenci (Numara, Adi, Soyadi, Kisim_no) VALUES ("&Numara&", '"&Adi&"', '"&Soyadi&"','"&Kisim_no&"')"
Con.Execute(StrSQL)
Con.Close
Set RS=Nothing
Set Con=Nothing
Response.Redirect("bilgigiris.asp")
%>
ÖĞRENCİ NOTLARI KAYDET/DEĞİŞTİR/SORGULA
MODÜLÜ
Goster.asp (Bilgileri kaydedilen öğrencilerin tümünü göstermek için kullanılır. Bu dosya bilgileri kaydediimiş öğrencileri veritabanından okuyarak gösterir)
<%
dim con,rs,x
Set Con = Server.CreateObject("ADODB.Connection")
Set Rs= Server.CreateObject("ADODB.recordset")
Con.Open = "provider=Microsoft.Jet.OLEDB.4.0 ; Data Source=dbs.mdb"
rs.CursorType = 3
strSQL= "SELECT * FROM ogrenci Order By Numara"
rs.Open strSQL, Con
%>
<table border="1" width="100%">
<tr bgcolor="#b0c4de">
<%
for each x in rs.Fields
response.write("<th>" & (x.name) & "</th>")
next
%>
</tr>
<%do until rs.EOF%>
<tr bgcolor="#f0f0f0">
<form method="post" action="demo_db_edit.asp" target="_blank">
<%
for each x in rs.Fields
if x.name="Numara" then%>
<td><input type="submit" name="no" value="<%=x.value%>"></td>
<%else%>
<td><div align="center"><%Response.Write(x.value)%> </div></td>
<%end if
next
%>
</form>
<%rs.MoveNext%>
</tr>
<%
loop
rs.close
set rs=nothing
con.close
set con=nothing
%>
Demo_db_edit.asp (Bir önceki sayfada seçilen öğrenciye ait bilgileri değiştirilebilecek şekilde form ile getiren modül)
<%
no=Request.Form("no")
if no="" then response.end
Set Con = Server.CreateObject("ADODB.Connection")
Set Rs= Server.CreateObject("ADODB.recordset")
Con.Open = "provider=Microsoft.Jet.OLEDB.4.0 ; Data Source=dbs.mdb"
rs.CursorType = 3
rs.Open "Select * from ogrenci where ogrenci.[Numara]=" & no , con
%>
<html>
<head>
<title>Edit DataBase Table</title>
</head>
<!--#include virtual="../ygp/elm/topelm.htm"-->
<form method="post" action="demo_db_submit.asp" target="_blank">
<input name="no" type="hidden" value=<%=no%>>
<table bgcolor="#b0c4de">
<%
for each x in rs.Fields
if x.name <> "no" then%>
<tr>
<td><%=x.name%> </td>
<td><input name="<%=x.name%>" value="<%=x.value%>" size="20"></td>
<%end if
next
rs.close
con.close
%>
</tr>
</table>
<br />
<input type="submit" name="action" value="Güncelle/Kaydet">
<input type="submit" name="action" value="Sil">
</form>
Demo_db_submit.asp (Bir önceki sayfada notu kaydedilen/değiştirilen/silinen öğrencinin bilgilerini veritabanına kaydeder)
<%on error resume next
Set Con = Server.CreateObject("ADODB.Connection")
Set Rs= Server.CreateObject("ADODB.recordset")
Con.Open = "provider=Microsoft.Jet.OLEDB.4.0 ; Data Source=dbs.mdb"
if Request.form("action")="Güncelle/Kaydet" then
no=Request.Form("no")
sql="UPDATE ogrenci SET Adi='" & Request.Form("Adi") & "',"
sql=sql & "Soyadi='" & Request.Form("Soyadi") & "',"
sql=sql & "Kisim_No=" & Request.Form("Kisim_No") & ","
sql=sql & "Odev_notu_1=" & Request.Form("Odev_notu_1") & ","
sql=sql & "Odev_notu_2=" & Request.Form("Odev_notu_2") & ","
sql=sql & "Quiz_1=" & Request.Form("Quiz_1") & ","
sql=sql & "Quiz_2=" & Request.Form("Quiz_2") & ","
sql=sql & "Uygulama_notu=" & Request.Form("Uygulama_notu") & ","
sql=sql & "Proje_no=" & Request.Form("Proje_no") & ","
sql=sql & "Proje_notu=" & Request.Form("Proje_notu") & ","
sql=sql & "Ara_sinav=" & Request.Form("Ara_sinav") & ","
sql=sql & "Final_sinavi=" & Request.Form("Final_sinavi") & ","
sql=sql & "Ortalama=" & Request.Form("Ortalama") & ","
sql=sql & "Basari_harfi='" & Request.Form("Basari_harfi") & "' WHERE ogrenci.[Numara]=" & no
con.Execute sql, Recordsaffected
'if err <> 0 then
'Response.Write("You do not have permission to update this database!")
'else
Response.Write( no & " numarali ögrencinin bilgileri güncellenmistir/kaydedilmistir.")
'end if
' Response.Write("Submitting records has been disabled from this demo")
end if
if Request.Form("action")="Sil" then
no=Request.Form("no")
con.Execute "DELETE FROM ogrenci WHERE ogrenci.[Numara]=" & no, Recordsaffected
'if err <> 0 then
'Response.Write("You do not have permission to delete a record from this database!")
'else
Response.Write( no & " numarali ögrencinin bilgileri silinmistir.")
end if
' Response.Write("Deleting records has been disabled from this demo")
con.close%>
ogrencisorgula1.asp (Öğrenci bazında sorgulama yapmak için kullanılır)
<form name="form1" method="post" action="yeni1.asp">
<table width="194" border="0" bgcolor="#b0c4de">
<tr>
<th width="97" scope="col">Numara</th>
<th width="81" scope="col"> <input name="Numar" type="number" size="9"></th>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="Sorgula">
</div></td>
</tr>
</table>
</form>
Kisimsorgula1.asp (kısım bazında sorgulama yapmak için kullanılır)
<form name="form1" method="post" action="yeni2.asp">
<table width="194" border="0" bgcolor="#b0c4de">
<tr>
<th width="97" scope="col">Kısım</th>
<th width="81" scope="col"> <input name="Kisi" type="number" size="9"></th>
</tr>
<tr bgcolor="#b0c4de">
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="Sorgula">
</div></td>
</tr>
</table>
</form>
ÖĞRETİM ELEMANI ÖDEV VERME/ÖĞRENCİ ÖDEV
TESLİM ETME MODÜLÜ
Bu modül sayesinde öğretim elemanı istediği dokümanı veritabanına kaydedebilmektedir.
Öğrenciler ise verilen ödevi teslim edebilmektedir.
Uploadform.asp (Veritabanına veya diske herhangi bir dokumanı yuklemek için kullanılan form)
<!--#include virtual="../ygp/elm/topelm.htm"-->
<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="uploadexmple.asp">
<table width="503" border="0" bgcolor="#b0c4de">
<tr>
<th width="167" scope="col"><div align="left">Ödev No </div></th>
<th width="220" scope="col"><div align="left">
<input type=NUMBER size=1 name="id">
</div></th>
</tr>
<tr>
<td><div align="left">Dosyanız</div></td>
<td><input type=FILE size=50 name="FILE1"></td>
</tr>
<tr>
<td><div align="left">Nereye?</div></td>
<td> Diske
<input type=RADIO name="saveto" value="disk" checked>
Veritabanına
<input type=RADIO name="saveto" value="database"></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input name="SUBMIT" type=SUBMIT value="Yükle">
</div></td>
</tr>
</table>
</FORM>
Uploadex.asp (dosyaları veritabanına yükler)
<%@ Language=VBScript %>
<%Option Explicit%>
<!--#include virtual="../ygp/elm/topelm.htm"-->
<!-- #include file="upload.asp" -->
<%
' Create the FileUploader
Dim Uploader, File, Con, RS,id
Set Uploader = New FileUploader
' This starts the upload process
Uploader.Upload()
'******************************************
Response.Write "<b>Ödev Yüklendi " & Uploader.Form("fullname") & "</b><br>"
'numarayý
id=Uploader.Form("id")
' Check if any files were uploaded
If Uploader.Files.Count = 0 Then
Response.Write "File(s) not uploaded."
Else
' Loop through the uploaded files
For Each File In Uploader.Files.Items
' Check where the user wants to save the file
If Uploader.Form("saveto") = "disk" Then
' Save the file
File.SaveToDisk "F:\uploaded\"
ElseIf Uploader.Form("saveto") = "database" Then
' Open the table you are saving the file to
Set Con = Server.CreateObject("ADODB.Connection")
Set RS= Server.CreateObject("ADODB.recordset")
Con.Open = "provider=Microsoft.Jet.OLEDB.4.0 ; Data Source=dbs.mdb"
' Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "dosya", Con, 2, 2
RS.AddNew ' create a new record
RS("id") = id
RS("filename") = File.FileName
RS("filesize") = File.FileSize
RS("contenttype") = File.ContentType
' Save the file to the database
File.SaveToDatabase RS("filedata")
' Commit the changes and close
RS.Update
RS.Close
Con.Close
End If
' Output the file details to the browser
Response.Write "Yüklenen Dosya: " & File.FileName & "<br>"
Response.Write "Boyut: " & File.FileSize & " bytes<br>"
Response.Write "Tip: " & File.ContentType & "<br><br>"
Next
End If
%>
Ulpoader.asp (upload işleminin kullandığı dosya)
<%
Class FileUploader
Public Files
Private mcolFormElem
Private Sub Class_Initialize()
Set Files = Server.CreateObject("Scripting.Dictionary")
Set mcolFormElem = Server.CreateObject("Scripting.Dictionary")
End Sub
Private Sub Class_Terminate()
If IsObject(Files) Then
Files.RemoveAll()
Set Files = Nothing
End If
If IsObject(mcolFormElem) Then
mcolFormElem.RemoveAll()
Set mcolFormElem = Nothing
End If
End Sub
Public Property Get Form(sIndex)
Form = ""
If mcolFormElem.Exists(LCase(sIndex)) Then Form = mcolFormElem.Item(LCase(sIndex))
End Property
Public Default Sub Upload()
Dim biData, sInputName
Dim nPosBegin, nPosEnd, nPos, vDataBounds, nDataBoundPos
Dim nPosFile, nPosBound
biData = Request.BinaryRead(Request.TotalBytes)
nPosBegin = 1
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13)))
If (nPosEnd-nPosBegin) <= 0 Then Exit Sub
vDataBounds = MidB(biData, nPosBegin, nPosEnd-nPosBegin)
nDataBoundPos = InstrB(1, biData, vDataBounds)
Do Until nDataBoundPos = InstrB(biData, vDataBounds & CByteString("--"))
nPos = InstrB(nDataBoundPos, biData, CByteString("Content-Disposition"))
nPos = InstrB(nPos, biData, CByteString("name="))
nPosBegin = nPos + 6
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34)))
sInputName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
nPosFile = InstrB(nDataBoundPos, biData, CByteString("filename="))
nPosBound = InstrB(nPosEnd, biData, vDataBounds)
If nPosFile <> 0 And nPosFile < nPosBound Then
Dim oUploadFile, sFileName
Set oUploadFile = New UploadedFile
nPosBegin = nPosFile + 10
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34)))
sFileName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
oUploadFile.FileName = Right(sFileName, Len(sFileName)-InStrRev(sFileName, "\"))
nPos = InstrB(nPosEnd, biData, CByteString("Content-Type:"))
nPosBegin = nPos + 14
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13)))
oUploadFile.ContentType = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
nPosBegin = nPosEnd+4
nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2
oUploadFile.FileData = MidB(biData, nPosBegin, nPosEnd-nPosBegin)
If oUploadFile.FileSize > 0 Then Files.Add LCase(sInputName), oUploadFile
Else
nPos = InstrB(nPos, biData, CByteString(Chr(13)))
nPosBegin = nPos + 4
nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2
If Not mcolFormElem.Exists(LCase(sInputName)) Then mcolFormElem.Add LCase(sInputName), CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
End If
nDataBoundPos = InstrB(nDataBoundPos + LenB(vDataBounds), biData, vDataBounds)
Loop
End Sub
'String to byte string conversion
Private Function CByteString(sString)
Dim nIndex
For nIndex = 1 to Len(sString)
CByteString = CByteString & ChrB(AscB(Mid(sString,nIndex,1)))
Next
End Function
'Byte string to string conversion
Private Function CWideString(bsString)
Dim nIndex
CWideString =""
For nIndex = 1 to LenB(bsString)
CWideString = CWideString & Chr(AscB(MidB(bsString,nIndex,1)))
Next
End Function
End Class
Class UploadedFile
Public ContentType
Public FileName
Public FileData
Public Property Get FileSize()
FileSize = LenB(FileData)
End Property
Public Sub SaveToDisk(sPath)
Dim oFS, oFile
Dim nIndex
If sPath = "" Or FileName = "" Then Exit Sub
If Mid(sPath, Len(sPath)) <> "\" Then sPath = sPath & "\"
Set oFS = Server.CreateObject("Scripting.FileSystemObject")
If Not oFS.FolderExists(sPath) Then Exit Sub
Set oFile = oFS.CreateTextFile(sPath & FileName, True)
For nIndex = 1 to LenB(FileData)
oFile.Write Chr(AscB(MidB(FileData,nIndex,1)))
Next
oFile.Close
End Sub
Public Sub SaveToDatabase(ByRef oField)
If LenB(FileData) = 0 Then Exit Sub
If IsObject(oField) Then
oField.AppendChunk FileData
End If
End Sub
End Class
%>
ÖĞRETİM ELEMANININ ÖĞRENCİLERİN VERDİĞİ
ÖDEVİ/ÖĞRENCİLERİN ALDIKLARI ÖDEVİ GÖRME MODÜLÜ
Show.asp (Veritabanındaki binary data’nın kullanıcıya gösterilmesi için)
<%
' -- show.asp --
' Generates a list of uploaded files
Response.Buffer = True
' Connection String
Dim connStr
Set connStr = Server.CreateObject("ADODB.Connection")
connStr.Open = "provider=Microsoft.Jet.OLEDB.4.0 ; Data Source=dbs.mdb"
%>
<html>
<head>
</head>
<!--#include virtual="../ygp/elm/topelm.htm"-->
<p align="center">
<b>Showing Binary Data from the Database</b><br>
p>
<table width="700" border="1" align="center">
<%
' <style>
' body, input, td { font-family:verdana,arial; font-size:10pt; }
' </style>
' Recordset Object
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
' opening connection
rs.Open "select [id], [filename], [filesize], [contenttype] from dosya_ogc ", connStr, 2, 4
If Not rs.EOF Then
Response.Write "<tr><td colspan=""7"" align=""center""><i>"
Response.Write "No. of records : " &rs.RecordCount
Response.Write ", Table : Files</i><br>"
Response.Write "</td></tr>"
While Not rs.EOF
Response.Write "<tr><td>"
Response.Write rs("id") & "</td><td>"
Response.Write "<a href=""file.asp?id=" & rs("id") & """>"
Response.Write rs("id") & "</a></td><td>"
Response.Write rs("filename") & "</td><td>"
Response.Write rs("filesize") & "</td><td>"
Response.Write rs("contenttype") & "</td><td>"
Response.Write "</td></tr>"
rs.MoveNext
Wend
Else
Response.Write "No Record Found"
End If
rs.Close
Set rs = Nothing
%>
</table>
File.asp(Veritabanındaki dokümanlara ulaşmak için kullanılır)
%
<!--#include virtual="../ygp/elm/topelm.htm"-->
' -- file.asp --
' Retrieves binary files from the database
Response.Buffer = True
' ID of the file to retrieve
Dim id
id=Request("id")
' ID=13
If Len(ID) < 1 Then
ID = 7
End If
' Connection String
Dim connStr
Set connStr = Server.CreateObject("ADODB.Connection")
connStr.Open = "provider=Microsoft.Jet.OLEDB.4.0 ; Data Source=dbs.mdb"
' Recordset Object
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
' opening connection
rs.Open "select [filedata],[contenttype] from dosya_ogc where id="&id&" ", connStr, 2, 4
If Not rs.EOF Then
Response.ContentType = rs("contenttype")
Response.BinaryWrite rs("filedata")
End If
rs.Close
Set rs = Nothing
%>