Post on 10-Apr-2018
transcript
8/8/2019 Intranet Mechanization
1/20
Issue Book Form
Figure 7.3.11
51
8/8/2019 Intranet Mechanization
2/20
Return Book Form
Figure 7.3.12
52
8/8/2019 Intranet Mechanization
3/20
Employee Home Form
Figure 7.3.12
53
8/8/2019 Intranet Mechanization
4/20
Mail Information Form
Figure 7.3.13
54
8/8/2019 Intranet Mechanization
5/20
Employee Library Form
Figure 7.3.14
55
8/8/2019 Intranet Mechanization
6/20
Chat Form
Figure 7.3.15
56
8/8/2019 Intranet Mechanization
7/20
Employee Leave Details Form
Figure 7.3.16
57
8/8/2019 Intranet Mechanization
8/20
General Service Form
Figure 7.3.17
58
8/8/2019 Intranet Mechanization
9/20
Message Post Form
Figure 7.3.18
59
8/8/2019 Intranet Mechanization
10/20
View Message Form
Figure 7.3.19
60
8/8/2019 Intranet Mechanization
11/20
CHAPTER 8
CONCLUSION AND FURTHER SCOPE
8.1 APPLICATION AREA
This particular software, which has been designed and developed for
WINFOCOM SOLUTIONS (P) LTD can be used in various branches. The individual
modules can be used in different application areas. So we can conclude by saying that
this software can be used as a bundle of modules or either individual modules to cater to
the needs of the perspective organization.
8.2 CONCLUSION AND FURTHER SCOPE
The system has been incorporated successfully. Appropriate care has been taken
during database design, to maintain data integrity and to avoid redundancy of data.
Validations have been done instantaneously to avoid data redundancy.
This site was developed in such a way that any further modifications needed can
be done easily. It is user-friendly and all technical complexities are hidden.
The quality factors like correctness, efficiency, usability, maintainability,
portability, accuracy, tolerance, expandability and communicatively all are successfully
done.
Future enhancements can be done further in case of the Chatting Module where a
Private Chat can be included.
61
8/8/2019 Intranet Mechanization
12/20
APPENDICES
SAMPLE SOURCE CODE
Authentication.Java
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
public class Authentication extends HttpServlet
{
public void doPost(HttpServletRequest req,HttpServletResponse res) throws
IOException
{
res.setContentType("text/html");
PrintWriter out=res.getWriter();
String fusername=req.getParameter("username").trim();
String fpassword=req.getParameter("password").trim();
HttpSession session=req.getSession(true);
session.setAttribute("username",fusername);
out.println(fusername);
out.println(fpassword);
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");Connection
con=DriverManager.getConnection("jdbc:odbc:intranet_test","sa","");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select userid,password from
employee where userid='"+fusername+"'");
62
8/8/2019 Intranet Mechanization
13/20
String tusername=null;
String tpassword=null;
while(rs.next()){
tusername=(rs.getString(1)).trim();
out.println(tusername);
tpassword=(rs.getString(2)).trim();
out.println(tpassword);
}
if((fusername.equals(tusername))&&(fpassword.equals(tpassword))){
if(fusername.equals("admin")){
res.sendRedirect("/christo/AdminHome.html");
}
else{
res.sendRedirect("/christo/EmployeeHome.html");
}
}
else{
//out.println("U R not a valid person");
res.sendRedirect("/christo/index.jsp?
message=Invalid User");
}
}
catch(Exception e)
{
out.println(e.getMessage());
63
8/8/2019 Intranet Mechanization
14/20
}
}
}
Admin.Java
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
public class Authentication extends HttpServlet
{
public void doPost(HttpServletRequest req,HttpServletResponse res) throws
IOException
{
Connection con=null;
res.setContentType("text/html");
PrintWriter out=res.getWriter();
String fusername=req.getParameter("username").trim();
String fpassword=req.getParameter("password").trim();
HttpSession session=req.getSession(true);
session.setAttribute("username",fusername);
out.println(fusername);
out.println(fpassword);
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:intranet_test","sa","");
Statement st=con.createStatement();
64
8/8/2019 Intranet Mechanization
15/20
ResultSet rs=st.executeQuery("select userid,password from employee where
userid='"+fusername+"'");
String tusername=null;
String tpassword=null;
while(rs.next())
{
tusername=(rs.getString(1)).trim();
out.println(tusername);
tpassword=(rs.getString(2)).trim();
out.println(tpassword);
}
if((fusername.equals(tusername))&&(fpassword.equals(tpassword))){
if(fusername.equals("admin")){
res.sendRedirect("/christo/AdminHome.html");
}
else
{
res.sendRedirect("/christo/EmployeeHome.html");
}
}
else{
//out.println("U R not a valid person");
res.sendRedirect("/christo/index.jsp?message=Invalid User");
}
}
catch(Exception e)
{
out.println(e.getMessage());
65
8/8/2019 Intranet Mechanization
16/20
}
}
}
Chat.Java
import java.io.*;
import java.util.*;
import java.net.*;
class BroadcastClientHandler extends Thread
{
protected Socket incoming;
protected int id;
protected BufferedReader in;
protected PrintWriter out;
public BroadcastClientHandler (Socket incoming, int id)
{
this.incoming = incoming;
this.id = id;
try
{
if (incoming != null)
{
in = new BufferedReader (new InputStreamReader (
incoming.getInputStream()));
out = new PrintWriter (new OutputStreamWriter (
incoming.getOutputStream()));
}
}
66
8/8/2019 Intranet Mechanization
17/20
catch (Exception e)
{
e.printStackTrace();
}
}
public synchronized void sendMessage (String msg)
{
if (out != null)
{
out.println (msg);
out.flush();
}
}
public void run ()
{
if (in != null && out != null)
{
sendMessage ("This is Winfocom Chatting");
try
{
while (true)
{
String str = in.readLine();
//System.out.println(str);
Iterator iter = server.activeClients.iterator();
while (iter.hasNext())
67
8/8/2019 Intranet Mechanization
18/20
{
BroadcastClientHandler t = (BroadcastClientHandler) iter.next();
t.sendMessage (str);
}
} // end while
// incoming.close();
// this client is no longer active
// server.activeClients.remove(this);
}
catch (IOException e)
{
//e.printStackTrace();
}
} // end if
}
}
public class server //BroadcastEchoServer
{
static protected Set activeClients = new HashSet();
public static void main (String[] args)
{
int i = 1;
try
{
System.out.println("Server Started ...................");
68
8/8/2019 Intranet Mechanization
19/20
System.out.println("To Stop Server Press Ctrl+c ......");
ServerSocket ss = new ServerSocket (1500);
while (true)
{
Socket s = ss.accept();
BroadcastClientHandler newClient =
new BroadcastClientHandler (s,i++);
activeClients.add(newClient);
newClient.start();
}
}
catch (Exception e)
{
//e.printStackTrace();
}
}
}
69
8/8/2019 Intranet Mechanization
20/20
BIBILIOGRAPHY
BOOKS
Thinking in Java by Bruce Echel, Edition 2001.
The Complete Idiots Guide to JavaScript by Scott J.Walter and Aaron Weiss,
Edition 2000.
Teach Yourself Java in 21 days by David Harms, Edition 2000.
Hooked on Java by Arthur Van Hoff, Edition 1998.
Software Engineering by Roger S. Pressman, Edition 2000.
WEBSITES
www.freewarejava.com on 23 Aug 2004
www.idgbooks.com on 26th Aug 2004
70
http://www.freewarejava.com/http://www.idgbooks.com/http://www.freewarejava.com/http://www.idgbooks.com/