ONLINE PORTAL FOR DISTRIBUTED LIBRARY INFORMATION SYSTEM


ONLINE PORTAL FOR DISTRIBUTED LIBRARY INFORMATION SYSTEM
AIM:
            To create a online portal for distributed library information system using Java Script.

ALGORITHM:
STEP 1: Start the process.
STEP 2: Design the index.html code for checking the authorized user.
STEP 3: Design the books.html code and access through the index.html code.
STEP 4: Enter book name, author name, publication and edition details in the relevant text boxes and click the search button.
STEP 5: Display all the records which matches the above data.
STEP 6: Stop the process.

Index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Online Library Portal</title>
<script type="text/javascript" >
function login()
{
var con = new ActiveXObject("ADODB.Connection")
con.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:/library.mdb")
var rs = new ActiveXObject("ADODB.Recordset")
rs.Open("select * from users",con)
while(!rs.EOF)
{alert(rs('id'))
if(rs('nam')==document.getElementById('unam').value&&rs('pass')==document.getElementById('pass').value)
{
rs.close()
con.close()
window.navigate('books.html')
}
rs.movenext
}
err.innerText='Wrong Credentials'
rs.close()
con.close()
}
</script>
</head>
<body>
<form id="log">
<table align="center" >
<tr><td>Username</td><td>
<input type="text" id="unam" style="width: 130px">
</td></tr>
<tr><td style="height: 53px">Password</td>
<td style="height: 53px">
<input type="password" id="pass" style="width: 130px"></td>
<td style="width: 103px; height: 53px;">
<label id="err"></label>
</td></tr>
<tr><td></td>
<td style="text-align:center ">
<input type="button" value="Log In" style="width: 70px; height: 26px" onclick="login()">
</td></tr>
</table>
</form>
</body>
</html>

Books.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Online Library Portal</title>
<script type="text/javascript">
function sear() {
var con = new ActiveXObject("ADODB.Connection")
con.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:/library.mdb")
var rs = new ActiveXObject("ADODB.Recordset")
rs.Open("select * from books",con)
var ta='<table align=\'center\' width=\'80%\' border=\'1\'><tr><th>Book</th><th>Author</th><th>Publisher</th><th>Edition</th></tr>'
while(!rs.EOF)  {
if(rs('nam')==document.getElementById('book').value&&rs('author')==document.getElementById('auth').value&&rs('publisher')==document.getElementById('pub').value&&rs('edi')==document.getElementById('edi').value)
{
ta+='<tr><td><a href="books/'+rs('id')+'.pdf">'+rs('nam')+'</a></td><td>'+rs('author')+'</td><td>'+rs('publisher')+'</td><td>'+rs('edi')+'</td></tr>'
}
rs.movenext
}
rs.movefirst
while(!rs.EOF)
{
if(rs('nam')==document.getElementById('book').value&&rs('author')==document.getElementById('auth').value&&rs('publisher')==document.getElementById('pub').value&&rs('edi')!=document.getElementById('edi').value)
{
ta+='<tr><td><a href="books/'+rs('id')+'.pdf">'+rs('nam')+'</a></td><td>'+rs('author')+'</td><td>'+rs('publisher')+'</td><td>'+rs('edi')+'</td></tr>'
}
rs.movenext
}
rs.movefirst
while(!rs.EOF)
{
if(rs('nam')==document.getElementById('book').value&&rs('author')==document.getElementById('auth').value&&rs('publisher')!=document.getElementById('pub').value&&rs('edi')!=document.getElementById('edi').value)
{
ta+='<tr><td><a href="books/'+rs('id')+'.pdf">'+rs('nam')+'</a></td><td>'+rs('author')+'</td><td>'+rs('publisher')+'</td><td>'+rs('edi')+'</td></tr>'
}
rs.movenext
}
rs.movefirst
while(!rs.EOF)
{
if(rs('nam')==document.getElementById('book').value&&rs('author')!=document.getElementById('auth').value&&rs('publisher')!=document.getElementById('pub').value&&rs('edi')!=document.getElementById('edi').value)
{
ta+='<tr><td><a href="books/'+rs('id')+'.pdf">'+rs('nam')+'</a></td><td>'+rs('author')+'</td><td>'+rs('publisher')+'</td><td>'+rs('edi')+'</td></tr>'
}
rs.movenext
}
rs.movefirst
while(!rs.EOF)
{
if(rs('nam')!=document.getElementById('book').value&&rs('author')==document.getElementById('auth').value&&rs('publisher')!=document.getElementById('pub').value&&rs('edi')!=document.getElementById('edi').value)
{
ta+='<tr><td><a href="books/'+rs('id')+'.pdf">'+rs('nam')+'</a></td><td>'+rs('author')+'</td><td>'+rs('publisher')+'</td><td>'+rs('edi')+'</td></tr>'
}
rs.movenext
}
rs.movefirst
while(!rs.EOF)
{
if(rs('nam')!=document.getElementById('book').value&&rs('author')!=document.getElementById('auth').value&&rs('publisher')==document.getElementById('pub').value&&rs('edi')!=document.getElementById('edi').value)
{
ta+='<tr><td><a href="books/'+rs('id')+'.pdf">'+rs('nam')+'</a></td><td>'+rs('author')+'</td><td>'+rs('publisher')+'</td><td>'+rs('edi')+'</td></tr>'
}
rs.movenext
}
rs.movefirst
while(!rs.EOF)
{
if(rs('nam')!=document.getElementById('book').value&&rs('author')!=document.getElementById('auth').value&&rs('publisher')!=document.getElementById('pub').value&&rs('edi')==document.getElementById('edi').value)
{
ta+='<tr><td><a href="books/'+rs('id')+'.pdf">'+rs('nam')+'</a></td><td>'+rs('author')+'</td><td>'+rs('publisher')+'</td><td>'+rs('edi')+'</td></tr>'
}
rs.movenext
}
ta+='</table>'
result.innerHTML=ta
rs.close()
con.close()
}
</script>
</head>
<body>
<form id="search">
<table align="center" >
<tr><td>Book</td>
<td><input type="text" id="book" style="width: 200px">
</td> </tr>
 <tr> <td> Author</td><td>
<input type="text" id="auth" style="width: 200px">
</td></tr>
<tr><td>Publisher</td>
<td><input type="text" id="pub" style="width: 200px">
</td> </tr>
<tr><td>Edition</td>
<td><input type="text" id="edi" style="width: 200px">
</td></tr>
<tr><td></td>
<td style="text-align:center ">
<input type="button" id="search" value="Search" onclick="sear()">
</td></tr>
</table>
</form>
<div id="result">   </div>
</body>
</html>

4 comments:

Anonymous said...

Hai sir, Can u pls give me the library.mdb file.


Thanks and regards

SPS

Anonymous said...

hi... how to insert data into access using javascript with html..

Anonymous said...

can u give this type of coding for "employee expenses management system"

Anonymous said...

can u give this type of coding for "employee expenses management system"

Post a Comment