% page=0 volume=0 id=0 book_num=0 Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("Taimiya.mdb") & ";" volume = Request("volume") page = Request("page") book_num = Request("book") words = Request("words") id = Request("id") If id>0 And book_num>0 then SQLQuery = "SELECT * FROM BK" & book_num & " WHERE id=" & id Set Results = Conn.Execute(SQLQuery) elseIf page>0 And book_num>0 then SQLQuery = "SELECT * FROM BK" & book_num & " WHERE page=" & page & " AND part=" & volume Set Results = Conn.Execute(SQLQuery) else no_body = True end if %>
<%If no_body And book_num=0 Then%><% Found=1 counter=1 If words<>"" And ID="" And book_num<>0 Then Found=0 SQLQuery = "SELECT * FROM BK" & book_num & " WHERE text LIKE '%" & words & "%';" Set Results = Conn.Execute(SQLQuery) If not Results.EOF then Found = 1 Response.write("نتائج البحث هي:") End If Do While (Not Results.EOF) %>
<% counter = counter+1 Results.MoveNext Loop End If If Found=0 And words <> "" then Response.write("<% Results.Close Conn.Close %>عذراً، لم نجد نتائج تحتوي على: ") Response.write(words) End If If no_body Then If book_num>0 Then 'Display the search box If words="" Then getBookSubjects(book_num) Else getBookList_Taimiya() End IF Response.end End IF If Results.EOF then Response.write("
You have reached the end of the book.") Response.end Else If Results.BOF then Response.write("
You have reached the beginning of the book.") Response.end else textStr = Results("TEXT") colorText(textStr) id = Results("ID") end if End If Set TempRS = Conn.Execute("SELECT * FROM BK" & book_num & " WHERE id=" & (id*1)+1) If TempRS.EOF then next_id = 0 else next_id = (id*1)+1 end if Set TempRS = Conn.Execute("SELECT * FROM BK" & book_num & " WHERE id=" & (id*1)-1) If TempRS.EOF then previous_id = 0 else previous_id = (id*1)-1 end if TempRS.Close %>
كتاب <%= getBookName(book_num) %>، الجزء <%= Results("part") %>، صفحة <%= Results("page") %>.