├── Pharmacy-Drug-Mangement
├── .gitignore
├── .settings
│ ├── org.eclipse.wst.jsdt.ui.superType.name
│ ├── org.eclipse.wst.jsdt.ui.superType.container
│ ├── org.eclipse.wst.common.project.facet.core.xml
│ ├── org.eclipse.wst.common.component
│ ├── org.eclipse.jdt.core.prefs
│ └── .jsdtscope
├── WebContent
│ ├── META-INF
│ │ ├── MANIFEST.MF
│ │ └── context.xml
│ ├── images
│ │ ├── bg.png
│ │ ├── User.png
│ │ ├── pills.png
│ │ └── vendor.png
│ ├── WEB-INF
│ │ └── lib
│ │ │ └── mysql-connector-java-5.1.48.jar
│ ├── Logout.jsp
│ ├── Index.html
│ ├── Login.html
│ ├── LoginError1.html
│ ├── LoginError2.html
│ ├── SellerRegister.html
│ ├── SellerRegisterError2.html
│ ├── SellerRegisterError1.html
│ ├── css
│ │ ├── Index.css
│ │ ├── Register.css
│ │ ├── Orders.css
│ │ ├── Homepage.css
│ │ ├── Login.css
│ │ ├── AddProduct.css
│ │ └── Buy.css
│ ├── Register.html
│ ├── RegisterError1.html
│ ├── RegisterError2.html
│ ├── UpdateInventory.jsp
│ ├── PlaceOrder.jsp
│ ├── Login.jsp
│ ├── AddProduct.html
│ ├── AddProductError.html
│ ├── AddProductError2.html
│ ├── SellerRegister.jsp
│ ├── Register.jsp
│ ├── SellerHomepage.jsp
│ ├── Orders.jsp
│ ├── SellerOrders.jsp
│ ├── Homepage.jsp
│ ├── AddProduct.jsp
│ ├── AddInventory.jsp
│ └── Buy.jsp
├── dist
│ └── Pharmacy-Drug-Mangement.war
├── nbproject
│ ├── private
│ │ ├── private.xml
│ │ └── private.properties
│ ├── genfiles.properties
│ ├── project.xml
│ ├── project.properties
│ ├── ant-deploy.xml
│ └── build-impl.xml
├── .classpath
├── .project
└── build.xml
├── Screenshots
├── Buy 1.png
├── Buy 2.png
├── Index.png
├── Login.png
├── Restock.png
├── CustomerHomepage.png
├── SellerRegister.png
└── VendorHomepage.png
├── README.md
├── drugdatabase.sql
└── SQL.txt
/Pharmacy-Drug-Mangement/.gitignore:
--------------------------------------------------------------------------------
1 | /build/
2 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/.settings/org.eclipse.wst.jsdt.ui.superType.name:
--------------------------------------------------------------------------------
1 | Window
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Class-Path:
3 |
4 |
--------------------------------------------------------------------------------
/Screenshots/Buy 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stellarloop/Pharmacy-Drug-Management-System/HEAD/Screenshots/Buy 1.png
--------------------------------------------------------------------------------
/Screenshots/Buy 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stellarloop/Pharmacy-Drug-Management-System/HEAD/Screenshots/Buy 2.png
--------------------------------------------------------------------------------
/Screenshots/Index.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stellarloop/Pharmacy-Drug-Management-System/HEAD/Screenshots/Index.png
--------------------------------------------------------------------------------
/Screenshots/Login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stellarloop/Pharmacy-Drug-Management-System/HEAD/Screenshots/Login.png
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/.settings/org.eclipse.wst.jsdt.ui.superType.container:
--------------------------------------------------------------------------------
1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary
--------------------------------------------------------------------------------
/Screenshots/Restock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stellarloop/Pharmacy-Drug-Management-System/HEAD/Screenshots/Restock.png
--------------------------------------------------------------------------------
/Screenshots/CustomerHomepage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stellarloop/Pharmacy-Drug-Management-System/HEAD/Screenshots/CustomerHomepage.png
--------------------------------------------------------------------------------
/Screenshots/SellerRegister.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stellarloop/Pharmacy-Drug-Management-System/HEAD/Screenshots/SellerRegister.png
--------------------------------------------------------------------------------
/Screenshots/VendorHomepage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stellarloop/Pharmacy-Drug-Management-System/HEAD/Screenshots/VendorHomepage.png
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/META-INF/context.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/images/bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stellarloop/Pharmacy-Drug-Management-System/HEAD/Pharmacy-Drug-Mangement/WebContent/images/bg.png
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/images/User.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stellarloop/Pharmacy-Drug-Management-System/HEAD/Pharmacy-Drug-Mangement/WebContent/images/User.png
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/images/pills.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stellarloop/Pharmacy-Drug-Management-System/HEAD/Pharmacy-Drug-Mangement/WebContent/images/pills.png
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/images/vendor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stellarloop/Pharmacy-Drug-Management-System/HEAD/Pharmacy-Drug-Mangement/WebContent/images/vendor.png
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/dist/Pharmacy-Drug-Mangement.war:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stellarloop/Pharmacy-Drug-Management-System/HEAD/Pharmacy-Drug-Mangement/dist/Pharmacy-Drug-Mangement.war
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/WEB-INF/lib/mysql-connector-java-5.1.48.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stellarloop/Pharmacy-Drug-Management-System/HEAD/Pharmacy-Drug-Mangement/WebContent/WEB-INF/lib/mysql-connector-java-5.1.48.jar
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/nbproject/private/private.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/nbproject/private/private.properties:
--------------------------------------------------------------------------------
1 | deploy.ant.properties.file=C:\\Users\\msi\\AppData\\Roaming\\NetBeans\\8.2rc\\tomcat70.properties
2 | j2ee.server.home=C:/xampp1/tomcat
3 | j2ee.server.instance=tomcat70:home=C:\\xampp1\\tomcat
4 | javac.debug=true
5 | javadoc.preview=true
6 | selected.browser=SL[/Browsers/FirefoxBrowser
7 | user.properties.file=C:\\Users\\msi\\AppData\\Roaming\\NetBeans\\8.2rc\\build.properties
8 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/.settings/org.eclipse.wst.common.project.facet.core.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/Logout.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2 | pageEncoding="ISO-8859-1"%>
3 |
4 |
5 |
6 |
7 | Insert title here
8 |
9 |
10 | <%
11 | HttpSession httpsession = request.getSession();
12 | httpsession.invalidate();
13 | response.sendRedirect("Index.html");
14 | %>
15 |
16 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/nbproject/genfiles.properties:
--------------------------------------------------------------------------------
1 | build.xml.data.CRC32=52379792
2 | build.xml.script.CRC32=a708673e
3 | build.xml.stylesheet.CRC32=651128d4@1.77.1.1
4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6 | nbproject/build-impl.xml.data.CRC32=52379792
7 | nbproject/build-impl.xml.script.CRC32=06cb5643
8 | nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1
9 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/.settings/org.eclipse.wst.common.component:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=12
4 | org.eclipse.jdt.core.compiler.compliance=12
5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6 | org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
7 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
8 | org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
9 | org.eclipse.jdt.core.compiler.release=enabled
10 | org.eclipse.jdt.core.compiler.source=12
11 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/.settings/.jsdtscope:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/Index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Index
6 |
7 |
8 |
9 |
10 |
11 |
12 |
Drug Store Management
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/nbproject/project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | org.netbeans.modules.web.project
4 |
5 |
6 | Pharmacy-Drug-Mangement
7 | 1.6.5
8 |
9 |
10 | ${file.reference.mysql-connector-java-5.1.23-bin.jar}
11 | WEB-INF/lib
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/Login.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Login
6 |
7 |
8 |
9 |
28 |
29 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/LoginError1.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Login
6 |
7 |
8 |
9 |
29 |
30 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/LoginError2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Login
6 |
7 |
8 |
9 |
29 |
30 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/SellerRegister.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Register
6 |
7 |
8 |
9 |
23 |
24 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | Pharmacy-Drug-Mangement
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.wst.common.project.facet.core.builder
15 |
16 |
17 |
18 |
19 | org.eclipse.wst.validation.validationbuilder
20 |
21 |
22 |
23 |
24 |
25 | org.eclipse.jem.workbench.JavaEMFNature
26 | org.eclipse.wst.common.modulecore.ModuleCoreNature
27 | org.eclipse.wst.common.project.facet.core.nature
28 | org.eclipse.jdt.core.javanature
29 | org.eclipse.wst.jsdt.core.jsNature
30 |
31 |
32 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/SellerRegisterError2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Register
6 |
7 |
8 |
9 |
24 |
25 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/SellerRegisterError1.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Register
6 |
7 |
8 |
9 |
24 |
25 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/css/Index.css:
--------------------------------------------------------------------------------
1 | body{
2 | margin: 0;
3 | padding: 0;
4 | font-family: sans-serif;
5 | background-image: url("../images/bg.png");
6 | background-color: #78e4ff;
7 | background-repeat: no-repeat;
8 | }
9 |
10 | .container
11 | {
12 | width: 50%;
13 | display: flex;
14 | align-items: center;
15 | height: 720px;
16 | }
17 |
18 | .indexbox{
19 | width: 320px;
20 | height: auto;
21 | padding:30px 30px;
22 | box-sizing: border-box;
23 | background: rgba(255,250,250,0.85);
24 | margin: 0 auto;
25 | }
26 |
27 | h2{
28 | top:-20%;
29 | margin: 0 auto;
30 | padding: 0 0 40px;
31 | color:#2f4f4f;
32 | font-size:22px;
33 | }
34 |
35 | .indexbox button
36 | {
37 | width: 100%;
38 | margin-bottom: 40px;
39 | }
40 |
41 | .button1{
42 | position: realtive;
43 | align: center;
44 | border: none;
45 | outline: none;
46 | height: 40px;
47 | width: 64%;
48 | color: #fff;
49 | font-size: 18px;
50 | background: #090adc;
51 | cursor: pointer;
52 | border-radius: 20px;
53 | }
54 |
55 | .button1:hover{
56 | color: #262626;
57 | background: #04e4e4;
58 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | This Project Pharmacy management system has been developed on Java, mysql, swing.
4 | The most purpose of this java project Pharmacy management system is to develop the web application in Diploma in engineering, B.SC in Computer science engineering (CSE), IT, software engineer final year college and university students submission. The java Online Pharmacy management system project is accessible in our site projectworlds.in. We provide full free java project with source code. The main activities for developing this Pharmacy management system project in java are to manage the details Pharmacy management system-
5 |
6 | Pharmacy management system is a medical store system developed in NetBeans using java programming language. Pharmacy management system offers you the control over your pharmacy shop in the manner that what you can add or remove from the pharma store.
7 |
8 | Requirement :
9 |
10 | Jdk
11 |
12 | Neatbean IDE
13 |
14 | Mysql
15 |
16 | xampp for phpmyadmin
17 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/Register.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Register
6 |
7 |
8 |
9 |
25 |
26 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/RegisterError1.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Register
6 |
7 |
8 |
9 |
26 |
27 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/RegisterError2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Register
6 |
7 |
8 |
9 |
26 |
27 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/UpdateInventory.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2 | pageEncoding="ISO-8859-1"%>
3 |
4 |
5 |
6 |
7 | Insert title here
8 |
9 |
10 | <%@ page import="java.sql.*"%>
11 | <%@ page import="javax.sql.*"%>
12 | <%
13 | int qt=Integer.parseInt(request.getParameter("restock"));
14 | String prod=request.getParameter("pid");
15 | HttpSession httpSession = request.getSession();
16 | String guid=(String)httpSession.getAttribute("currentuser");
17 | ResultSet rs=null;
18 | Connection conn=null;
19 | PreparedStatement ps=null;
20 | String query="update inventory set quantity=quantity+? where sid=? and pid=?";
21 | try{
22 | Class.forName("com.mysql.jdbc.Driver");
23 | conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/drugdatabase","root","1234");
24 | ps=conn.prepareStatement(query);
25 | ps.setInt(1,qt);
26 | ps.setString(2,guid);
27 | ps.setString(3,prod);
28 | int i=ps.executeUpdate();
29 | response.sendRedirect("AddInventory.jsp");
30 | }
31 | catch(Exception e)
32 | {
33 | out.println(e);
34 | }
35 | finally {
36 | try { if (rs != null) rs.close(); } catch (Exception e) {};
37 | try { if (ps != null) ps.close(); } catch (Exception e) {};
38 | try { if (conn != null) conn.close(); } catch (Exception e) {};
39 | }
40 |
41 | %>
42 |
43 |
44 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/css/Register.css:
--------------------------------------------------------------------------------
1 | body{
2 | margin: 0;
3 | padding: 0;
4 | font-family:sans-serif;
5 | background-image: url("../images/bg.png");
6 | background-color: #78e4ff;
7 | background-repeat: no-repeat;
8 | }
9 |
10 | .container
11 | {
12 | width: 50%;
13 | display: flex;
14 | align-items: center;
15 | height: 720px;
16 | }
17 |
18 | .registerbox{
19 | width: 320px;
20 | height: auto;
21 | box-sizing: border-box;
22 | padding: 30px 30px;
23 | background: rgba(255,250,250,0.85);
24 | margin:0 auto;
25 | }
26 |
27 | h2{
28 | top: 0%;
29 | margin: 0 auto;
30 | padding: 0 0 30px;
31 | color:#2f4f4f;
32 | font-size:22px;
33 | }
34 | h3{
35 | position:relative;
36 | margin :0 auto;
37 | color: #ff2929;
38 | font-size: 16px;
39 | padding: 0 0 20px;
40 | }
41 | .registerbox input{
42 | width: 100%;
43 | margin-bottom: 25px;
44 | }
45 |
46 | .registerbox input[type="text"],.registerbox input[type="password"]
47 | {
48 | position: relative;
49 | border: none;
50 | outline: none;
51 | height: 30px;
52 | border-bottom: 1px solid #808080;
53 | color: black;
54 | background: transparent;
55 | font-size:16px;
56 | }
57 |
58 | ::placeholder
59 | {
60 | font-size:16px;
61 | color: #808080;
62 | }
63 |
64 | .registerbox input[type="submit"]
65 | {
66 | margin: 0 25px;
67 | border: none;
68 | outline: none;
69 | border-radius: 20px;
70 | color: #fff;
71 | background: #090adc;
72 | height: 40px;
73 | width: 80%;
74 | font-size:18px;
75 | cursor: pointer;
76 | }
77 | .registerbox input[type="submit"]:hover
78 | {
79 | background: #04e4e4;
80 | color: #262626;
81 | }
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/PlaceOrder.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2 | pageEncoding="ISO-8859-1"%>
3 |
4 |
5 |
6 |
7 | Orders JSP
8 |
9 |
10 | <%@ page import="java.sql.*" %>
11 | <%@ page import="javax.sql.*" %>
12 | <%
13 | String pid=request.getParameter("pid");
14 | int qr=Integer.parseInt(request.getParameter("orderquantity"));
15 | HttpSession httpSession = request.getSession();
16 | String guid=(String)httpSession.getAttribute("currentuser");
17 | Connection conn=null;
18 | ResultSet rs=null;
19 | PreparedStatement ps=null;
20 | PreparedStatement ps2=null;
21 | String a,b;
22 | int c;
23 | String query1="select P.pid,O.sid,P.price from inventory o,product p where p.pid=? and p.pid=o.pid";
24 | String query2="insert into orders(pid,sid,uid,quantity,price) values(?,?,?,?,?)";
25 | try{
26 | Class.forName("com.mysql.jdbc.Driver");
27 | conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/drugdatabase","root","1234");
28 | ps=conn.prepareStatement(query1);
29 | ps.setString(1,pid);
30 | rs=ps.executeQuery();
31 | if(rs.next())
32 | {
33 | a=rs.getString("pid");
34 | b=rs.getString("sid");
35 | c=rs.getInt("price");
36 | ps2=conn.prepareStatement(query2);
37 | ps2.setString(1,a);
38 | ps2.setString(2,b);
39 | ps2.setString(3,guid);
40 | ps2.setInt(4,qr);
41 | ps2.setInt(5,qr*c);
42 | int i=ps2.executeUpdate();
43 | response.sendRedirect("Orders.jsp");
44 | }
45 | }
46 | catch(Exception E)
47 | {
48 | out.println(E);
49 | }
50 | finally {
51 | try { if (rs != null) rs.close(); } catch (Exception e) {};
52 | try { if (ps != null) ps.close(); } catch (Exception e) {};
53 | try { if (ps2 != null) ps2.close(); } catch (Exception e) {};
54 | try { if (conn != null) conn.close(); } catch (Exception e) {};
55 | }
56 | %>
57 |
58 |
59 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/Login.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2 | pageEncoding="ISO-8859-1"%>
3 |
4 |
5 |
6 |
7 | Login
8 |
9 |
10 | <%@ page import="java.sql.*" %>
11 | <%@ page import="javax.sql.*" %>
12 | <%
13 | String uid1=request.getParameter("userid");
14 | String pass1=request.getParameter("password");
15 | String u2=request.getParameter("utype");
16 | int u=Integer.parseInt(u2);
17 |
18 | HttpSession httpSession = request.getSession();
19 | httpSession.setAttribute("currentuser", uid1);
20 |
21 | ResultSet rs=null;
22 | Connection conn=null;
23 | PreparedStatement ps=null;
24 |
25 | String query2="SELECT sid,pass from Seller WHERE sid=?";
26 | String query1="SELECT uid,pass from customer WHERE uid=?";
27 | try{
28 | Class.forName("com.mysql.jdbc.Driver");
29 | conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/drugdatabase","root","1234");
30 | if(u==2)
31 | {
32 | ps=conn.prepareStatement(query2);
33 | ps.setString(1,uid1);
34 | }
35 | else if(u==1)
36 | {
37 | ps=conn.prepareStatement(query1);
38 | ps.setString(1,uid1);
39 | }
40 | rs=ps.executeQuery();
41 | if(rs.next())
42 | {
43 | if((rs.getString(2)).equals(pass1))
44 | {
45 | if(u==1)
46 | response.sendRedirect("Homepage.jsp");
47 | else
48 | if(u==2)
49 | response.sendRedirect("SellerHomepage.jsp");
50 | }
51 | else
52 | {
53 | response.sendRedirect("LoginError1.html");
54 | }
55 | }
56 | else
57 | response.sendRedirect("LoginError2.html");
58 | }
59 | catch(Exception e){
60 | out.println(e);
61 | }
62 | finally {
63 | try { if (rs != null) rs.close(); } catch (Exception e) {};
64 | try { if (ps != null) ps.close(); } catch (Exception e) {};
65 | try { if (conn != null) conn.close(); } catch (Exception e) {};
66 | }
67 |
68 | %>
69 |
70 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/AddProduct.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Add Product
6 |
7 |
8 |
9 |
29 |
30 |
31 |
Add product
32 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/AddProductError.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Add Product
6 |
7 |
8 |
9 |
29 |
30 |
31 |
Product Already Exists Add Different product
32 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/AddProductError2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Insert title here
6 |
7 |
8 |
9 |
29 |
30 |
31 |
Invalid Date format Enter Date Again
32 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/css/Orders.css:
--------------------------------------------------------------------------------
1 | body{
2 | margin: 0;
3 | padding: 0;
4 | font-family: sans-serif;
5 | background-image: url("b2g.png");
6 | background-repeat: no-repeat;
7 | }
8 |
9 | .main{
10 | margin: 0 auto;
11 | width: 100%;
12 | height: auto;
13 | }
14 |
15 | .topbar1{
16 | width: 100%;
17 | height: 4px;
18 | background-color: #fcc508;
19 | }
20 |
21 | .topbar2{
22 | width: 100%;
23 | height: 30px;
24 | background-color: #2a2b2c;
25 | }
26 |
27 | .container1{
28 | width: 1000px;
29 | height: 30px;
30 | background-color: transparent;
31 | margin: 0 auto;
32 | }
33 |
34 | .container2{
35 | width: 1000px;
36 | height: 30px;
37 | background-color: transparent;
38 | margin: 0 auto;
39 | }
40 |
41 | .logout-btn{
42 | width: 150px;
43 | height: 30px;
44 | float: right;
45 | }
46 |
47 | .logout-btn a{
48 | display: block;
49 | color: white;
50 | text-decoration: none;
51 | padding: 4px;
52 | }
53 |
54 | .header{
55 | width: 100%;
56 | height: 40px;
57 | float: left;
58 | background-color:#0ca1a6;
59 | box-shadow: 0 0, 0 6px 20px 0 rgba(0, 0, 0, .14);
60 | }
61 |
62 | .navbar{
63 | width: 700px;
64 | float: left;
65 | text-align: left;
66 | padding-top:10px;
67 | padding-bottom: 10px;
68 | }
69 |
70 | .navbar a{
71 | display: inline-block;
72 | color: black;
73 | text-decoration:none;
74 | padding: 0 10px;
75 | font-weight:bold;
76 | }
77 |
78 | .navbar a:hover{
79 | color: white;
80 | background-color: black;
81 | padding: 0 10px;
82 | }
83 |
84 | .active{
85 | width:1000px;
86 | min-height:688px;
87 | background-color: white;
88 | margin: 0 auto;
89 | padding: 0px 20px 0px 20px;
90 | }
91 |
92 | .filler2{
93 | width:100%;
94 | height:75px;
95 | backgroud-color: transparent;
96 | }
97 |
98 | table {
99 | width: 100%;
100 | border-collapse: collapse;
101 | border: 1px solid black;
102 | }
103 | th {
104 | border: 1px solid black;
105 | padding: 15px;
106 | text-align: left;
107 | background-color: #0ca1a6;
108 | color: white;
109 | }
110 |
111 | tr,td{
112 | border: 1px solid black;
113 | padding: 15px;
114 | text-align: left;
115 | }
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/SellerRegister.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2 | pageEncoding="ISO-8859-1"%>
3 |
4 |
5 |
6 |
7 | Register
8 |
9 |
10 | <%@ page import="java.sql.*" %>
11 | <%@ page import="javax.sql.*" %>
12 | <%@ page import="java.lang.*" %>
13 | <%
14 | String name1=request.getParameter("name");
15 | String phno1=request.getParameter("phno");
16 | String uid1=request.getParameter("uid");
17 | long phno2=Long.parseLong(phno1);
18 | String address1=request.getParameter("address");
19 | String pass1=request.getParameter("pass1");
20 | String pass2=request.getParameter("pass2");
21 | PreparedStatement ps1=null;
22 | PreparedStatement ps2=null;
23 | Connection conn=null;
24 | String query1="SELECT sid from seller WHERE sid=?";
25 | String query2="INSERT INTO seller(sid,pass,sname,address,phno) VALUES(?,?,?,?,?)";
26 | ResultSet rs=null;
27 | try{
28 | Class.forName("com.mysql.jdbc.Driver");
29 | conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/drugdatabase","root","1234");
30 | ps1=conn.prepareStatement(query1);
31 | ps1.setString(1,uid1);
32 | rs=ps1.executeQuery();
33 | if(rs.next())
34 | {
35 | response.sendRedirect("SellerRegisterError1.html");
36 | }
37 | else
38 | {
39 | if(pass1.equals(pass2))
40 | {
41 | ps2=conn.prepareStatement(query2);
42 | ps2.setString(1,uid1);
43 | ps2.setString(2,pass1);
44 | ps2.setString(3,name1);
45 | ps2.setString(4,address1);
46 | ps2.setLong(5,phno2);
47 | int i=ps2.executeUpdate();
48 | response.sendRedirect("Login.html");
49 | }
50 | else
51 | response.sendRedirect("SellerRegisterError2.html");
52 | }
53 | }
54 | catch(Exception e){
55 | out.println("error: "+e);
56 | }
57 | finally {
58 | try { if (rs != null) rs.close(); } catch (Exception e) {};
59 | try { if (ps1 != null) ps1.close(); } catch (Exception e) {};
60 | try { if (ps2 != null) ps2.close(); } catch (Exception e) {};
61 | try { if (conn != null) conn.close(); } catch (Exception e) {};
62 | }
63 | %>
64 |
65 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/Register.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2 | pageEncoding="ISO-8859-1"%>
3 |
4 |
5 |
6 |
7 | Insert title here
8 |
9 |
10 | <%@ page import="java.sql.*" %>
11 | <%@ page import="javax.sql.*" %>
12 | <%
13 | String fname1=request.getParameter("fname");
14 | String lname1=request.getParameter("lname");
15 | String email1=request.getParameter("email");
16 | String phno1=request.getParameter("phno");
17 | String uid1=request.getParameter("uid");
18 | long phno2=Long.parseLong(phno1);
19 | String address1=request.getParameter("address");
20 | String pass1=request.getParameter("pass1");
21 | String pass2=request.getParameter("pass2");
22 |
23 | PreparedStatement ps1=null;
24 | PreparedStatement ps2=null;
25 | Connection conn=null;
26 | ResultSet rs=null;
27 |
28 | String query1="SELECT uid from customer WHERE uid=?";
29 | String query2="INSERT INTO customer(uid,pass,fname,lname,email,address,phno) VALUES(?,?,?,?,?,?,?)";
30 |
31 | try{
32 | Class.forName("com.mysql.jdbc.Driver");
33 | conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/drugdatabase","root","1234");
34 | ps1=conn.prepareStatement(query1);
35 | ps1.setString(1,uid1);
36 | rs=ps1.executeQuery();
37 | if(rs.next())
38 | {
39 | response.sendRedirect("RegisterError1.html");
40 | }
41 | else
42 | {
43 | if(pass1.equals(pass2))
44 | {
45 | ps2=conn.prepareStatement(query2);
46 | ps2.setString(1,uid1);
47 | ps2.setString(2,pass1);
48 | ps2.setString(3,fname1);
49 | ps2.setString(4,lname1);
50 | ps2.setString(5,email1);
51 | ps2.setString(6,address1);
52 | ps2.setLong(7,phno2);
53 | int i=ps2.executeUpdate();
54 | response.sendRedirect("Login.html");
55 | }
56 | else
57 | response.sendRedirect("RegisterError2.html");
58 | }
59 | }
60 | catch(Exception e){
61 | out.println(e);
62 | }
63 | finally{
64 | try { if (rs != null) rs.close(); } catch (Exception e) {};
65 | try { if (ps1 != null) ps1.close(); } catch (Exception e) {};
66 | try { if (ps2 != null) ps2.close(); } catch (Exception e) {};
67 | try { if (conn != null) conn.close(); } catch (Exception e) {};
68 | }
69 | %>
70 |
71 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/css/Homepage.css:
--------------------------------------------------------------------------------
1 | body{
2 | margin: 0;
3 | padding: 0;
4 | font-family: sans-serif;
5 | background: white;
6 | }
7 |
8 | .main{
9 | margin: 0 auto;
10 | width: 100%;
11 | height: auto;
12 | }
13 |
14 | .topbar1{
15 | width: 100%;
16 | height: 4px;
17 | background-color: #fcc508;
18 | }
19 |
20 | .topbar2{
21 | width: 100%;
22 | height: 30px;
23 | background-color: #2a2b2c;
24 | }
25 |
26 | .container1{
27 | width: 1000px;
28 | height: 30px;
29 | background-color: transparent;
30 | margin: 0 auto;
31 | }
32 |
33 | .container2{
34 | width: 1000px;
35 | height: 30px;
36 | background-color: transparent;
37 | margin: 0 auto;
38 | }
39 |
40 | .logout-btn{
41 | width: 150px;
42 | height: 30px;
43 | float: right;
44 | }
45 |
46 | .logout-btn a{
47 | display: block;
48 | color: white;
49 | text-decoration: none;
50 | padding: 4px;
51 | }
52 |
53 | .header{
54 | width: 100%;
55 | height: 40px;
56 | float: left;
57 | background-color:#0ca1a6;
58 | box-shadow: 0 0, 0 6px 20px 0 rgba(0, 0, 0, .14);
59 | }
60 |
61 | .navbar{
62 | width: 700px;
63 | float: left;
64 | text-align: left;
65 | padding-top:10px;
66 | padding-bottom: 10px;
67 | }
68 |
69 | .navbar a{
70 | display: inline-block;
71 | color: black;
72 | text-decoration:none;
73 | padding: 0 10px;
74 | font-weight:bold;
75 | }
76 |
77 | .navbar a:hover{
78 | color: white;
79 | background-color: black;
80 | padding: 0 10px;
81 | }
82 |
83 | .active{
84 | width:1000px;
85 | min-height:688px;
86 | background-color: white;
87 | margin: 0 auto;
88 | padding: 0px 20px 0px 20px;
89 | }
90 |
91 | .filler{
92 | width:100%;
93 | height:50px;
94 | backgroud-color: transparent;
95 | }
96 |
97 | .filler2{
98 | width:100%;
99 | height:30px;
100 | backgroud-color: transparent;
101 | }
102 |
103 | h2{
104 | text-align: center;
105 | padding: 20px 0 20px 0;
106 | }
107 |
108 | .card {
109 | width:340px;
110 | height: auto;
111 | box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
112 | transition: 0.3s;
113 | margin: 0 auto;
114 | text-align:center;
115 | padding: 4px 0 10px 0;
116 | }
117 |
118 | .card:hover {
119 | box-shadow: 0 8px 16px 2px rgba(0,0,0,0.2);
120 | }
121 |
122 | .space1{
123 | font-size:24px;
124 | }
125 |
126 | .filler3{
127 | width:auto;
128 | height:10px;
129 | }
130 |
131 | .space{
132 | padding-top:10px;
133 | }
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/SellerHomepage.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2 | pageEncoding="ISO-8859-1"%>
3 |
4 |
5 |
6 |
7 | Home Page
8 |
9 |
10 |
11 |
31 |
32 | <%@ page import="java.sql.*" %>
33 | <%@ page import="javax.sql.*" %>
34 | <%
35 | HttpSession httpSession = request.getSession();
36 | String guid=(String)httpSession.getAttribute("currentuser");
37 | %>
38 |
39 |
welcome <%=guid%>
40 | <%
41 | ResultSet rs=null;
42 | PreparedStatement ps=null;
43 | java.sql.Connection conn=null;
44 | String query="select sname,sid,address,phno from seller where sid=?";
45 | try{
46 | Class.forName("com.mysql.jdbc.Driver");
47 | conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/drugdatabase","root","1234");
48 | ps=conn.prepareStatement(query);
49 | ps.setString(1,guid);
50 | rs=ps.executeQuery();
51 | if(rs.next())
52 | {
53 | %>
54 |
55 |
56 |

57 |
58 |
<%=rs.getString("sname") %>
59 |
ID: <%=rs.getString("sid") %>
60 |
Address: <%=rs.getString("address") %>
61 |
Phone: <%=rs.getString("phno") %>
62 |
63 |
64 | <%
65 | }
66 | }
67 | catch(Exception e)
68 | {
69 | out.println("error: "+e);
70 | }
71 | finally {
72 | try { if (rs != null) rs.close(); } catch (Exception e) {};
73 | try { if (ps != null) ps.close(); } catch (Exception e) {};
74 | try { if (conn != null) conn.close(); } catch (Exception e) {};
75 | }
76 | %>
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/Orders.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2 | pageEncoding="ISO-8859-1"%>
3 |
4 |
5 |
6 |
7 | Orders
8 |
9 |
10 |
11 |
30 |
31 | <%@ page import="java.sql.*" %>
32 | <%@ page import="javax.sql.*" %>
33 | <%
34 | HttpSession httpSession = request.getSession();
35 | String gid=(String)httpSession.getAttribute("currentuser");
36 | %>
37 |
38 |
39 |
40 | <%
41 | int flag=0;
42 | ResultSet rs=null;
43 | CallableStatement cs=null;
44 | java.sql.Connection conn=null;
45 | try{
46 | Class.forName("com.mysql.jdbc.Driver");
47 | conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/drugdatabase","root","1234");
48 | cs = conn.prepareCall("call getorders(?)");
49 | cs.setString(1, gid);
50 | rs = cs.executeQuery();
51 | %>
52 |
53 |
54 | | Order ID |
55 | Product ID |
56 | Price |
57 | Quantity |
58 | Seller ID |
59 | Order Date and Time |
60 |
61 | <%while(rs.next())
62 | {
63 | %>
64 |
65 |
66 | | <%=rs.getInt("oid") %> |
67 | <%=rs.getString("pid") %> |
68 | <%=rs.getInt("price") %> |
69 | <%=rs.getInt("quantity") %> |
70 | <%=rs.getString("sid") %> |
71 | <%=rs.getTimestamp("orderdatetime") %>
72 | |
73 |
74 | <%
75 | }
76 | %>
77 |
78 |
79 | <%
80 | }
81 | catch(Exception e)
82 | {
83 | out.println("error: "+e);
84 | }
85 | finally {
86 | try { if (rs != null) rs.close(); } catch (Exception e) {};
87 | try { if (cs != null) cs.close(); } catch (Exception e) {};
88 | try { if (conn != null) conn.close(); } catch (Exception e) {};
89 | }
90 | %>
91 |
92 |
93 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/SellerOrders.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2 | pageEncoding="ISO-8859-1"%>
3 |
4 |
5 |
6 |
7 | Orders
8 |
9 |
10 |
11 |
31 |
32 | <%@ page import="java.sql.*" %>
33 | <%@ page import="javax.sql.*" %>
34 | <%
35 | HttpSession httpSession = request.getSession();
36 | String guid=(String)httpSession.getAttribute("currentuser");
37 | %>
38 |
39 | <%
40 | int flag=0;
41 | ResultSet rs=null;
42 | CallableStatement cs=null;
43 | java.sql.Connection conn=null;
44 | try{
45 | Class.forName("com.mysql.jdbc.Driver");
46 | conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/drugdatabase","root","1234");
47 | cs = conn.prepareCall("call getsellerorders(?)");
48 | cs.setString(1, guid);
49 | rs = cs.executeQuery();
50 | %>
51 |
52 |
53 | | Order ID |
54 | Product ID |
55 | Price |
56 | Quantity |
57 | CUSTOMER ID |
58 | Order Date and Time |
59 |
60 | <%while(rs.next())
61 | {
62 | %>
63 |
64 |
65 | | <%=rs.getInt("oid") %> |
66 | <%=rs.getString("pid") %> |
67 | <%=rs.getInt("price") %> |
68 | <%=rs.getInt("quantity") %> |
69 | <%=rs.getString("uid") %> |
70 | <%=rs.getTimestamp("orderdatetime") %>
71 | |
72 |
73 | <%
74 | }
75 | %>
76 |
77 |
78 | <%
79 | }
80 | catch(Exception e)
81 | {
82 | out.println("error: "+e);
83 | }
84 | finally {
85 | try { if (rs != null) rs.close(); } catch (Exception e) {};
86 | try { if (cs != null) cs.close(); } catch (Exception e) {};
87 | try { if (conn != null) conn.close(); } catch (Exception e) {};
88 | }
89 | %>
90 |
91 |
92 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/Homepage.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2 | pageEncoding="ISO-8859-1"%>
3 |
4 |
5 |
6 |
7 | Home Page
8 |
9 |
10 |
11 |
30 |
31 | <%@ page import="java.sql.*" %>
32 | <%@ page import="javax.sql.*" %>
33 |
34 | <%
35 | HttpSession httpSession = request.getSession();
36 | String guid=(String)httpSession.getAttribute("currentuser");
37 | %>
38 |
39 |
40 |
Welcome <%=guid%>
41 |
42 | <%
43 | ResultSet rs=null;
44 | PreparedStatement ps=null;
45 | java.sql.Connection conn=null;
46 | String query="select fname,uid,address,phno,email from customer where uid=?";
47 | try{
48 | Class.forName("com.mysql.jdbc.Driver");
49 | conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/drugdatabase","root","1234");
50 | ps=conn.prepareStatement(query);
51 | ps.setString(1,guid);
52 | rs=ps.executeQuery();
53 | if(rs.next())
54 | {
55 |
56 | %>
57 |
58 |
59 |

60 |
61 |
<%=rs.getString("fname") %>
62 |
63 |
ID: <%=rs.getString("uid") %>
64 |
Address: <%=rs.getString("address") %>
65 |
Phone: <%=rs.getString("phno") %>
66 |
Email: <%=rs.getString("email") %>
67 |
68 |
69 | <%
70 |
71 | }
72 | }
73 | catch(Exception e)
74 | {
75 | out.println("error: "+e);
76 | }
77 | finally {
78 | try { if (rs != null) rs.close(); } catch (Exception e) {};
79 | try { if (ps != null) ps.close(); } catch (Exception e) {};
80 | try { if (conn != null) conn.close(); } catch (Exception e) {};
81 | }
82 | %>
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/css/Login.css:
--------------------------------------------------------------------------------
1 | body{
2 | margin: 0;
3 | padding: 0;
4 | font-family:sans-serif;
5 | background-image: url("../images/bg.png");
6 | background-color: #78e4ff;
7 | background-repeat: no-repeat;
8 | }
9 |
10 | .container
11 | {
12 | width: 50%;
13 | display: flex;
14 | align-items: center;
15 | height: 720px;
16 | }
17 |
18 | .loginbox{
19 | width: 320px;
20 | height: auto;
21 | box-sizing: border-box;
22 | padding: 40px 30px;
23 | background: rgba(255,250,250,0.85);
24 | margin:0 auto;
25 | }
26 |
27 | h2{
28 | position:relative;
29 | margin :0 auto;
30 | color: #2f4f4f;
31 | font-size: 22px;
32 | padding: 0 0 20px;
33 | }
34 |
35 | h3{
36 | position:relative;
37 | margin :0 auto;
38 | color: #ff2929;
39 | font-size: 18px;
40 | padding: 0 0 20px;
41 | }
42 |
43 | .customselect select{
44 | width: 100%;
45 | height: 100%;
46 | background: none;
47 | border: none;
48 | -webkit-appearance: none;
49 | cusrsor: pointer;
50 | text-indent: 5px;
51 | }
52 |
53 | .customselect select:focus{
54 | outline: none;
55 | }
56 |
57 | .customselect option{
58 | font-size: 16px;
59 | }
60 |
61 | .customselect .select{
62 | position: relative;
63 | background: #fff;
64 | border: 1px solid #1d67b1;
65 | height: 20px;
66 | cursor: pointer;
67 | }
68 |
69 | .customselect .select:before{
70 | content: '';
71 | background: #1d67b1;
72 | position: absolute;
73 | top: -1px;
74 | bottom: 0;
75 | right:-1px;
76 | width: 40px;
77 | pointer-events: none;
78 | }
79 |
80 | .customselect .select:after{
81 | content: '';
82 | width: 0;
83 | height: 0;
84 | border-style: solid;
85 | border-width: 10px 7px 0;
86 | border-color: #fff transparent transparent transparent;
87 | position: absolute;
88 | top: 50%;
89 | right: 11px;
90 | transform: translateY(-50%);
91 | pointer-events: none;
92 | }
93 |
94 | .loginbox input{
95 | width:100%;
96 | margin-bottom:30px;
97 | }
98 |
99 | .loginbox input[type="text"],.loginbox input[type="password"]
100 | {
101 | position:relative;
102 | border: none;
103 | padding-top: 20px;
104 | border-bottom: 1px solid #808080;
105 | outline: none;
106 | color: black;
107 | height: 30px;
108 | background: transparent;
109 | font-size: 18px;
110 | }
111 |
112 | ::placeholder
113 | {
114 | font-size:16px;
115 | color: #808080;
116 | }
117 |
118 | .loginbox input[type="submit"]
119 | {
120 | margin: 0 25px;
121 | border: none;
122 | outline: none;
123 | border-radius: 20px;
124 | color: #fff;
125 | background: #090adc;
126 | height: 40px;
127 | width: 80%;
128 | font-size:18px;
129 | cursor: pointer;
130 | }
131 |
132 | .loginbox input[type="submit"]:hover
133 | {
134 | background: #04e4e4;
135 | color: #262626;
136 | }
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/AddProduct.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2 | pageEncoding="ISO-8859-1"%>
3 |
4 |
5 |
6 |
7 | AddProduct JSP
8 |
9 |
10 | <%@ page import="java.sql.*" %>
11 | <%@ page import="javax.sql.*" %>
12 | <%@ page import="java.lang.Object.*" %>
13 | <%
14 | HttpSession httpSession = request.getSession();
15 | String guid=(String)httpSession.getAttribute("currentuser");
16 |
17 | String prname=request.getParameter("prname");
18 | String prid=request.getParameter("prid");
19 | String mfname=request.getParameter("mfname");
20 | String mdate=request.getParameter("mdate");
21 | String edate=request.getParameter("edate");
22 | String price1=request.getParameter("price");
23 | String quantity1=request.getParameter("quantity");
24 | int price=Integer.parseInt(price1);
25 | int quantity=Integer.parseInt(quantity1);
26 |
27 | String query1="select pid from product where pid=?";
28 | String query2="insert into product(pid,pname,manufacturer,mfg,exp,price) values (?,?,?,?,?,?)";
29 | String query3="insert into inventory(pid,pname,sid,quantity) values (?,?,?,?)";
30 |
31 | ResultSet rs=null;
32 | Connection conn=null;
33 | PreparedStatement ps1=null;
34 | PreparedStatement ps2=null;
35 | PreparedStatement ps3=null;
36 | try{
37 | Class.forName("com.mysql.jdbc.Driver");
38 | conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/drugdatabase","root","1234");
39 | ps1=conn.prepareStatement(query1);
40 | ps1.setString(1,prid);
41 | rs=ps1.executeQuery();
42 | if(!rs.next())
43 | {
44 | ps2=conn.prepareStatement(query2);
45 | ps2.setString(1,prid);
46 | ps2.setString(2,prname);
47 | ps2.setString(3,mfname);
48 | ps2.setString(4,mdate);
49 | ps2.setString(5,edate);
50 | ps2.setInt(6,price);
51 | int i=ps2.executeUpdate();
52 | ps3=conn.prepareStatement(query3);
53 | ps3.setString(1,prid);
54 | ps3.setString(2,prname);
55 | ps3.setString(3,guid);
56 | ps3.setInt(4,quantity);
57 | int j=ps3.executeUpdate();
58 | response.sendRedirect("AddInventory.jsp");
59 | }
60 | else
61 | {
62 | response.sendRedirect("AddProductError.html");
63 | }
64 | }
65 | catch(Exception e)
66 | {
67 | response.sendRedirect("AddProductError2.html");
68 | }
69 | finally {
70 | try { if (rs != null) rs.close(); } catch (Exception e) {};
71 | try { if (ps1 != null) ps1.close(); } catch (Exception e) {};
72 | try { if (ps2 != null) ps2.close(); } catch (Exception e) {};
73 | try { if (ps3 != null) ps3.close(); } catch (Exception e) {};
74 | try { if (conn != null) conn.close(); } catch (Exception e) {};
75 | }
76 | %>
77 |
78 |
--------------------------------------------------------------------------------
/drugdatabase.sql:
--------------------------------------------------------------------------------
1 | CREATE SCHEMA drugdatabase;
2 |
3 | USE drugdatabase;
4 |
5 | CREATE TABLE customer (
6 | uid varchar(20) NOT NULL,
7 | pass varchar(20) DEFAULT NULL,
8 | fname varchar(15) DEFAULT NULL,
9 | lname varchar(15) DEFAULT NULL,
10 | email varchar(30) DEFAULT NULL,
11 | address varchar(128) DEFAULT NULL,
12 | phno bigint DEFAULT NULL,
13 | PRIMARY KEY (uid)
14 | );
15 |
16 | CREATE TABLE seller (
17 | sid varchar(15) NOT NULL,
18 | sname varchar(20) DEFAULT NULL,
19 | pass varchar(20) DEFAULT NULL,
20 | address varchar(128) DEFAULT NULL,
21 | phno bigint DEFAULT NULL,
22 | PRIMARY KEY (sid)
23 | );
24 |
25 | CREATE TABLE product (
26 | pid varchar(15) NOT NULL,
27 | pname varchar(20) DEFAULT NULL,
28 | manufacturer varchar(20) DEFAULT NULL,
29 | mfg date DEFAULT NULL,
30 | exp date DEFAULT NULL,
31 | price int DEFAULT NULL,
32 | PRIMARY KEY (pid),
33 | UNIQUE KEY pname (pname)
34 | );
35 |
36 | CREATE TABLE inventory (
37 | pid varchar(15) NOT NULL,
38 | pname varchar(20) DEFAULT NULL,
39 | quantity int unsigned DEFAULT NULL,
40 | sid varchar(15) NOT NULL,
41 | PRIMARY KEY (pid,sid),
42 | CONSTRAINT fk01 FOREIGN KEY (pid) REFERENCES product (pid) ON DELETE CASCADE,
43 | CONSTRAINT fk02 FOREIGN KEY (pname) REFERENCES product (pname) ON DELETE CASCADE,
44 | CONSTRAINT fk03 FOREIGN KEY (sid) REFERENCES seller (sid) ON DELETE CASCADE
45 | );
46 |
47 | CREATE TABLE orders (
48 | oid int NOT NULL AUTO_INCREMENT,
49 | pid varchar(15) DEFAULT NULL,
50 | sid varchar(15) DEFAULT NULL,
51 | uid varchar(15) DEFAULT NULL,
52 | orderdatetime datetime DEFAULT NULL,
53 | quantity int unsigned DEFAULT NULL,
54 | price int unsigned DEFAULT NULL,
55 | PRIMARY KEY (oid),
56 | CONSTRAINT fk04 FOREIGN KEY (pid) REFERENCES product (pid) ON DELETE CASCADE,
57 | CONSTRAINT fk05 FOREIGN KEY (sid) REFERENCES seller (sid) ON DELETE CASCADE,
58 | CONSTRAINT fk06 FOREIGN KEY (uid) REFERENCES customer (uid) ON DELETE CASCADE
59 | );
60 |
61 | ALTER TABLE orders AUTO_INCREMENT=1000;
62 |
63 |
64 |
65 |
66 | DELIMITER //
67 |
68 | CREATE TRIGGER updatetime BEFORE INSERT ON orders FOR EACH ROW
69 | BEGIN
70 | SET NEW.orderdatetime = NOW();
71 | END//
72 |
73 | DELIMITER ;
74 |
75 |
76 |
77 | DELIMITER //
78 | CREATE TRIGGER inventorytrigger AFTER INSERT ON orders
79 | FOR EACH ROW
80 | begin
81 |
82 | DECLARE qnty int;
83 | DECLARE productid varchar(20);
84 |
85 | SELECT pid INTO productid
86 | FROM orders
87 | ORDER BY oid DESC
88 | LIMIT 1;
89 |
90 | SELECT quantity INTO qnty
91 | FROM orders
92 | ORDER BY oid DESC
93 | LIMIT 1;
94 |
95 | UPDATE inventory
96 | SET quantity=quantity-qnty
97 | WHERE pid=productid;
98 | END//
99 |
100 | DELIMITER ;
101 |
102 |
103 |
104 |
105 |
106 | DELIMITER //
107 |
108 | CREATE PROCEDURE getsellerorders(IN param1 VARCHAR(20))
109 | BEGIN
110 | SELECT * FROM orders where sid=param1;
111 | END //
112 |
113 | DELIMITER ;
114 |
115 |
116 |
117 | DELIMITER //
118 |
119 | CREATE PROCEDURE getorders
120 | (IN param1 VARCHAR(20))
121 | BEGIN
122 | SELECT * FROM orders WHERE uid=param1;
123 | END //
124 |
125 | DELIMITER ;
126 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/css/AddProduct.css:
--------------------------------------------------------------------------------
1 | body{
2 | margin: 0;
3 | padding: 0;
4 | font-family: sans-serif;
5 | background-image: url("b2g.png");
6 | background-repeat: no-repeat;
7 | }
8 | .main{
9 | margin: 0 auto;
10 | width: 100%;
11 | height: auto;
12 | }
13 | .topbar1{
14 | width: 100%;
15 | height: 4px;
16 | background-color: #fcc508;
17 | }
18 | .topbar2{
19 | width: 100%;
20 | height: 30px;
21 | background-color: #2a2b2c;
22 | }
23 | .container1{
24 | width: 1000px;
25 | height: 30px;
26 | background-color: transparent;
27 | margin: 0 auto;
28 | }
29 | .container2{
30 | width: 1000px;
31 | height: 30px;
32 | background-color: transparent;
33 | margin: 0 auto;
34 | }
35 | .logout-btn{
36 | width: 150px;
37 | height: 30px;
38 | float: right;
39 | }
40 | .logout-btn a{
41 | display: block;
42 | color: white;
43 | text-decoration: none;
44 | padding: 4px;
45 | }
46 | .header{
47 | width: 100%;
48 | height: 40px;
49 | float: left;
50 | background-color:#0ca1a6;
51 | box-shadow: 0 0, 0 6px 20px 0 rgba(0, 0, 0, .14);
52 | }
53 | .navbar{
54 | width: 700px;
55 | float: left;
56 | text-align: left;
57 | padding-top:10px;
58 | padding-bottom: 10px;
59 | }
60 | .navbar a{
61 | display: inline-block;
62 | color: black;
63 | text-decoration:none;
64 | padding: 0 10px;
65 | font-weight:bold;
66 | }
67 | .navbar a:hover{
68 | color: white;
69 | background-color: black;
70 | padding: 0 10px;
71 | }
72 |
73 | .active{
74 | width:1000px;
75 | min-height:688px;
76 | background-color: white;
77 | margin: 0 auto;
78 | padding: 0px 20px 0px 20px;
79 | }
80 | .filler{
81 | width:100%;
82 | height:50px;
83 | backgroud-color: transparent;
84 | }
85 | .filler2{
86 | width:100%;
87 | height:30px;
88 | backgroud-color: transparent;
89 | }
90 | .bigcard {
91 | width: 80%;
92 | padding: 0 10px 10px 10px;
93 | align: center;
94 | display: inline-block;
95 | border-radius:10px;
96 | }
97 | .bigcard1{
98 | float:left;
99 | }
100 | .bigcard2{
101 | float:right;
102 | }
103 |
104 | .bigcard1 input[type="text"],.bigcard1 input[type="date"]
105 | {
106 | position:relative;
107 | padding: 5px;
108 | box-shadow: 0px 2px 0px 0px rgba(0,0,0,0.2);
109 | border: 1px solid black;
110 | border-radius:5px;
111 | outline: none;
112 | color: black;
113 | height: 25px;
114 | background: White;
115 | font-size: 18px;
116 | text-align:left;
117 | }
118 |
119 | .bigcard2 p{
120 | padding:10px 0 10px 0;
121 | }
122 | .bigcard2 input[type="text"]{
123 | position: realtive;
124 | padding: 5px;
125 | box-shadow: 0px 2px 0px 0px rgba(0,0,0,0.2);
126 | border: 1px solid black;
127 | border-radius:5px;
128 | outline: none;
129 | color: black;
130 | height: 25px;
131 | background: White;
132 | font-size: 18px;
133 | text-align:left;
134 | }
135 | .bigcard2 input[type="submit"] {
136 | height: 35px;
137 | width: 220px;
138 | box-shadow: 0px 2px 2px 0px rgba(0,0,0,0.2);
139 | border-radius:5px;
140 | background-color: #0ca1a6;
141 | color: white;
142 | border:1px solid #0ca1a6;
143 | -webkit-transition-duration: 0.4s;
144 | transition-duration: 0.4s;
145 | }
146 |
147 | .bigcard2 input[type="submit"]:hover{
148 | background-color: #4CAF50;
149 | border:1px solid #4CAF50;
150 | color: white;
151 | }
152 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/AddInventory.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2 | pageEncoding="ISO-8859-1"%>
3 |
4 |
5 |
6 |
7 | ReStock
8 |
9 |
10 |
11 |
31 |
32 | <%@ page import="java.sql.*" %>
33 | <%@ page import="javax.sql.*" %>
34 | <%
35 | HttpSession httpSession = request.getSession();
36 | String guid=(String)httpSession.getAttribute("currentuser");
37 | %>
38 |
39 | <%
40 | int flag=0;
41 | ResultSet rs=null;
42 | PreparedStatement ps=null;
43 | java.sql.Connection conn=null;
44 | String query="select p.pid,i.quantity,p.pname,p.manufacturer,p.mfg,p.exp,p.price from product p,inventory i where p.pid=i.pid and i.sid=?";
45 | try{
46 | Class.forName("com.mysql.jdbc.Driver");
47 | conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/drugdatabase","root","1234");
48 | ps=conn.prepareStatement(query);
49 | ps.setString(1,guid);
50 | rs=ps.executeQuery();
51 | %>
52 |
53 |
54 | <%
55 | while(rs.next())
56 | {
57 | if(flag==4)
58 | {
59 | flag=1;
60 | %>
61 |
62 |
63 | <%
64 | }
65 | else
66 | flag++;
67 | %>
68 |
69 |
87 | <%
88 | }
89 | %>
90 |
91 |
92 | <%
93 | }
94 | catch(Exception e)
95 | {
96 | out.println("error: "+e);
97 | }
98 | finally {
99 | try { if (rs != null) rs.close(); } catch (Exception e) {};
100 | try { if (ps != null) ps.close(); } catch (Exception e) {};
101 | try { if (conn != null) conn.close(); } catch (Exception e) {};
102 | }
103 |
104 | %>
105 |
106 |
107 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/Buy.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2 | pageEncoding="ISO-8859-1"%>
3 |
4 |
5 |
6 |
7 | Buy
8 |
9 |
10 |
11 |
30 |
31 | <%@ page import="java.sql.*" %>
32 | <%@ page import="javax.sql.*" %>
33 | <%
34 | HttpSession httpSession = request.getSession();
35 | String uid=(String)httpSession.getAttribute("currentuser");
36 | %>
37 |
38 |
39 |
40 | <%
41 | int flag=0;
42 | ResultSet rs=null;
43 | PreparedStatement ps=null;
44 | java.sql.Connection conn=null;
45 | String query="select p.pname,p.pid,p.manufacturer,p.mfg,p.price,i.quantity from product p,inventory i where p.pid=i.pid";
46 |
47 | try{
48 | Class.forName("com.mysql.jdbc.Driver");
49 | conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/drugdatabase","root","1234");
50 | ps=conn.prepareStatement(query);
51 | rs=ps.executeQuery();
52 | %>
53 |
54 | <%
55 | while(rs.next())
56 | {
57 | if(flag==4)
58 | {
59 | flag=1;
60 | %>
<%
61 | }
62 | else
63 | flag++;
64 | %>
65 |
66 |
67 |
68 |

69 |
<%=rs.getString("pname") %>
70 |
ID: <%=rs.getString("pid") %>
71 |
Manufacturer: <%=rs.getString("manufacturer") %>
72 |
Mfg Date: <%=rs.getDate("mfg") %>
73 |
Stock: <%=rs.getInt("quantity") %>
74 |
Price: <%=rs.getInt("price") %>
75 | <%if (rs.getInt("quantity")>0)
76 | {
77 | %>
78 |
83 | <%
84 | }
85 | else
86 | {
87 | %>
88 |
89 |
90 | <%
91 | }
92 | %>
93 |
94 | <%
95 | }
96 | %>
97 |
98 | <%
99 | }
100 | catch(Exception e)
101 | {
102 | out.println("error: "+e);
103 | }
104 | finally {
105 | try { if (rs != null) rs.close(); } catch (Exception e) {};
106 | try { if (ps != null) ps.close(); } catch (Exception e) {};
107 | try { if (conn != null) conn.close(); } catch (Exception e) {};
108 | }
109 | %>
110 |
111 |
112 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/WebContent/css/Buy.css:
--------------------------------------------------------------------------------
1 | body{
2 | margin: 0;
3 | padding: 0;
4 | font-family: sans-serif;
5 | background: white;
6 | }
7 |
8 | .main{
9 | margin: 0 auto;
10 | width: 100%;
11 | height: auto;
12 | }
13 |
14 | .topbar1{
15 | width: 100%;
16 | height: 4px;
17 | background-color: #fcc508;
18 | }
19 |
20 | .topbar2{
21 | width: 100%;
22 | height: 30px;
23 | background-color: #2a2b2c;
24 | }
25 |
26 | .container1{
27 | width: 1000px;
28 | height: 30px;
29 | background-color: transparent;
30 | margin: 0 auto;
31 | }
32 |
33 | .container2{
34 | width: 1000px;
35 | height: 30px;
36 | background-color: transparent;
37 | margin: 0 auto;
38 | }
39 |
40 | .logout-btn{
41 | width: 150px;
42 | height: 30px;
43 | float: right;
44 | }
45 |
46 | .logout-btn a{
47 | display: block;
48 | color: white;
49 | text-decoration: none;
50 | padding: 4px;
51 | }
52 |
53 | .header{
54 | width: 100%;
55 | height: 40px;
56 | float: left;
57 | background-color: #0ca1a6;
58 | box-shadow: 0 0, 0 6px 20px 0 rgba(0, 0, 0, .14);
59 | }
60 |
61 | .navbar{
62 | width: 700px;
63 | float: left;
64 | text-align: left;
65 | padding-top:10px;
66 | padding-bottom: 10px;
67 | }
68 |
69 | .navbar a{
70 | display: inline-block;
71 | color: black;
72 | text-decoration:none;
73 | padding: 0 10px;
74 | font-weight:bold;
75 | }
76 |
77 | .navbar a:hover{
78 | color: white;
79 | background-color: black;
80 | padding: 0 10px;
81 | }
82 |
83 | .active{
84 | width:1000px;
85 | min-height:638px;
86 | background-color: white;
87 | margin: 0 auto;
88 | padding: 0px 20px 50px 20px;
89 | }
90 |
91 | .filler{
92 | width:100%;
93 | height:50px;
94 | backgroud-color: transparent;
95 | }
96 |
97 | .filler2{
98 | width:100%;
99 | height:30px;
100 | backgroud-color: transparent;
101 | }
102 |
103 | h2{
104 | text-align: center;
105 | padding: 10px 0 5px 0;
106 | }
107 |
108 | .column {
109 | float: left;
110 | width: 22%;
111 | padding: 0 10px;
112 | }
113 |
114 | .row {margin: 0 0;}
115 |
116 | .row:after {
117 | content: "";
118 | display: table;
119 | clear: both;
120 | }
121 |
122 | .card {
123 | box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
124 | max-width: 300px;
125 | margin: auto;
126 | text-align: center;
127 | font-family: sans-serif;
128 | background-color: rgba(0,0,0,0.1);
129 | }
130 |
131 | .card img{
132 | padding:0 17px 0 22px;
133 | background-color: white;
134 | }
135 |
136 | .card p{
137 | padding: 0;
138 | padding-bottom: 7px;
139 | margin:0;
140 | }
141 |
142 | .card input[type="number"]{
143 | border: 1px solid #808080;
144 | border-radius:3px;
145 | background-color: white;
146 | text-align: center;
147 | color:black;
148 | -webkit-appearance: none;
149 | }
150 |
151 | .card input[type=number]::-webkit-inner-spin-button,
152 | .card input[type=number]::-webkit-outer-spin-button {
153 | -webkit-appearance: none;
154 | }
155 |
156 | .card button {
157 | border: none;
158 | outline: 0;
159 | padding: 12px;
160 | color: white;
161 | background-color: #000;
162 | text-align: center;
163 | cursor: pointer;
164 | width: 100%;
165 | font-size: 18px;
166 | }
167 |
168 | .card button:hover {
169 | opacity: 0.7;
170 | }
171 |
172 | .card:hover{
173 | box-shadow: 0 6px 12px 0 rgba(0, 0, 0, 0.3);
174 | }
175 |
176 | @media screen and (max-width: 600px) {
177 | .column {
178 | width: 100%;
179 | display: inline-block;
180 | margin-bottom: 20px;
181 | }
182 | }
--------------------------------------------------------------------------------
/SQL.txt:
--------------------------------------------------------------------------------
1 | *Table Creation*
2 |
3 | CREATE SCHEMA drugdatabase;
4 |
5 | USE drugdatabase;
6 |
7 | CREATE TABLE customer (
8 | uid varchar(20) NOT NULL,
9 | pass varchar(20) DEFAULT NULL,
10 | fname varchar(15) DEFAULT NULL,
11 | lname varchar(15) DEFAULT NULL,
12 | email varchar(30) DEFAULT NULL,
13 | address varchar(128) DEFAULT NULL,
14 | phno bigint DEFAULT NULL,
15 | PRIMARY KEY (uid)
16 | );
17 |
18 | CREATE TABLE seller (
19 | sid varchar(15) NOT NULL,
20 | sname varchar(20) DEFAULT NULL,
21 | pass varchar(20) DEFAULT NULL,
22 | address varchar(128) DEFAULT NULL,
23 | phno bigint DEFAULT NULL,
24 | PRIMARY KEY (sid)
25 | );
26 |
27 | CREATE TABLE product (
28 | pid varchar(15) NOT NULL,
29 | pname varchar(20) DEFAULT NULL,
30 | manufacturer varchar(20) DEFAULT NULL,
31 | mfg date DEFAULT NULL,
32 | exp date DEFAULT NULL,
33 | price int DEFAULT NULL,
34 | PRIMARY KEY (pid),
35 | UNIQUE KEY pname (pname)
36 | );
37 |
38 | CREATE TABLE inventory (
39 | pid varchar(15) NOT NULL,
40 | pname varchar(20) DEFAULT NULL,
41 | quantity int unsigned DEFAULT NULL,
42 | sid varchar(15) NOT NULL,
43 | PRIMARY KEY (pid,sid),
44 | CONSTRAINT fk01 FOREIGN KEY (pid) REFERENCES product (pid) ON DELETE CASCADE,
45 | CONSTRAINT fk02 FOREIGN KEY (pname) REFERENCES product (pname) ON DELETE CASCADE,
46 | CONSTRAINT fk03 FOREIGN KEY (sid) REFERENCES seller (sid) ON DELETE CASCADE
47 | );
48 |
49 | CREATE TABLE orders (
50 | oid int NOT NULL AUTO_INCREMENT,
51 | pid varchar(15) DEFAULT NULL,
52 | sid varchar(15) DEFAULT NULL,
53 | uid varchar(15) DEFAULT NULL,
54 | orderdatetime datetime DEFAULT NULL,
55 | quantity int unsigned DEFAULT NULL,
56 | price int unsigned DEFAULT NULL,
57 | PRIMARY KEY (oid),
58 | CONSTRAINT fk04 FOREIGN KEY (pid) REFERENCES product (pid) ON DELETE CASCADE,
59 | CONSTRAINT fk05 FOREIGN KEY (sid) REFERENCES seller (sid) ON DELETE CASCADE,
60 | CONSTRAINT fk06 FOREIGN KEY (uid) REFERENCES customer (uid) ON DELETE CASCADE
61 | );
62 |
63 | ALTER TABLE orders AUTO_INCREMENT=1000;
64 |
65 | ----------------------------------------------------------------------------------------------------------------------------------------
66 | *Triggers*
67 |
68 |
69 | DELIMITER //
70 |
71 | CREATE TRIGGER updatetime BEFORE INSERT ON orders FOR EACH ROW
72 | BEGIN
73 | SET NEW.orderdatetime = NOW();
74 | END//
75 |
76 | DELIMITER ;
77 |
78 |
79 |
80 | DELIMITER //
81 | CREATE TRIGGER inventorytrigger AFTER INSERT ON orders
82 | FOR EACH ROW
83 | begin
84 |
85 | DECLARE qnty int;
86 | DECLARE productid varchar(20);
87 |
88 | SELECT pid INTO productid
89 | FROM orders
90 | ORDER BY oid DESC
91 | LIMIT 1;
92 |
93 | SELECT quantity INTO qnty
94 | FROM orders
95 | ORDER BY oid DESC
96 | LIMIT 1;
97 |
98 | UPDATE inventory
99 | SET quantity=quantity-qnty
100 | WHERE pid=productid;
101 | END//
102 |
103 | DELIMITER ;
104 |
105 |
106 | ----------------------------------------------------------------------------------------------------------------------------------------
107 | *Stored Procedures*
108 |
109 |
110 | DELIMITER //
111 |
112 | CREATE PROCEDURE getsellerorders(IN param1 VARCHAR(20))
113 | BEGIN
114 | SELECT * FROM orders where sid=param1;
115 | END //
116 |
117 | DELIMITER ;
118 |
119 |
120 |
121 | DELIMITER //
122 |
123 | CREATE PROCEDURE getorders
124 | (IN param1 VARCHAR(20))
125 | BEGIN
126 | SELECT * FROM orders WHERE uid=param1;
127 | END //
128 |
129 | DELIMITER ;
130 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/build.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Builds, tests, and runs the project Pharmacy-Drug-Mangement.
12 |
13 |
71 |
72 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/nbproject/project.properties:
--------------------------------------------------------------------------------
1 | annotation.processing.enabled=true
2 | annotation.processing.enabled.in.editor=true
3 | annotation.processing.processors.list=
4 | annotation.processing.run.all.processors=true
5 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
6 | build.classes.dir=${build.web.dir}/WEB-INF/classes
7 | build.classes.excludes=**/*.java,**/*.form
8 | build.dir=build
9 | build.generated.dir=${build.dir}/generated
10 | build.generated.sources.dir=${build.dir}/generated-sources
11 | build.test.classes.dir=${build.dir}/test/classes
12 | build.test.results.dir=${build.dir}/test/results
13 | build.web.dir=${build.dir}/web
14 | build.web.excludes=${build.classes.excludes}
15 | client.urlPart=
16 | compile.jsps=false
17 | conf.dir=conf
18 | debug.classpath=${build.classes.dir}:${javac.classpath}
19 | debug.test.classpath=\
20 | ${run.test.classpath}
21 | display.browser=true
22 | dist.dir=dist
23 | dist.ear.war=${dist.dir}/${war.ear.name}
24 | dist.javadoc.dir=${dist.dir}/javadoc
25 | dist.war=${dist.dir}/${war.name}
26 | endorsed.classpath=\
27 | ${libs.javaee-endorsed-api-6.0.classpath}
28 | excludes=
29 | file.reference.mysql-connector-java-5.1.23-bin.jar=C:\\Users\\msi\\Desktop\\jsp\\mysql-connector-java-5.1.23-bin.jar
30 | includes=**
31 | j2ee.compile.on.save=true
32 | j2ee.copy.static.files.on.save=true
33 | j2ee.deploy.on.save=true
34 | j2ee.platform=1.6-web
35 | j2ee.platform.classpath=${j2ee.server.home}/lib/annotations-api.jar:${j2ee.server.home}/lib/catalina-ant.jar:${j2ee.server.home}/lib/catalina-ha.jar:${j2ee.server.home}/lib/catalina-tribes.jar:${j2ee.server.home}/lib/catalina.jar:${j2ee.server.home}/lib/ecj-4.4.2.jar:${j2ee.server.home}/lib/el-api.jar:${j2ee.server.home}/lib/jasper-el.jar:${j2ee.server.home}/lib/jasper.jar:${j2ee.server.home}/lib/jsp-api.jar:${j2ee.server.home}/lib/servlet-api.jar:${j2ee.server.home}/lib/tomcat-api.jar:${j2ee.server.home}/lib/tomcat-coyote.jar:${j2ee.server.home}/lib/tomcat-dbcp.jar:${j2ee.server.home}/lib/tomcat-i18n-es.jar:${j2ee.server.home}/lib/tomcat-i18n-fr.jar:${j2ee.server.home}/lib/tomcat-i18n-ja.jar:${j2ee.server.home}/lib/tomcat-i18n-ru.jar:${j2ee.server.home}/lib/tomcat-jdbc.jar:${j2ee.server.home}/lib/tomcat-util.jar:${j2ee.server.home}/lib/tomcat7-websocket.jar:${j2ee.server.home}/lib/websocket-api.jar
36 | j2ee.server.type=Tomcat
37 | jar.compress=false
38 | java.source.based=true
39 | javac.classpath=\
40 | ${file.reference.mysql-connector-java-5.1.23-bin.jar}
41 | # Space-separated list of extra javac options
42 | javac.compilerargs=
43 | javac.debug=true
44 | javac.deprecation=false
45 | javac.processorpath=\
46 | ${javac.classpath}
47 | javac.source=1.8
48 | javac.target=1.8
49 | javac.test.classpath=\
50 | ${javac.classpath}:\
51 | ${build.classes.dir}
52 | javac.test.processorpath=\
53 | ${javac.test.classpath}
54 | javadoc.additionalparam=
55 | javadoc.author=false
56 | javadoc.encoding=${source.encoding}
57 | javadoc.noindex=false
58 | javadoc.nonavbar=false
59 | javadoc.notree=false
60 | javadoc.preview=true
61 | javadoc.private=false
62 | javadoc.splitindex=true
63 | javadoc.use=true
64 | javadoc.version=false
65 | javadoc.windowtitle=
66 | persistence.xml.dir=${conf.dir}
67 | platform.active=default_platform
68 | resource.dir=setup
69 | run.test.classpath=\
70 | ${javac.test.classpath}:\
71 | ${build.test.classes.dir}
72 | # Space-separated list of JVM arguments used when running a class with a main method or a unit test
73 | # (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value):
74 | runmain.jvmargs=
75 | source.encoding=UTF-8
76 | source.root=.
77 | test.src.dir=
78 | war.content.additional=
79 | war.ear.name=${war.name}
80 | war.name=Pharmacy-Drug-Mangement.war
81 | web.docbase.dir=WebContent
82 | webinf.dir=WebContent/WEB-INF
83 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/nbproject/ant-deploy.xml:
--------------------------------------------------------------------------------
1 |
2 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/Pharmacy-Drug-Mangement/nbproject/build-impl.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 | Must set build.dir
234 | Must set build.web.dir
235 | Must set build.generated.dir
236 | Must set dist.dir
237 | Must set build.classes.dir
238 | Must set dist.javadoc.dir
239 | Must set build.test.classes.dir
240 | Must set build.test.results.dir
241 | Must set build.classes.excludes
242 | Must set dist.war
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 | The Java EE server classpath is not correctly set up - server home directory is missing.
253 | Either open the project in the IDE and assign the server or setup the server classpath manually.
254 | For example like this:
255 | ant -Dj2ee.server.home=<app_server_installation_directory>
256 |
257 |
258 | The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}.
259 | Either open the project in the IDE and assign the server or setup the server classpath manually.
260 | For example like this:
261 | ant -Duser.properties.file=<path_to_property_file> (where you put the property "j2ee.platform.classpath" in a .properties file)
262 | or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties file is used)
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 | Must set javac.includes
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 | No tests executed.
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 | The libs.CopyLibs.classpath property is not set up.
783 | This property must point to
784 | org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part
785 | of NetBeans IDE installation and is usually located at
786 | <netbeans_installation>/java<version>/ant/extra folder.
787 | Either open the project in the IDE and make sure CopyLibs library
788 | exists or setup the property manually. For example like this:
789 | ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar
790 |
791 |
792 |
793 |
794 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 |
804 |
805 |
806 |
807 |
808 |
809 |
810 |
811 |
812 |
813 |
814 |
815 |
816 |
819 |
820 |
821 |
822 |
823 |
824 |
825 |
826 |
827 |
828 |
829 | Must set JVM to use for profiling in profiler.info.jvm
830 | Must set profiler agent JVM arguments in profiler.info.jvmargs.agent
831 |
832 |
835 |
836 |
839 |
840 |
841 |
842 |
843 |
844 |
845 |
846 |
847 |
848 |
849 |
850 |
851 |
852 |
853 |
854 |
855 |
856 |
857 |
858 |
859 |
860 |
861 |
862 |
863 |
864 |
865 |
866 |
867 |
868 |
869 |
870 |
871 |
872 |
873 |
874 |
875 |
876 |
877 |
878 |
879 |
880 |
881 |
882 |
883 | Must select some files in the IDE or set javac.includes
884 |
885 |
886 |
887 |
888 |
889 |
890 |
891 |
892 |
893 |
894 |
895 |
896 |
897 |
898 |
899 |
900 |
901 |
902 |
903 |
904 |
905 |
906 |
907 |
908 |
909 |
910 |
911 |
912 |
913 |
914 | Must select some files in the IDE or set javac.jsp.includes
915 |
916 |
917 |
918 |
919 |
920 |
921 |
922 |
923 |
924 |
925 |
926 |
927 |
928 |
929 |
930 |
931 |
932 |
933 |
934 |
935 |
936 |
937 |
938 |
939 |
940 | Must select a file in the IDE or set jsp.includes
941 |
942 |
943 |
946 |
947 |
948 |
949 |
950 |
951 |
952 |
953 |
954 |
955 |
956 |
957 |
958 |
959 |
960 |
961 |
962 |
963 |
964 |
965 |
966 |
967 |
968 |
969 |
970 |
971 |
972 |
973 |
974 |
975 |
976 |
977 |
978 |
979 |
980 |
981 |
982 |
983 |
984 |
985 |
986 |
987 |
988 |
989 |
990 |
991 |
992 |
993 |
994 |
995 |
996 |
997 |
998 |
999 |
1000 |
1001 |
1002 |
1003 |
1006 |
1007 |
1008 |
1009 |
1010 |
1011 |
1012 |
1013 |
1014 |
1015 |
1016 |
1017 |
1018 |
1019 |
1020 |
1021 |
1022 |
1023 |
1024 |
1025 |
1026 |
1027 |
1028 |
1029 |
1030 |
1031 |
1032 |
1033 |
1034 |
1035 |
1036 |
1037 |
1038 |
1039 |
1040 |
1041 |
1042 |
1043 |
1044 |
1045 |
1046 |
1047 |
1048 |
1049 |
1050 |
1051 |
1052 |
1053 |
1054 |
1055 |
1056 |
1057 |
1058 |
1059 |
1060 |
1061 |
1062 |
1063 |
1064 |
1065 |
1066 |
1067 |
1068 |
1069 |
1070 |
1071 |
1072 |
1073 |
1074 |
1075 |
1076 |
1077 |
1078 |
1079 |
1080 |
1081 |
1082 |
1083 |
1084 |
1085 |
1086 |
1087 |
1088 |
1089 |
1090 |
1091 |
1092 |
1093 |
1094 |
1095 |
1096 |
1097 |
1098 |
1099 |
1100 |
1101 |
1102 |
1103 |
1104 |
1105 |
1106 |
1107 |
1108 |
1109 |
1110 | Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable.
1111 |
1112 |
1113 | Launching ${browse.url}
1114 |
1115 |
1116 |
1117 |
1118 |
1119 | Must select one file in the IDE or set run.class
1120 |
1121 |
1122 |
1123 | Must select one file in the IDE or set run.class
1124 |
1125 |
1126 |
1127 |
1128 |
1129 |
1132 |
1133 |
1134 |
1135 |
1136 |
1137 |
1138 |
1139 |
1140 |
1141 |
1142 |
1143 |
1144 |
1145 |
1146 |
1147 |
1148 |
1149 |
1150 |
1151 |
1152 |
1153 |
1154 |
1155 |
1156 |
1157 |
1158 |
1159 |
1160 |
1161 |
1162 |
1163 | Must select one file in the IDE or set debug.class
1164 |
1165 |
1166 |
1167 |
1168 |
1169 |
1170 |
1171 |
1172 |
1173 |
1174 |
1175 | Must select one file in the IDE or set debug.class
1176 |
1177 |
1178 |
1179 |
1180 | Must set fix.includes
1181 |
1182 |
1183 |
1184 |
1185 |
1186 |
1187 |
1192 |
1195 |
1196 |
1197 |
1198 |
1199 |
1200 |
1201 |
1202 |
1203 |
1204 |
1205 |
1206 |
1207 |
1208 |
1209 |
1210 |
1211 |
1212 |
1213 |
1214 |
1215 |
1216 |
1217 | This target only works when run from inside the NetBeans IDE.
1218 |
1219 |
1220 |
1221 |
1222 |
1223 |
1224 |
1225 |
1226 |
1227 |
1228 |
1229 |
1230 |
1231 |
1232 |
1233 |
1234 |
1235 |
1236 |
1237 |
1238 |
1239 |
1240 |
1241 |
1242 |
1243 |
1244 |
1245 |
1246 |
1247 |
1248 |
1249 |
1250 |
1251 |
1252 |
1253 |
1254 |
1255 |
1256 |
1257 |
1258 |
1259 |
1260 |
1261 |
1262 |
1263 |
1264 |
1265 |
1266 |
1267 |
1268 |
1271 |
1272 |
1273 |
1274 |
1275 |
1276 |
1277 |
1278 |
1279 |
1280 |
1281 |
1282 |
1283 |
1284 |
1285 |
1286 |
1287 |
1288 |
1289 |
1290 |
1291 |
1295 |
1296 |
1297 |
1298 |
1299 |
1300 |
1301 |
1302 |
1303 |
1304 |
1305 |
1306 |
1307 |
1308 |
1309 |
1310 |
1311 |
1312 |
1313 |
1314 |
1315 |
1316 |
1317 | Must select some files in the IDE or set javac.includes
1318 |
1319 |
1320 |
1321 |
1322 |
1323 |
1324 |
1325 |
1326 |
1330 |
1331 |
1332 |
1333 |
1334 |
1335 |
1336 |
1337 | Some tests failed; see details above.
1338 |
1339 |
1340 |
1341 |
1342 |
1343 |
1344 |
1345 |
1346 | Must select some files in the IDE or set test.includes
1347 |
1348 |
1349 |
1350 | Some tests failed; see details above.
1351 |
1352 |
1353 |
1354 | Must select some files in the IDE or set test.class
1355 | Must select some method in the IDE or set test.method
1356 |
1357 |
1358 |
1359 | Some tests failed; see details above.
1360 |
1361 |
1362 |
1366 |
1367 | Must select one file in the IDE or set test.class
1368 |
1369 |
1370 |
1371 | Must select one file in the IDE or set test.class
1372 | Must select some method in the IDE or set test.method
1373 |
1374 |
1375 |
1376 |
1377 |
1378 |
1379 |
1380 |
1381 |
1382 |
1383 |
1384 |
1388 |
1389 |
1390 |
1391 |
1392 |
1393 |
1394 |
1395 |
1396 |
1397 |
1398 |
1399 |
1400 |
1401 |
1402 |
1403 |
1404 |
1405 |
1406 |
1407 |
1408 |
1409 |
1410 |
1411 |
1412 |
1413 |
1414 |
1415 |
--------------------------------------------------------------------------------