diff --git a/The Mavericks_SY_59/README.md b/The Mavericks_SY_59/README.md new file mode 100644 index 0000000..fec7d10 --- /dev/null +++ b/The Mavericks_SY_59/README.md @@ -0,0 +1,13 @@ +Theme : Digital Society + +Topic : Parking Allotment System + +Details : This project is trying to digitalize the Parking Allotment System in Shopping complexes, Airports, etc. In Our Application User needs to enter the Vehicle number and phone and the nearest empty parking space is shown along with the path to reach there is available which will reduce the manpower working in the parking areas. Also, giving feature of Calculation of bill Amount for a vehicle while exiting and viewing the status of all levels of parking to admin. + +Video link: https://drive.google.com/file/d/19Fh9MCOMe-FGKd-XdcBUaDEJP2WYPiSh/view?usp=share_link + +Report link : https://drive.google.com/drive/folders/1dLtF9dUBP0TCshhAGIxuUeiH_l82CzZh?usp=share_link + +Team Members: + 1) Name :Nandini Wani,Year :SY,Branch: Comp + 2) Name :Sonia Dessai,Year :SY,Branch: Comp diff --git a/The Mavericks_SY_59/src/main/java/com/buffer/DataImport.java b/The Mavericks_SY_59/src/main/java/com/buffer/DataImport.java new file mode 100644 index 0000000..a5e9bc1 --- /dev/null +++ b/The Mavericks_SY_59/src/main/java/com/buffer/DataImport.java @@ -0,0 +1,129 @@ +package com.buffer; + +import java.beans.Statement; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.time.LocalDate; +import java.time.LocalTime; +import java.util.Arrays; +import java.util.Scanner; + +class DataImport { +//inserting data + static final String JDBC_DRIVER = "com.mysql.jdbc.Driver"; + static final String DB_URL="jdbc:mysql://localhost/vozilopark"; + static final String user="root"; + static final String pass="DarkLord@05"; + public Connection con; + DataImport(){ + try { + System.out.println("Checking for driver"); + Class.forName(JDBC_DRIVER); + System.out.println("Driver ok"); + System.out.println("Connecting database"); + con=DriverManager.getConnection(DB_URL,user,pass); + System.out.println("Connected"); + } + catch(ClassNotFoundException e) { + System.out.println("Class Not Found"); + } + catch(SQLException se) { + System.out.println("SQL Exception"); + } + } + + public void insertdata(Connection xyz,Method abc,Heap bcd) throws SQLException { + PreparedStatement pstmt=null; + String query,query1; + query="select * from parking"; + pstmt=xyz.prepareStatement(query); + ResultSet rs1=pstmt.executeQuery(query); + while(rs1.next()) { + String no=rs1.getString("parkingno"); + int f=rs1.getInt("fill"); + Parking newnode=abc.search(no); + if(f==1) { + newnode.fill=true; + abc.Put(no,newnode); + query1="select * from vehicle where parkingno = '"+no+"'"; + PreparedStatement x=xyz.prepareStatement(query1); + ResultSet rs2=x.executeQuery(query1); + Vehicle newnode1=new Vehicle(); + while(rs2.next()) { + newnode1.Vehicle_No=rs2.getString("Vehicleno"); + newnode1.Phone_No=rs2.getString("phoneno"); + newnode1.ParkingNo=rs2.getString("parkingno"); + LocalDate localDate = rs2.getDate("EntryDate").toLocalDate(); + newnode1.Date=localDate; + CharSequence s1=rs2.getString("Entrytime"); + LocalTime localtime=LocalTime.parse(s1); + newnode1.Entry=localtime; + abc.entry(no, newnode1); + } + } + else { + bcd.insert(newnode); + + } + } + + } + + public long delete(Connection xyz,Method abc,Heap bcd,String number) throws SQLException { + System.out.println("Delete Executed"); + PreparedStatement pstmt=null; + String query,query1; + bcd.insert(abc.search(number)); + Vehicle car=abc.exit(number); + car.exit(); + long a=car.payment(); + query="delete from vehicle where parkingno=?"; + pstmt=xyz.prepareStatement(query); + pstmt.setString(1,number); + pstmt.executeUpdate(); + query1="update parking set fill=0 where parkingno=?"; + pstmt=xyz.prepareStatement(query1); + pstmt.setString(1,number); + pstmt.executeUpdate(); + for(int i = 0; i < 48; i ++) { + if(MainServlet.h.heap[i] != null)System.out.println(MainServlet.h.heap[i].parkingNo); + } + return a; + } + + public String getnearest(Connection xyz,Method abc,Heap bcd,String vehno,String phnum) throws SQLException { + + //heap + Parking allocted=bcd.heap[1]; + String s2=allocted.parkingNo; + + + Vehicle cust=new Vehicle(); + cust.userdetails(allocted.parkingNo,vehno,phnum); + abc.Put(allocted.parkingNo, allocted); + abc.entry(allocted.parkingNo,cust); + bcd.delete(); + + PreparedStatement pstmt=null; + String query; + query="insert into vehicle values( '"+cust.Vehicle_No+"','"+cust.ParkingNo+"','" + +cust.Phone_No+"','"+cust.Date.toString()+"','"+cust.Entry.toString()+"')"; + pstmt=xyz.prepareStatement(query); + pstmt.executeUpdate(); + + String query1="update parking set fill=1 where parkingno= '"+s2+"'"; + pstmt=xyz.prepareStatement(query1); + pstmt.executeUpdate(); + + return s2; + } + +} + + + + + diff --git a/The Mavericks_SY_59/src/main/java/com/buffer/ExitServlet.java b/The Mavericks_SY_59/src/main/java/com/buffer/ExitServlet.java new file mode 100644 index 0000000..e9f52f7 --- /dev/null +++ b/The Mavericks_SY_59/src/main/java/com/buffer/ExitServlet.java @@ -0,0 +1,50 @@ +package com.buffer; + +import java.io.IOException; +import java.sql.SQLException; + +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletException; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +/** + * Servlet implementation class ExitServlet + */ +@WebServlet("/ExitServlet") +public class ExitServlet extends HttpServlet { + private static final long serialVersionUID = 1L; + + /** + * Default constructor. + */ +public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + +// DataImport dm = new DataImport(); +// Method vozilopark=new Method(); +// Heap h=new Heap(48); + long amount = 0; + String vehicleNo = request.getParameter("exitvehicle"); + System.out.println(vehicleNo); +// try { +// MainServlet.dm.insertdata(MainServlet.dm.con,MainServlet.vozilopark,MainServlet.h); +// } catch (SQLException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } + try { + amount = MainServlet.dm.delete(MainServlet.dm.con,MainServlet.vozilopark ,MainServlet.h,vehicleNo); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + request.setAttribute("amount", amount); + RequestDispatcher rd = request.getRequestDispatcher("/bill.jsp"); + rd.forward(request, response); + + } +} diff --git a/The Mavericks_SY_59/src/main/java/com/buffer/Hashtable.java b/The Mavericks_SY_59/src/main/java/com/buffer/Hashtable.java new file mode 100644 index 0000000..1076419 --- /dev/null +++ b/The Mavericks_SY_59/src/main/java/com/buffer/Hashtable.java @@ -0,0 +1,249 @@ +package com.buffer; + +import java.util.Scanner; + + + +public class Hashtable { + + Parking[] Floor1=new Parking[16]; + + Parking[] Floor2=new Parking[16]; + + Parking[] Floor3=new Parking[16]; + + Parking[] Parking_Lot[]= {Floor1,Floor2,Floor3}; + + + + long generateHeapKey(String parkingID) { + + + + long ans = 0; + + ans += Integer.parseInt(parkingID.substring(0, 1)); + + String c = parkingID.substring(1,2); + + ans *= 10; + + + + if(c.equals("B")){ + + ans += 2; + + } + + + + else if(c.equals("R" )||c.equals("L" )) { + + ans += 1; + + } + + + + String s = parkingID.substring(2); + + ans *= Math.pow(10, s.length()); + + ans += Integer.parseInt(s); + + + + return ans; + + + + } + + + + Hashtable() + + { + + + + for(int i=0;i<3;i++) + + { + + for(int j=0;j<16;j++) + + { + + + + if(j<6) { + + Parking newnode=new Parking(Integer.toString(i+1)+"R"+Integer.toString(j+1)); + + Parking_Lot[i][j]=newnode; + + Parking_Lot[i][j].heapKey=generateHeapKey(Integer.toString(i+1)+"R"+Integer.toString(j+1)); + + } + + else if(j<=10 && j>=6) { + + Parking newnode=new Parking(Integer.toString(i+1)+"L"+Integer.toString(j-5)); + + Parking_Lot[i][j]=newnode; + + Parking_Lot[i][j].heapKey=generateHeapKey(Integer.toString(i+1)+"L"+Integer.toString(j-5)); + + } + + else { + + + + Parking newnode=new Parking(Integer.toString(i+1)+"B"+Integer.toString(j-10)); + + Parking_Lot[i][j]=newnode; + + Parking_Lot[i][j].heapKey=generateHeapKey(Integer.toString(i+1)+"B"+Integer.toString(j-10)); + + } + + } + + } + + + + }} + + + +class Method{ + + Scanner input=new Scanner(System.in); + + + + Hashtable node=new Hashtable(); + + + + int outerHashkey(String key){ + + int key1; + + String Str=key.substring(0,1); + + key1=Integer.parseInt(Str); + + return key1-1; + + } + + + + int Innerhashkey(String Key) { + + int key1; + + String str =Key.substring(1,2); + + String Str1=Key.substring(2,3); + + int a=Integer.parseInt(Str1); + + if(str.equals("R")) { + + return a-1; + + } + + else if(str.equals("L")) { + + return a+5; + + } + + else { + + return a+10; + + } + + } + + + + void Put(String Key,Parking Node){ + + int i=outerHashkey(Key); + + int j=Innerhashkey(Key); + + node.Parking_Lot[i][j]=Node; + + } + + + + Parking search(String Key){ + + int i=outerHashkey(Key); + + int j=Innerhashkey(Key); + + return node.Parking_Lot[i][j]; + + } + + + + Vehicle exit(String Key){ + + int i=outerHashkey(Key); + int j=Innerhashkey(Key); + Vehicle newnode=new Vehicle(); + Vehicle x=node.Parking_Lot[i][j].User; + node.Parking_Lot[i][j].User=newnode; + node.Parking_Lot[i][j].fill=false; + return x; + + } + + + + void entry(String Key,Vehicle newnode){ + + int i=outerHashkey(Key); + + int j=Innerhashkey(Key); + + node.Parking_Lot[i][j].User=newnode; + + node.Parking_Lot[i][j].fill=true; + + } + + + + boolean notfill(Parking newnode) { + + if(newnode.fill==false) { + + return true; + + } + + else { + + return false; + + } + + }} + + + + diff --git a/The Mavericks_SY_59/src/main/java/com/buffer/Heap.java b/The Mavericks_SY_59/src/main/java/com/buffer/Heap.java new file mode 100644 index 0000000..80734f9 --- /dev/null +++ b/The Mavericks_SY_59/src/main/java/com/buffer/Heap.java @@ -0,0 +1,181 @@ +package com.buffer; + +public class Heap { + + + +Parking heap[]; + +int lastIndexEntered; + + + +Heap(int size){ + +heap = new Parking[size+1]; + +lastIndexEntered = 0; + +heap[0] = new Parking("00"); + +heap[0].heapKey =Integer.MIN_VALUE; + +} + + + +boolean isFull() { + + + +if(lastIndexEntered == heap.length-1) return true; + +return false; + + + +} + + + +boolean isEmpty() { + + + +if(lastIndexEntered == 0) return true; + +return false; + + + +} + + + +void heapifyBottomToTop(int index) { + + + + if(heap[index].heapKey < heap[index/2].heapKey) { + + Parking temp = heap[index]; + + heap[index] = heap[index/2]; + + heap[index/2] = temp; + + heapifyBottomToTop(index/2); + + } + + + +} + + + +void heapifyTopToBottom(int index) { + + + + int left = index * 2, right = index * 2 + 1; + + + + if(left > lastIndexEntered) { + + + + return; + + + + } + + + + if(heap[left].heapKey < heap[right].heapKey && heap[left].heapKey < heap[index].heapKey) { + + + + Parking temp = heap[left]; + + heap[left]=heap[index]; + + heap[index]=temp; + + heapifyTopToBottom(left); + + + + } + + else{ + + + + Parking temp=heap[right]; + + heap[right]=heap[index]; + + heap[index]=temp; + + heapifyTopToBottom(right); + + + + } + + + +} + + + + + +void insert(Parking val) { + + + +if(!isFull()) { + +heap[++lastIndexEntered]=val; + +heapifyBottomToTop(lastIndexEntered); + +} + +System.out.println("Insert done"); +System.out.println(heap[1].heapKey); +System.out.println(heap[1].parkingNo); + + +} + + + +void delete() { + + + +if(!isEmpty()) { + + + +heap[1]=heap[lastIndexEntered]; + +lastIndexEntered--; + +heapifyTopToBottom(1); + + + +} + + + +} +} + + diff --git a/The Mavericks_SY_59/src/main/java/com/buffer/Level1Servlet.java b/The Mavericks_SY_59/src/main/java/com/buffer/Level1Servlet.java new file mode 100644 index 0000000..326fa06 --- /dev/null +++ b/The Mavericks_SY_59/src/main/java/com/buffer/Level1Servlet.java @@ -0,0 +1,46 @@ +package com.buffer; + +import java.io.IOException; + +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletException; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +/** + * Servlet implementation class Level1Servlet + */ +@WebServlet("/Level1Servlet") +public class Level1Servlet extends HttpServlet { + private static final long serialVersionUID = 1L; + + /** + * Default constructor. + */ + public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + Hashtable hash = MainServlet.vozilopark.node; + + String s = ""; + + for(int i = 0; i<16; i++) { + if(hash.Floor1[i].fill) { + s += "1"; + } + else { + s += "0"; + } + } + + int name = 3; + //String s = "1110010000110101"; + + request.setAttribute("label", name); + request.setAttribute("ele", s); + RequestDispatcher rd = request.getRequestDispatcher("/level1.jsp"); + rd.forward(request, response); + + } +} diff --git a/The Mavericks_SY_59/src/main/java/com/buffer/Level2Servlet.java b/The Mavericks_SY_59/src/main/java/com/buffer/Level2Servlet.java new file mode 100644 index 0000000..ba5eb1a --- /dev/null +++ b/The Mavericks_SY_59/src/main/java/com/buffer/Level2Servlet.java @@ -0,0 +1,46 @@ +package com.buffer; + +import java.io.IOException; + +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletException; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +/** + * Servlet implementation class Level2Servlet + */ +@WebServlet("/Level2Servlet") +public class Level2Servlet extends HttpServlet { + private static final long serialVersionUID = 1L; + + /** + * Default constructor. + */ + public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + +Hashtable hash = MainServlet.vozilopark.node; + + String s = ""; + + for(int i = 0; i<16; i++) { + if(hash.Floor2[i].fill) { + s += "1"; + } + else { + s += "0"; + } + } + + int name = 3; + //String s = "1110010110110101"; + + request.setAttribute("label", name); + request.setAttribute("ele", s); + RequestDispatcher rd = request.getRequestDispatcher("/level2.jsp"); + rd.forward(request, response); + + } +} diff --git a/The Mavericks_SY_59/src/main/java/com/buffer/Level3Servlet.java b/The Mavericks_SY_59/src/main/java/com/buffer/Level3Servlet.java new file mode 100644 index 0000000..ab74bd6 --- /dev/null +++ b/The Mavericks_SY_59/src/main/java/com/buffer/Level3Servlet.java @@ -0,0 +1,43 @@ +package com.buffer; + +import java.io.IOException; + +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletException; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +/** + * Servlet implementation class Level3Servlet + */ +@WebServlet("/Level3Servlet") +public class Level3Servlet extends HttpServlet { + private static final long serialVersionUID = 1L; + + public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + Hashtable hash = MainServlet.vozilopark.node; + + String s = ""; + + for(int i = 0; i<16; i++) { + if(hash.Floor3[i].fill) { + s += "1"; + } + else { + s += "0"; + } + } + + int name = 3; + //String s = "1110000000110101"; + + request.setAttribute("label", name); + request.setAttribute("ele", s); + RequestDispatcher rd = request.getRequestDispatcher("/level3.jsp"); + rd.forward(request, response); + + } +} diff --git a/The Mavericks_SY_59/src/main/java/com/buffer/MainServlet.java b/The Mavericks_SY_59/src/main/java/com/buffer/MainServlet.java new file mode 100644 index 0000000..3593a54 --- /dev/null +++ b/The Mavericks_SY_59/src/main/java/com/buffer/MainServlet.java @@ -0,0 +1,38 @@ +package com.buffer; + +import java.io.IOException; +import java.sql.SQLException; + +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletException; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +/** + * Servlet implementation class MainServlet + */ +@WebServlet("/MainServlet") +public class MainServlet extends HttpServlet { + private static final long serialVersionUID = 1L; + + public static DataImport dm = new DataImport(); + public static Heap h = new Heap(48); + public static Method vozilopark = new Method(); + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + //DataImport dm = new DataImport(); + //Method vozilopark=new Method(); + //Heap h=new Heap(48); + try { + dm.insertdata(dm.con,vozilopark,h); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + RequestDispatcher rd = request.getRequestDispatcher("main.jsp"); + rd.forward(request, response); + } + +} diff --git a/The Mavericks_SY_59/src/main/java/com/buffer/Parking.java b/The Mavericks_SY_59/src/main/java/com/buffer/Parking.java new file mode 100644 index 0000000..86f1db1 --- /dev/null +++ b/The Mavericks_SY_59/src/main/java/com/buffer/Parking.java @@ -0,0 +1,52 @@ +package com.buffer; + +public class Parking { + + + + String parkingNo; + + + + boolean fill; + + + + long heapKey; + + + + Vehicle User; + + + + public Parking(String parkingNo){ + + + + this.parkingNo = parkingNo; + + + + fill = false; + + + + heapKey = -1; + + + + User=null; + + + + } + + + + + + + +} + diff --git a/The Mavericks_SY_59/src/main/java/com/buffer/ParkingServlet.java b/The Mavericks_SY_59/src/main/java/com/buffer/ParkingServlet.java new file mode 100644 index 0000000..2d6a874 --- /dev/null +++ b/The Mavericks_SY_59/src/main/java/com/buffer/ParkingServlet.java @@ -0,0 +1,74 @@ +package com.buffer; + +import java.io.IOException; +import java.sql.SQLException; + +import org.apache.catalina.Globals; + +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletException; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +@SuppressWarnings("serial") +@WebServlet("/ParkingServlet") +public class ParkingServlet extends HttpServlet{ + + public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + +// DataImport dm = new DataImport(); +// Method vozilopark=new Method(); +// Heap h=new Heap(48); +// try { +// MainServlet.dm.insertdata(MainServlet.dm.con,MainServlet.vozilopark,MainServlet.h); +// } catch (SQLException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } + + String vehicleNo = (String) request.getAttribute("vehicleNo"); + String phoneNo = (String) request.getAttribute("phoneNo"); + + String s1 = null; + + try { + s1 = MainServlet.dm.getnearest(MainServlet.dm.con,MainServlet.vozilopark,MainServlet.h, vehicleNo, phoneNo); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + System.out.println(s1); + + int floor = Integer.parseInt(s1.substring(0,1)); + String s = s1.substring(1); + if(s.charAt(0) != 'B') { + int width = 100 - (6 - Integer.parseInt(s.substring(1))) * 15; + String road = "
"; + request.setAttribute("road", road); + String empBox = ""; + request.setAttribute("emp-park", empBox); + String bottom_road = "
"; + request.setAttribute("bottom-road", bottom_road); + } + else { + int width = 15 * (Integer.parseInt(s.substring(1)) + 1); + String road = "
"; + request.setAttribute("road", road); + String empBox = ""; + request.setAttribute("emp-park", empBox); + String bottom_road = "
"; + request.setAttribute("bottom-road", bottom_road); + } + + + request.setAttribute("label", floor); + request.setAttribute("ele", s); + RequestDispatcher rd = request.getRequestDispatcher("parking.jsp"); + rd.forward(request, response); + + } + +} diff --git a/The Mavericks_SY_59/src/main/java/com/buffer/Vehicle.java b/The Mavericks_SY_59/src/main/java/com/buffer/Vehicle.java new file mode 100644 index 0000000..af9911b --- /dev/null +++ b/The Mavericks_SY_59/src/main/java/com/buffer/Vehicle.java @@ -0,0 +1,58 @@ +package com.buffer; + +import java.time.LocalDate; +import java.time.LocalTime; +import java.util.Scanner; +import java.time.temporal.ChronoUnit; +public class Vehicle { + + String Vehicle_No; + String Phone_No; + LocalTime Entry; + LocalTime Exit; + LocalDate Date; + String ParkingNo; + +Vehicle(){ +Vehicle_No=null; +Phone_No=null; +Entry=null; +Exit=null; +Date=null; +ParkingNo=null; + +} + +void userdetails(String number,String vno,String pno) { + +Vehicle_No=vno; + +Phone_No=pno; + +Entry=LocalTime.now(); + +Date=LocalDate.now(); + +ParkingNo=number; + +} + +void exit() { +Exit=LocalTime.now(); +} + +long payment() { + long hours = ChronoUnit.HOURS.between(Entry, Exit); + System.out.println(hours); + if(hours<=2) { + return 30; + } + else { + long cal=hours-2; + return 30+cal*20; + } +} + + +} + diff --git a/The Mavericks_SY_59/src/main/java/com/buffer/VehicleServlet.java b/The Mavericks_SY_59/src/main/java/com/buffer/VehicleServlet.java new file mode 100644 index 0000000..dd792ec --- /dev/null +++ b/The Mavericks_SY_59/src/main/java/com/buffer/VehicleServlet.java @@ -0,0 +1,36 @@ +package com.buffer; + +import java.io.IOException; + +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletException; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +/** + * Servlet implementation class VehicleServlet + */ +@WebServlet("/VehicleServlet") +public class VehicleServlet extends HttpServlet { + private static final long serialVersionUID = 1L; + + + protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + + String vehicleNo = request.getParameter("vehicle"); + String phoneNo = request.getParameter("phone"); + +// System.out.println(vehicleNo); +// System.out.println(phoneNo); + + request.setAttribute("vehicleNo", vehicleNo); + request.setAttribute("phoneNo", phoneNo); + + RequestDispatcher rd = request.getRequestDispatcher("/ParkingServlet"); + rd.forward(request, response); + } + +} diff --git a/The Mavericks_SY_59/src/main/webapp/META-INF/MANIFEST.MF b/The Mavericks_SY_59/src/main/webapp/META-INF/MANIFEST.MF new file mode 100644 index 0000000..5e94951 --- /dev/null +++ b/The Mavericks_SY_59/src/main/webapp/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/The Mavericks_SY_59/src/main/webapp/WEB-INF/lib/mysql-connector-j-8.0.33.jar b/The Mavericks_SY_59/src/main/webapp/WEB-INF/lib/mysql-connector-j-8.0.33.jar new file mode 100644 index 0000000..3f741f5 Binary files /dev/null and b/The Mavericks_SY_59/src/main/webapp/WEB-INF/lib/mysql-connector-j-8.0.33.jar differ diff --git a/The Mavericks_SY_59/src/main/webapp/admin.css b/The Mavericks_SY_59/src/main/webapp/admin.css new file mode 100644 index 0000000..dcf09f8 --- /dev/null +++ b/The Mavericks_SY_59/src/main/webapp/admin.css @@ -0,0 +1,80 @@ +@charset "UTF-8"; + +*{ + margin : 0px; + box-sizing : border-box; +} + +body{ + height : 100vh; + display : flex; + flex-direction: column; +} + +header{ + background : #1D1D1D; + padding : 20px; +} + +h1{ + font-size : 30px; + color : #2272FF; +} + +#parking { + height: 100%; + padding : 5%; +} + +#parking-one{ + height : 25%; +} + +#mid-space{ + height : 15%; +} + +#parking-two{ + height : 25%; +} + +#parking-three{ + height : 25%; +} + +.empty-parking-lot{ + float : left; + height : 100%; + width : 15%; + border : double 2px white; +} + +.parking-lot{ + background : #2272FF; + float : left; + height : 100%; + width : 15%; + border : double 2px black; +} + +#bottom-space{ + height : 15%; +} + +#login-form{ + padding : 5px; +} + +button{ + float: left; + padding : 2%; + width: 25%; +} + +footer{ + background : #1D1D1D; + margin-top : auto; + color : #2272FF; + font-size : 10px; + padding : 10px 20px; +} \ No newline at end of file diff --git a/The Mavericks_SY_59/src/main/webapp/admin.jsp b/The Mavericks_SY_59/src/main/webapp/admin.jsp new file mode 100644 index 0000000..1825442 --- /dev/null +++ b/The Mavericks_SY_59/src/main/webapp/admin.jsp @@ -0,0 +1,26 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + Vozilo Park + + + + +
+

Vozilo Park

+
+ +
+
+ +
+
+ +
+
+ + + \ No newline at end of file diff --git a/The Mavericks_SY_59/src/main/webapp/bill.jsp b/The Mavericks_SY_59/src/main/webapp/bill.jsp new file mode 100644 index 0000000..8c46f32 --- /dev/null +++ b/The Mavericks_SY_59/src/main/webapp/bill.jsp @@ -0,0 +1,22 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + Vozilo Park + + + + +
+

Vozilo Park

+

Bill

+
+

Your bill is : ${amount}

+ +
+
+ + + \ No newline at end of file diff --git a/The Mavericks_SY_59/src/main/webapp/entry.css b/The Mavericks_SY_59/src/main/webapp/entry.css new file mode 100644 index 0000000..6d3a8a6 --- /dev/null +++ b/The Mavericks_SY_59/src/main/webapp/entry.css @@ -0,0 +1,86 @@ +@charset "UTF-8"; + +*{ + margin : 0px; + box-sizing : border-box; +} + +body{ + height : 100vh; + display : flex; + flex-direction: column; +} + +header{ + background : #1D1D1D; + padding : 20px; +} + +h1{ + font-size : 30px; + color : #2272FF; +} + +h2{ + float:right; + color : #2272FF; +} + +#parking { + height: 100%; + padding : 5%; +} + +#parking-one{ + height : 25%; +} + +#mid-space{ + height : 15%; +} + +#parking-two{ + height : 25%; +} + +#parking-three{ + height : 25%; +} + +.empty-parking-lot{ + float : left; + height : 100%; + width : 15%; + border : double 2px white; +} + +.parking-lot{ + background : #2272FF; + float : left; + height : 100%; + width : 15%; + border : double 2px black; +} + +#bottom-space{ + height : 15%; +} + +button{ + font-size : 18px; + font-weight : bold; + margin : 20px 0; + padding : 10px 15px; + width : 25%; + border-radius : 5px; + float: right; + background: blue; +} + +footer{ + background : #1D1D1D; + margin-top : auto; + color : #2272FF; + font-size : 10px; + padding : 10px 20px; +} \ No newline at end of file diff --git a/The Mavericks_SY_59/src/main/webapp/entry.jsp b/The Mavericks_SY_59/src/main/webapp/entry.jsp new file mode 100644 index 0000000..9ce80bb --- /dev/null +++ b/The Mavericks_SY_59/src/main/webapp/entry.jsp @@ -0,0 +1,24 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + Vozilo Park + + + + +
+

Vozilo Park

+
+

Vehicle Number

+ +

Phone Number

+ + +
+
+ + + \ No newline at end of file diff --git a/The Mavericks_SY_59/src/main/webapp/index.jsp b/The Mavericks_SY_59/src/main/webapp/index.jsp new file mode 100644 index 0000000..20681bd --- /dev/null +++ b/The Mavericks_SY_59/src/main/webapp/index.jsp @@ -0,0 +1,22 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + Vozilo Park + + + + +
+

Welcome To

+

Vozilo Park

+

Team The Mavericks

+
+ +
+
+ + + \ No newline at end of file diff --git a/The Mavericks_SY_59/src/main/webapp/level1.jsp b/The Mavericks_SY_59/src/main/webapp/level1.jsp new file mode 100644 index 0000000..4b1e69f --- /dev/null +++ b/The Mavericks_SY_59/src/main/webapp/level1.jsp @@ -0,0 +1,86 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + Vozilo Park + + + + + +
+

Vozilo Park

+

Green indicates filled

+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
1R6
+
1R5
+
1R4
+
1R3
+
1R2
+
1R1
+

Entry

+
+
+
+
+
+
1L5
+
1L4
+
1L3
+
1L2
+
1L1
+
+
+
+
1B1
+
1B2
+
1B3
+
1B4
+
1B5
+
+

Exit

+
+ + + + + + + diff --git a/The Mavericks_SY_59/src/main/webapp/level2.jsp b/The Mavericks_SY_59/src/main/webapp/level2.jsp new file mode 100644 index 0000000..d925ab5 --- /dev/null +++ b/The Mavericks_SY_59/src/main/webapp/level2.jsp @@ -0,0 +1,86 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + Vozilo Park + + + + + +
+

Vozilo Park

+

Green indicates filled

+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
2R6
+
2R5
+
2R4
+
2R3
+
2R2
+
2R1
+

Entry

+
+
+
+
+
+
2L5
+
2L4
+
2L3
+
2L2
+
2L1
+
+
+
+
2B1
+
2B2
+
2B3
+
2B4
+
2B5
+
+

Exit

+
+ + + + + + + diff --git a/The Mavericks_SY_59/src/main/webapp/level3.jsp b/The Mavericks_SY_59/src/main/webapp/level3.jsp new file mode 100644 index 0000000..ab2c98b --- /dev/null +++ b/The Mavericks_SY_59/src/main/webapp/level3.jsp @@ -0,0 +1,86 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + Vozilo Park + + + + + +
+

Vozilo Park

+

Green indicates filled

+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
3R6
+
3R5
+
3R4
+
3R3
+
3R2
+
3R1
+

Entry

+
+
+
+
+
+
3L5
+
3L4
+
3L3
+
3L2
+
3L1
+
+
+
+
3B1
+
3B2
+
3B3
+
3B4
+
3B5
+
+

Exit

+
+ + + + + + + diff --git a/The Mavericks_SY_59/src/main/webapp/login.css b/The Mavericks_SY_59/src/main/webapp/login.css new file mode 100644 index 0000000..35bf75f --- /dev/null +++ b/The Mavericks_SY_59/src/main/webapp/login.css @@ -0,0 +1,63 @@ +@charset "UTF-8"; + +*{ + margin-bottom: 2%; + font-family : sans-serif; +} + +body{ + height : 100vh; + background : linear-gradient(180deg, blue, black); +} + +.login-form{ + width : 50%; + top : 50%; + left : 50%; + transform : translate(-50%, -50%); + position : absolute; + color :#fff; + align-items : center; +} + +.login-form h1{ + font-size : 40px; + text-align : center; + text-transform : uppercase; +} + +.login-form h2{ + font-size : 40px; + text-align : center; + text-transform : uppercase; +} + +.login-form h3{ + font-size : 40px; + text-align : center; + text-transform : uppercase; +} + + +.login-form p{ + font-size : 20px; +} + +.login-form input{ + font-size : 16px; + width : 100%; + padding : 15px 10px; + border : 0; + outline : none; + border-radius : 5px; +} + +.login-form button{ + align-items : center; + font-size : 18px; + font-weight : bold; + padding : 15px 10px; + width : 100%; + border-radius : 5px; + margin : 2%; +} \ No newline at end of file diff --git a/The Mavericks_SY_59/src/main/webapp/main.jsp b/The Mavericks_SY_59/src/main/webapp/main.jsp new file mode 100644 index 0000000..aae3b21 --- /dev/null +++ b/The Mavericks_SY_59/src/main/webapp/main.jsp @@ -0,0 +1,26 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + Vozilo Park + + + + +
+

Vozilo Park

+
+ +
+
+ +
+
+ +
+
+ + + \ No newline at end of file diff --git a/The Mavericks_SY_59/src/main/webapp/parking.jsp b/The Mavericks_SY_59/src/main/webapp/parking.jsp new file mode 100644 index 0000000..5f9f4e8 --- /dev/null +++ b/The Mavericks_SY_59/src/main/webapp/parking.jsp @@ -0,0 +1,84 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + Vozilo Park + + + + + + +
+

Vozilo Park

+

Go to floor number ${label}

+
+ +
+
+ +
+
+ +
+
+
${label}R6
+
${label}R5
+
${label}R4
+
${label}R3
+
${label}R2
+
${label}R1
+

Entry

+
+
+ <%= (request.getAttribute("road")) %> +
+
+
+
${label}L5
+
${label}L4
+
${label}L3
+
${label}L2
+
${label}L1
+
+
+
+
${label}B1
+
${label}B2
+
${label}B3
+
${label}B4
+
${label}B5
+
+
+ <%= (request.getAttribute("bottom-road")) %> +
+

Exit

+
+ + + + + +<%= (String)(request.getAttribute("emp-park")) %> + + + \ No newline at end of file diff --git a/The Mavericks_SY_59/src/main/webapp/parkno.jsp b/The Mavericks_SY_59/src/main/webapp/parkno.jsp new file mode 100644 index 0000000..b0f16ec --- /dev/null +++ b/The Mavericks_SY_59/src/main/webapp/parkno.jsp @@ -0,0 +1,22 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + Vozilo Park + + + + +
+

Vozilo Park

+
+

Parking Number

+ + +
+
+ + + diff --git a/The Mavericks_SY_59/web.xml b/The Mavericks_SY_59/web.xml new file mode 100644 index 0000000..31e46eb --- /dev/null +++ b/The Mavericks_SY_59/web.xml @@ -0,0 +1,109 @@ + + + + + ParkServlet + ParkServlet + com.buffer.ParkServlet + + + ParkServlet + /ParkServlet + + ParkingSystem + + + + VehicleServlet + VehicleServlet + com.buffer.VehicleServlet + + + VehicleServlet + /VehicleServlet + + VehicleServlet + + + index.html + index.htm + index.jsp + default.html + default.htm + default.jsp + + + ParkingServlet + com.buffer.ParkingServlet + + + ParkingServlet + /ParkingServlet + + + + ExitServlet + com.buffer.ExitServlet + + + ExitServlet + /ExitServlet + + + + + ParkingSystem + ParkingSystem + com.buffer.ParkingServlet + + + ParkingSystem + /ParkingSystem + + ParkingSystem + + + index.html + index.htm + index.jsp + default.html + default.htm + default.jsp + + + + Level1Servlet + com.buffer.Level1Servlet + + + Level1Servlet + /Level1Servlet + + + + Level2Servlet + com.buffer.Level2Servlet + + + Level2Servlet + /Level2Servlet + + + + Level3Servlet + com.buffer.Level3Servlet + + + Level3Servlet + /Level3Servlet + + + + MainServlet + com.buffer.MainServlet + + + MainServlet + /MainServlet + + \ No newline at end of file