├── Database.PNG ├── EDMS ├── pom.xml ├── src │ └── main │ │ ├── java │ │ └── JavaFiles │ │ │ ├── AddAskHelp.java │ │ │ ├── AddContribution.java │ │ │ ├── AddLocation.java │ │ │ ├── AddPost.java │ │ │ ├── DataServlet.java │ │ │ ├── Login.java │ │ │ ├── MachineLearning.java │ │ │ ├── Pair.java │ │ │ ├── PredictWithModel.java │ │ │ ├── PrintCharacter.java │ │ │ ├── Registration.java │ │ │ ├── TrainModel.java │ │ │ ├── UpdateProfile.java │ │ │ └── divisions.java │ │ └── webapp │ │ ├── AddAskHelp.jsp │ │ ├── AddContribution.jsp │ │ ├── AddLocation.jsp │ │ ├── AddPost.jsp │ │ ├── CSS │ │ ├── Faq.css │ │ ├── Home.css │ │ ├── Location.css │ │ ├── LocationProfile.css │ │ ├── Post.css │ │ ├── Profile.css │ │ ├── Regi.css │ │ ├── Shelter_and_areas.css │ │ ├── Social.css │ │ └── login.css │ │ ├── Faq.jsp │ │ ├── Home.jsp │ │ ├── IMAGES │ │ ├── asif.jpg │ │ ├── badge-1.png │ │ ├── badge-2.png │ │ ├── badge-3.png │ │ ├── badge-4.png │ │ ├── badge-5.png │ │ ├── post1.jpg │ │ ├── post4.jpg │ │ ├── shakil.png │ │ └── unayes.jpeg │ │ ├── Location_Profile.jsp │ │ ├── Login.jsp │ │ ├── META-INF │ │ └── MANIFEST.MF │ │ ├── People_Profile.jsp │ │ ├── Profile.jsp │ │ ├── Registration.jsp │ │ ├── Shelter_and_Areas.jsp │ │ ├── Social.jsp │ │ ├── UpdateProfile.jsp │ │ ├── WEB-INF │ │ └── web.xml │ │ └── logout.jsp ├── target │ ├── classes │ │ └── JavaFiles │ │ │ ├── AddAskHelp.class │ │ │ ├── AddContribution.class │ │ │ ├── AddLocation.class │ │ │ ├── AddPost.class │ │ │ ├── DataServlet.class │ │ │ ├── Login.class │ │ │ ├── MachineLearning.class │ │ │ ├── Pair.class │ │ │ ├── PredictWithModel.class │ │ │ ├── PrintCharacter.class │ │ │ ├── Registration.class │ │ │ ├── TrainModel.class │ │ │ ├── UpdateProfile.class │ │ │ └── divisions.class │ └── m2e-wtp │ │ └── web-resources │ │ └── META-INF │ │ ├── MANIFEST.MF │ │ └── maven │ │ └── EDMS │ │ └── EDMS │ │ ├── pom.properties │ │ └── pom.xml └── trained_model.model ├── Home1.PNG ├── Home2.PNG ├── Home3.PNG ├── LICENSE ├── LocProfile1.PNG ├── LocProfile2.PNG ├── Profile.PNG ├── ProjectArchi.PNG ├── README.md ├── Shelter.PNG ├── Social.PNG ├── Therap Java Fest Certificate1.jpeg └── Therap Java Fest Finalist Certificate.jpg /Database.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/Database.PNG -------------------------------------------------------------------------------- /EDMS/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | EDMS 4 | EDMS 5 | 0.0.1-SNAPSHOT 6 | war 7 | 8 | 9 | 10 | 11 | 12 | org.apache.commons 13 | commons-lang3 14 | 3.12.0 15 | 16 | 17 | 18 | mysql 19 | mysql-connector-java 20 | 8.0.33 21 | 22 | 23 | 24 | org.jsoup 25 | jsoup 26 | 1.16.1 27 | 28 | 29 | 30 | javax.servlet 31 | servlet-api 32 | 2.5 33 | provided 34 | 35 | 36 | 37 | org.mindrot 38 | jbcrypt 39 | 0.4 40 | 41 | 42 | 43 | com.fasterxml.jackson.core 44 | jackson-databind 45 | 2.12.5 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | nz.ac.waikato.cms.weka 54 | weka-stable 55 | 3.8.0 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | maven-compiler-plugin 66 | 3.8.1 67 | 68 | 17 69 | 70 | 71 | 72 | maven-war-plugin 73 | 3.2.3 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /EDMS/src/main/java/JavaFiles/AddAskHelp.java: -------------------------------------------------------------------------------- 1 | package JavaFiles; 2 | 3 | import jakarta.servlet.ServletException; 4 | import jakarta.servlet.annotation.MultipartConfig; 5 | import jakarta.servlet.annotation.WebServlet; 6 | import jakarta.servlet.http.HttpServlet; 7 | import jakarta.servlet.http.HttpServletRequest; 8 | import jakarta.servlet.http.HttpServletResponse; 9 | import jakarta.servlet.http.HttpSession; 10 | import jakarta.servlet.http.Part; 11 | 12 | import java.io.IOException; 13 | import java.io.InputStream; 14 | import java.sql.Connection; 15 | import java.sql.DriverManager; 16 | import java.sql.PreparedStatement; 17 | import java.sql.SQLException; 18 | import java.text.SimpleDateFormat; 19 | import java.util.Date; 20 | import java.util.Locale; 21 | 22 | @MultipartConfig 23 | @WebServlet(name="AddAskHelp",urlPatterns= {"/AddAskHelp"}) 24 | public class AddAskHelp extends HttpServlet { 25 | private static final long serialVersionUID = 1L; 26 | 27 | 28 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 29 | Connection con = null; 30 | HttpSession session=request.getSession(false); 31 | String loggedInUser = (String) session.getAttribute("loggedInUser"); 32 | //System.out.println(loggedInUser); 33 | String LocationUsername=request.getParameter("LocationUsername"); 34 | //System.out.println(LocationUsername); 35 | String Description = request.getParameter("Description"); 36 | //System.out.println(Description); 37 | String ams=request.getParameter("help-am"); 38 | //System.out.println(ams); 39 | int am=Integer.parseInt(ams); 40 | String afs=request.getParameter("help-af"); 41 | int af=Integer.parseInt(afs); 42 | String acs=request.getParameter("help-ac"); 43 | int ac=Integer.parseInt(acs); 44 | int tot=af+am+ac; 45 | 46 | try 47 | { 48 | Class.forName("com.mysql.cj.jdbc.Driver"); 49 | } 50 | catch(ClassNotFoundException e) 51 | { 52 | e.printStackTrace(); 53 | } 54 | try 55 | { 56 | con=DriverManager.getConnection("jdbc:mysql://localhost:3306/edms" , "root",""); 57 | } 58 | catch(SQLException e) 59 | { 60 | e.printStackTrace(); 61 | } 62 | 63 | Part part1=request.getPart("ImageName1"); 64 | Part part2=request.getPart("ImageName2"); 65 | String contentType1 = part1.getContentType(); 66 | String contentType2 = part2.getContentType(); 67 | if (!(contentType1 != null && (contentType1.startsWith("image/jpeg") || contentType1.startsWith("image/png") || contentType1.startsWith("image/gif") || contentType1.startsWith("image/jpg") || contentType1.startsWith("image/svg") || contentType1.startsWith("image/webp")|| contentType1.startsWith("image/JPEG") || contentType1.startsWith("image/PNG") || contentType1.startsWith("image/GIF") || contentType1.startsWith("image/JPG") || contentType1.startsWith("image/SVG") || contentType1.startsWith("image/WEBP")))) { 68 | request.setAttribute("message", "Give a proper image ( Photo 1)"); 69 | String goUrl="AddAskHelp.jsp?LocationUsernameFromLocationProfile="+LocationUsername; 70 | request.getRequestDispatcher(goUrl).forward(request, response); 71 | } 72 | else if (!(contentType2 != null && (contentType2.startsWith("image/jpeg") || contentType2.startsWith("image/png") || contentType2.startsWith("image/gif") || contentType2.startsWith("image/jpg") || contentType2.startsWith("image/svg") || contentType2.startsWith("image/webp")|| contentType2.startsWith("image/JPEG") || contentType2.startsWith("image/PNG") || contentType2.startsWith("image/GIF") || contentType2.startsWith("image/JPG") || contentType2.startsWith("image/SVG") || contentType2.startsWith("image/WEBP")))) { 73 | request.setAttribute("message", "Give a proper image ( Photo 2)"); 74 | String goUrl="AddAskHelp.jsp?LocationUsernameFromLocationProfile="+LocationUsername; 75 | request.getRequestDispatcher(goUrl).forward(request, response); 76 | } 77 | else { 78 | 79 | try { 80 | InputStream is1=part1.getInputStream(); 81 | InputStream is2=part2.getInputStream(); 82 | PreparedStatement ps=con.prepareStatement("insert into "+LocationUsername+"_askhelp(Description,Photo1,Photo2,LocationUsername,Total,Username,Date,Second)values(?,?,?,?,?,?,?,?)"); 83 | ps.setString(1,Description); 84 | ps.setBlob(2, is1); 85 | ps.setBlob(3,is2); 86 | ps.setString(4, LocationUsername); 87 | ps.setInt(5, tot); 88 | ps.setString(6, loggedInUser); 89 | Date currentDate = new Date(); 90 | SimpleDateFormat dateFormat = new SimpleDateFormat("h:mma dd MMM, yyyy", Locale.ENGLISH); 91 | String formattedDateTime = dateFormat.format(currentDate); 92 | ps.setString(7, formattedDateTime); 93 | Date date = dateFormat.parse(formattedDateTime); 94 | long secondsSinceEpoch = date.getTime() / 1000; 95 | ps.setLong(8, secondsSinceEpoch); 96 | ps.executeUpdate(); 97 | }catch(Exception e) { 98 | 99 | } 100 | } 101 | response.sendRedirect("Location_Profile.jsp?LocationUsernameFromShelterPage="+LocationUsername); 102 | } 103 | 104 | 105 | } 106 | -------------------------------------------------------------------------------- /EDMS/src/main/java/JavaFiles/AddContribution.java: -------------------------------------------------------------------------------- 1 | package JavaFiles; 2 | 3 | import jakarta.servlet.ServletException; 4 | import jakarta.servlet.annotation.MultipartConfig; 5 | import jakarta.servlet.annotation.WebServlet; 6 | import jakarta.servlet.http.HttpServlet; 7 | import jakarta.servlet.http.HttpServletRequest; 8 | import jakarta.servlet.http.HttpServletResponse; 9 | import jakarta.servlet.http.HttpSession; 10 | import jakarta.servlet.http.Part; 11 | 12 | import java.io.IOException; 13 | import java.io.InputStream; 14 | import java.sql.Connection; 15 | import java.sql.DriverManager; 16 | import java.sql.PreparedStatement; 17 | import java.sql.ResultSet; 18 | import java.sql.SQLException; 19 | import java.sql.Statement; 20 | import java.text.SimpleDateFormat; 21 | import java.util.Date; 22 | import java.util.Locale; 23 | 24 | @MultipartConfig 25 | @WebServlet(name="AddContribution",urlPatterns= {"/AddContribution"}) 26 | public class AddContribution extends HttpServlet { 27 | private static final long serialVersionUID = 1L; 28 | 29 | 30 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 31 | 32 | Connection con = null; 33 | HttpSession session=request.getSession(false); 34 | String loggedInUser = (String) session.getAttribute("loggedInUser"); 35 | 36 | String LocationUsername=request.getParameter("LocationUsername"); 37 | String Description = request.getParameter("help-des"); 38 | String tot1=request.getParameter("help-Count"); 39 | int tot=Integer.parseInt(tot1); 40 | 41 | try 42 | { 43 | Class.forName("com.mysql.cj.jdbc.Driver"); 44 | } 45 | catch(ClassNotFoundException e) 46 | { 47 | e.printStackTrace(); 48 | } 49 | try 50 | { 51 | con=DriverManager.getConnection("jdbc:mysql://localhost:3306/edms" , "root",""); 52 | } 53 | catch(SQLException e) 54 | { 55 | e.printStackTrace(); 56 | } 57 | 58 | Part part1=request.getPart("help-p1"); 59 | Part part2=request.getPart("help-p2"); 60 | String contentType1 = part1.getContentType(); 61 | String contentType2 = part2.getContentType(); 62 | if (!(contentType1 != null && (contentType1.startsWith("image/jpeg") || contentType1.startsWith("image/png") || contentType1.startsWith("image/gif") || contentType1.startsWith("image/jpg") || contentType1.startsWith("image/svg") || contentType1.startsWith("image/webp")|| contentType1.startsWith("image/JPEG") || contentType1.startsWith("image/PNG") || contentType1.startsWith("image/GIF") || contentType1.startsWith("image/JPG") || contentType1.startsWith("image/SVG") || contentType1.startsWith("image/WEBP")))) { 63 | request.setAttribute("message", "Give a proper image ( Photo 1)"); 64 | String goUrl="AddContribution.jsp?LocationUsernameFromLocationProfile="+LocationUsername; 65 | request.getRequestDispatcher(goUrl).forward(request, response); 66 | } 67 | else if (!(contentType2 != null && (contentType2.startsWith("image/jpeg") || contentType2.startsWith("image/png") || contentType2.startsWith("image/gif") || contentType2.startsWith("image/jpg") || contentType2.startsWith("image/svg") || contentType2.startsWith("image/webp")|| contentType2.startsWith("image/JPEG") || contentType2.startsWith("image/PNG") || contentType2.startsWith("image/GIF") || contentType2.startsWith("image/JPG") || contentType2.startsWith("image/SVG") || contentType2.startsWith("image/WEBP")))) { 68 | request.setAttribute("message", "Give a proper image ( Photo 2)"); 69 | String goUrl="AddContribution.jsp?LocationUsernameFromLocationProfile="+LocationUsername; 70 | request.getRequestDispatcher(goUrl).forward(request, response); 71 | } 72 | else { 73 | 74 | try { 75 | InputStream is1=part1.getInputStream(); 76 | InputStream is2=part2.getInputStream(); 77 | PreparedStatement ps=con.prepareStatement("insert into "+LocationUsername+"_contribution(Description,Photo1,Photo2,LocationUsername,Total,Username,Date,Second)values(?,?,?,?,?,?,?,?)"); 78 | ps.setString(1,Description); 79 | ps.setBlob(2, is1); 80 | ps.setBlob(3,is2); 81 | ps.setString(4, LocationUsername); 82 | ps.setInt(5, tot); 83 | ps.setString(6, loggedInUser); 84 | Date currentDate = new Date(); 85 | SimpleDateFormat dateFormat = new SimpleDateFormat("h:mma dd MMM, yyyy", Locale.ENGLISH); 86 | String formattedDateTime = dateFormat.format(currentDate); 87 | ps.setString(7, formattedDateTime); 88 | Date date = dateFormat.parse(formattedDateTime); 89 | long secondsSinceEpoch = date.getTime() / 1000; 90 | ps.setLong(8, secondsSinceEpoch); 91 | ps.executeUpdate(); 92 | }catch(Exception e) { 93 | 94 | } 95 | } 96 | response.sendRedirect("Location_Profile.jsp?LocationUsernameFromShelterPage="+LocationUsername); 97 | } 98 | 99 | } 100 | -------------------------------------------------------------------------------- /EDMS/src/main/java/JavaFiles/AddLocation.java: -------------------------------------------------------------------------------- 1 | package JavaFiles; 2 | 3 | import jakarta.servlet.ServletException; 4 | import jakarta.servlet.annotation.MultipartConfig; 5 | import jakarta.servlet.annotation.WebServlet; 6 | import jakarta.servlet.http.HttpServlet; 7 | import jakarta.servlet.http.HttpServletRequest; 8 | import jakarta.servlet.http.HttpServletResponse; 9 | import jakarta.servlet.http.Part; 10 | import jakarta.servlet.http.HttpSession; 11 | import java.io.IOException; 12 | import java.io.InputStream; 13 | import java.io.PrintWriter; 14 | import java.sql.Connection; 15 | import java.sql.DriverManager; 16 | import java.sql.PreparedStatement; 17 | import java.sql.ResultSet; 18 | import java.sql.SQLException; 19 | import java.sql.Statement; 20 | import java.text.SimpleDateFormat; 21 | import java.util.Date; 22 | import java.util.Locale; 23 | /** 24 | * Servlet implementation class AddLocation 25 | */ 26 | @MultipartConfig 27 | @WebServlet(name="AddLocation",urlPatterns= {"/AddLocation"}) 28 | public class AddLocation extends HttpServlet { 29 | private static final long serialVersionUID = 1L; 30 | 31 | PrintWriter out; 32 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 33 | Connection con = null; 34 | HttpSession session=request.getSession(false); 35 | String loggedInUser = (String) session.getAttribute("loggedInUser"); 36 | if (loggedInUser == null) { 37 | String currentURL = request.getRequestURI(); 38 | session.setAttribute("redirectURL", currentURL); 39 | response.sendRedirect("Login.jsp"); 40 | return; 41 | } 42 | String LocationUser=loggedInUser+"_loc_"; 43 | try 44 | { 45 | Class.forName("com.mysql.cj.jdbc.Driver"); 46 | } 47 | catch(ClassNotFoundException e) 48 | { 49 | e.printStackTrace(); 50 | } 51 | try 52 | { 53 | con=DriverManager.getConnection("jdbc:mysql://localhost:3306/edms" , "root",""); 54 | } 55 | catch(SQLException e) 56 | { 57 | e.printStackTrace(); 58 | } 59 | String qq="SELECT COUNT(*) FROM "+loggedInUser+"_location"; 60 | Statement stmt; 61 | int count_loc=0; 62 | try { 63 | stmt=con.createStatement(); 64 | ResultSet rs=stmt.executeQuery(qq); 65 | while(rs.next()) { 66 | count_loc=rs.getInt(1); 67 | count_loc++; 68 | } 69 | 70 | } catch (SQLException e) { 71 | // TODO Auto-generated catch block 72 | e.printStackTrace(); 73 | } 74 | LocationUser+=count_loc; 75 | 76 | String Name = request.getParameter("loc-name"); 77 | String Type = request.getParameter("loc-type"); 78 | String Description = request.getParameter("loc-des"); 79 | String linki = request.getParameter("loc-link"); 80 | 81 | String check1="https://www.google.c"; 82 | String check2="https://maps.app.goo"; 83 | String LinkCheck=linki.substring(0,Math.min(linki.length(),20)); 84 | if(LinkCheck.equals(check1)||LinkCheck.equals(check2)) { 85 | 86 | } 87 | else { 88 | request.setAttribute("message", "Give proper link"); 89 | request.getRequestDispatcher("AddLocation.jsp").forward(request, response); 90 | } 91 | 92 | String cont=request.getParameter("loc-cont"); 93 | String ams=request.getParameter("loc-am"); 94 | int am=Integer.parseInt(ams); 95 | String afs=request.getParameter("loc-af"); 96 | int af=Integer.parseInt(afs); 97 | String acs=request.getParameter("loc-ac"); 98 | int ac=Integer.parseInt(acs); 99 | int tot=af+am+ac; 100 | Part part1=request.getPart("loc-p1"); 101 | Part part2=request.getPart("loc-p2"); 102 | String link=request.getParameter("loc-link"); 103 | Statement stmtm; 104 | String selectedUnion= request.getParameter("selectedUnion"); 105 | 106 | String query5 = "SELECT * FROM bangladesh where Unionn = '"+selectedUnion+"'"; 107 | 108 | String District = null; 109 | String Upazilla = null; 110 | String Union = selectedUnion; 111 | 112 | Statement stmt5; 113 | try 114 | { 115 | stmt5 = con.createStatement(); 116 | ResultSet rs1 = stmt5.executeQuery(query5); 117 | while(rs1.next()) 118 | { 119 | District = rs1.getString("District"); 120 | Upazilla = rs1.getString("Upazila"); 121 | } 122 | 123 | } 124 | catch(Exception e) 125 | { 126 | e.printStackTrace(); 127 | } 128 | 129 | 130 | String contentType1 = part1.getContentType(); 131 | String contentType2 = part2.getContentType(); 132 | if (!(contentType1 != null && (contentType1.startsWith("image/jpeg") || contentType1.startsWith("image/png") || contentType1.startsWith("image/gif") || contentType1.startsWith("image/jpg") || contentType1.startsWith("image/svg") || contentType1.startsWith("image/webp")|| contentType1.startsWith("image/JPEG") || contentType1.startsWith("image/PNG") || contentType1.startsWith("image/GIF") || contentType1.startsWith("image/JPG") || contentType1.startsWith("image/SVG") || contentType1.startsWith("image/WEBP")))) { 133 | request.setAttribute("message", "Give a proper image ( Photo 1)"); 134 | String goUrl="AddLocation.jsp"; 135 | request.getRequestDispatcher(goUrl).forward(request, response); 136 | } 137 | else if (!(contentType2 != null && (contentType2.startsWith("image/jpeg") || contentType2.startsWith("image/png") || contentType2.startsWith("image/gif") || contentType2.startsWith("image/jpg") || contentType2.startsWith("image/svg") || contentType2.startsWith("image/webp")|| contentType2.startsWith("image/JPEG") || contentType2.startsWith("image/PNG") || contentType2.startsWith("image/GIF") || contentType2.startsWith("image/JPG") || contentType2.startsWith("image/SVG") || contentType2.startsWith("image/WEBP")))) { 138 | request.setAttribute("message", "Give a proper image ( Photo 2)"); 139 | String goUrl="AddLocation.jsp"; 140 | request.getRequestDispatcher(goUrl).forward(request, response); 141 | } 142 | else { 143 | 144 | try { 145 | InputStream is1=part1.getInputStream(); 146 | InputStream is2=part2.getInputStream(); 147 | 148 | PreparedStatement ps=con.prepareStatement("insert into "+loggedInUser+"_post(Description,Photo1,Photo2,Location,Affected,Date,Second)values(?,?,?,?,?,?,?)"); 149 | ps.setString(1,Description); 150 | ps.setBlob(2, is1); 151 | ps.setBlob(3,is2); 152 | ps.setString(4, selectedUnion); 153 | ps.setInt(5, tot); 154 | Date currentDate = new Date(); 155 | SimpleDateFormat dateFormat = new SimpleDateFormat("h:mma dd MMM, yyyy", Locale.ENGLISH); 156 | String formattedDateTime = dateFormat.format(currentDate); 157 | ps.setString(6, formattedDateTime); 158 | Date date = dateFormat.parse(formattedDateTime); 159 | long secondsSinceEpoch = date.getTime() / 1000; 160 | ps.setLong(7, secondsSinceEpoch); 161 | ps.executeUpdate(); 162 | 163 | /**/ 164 | PreparedStatement ps1=con.prepareStatement("insert into "+loggedInUser+"_location(Name,Type,Description,Photo1,Photo2,Location,Location_URL,Affected_Male,Affected_Female,Affected_Children,Affected_Total,ContactNo,Activity,LocationUsername,Date,Second)values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); 165 | is1=part1.getInputStream(); 166 | is2=part2.getInputStream(); 167 | ps1.setString(1,Name); 168 | ps1.setString(2,Type); 169 | ps1.setString(3,Description); 170 | ps1.setBlob(4, is1); 171 | ps1.setBlob(5,is2); 172 | ps1.setString(6, selectedUnion); 173 | ps1.setString(7,linki); 174 | ps1.setInt(8, am); 175 | ps1.setInt(9, af); 176 | ps1.setInt(10, ac); 177 | ps1.setInt(11, tot); 178 | ps1.setString(12, cont); 179 | ps1.setString(13, "Inactive"); 180 | ps1.setString(14,LocationUser); 181 | ps1.setString(15, formattedDateTime); 182 | ps1.setLong(16, secondsSinceEpoch); 183 | ps1.executeUpdate(); 184 | PreparedStatement ps11=con.prepareStatement("create table "+LocationUser+"_askhelp(LocationUsername text,Description text,Photo1 longblob,Photo2 longblob,Male int,Female int,Children int,Total int,Username text,Date text,Second bigint);"); 185 | ps11.executeUpdate(); 186 | PreparedStatement ps22=con.prepareStatement("create table "+LocationUser+"_contribution(LocationUsername text,Description text,Photo1 longblob,Photo2 longblob,Total int,Username text,Date text,Second bigint);"); 187 | ps22.executeUpdate(); 188 | /**/ 189 | PreparedStatement ps3=con.prepareStatement("insert into location_added(LocationUsername,Name,Type,Activity,Second,Priority,TotalPriority , District , Upazilla , Unionn,Link,Photo1,Photo2,ContactNo,Description,Male,Female,Children,Total)values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); 190 | ps3.setString(1,LocationUser); 191 | ps3.setString(2,Name); 192 | ps3.setString(3,Type); 193 | is1=part1.getInputStream(); 194 | is2=part2.getInputStream(); 195 | 196 | ps3.setString(4, "Inactive"); 197 | ps3.setLong(5, secondsSinceEpoch); 198 | ps3.setFloat(6, 0); 199 | ps3.setFloat(7, 0); 200 | ps3.setString(8, District); 201 | ps3.setString(9, Upazilla); 202 | ps3.setString(10, Union); 203 | ps3.setString(11, link); 204 | ps3.setBlob(12,is1); 205 | ps3.setBlob(13,is2); 206 | ps3.setString(14, cont); 207 | ps3.setString(15,Description); 208 | ps3.setInt(16, am); 209 | ps3.setInt(17, af); 210 | ps3.setInt(18, ac); 211 | ps3.setInt(19, tot); 212 | ps3.executeUpdate(); 213 | 214 | /**/ 215 | 216 | PreparedStatement ps4=con.prepareStatement("insert into post_added "+"(Username,Photo1,Photo2,Description,District,Upazilla,Unionn,Affected,Date,Second,Name)values(?,?,?,?,?,?,?,?,?,?,?)"); 217 | 218 | is1=part1.getInputStream(); 219 | is2=part2.getInputStream(); 220 | ps4.setString(1,LocationUser); 221 | ps4.setBlob(2, is1); 222 | ps4.setBlob(3,is2); 223 | ps4.setString(4,Description); 224 | ps4.setString(5,District ); 225 | ps4.setString(6,Upazilla ); 226 | ps4.setString(7,Union ); 227 | ps4.setInt(8, tot); 228 | ps4.setString(9, formattedDateTime); 229 | ps4.setLong(10, secondsSinceEpoch); 230 | ps4.setString(11,Name ); 231 | ps4.executeUpdate(); 232 | response.sendRedirect("Profile.jsp"); 233 | 234 | }catch(Exception e) { 235 | 236 | } 237 | } 238 | } 239 | 240 | } 241 | -------------------------------------------------------------------------------- /EDMS/src/main/java/JavaFiles/AddPost.java: -------------------------------------------------------------------------------- 1 | package JavaFiles; 2 | 3 | import jakarta.servlet.ServletException; 4 | import jakarta.servlet.annotation.MultipartConfig; 5 | import jakarta.servlet.annotation.WebServlet; 6 | import jakarta.servlet.http.HttpServlet; 7 | import jakarta.servlet.http.HttpServletRequest; 8 | import jakarta.servlet.http.HttpServletResponse; 9 | import jakarta.servlet.http.HttpSession; 10 | import jakarta.servlet.http.Part; 11 | 12 | import java.io.IOException; 13 | import java.io.InputStream; 14 | import java.io.PrintWriter; 15 | import java.sql.Connection; 16 | import java.sql.DriverManager; 17 | import java.sql.PreparedStatement; 18 | import java.sql.ResultSet; 19 | import java.sql.SQLException; 20 | import java.sql.Statement; 21 | import java.text.SimpleDateFormat; 22 | import java.util.Date; 23 | import java.util.Locale; 24 | 25 | 26 | @MultipartConfig 27 | @WebServlet(name="AddPost",urlPatterns= {"AddPost"}) 28 | public class AddPost extends HttpServlet { 29 | private static final long serialVersionUID = 1L; 30 | PrintWriter out; 31 | /** 32 | * @see HttpServlet#HttpServlet() 33 | */ 34 | 35 | 36 | 37 | 38 | 39 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 40 | // TODO Auto-generated method stub 41 | 42 | //System.out.println("Entered into Registration.java"); 43 | 44 | Connection con = null; 45 | 46 | try 47 | { 48 | Class.forName("com.mysql.cj.jdbc.Driver"); 49 | } 50 | catch(ClassNotFoundException e) 51 | { 52 | e.printStackTrace(); 53 | } 54 | try 55 | { 56 | con=DriverManager.getConnection("jdbc:mysql://localhost:3306/edms" , "root",""); 57 | } 58 | catch(SQLException e) 59 | { 60 | e.printStackTrace(); 61 | } 62 | 63 | HttpSession session=request.getSession(false); 64 | 65 | String Username = (String) session.getAttribute("loggedInUser"); 66 | if (Username == null) { 67 | String currentURL = request.getRequestURI(); 68 | session.setAttribute("redirectURL", currentURL); 69 | response.sendRedirect("Login.jsp"); 70 | } 71 | 72 | System.out.println("Printing from AddPost Servlet "+Username); 73 | 74 | 75 | String PostString = request.getParameter("PostString"); 76 | 77 | System.out.println(PostString); 78 | 79 | Statement stmtm; 80 | String selectedUnion= request.getParameter("selectedUnion"); 81 | 82 | 83 | String query1 = "SELECT * FROM bangladesh where Unionn = '"+selectedUnion+"'"; 84 | 85 | String District = null; 86 | String Upazilla = null; 87 | String Union = selectedUnion; 88 | 89 | Statement stmt1; 90 | try 91 | { 92 | stmt1 = con.createStatement(); 93 | ResultSet rs1 = stmt1.executeQuery(query1); 94 | while(rs1.next()) 95 | { 96 | District = rs1.getString("District"); 97 | Upazilla = rs1.getString("Upazila"); 98 | } 99 | 100 | } 101 | catch(Exception e) 102 | { 103 | e.printStackTrace(); 104 | } 105 | 106 | 107 | String Name=null; 108 | String queryn="SELECT * FROM registrationinfo where Username = '"+Username+"'"; 109 | Statement stmtn; 110 | try 111 | { 112 | stmtn = con.createStatement(); 113 | ResultSet rs1 = stmtn.executeQuery(queryn); 114 | while(rs1.next()) 115 | { 116 | Name=rs1.getString("Name"); 117 | } 118 | 119 | } 120 | catch(Exception e) 121 | { 122 | e.printStackTrace(); 123 | } 124 | //String ImageName = request.getParameter("ImageName"); 125 | 126 | 127 | 128 | 129 | response.setContentType("text/html;charset=UTF-8"); 130 | 131 | out=response.getWriter(); 132 | 133 | 134 | Part part1=request.getPart("ImageName1"); 135 | Part part2=request.getPart("ImageName2"); 136 | 137 | String contentType1 = part1.getContentType(); 138 | String contentType2 = part2.getContentType(); 139 | if (!(contentType1 != null && (contentType1.startsWith("image/jpeg") || contentType1.startsWith("image/png") || contentType1.startsWith("image/gif") || contentType1.startsWith("image/jpg") || contentType1.startsWith("image/svg") || contentType1.startsWith("image/webp")|| contentType1.startsWith("image/JPEG") || contentType1.startsWith("image/PNG") || contentType1.startsWith("image/GIF") || contentType1.startsWith("image/JPG") || contentType1.startsWith("image/SVG") || contentType1.startsWith("image/WEBP")))) { 140 | request.setAttribute("message", "Give a proper image ( Photo 1)"); 141 | String goUrl="AddPost.jsp"; 142 | request.getRequestDispatcher(goUrl).forward(request, response); 143 | } 144 | else if (!(contentType2 != null && (contentType2.startsWith("image/jpeg") || contentType2.startsWith("image/png") || contentType2.startsWith("image/gif") || contentType2.startsWith("image/jpg") || contentType2.startsWith("image/svg") || contentType2.startsWith("image/webp")|| contentType2.startsWith("image/JPEG") || contentType2.startsWith("image/PNG") || contentType2.startsWith("image/GIF") || contentType2.startsWith("image/JPG") || contentType2.startsWith("image/SVG") || contentType2.startsWith("image/WEBP")))) { 145 | request.setAttribute("message", "Give a proper image ( Photo 2)"); 146 | String goUrl="AddPost.jsp"; 147 | request.getRequestDispatcher(goUrl).forward(request, response); 148 | } 149 | else { 150 | 151 | if(part1!=null && part2!=null) { 152 | try { 153 | PreparedStatement ps=con.prepareStatement("insert into "+Username+"_post"+"(Description,Photo1,Photo2,Location,Affected,Date,Second)values(?,?,?,?,?,?,?)"); 154 | 155 | InputStream is1=part1.getInputStream(); 156 | InputStream is2=part2.getInputStream(); 157 | 158 | ps.setString(1,PostString); 159 | ps.setBlob(2, is1); 160 | ps.setBlob(3,is2); 161 | ps.setString(4, selectedUnion); 162 | ps.setInt(5, -1); 163 | Date currentDate = new Date(); 164 | SimpleDateFormat dateFormat = new SimpleDateFormat("h:mma dd MMM, yyyy", Locale.ENGLISH); 165 | String formattedDateTime = dateFormat.format(currentDate); 166 | ps.setString(6, formattedDateTime); 167 | Date date = dateFormat.parse(formattedDateTime); 168 | long secondsSinceEpoch = date.getTime() / 1000; 169 | ps.setLong(7, secondsSinceEpoch); 170 | int res=0; 171 | res=ps.executeUpdate(); 172 | 173 | PreparedStatement ps1=con.prepareStatement("insert into post_added "+"(Username,Photo1,Photo2,Description,District,Upazilla,Unionn,Affected,Date,Second,Name)values(?,?,?,?,?,?,?,?,?,?,?)"); 174 | 175 | is1=part1.getInputStream(); 176 | is2=part2.getInputStream(); 177 | ps1.setString(1,Username); 178 | ps1.setBlob(2, is1); 179 | ps1.setBlob(3,is2); 180 | ps1.setString(4,PostString ); 181 | ps1.setString(5,District ); 182 | ps1.setString(6,Upazilla ); 183 | ps1.setString(7,Union ); 184 | ps1.setInt(8, -1); 185 | ps1.setString(9, formattedDateTime); 186 | ps1.setLong(10, secondsSinceEpoch); 187 | ps1.setString(11,Name); 188 | ps1.executeUpdate(); 189 | 190 | }catch(Exception e) { 191 | System.out.println("Add image a dhora"); 192 | e.printStackTrace(); 193 | } 194 | 195 | } 196 | else 197 | { 198 | System.out.println("Photot somosssa"); 199 | } 200 | } 201 | response.sendRedirect("Profile.jsp"); 202 | } 203 | 204 | 205 | 206 | 207 | } 208 | -------------------------------------------------------------------------------- /EDMS/src/main/java/JavaFiles/DataServlet.java: -------------------------------------------------------------------------------- 1 | package JavaFiles; 2 | 3 | import jakarta.servlet.ServletException; 4 | import jakarta.servlet.annotation.WebServlet; 5 | import jakarta.servlet.http.HttpServlet; 6 | import jakarta.servlet.http.HttpServletRequest; 7 | import jakarta.servlet.http.HttpServletResponse; 8 | import java.io.IOException; 9 | import java.sql.Connection; 10 | import java.sql.DriverManager; 11 | import java.sql.PreparedStatement; 12 | import java.sql.ResultSet; 13 | import java.sql.SQLException; 14 | import java.sql.Statement; 15 | import java.util.ArrayList; 16 | import java.util.List; 17 | 18 | import com.fasterxml.jackson.databind.ObjectMapper; 19 | @WebServlet("/api/data") 20 | public class DataServlet extends HttpServlet { 21 | private static final long serialVersionUID = 1L; 22 | 23 | 24 | public DataServlet() { 25 | super(); 26 | // TODO Auto-generated constructor stub 27 | } 28 | 29 | /** 30 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) 31 | */ 32 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 33 | 34 | // Handle API request 35 | try { 36 | Connection connection = null; 37 | try 38 | { 39 | Class.forName("com.mysql.cj.jdbc.Driver"); 40 | } 41 | catch(ClassNotFoundException e) 42 | { 43 | e.printStackTrace(); 44 | } 45 | try 46 | { 47 | connection=DriverManager.getConnection("jdbc:mysql://localhost:3306/edms" , "root",""); 48 | } 49 | catch(SQLException e) 50 | { 51 | e.printStackTrace(); 52 | } 53 | String query = "SELECT * FROM location_added order by TotalPriority desc"; 54 | 55 | Statement stmt; 56 | ArrayListVerified1=new ArrayList(); 57 | ArrayListName1=new ArrayList(); 58 | ArrayListType1=new ArrayList(); 59 | ArrayListActivity1=new ArrayList(); 60 | ArrayListDistrict1=new ArrayList(); 61 | ArrayListUpazilla1=new ArrayList(); 62 | ArrayListUnion1=new ArrayList(); 63 | ArrayListUsername1=new ArrayList(); 64 | try 65 | { 66 | stmt = connection.createStatement(); 67 | ResultSet rs = stmt.executeQuery(query); 68 | while(rs.next()) 69 | { 70 | String name = rs.getString("Name"); 71 | String type = rs.getString("Type"); 72 | String activ = rs.getString("Activity"); 73 | String LocUser = rs.getString("LocationUsername"); 74 | String dist = rs.getString("District"); 75 | String upa = rs.getString("Upazilla"); 76 | String uni = rs.getString("Unionn"); 77 | String user= rs.getString("LocationUsername"); 78 | 79 | 80 | String Verified = null; 81 | 82 | String query2 = "SELECT * FROM location_verfied where LocationUsername = '"+LocUser+"'"; 83 | try 84 | { 85 | Statement stmt2 = connection.createStatement(); 86 | 87 | ResultSet rs2 = stmt2.executeQuery(query2); 88 | 89 | while(rs2.next()) 90 | { 91 | Verified = rs2.getString("LocationUsername"); 92 | } 93 | 94 | } 95 | catch(Exception e) 96 | { 97 | 98 | } 99 | 100 | 101 | 102 | Verified1.add(Verified); 103 | Name1.add(name); 104 | Type1.add(type); 105 | Activity1.add(activ); 106 | District1.add(dist); 107 | Upazilla1.add(upa); 108 | Union1.add(uni); 109 | Username1.add(user); 110 | //System.out.println("none"+Activity1.size()); 111 | 112 | } 113 | 114 | 115 | } 116 | catch(Exception e) 117 | { 118 | 119 | } 120 | List> mergedList = new ArrayList<>(); 121 | mergedList.add(Verified1); 122 | mergedList.add(Name1); 123 | mergedList.add(Type1); 124 | mergedList.add(Activity1); 125 | mergedList.add(District1); 126 | mergedList.add(Upazilla1); 127 | mergedList.add(Union1); 128 | mergedList.add(Username1); 129 | // Convert the data to JSON 130 | ObjectMapper objectMapper = new ObjectMapper(); 131 | try { 132 | String json = objectMapper.writeValueAsString(mergedList); 133 | 134 | response.setContentType("application/json"); 135 | response.setCharacterEncoding("UTF-8"); 136 | response.getWriter().write(json); 137 | } catch (Exception e) { 138 | e.printStackTrace(); 139 | } 140 | 141 | 142 | } catch (Exception e) { 143 | e.printStackTrace(); 144 | response.setStatus(500); 145 | } 146 | 147 | } 148 | 149 | 150 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 151 | // TODO Auto-generated method stub 152 | doGet(request, response); 153 | } 154 | 155 | } 156 | -------------------------------------------------------------------------------- /EDMS/src/main/java/JavaFiles/Login.java: -------------------------------------------------------------------------------- 1 | package JavaFiles; 2 | 3 | import jakarta.servlet.ServletException; 4 | import jakarta.servlet.annotation.MultipartConfig; 5 | import jakarta.servlet.annotation.WebServlet; 6 | import jakarta.servlet.http.HttpServlet; 7 | import jakarta.servlet.http.HttpServletRequest; 8 | import jakarta.servlet.http.HttpServletResponse; 9 | import jakarta.servlet.http.HttpSession; 10 | import java.util.*; 11 | import java.io.IOException; 12 | import java.io.InputStream; 13 | import java.sql.Connection; 14 | import java.sql.DriverManager; 15 | import java.sql.PreparedStatement; 16 | import java.sql.ResultSet; 17 | import java.sql.SQLException; 18 | import java.sql.Statement; 19 | import org.mindrot.jbcrypt.BCrypt; 20 | 21 | @MultipartConfig 22 | @WebServlet(name="Login",urlPatterns= {"/Login"}) 23 | public class Login extends HttpServlet { 24 | private static final long serialVersionUID = 1L; 25 | 26 | 27 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 28 | Connection con = null; 29 | 30 | try 31 | { 32 | Class.forName("com.mysql.cj.jdbc.Driver"); 33 | } 34 | catch(ClassNotFoundException e) 35 | { 36 | e.printStackTrace(); 37 | } 38 | try 39 | { 40 | con=DriverManager.getConnection("jdbc:mysql://localhost:3306/edms" , "root",""); 41 | } 42 | catch(SQLException e) 43 | { 44 | 45 | e.printStackTrace(); 46 | } 47 | 48 | String Username=request.getParameter("log_username"); 49 | String pass=request.getParameter("log_password"); 50 | 51 | // ------------------------------- verified update here ------------------------------------------- 52 | 53 | 54 | 55 | 56 | 57 | String queryv = "SELECT * FROM verified WHERE Username = '"+Username+"'"; 58 | Statement stmtv; 59 | String Verified = null; 60 | try 61 | { 62 | stmtv = con.createStatement(); 63 | ResultSet rs = stmtv.executeQuery(queryv); 64 | while(rs.next()) 65 | { 66 | Verified = rs.getString("Username"); 67 | 68 | } 69 | 70 | } 71 | catch(Exception e) 72 | { 73 | e.printStackTrace(); 74 | } 75 | 76 | 77 | 78 | 79 | if(Verified==null) 80 | { 81 | 82 | int count = 0; 83 | 84 | String query90 = "SELECT * FROM "+Username+"_location"; 85 | Statement stmt90; 86 | try 87 | { 88 | stmt90 = con.createStatement(); 89 | ResultSet rs = stmt90.executeQuery(query90); 90 | while(rs.next()) 91 | { 92 | 93 | 94 | String LLocUsername = rs.getString("LocationUsername"); 95 | 96 | 97 | String query901 = "SELECT COUNT(*) FROM "+LLocUsername+"_askhelp"; 98 | Statement stmt901; 99 | 100 | try 101 | { 102 | stmt901 = con.createStatement(); 103 | ResultSet rs1 = stmt901.executeQuery(query901); 104 | while(rs1.next()) 105 | { 106 | 107 | count = count + rs1.getInt(1); 108 | 109 | } 110 | 111 | } 112 | catch(Exception e) 113 | { 114 | e.printStackTrace(); 115 | } 116 | 117 | } 118 | 119 | } 120 | catch(Exception e) 121 | { 122 | e.printStackTrace(); 123 | } 124 | 125 | 126 | if(count>=20) 127 | { 128 | 129 | try 130 | { 131 | PreparedStatement ps=con.prepareStatement("insert into verified(Username)values(?)"); 132 | 133 | ps.setString(1, Username); 134 | ps.executeUpdate(); 135 | } 136 | catch(Exception e) 137 | { 138 | 139 | } 140 | 141 | 142 | } 143 | 144 | } 145 | 146 | 147 | Statement stmtm; 148 | 149 | HttpSession session=request.getSession(); 150 | try { 151 | stmtm=con.createStatement(); 152 | ResultSet rss=stmtm.executeQuery("select * from registrationinfo where Username ='"+Username+"'"); 153 | String password=null; 154 | 155 | 156 | while(rss.next()) { 157 | password=rss.getString("Password"); 158 | if (BCrypt.checkpw(pass, password)) { 159 | password=pass; 160 | System.out.println("Password is correct."); 161 | } 162 | else { 163 | request.setAttribute("message", "Username or Password Doesn't Match"); 164 | request.getRequestDispatcher("Login.jsp").forward(request, response); 165 | } 166 | 167 | } 168 | 169 | 170 | if(password==null) { 171 | 172 | request.setAttribute("message", "Username or Password Doesn't Match"); 173 | request.getRequestDispatcher("Login.jsp").forward(request, response); 174 | } 175 | else if(password.equals(pass)) { 176 | 177 | session.setAttribute("loggedInUser", Username); 178 | 179 | String redirectURL = (String) session.getAttribute("redirectURL"); 180 | if (redirectURL != null) { 181 | 182 | 183 | session.removeAttribute("redirectURL"); 184 | response.sendRedirect(redirectURL); 185 | } else { 186 | response.sendRedirect("Home.jsp"); 187 | } 188 | } 189 | else { 190 | 191 | request.setAttribute("message", "Username or Password Doesn't Match"); 192 | request.getRequestDispatcher("Login.jsp").forward(request, response); 193 | } 194 | }catch(Exception e) { 195 | 196 | } 197 | 198 | } 199 | 200 | } -------------------------------------------------------------------------------- /EDMS/src/main/java/JavaFiles/MachineLearning.java: -------------------------------------------------------------------------------- 1 | package JavaFiles; 2 | 3 | import jakarta.servlet.ServletException; 4 | import jakarta.servlet.annotation.WebServlet; 5 | import jakarta.servlet.http.HttpServlet; 6 | import jakarta.servlet.http.HttpServletRequest; 7 | import jakarta.servlet.http.HttpServletResponse; 8 | import java.io.IOException; 9 | import java.sql.Connection; 10 | import java.sql.DriverManager; 11 | import java.sql.ResultSet; 12 | import java.sql.SQLException; 13 | import java.sql.Statement; 14 | import java.util.*; 15 | import java.text.ParseException; 16 | import java.text.SimpleDateFormat; 17 | import java.util.Locale; 18 | import java.util.Date; 19 | 20 | import jakarta.servlet.ServletException; 21 | import jakarta.servlet.annotation.MultipartConfig; 22 | import jakarta.servlet.annotation.WebServlet; 23 | import jakarta.servlet.http.HttpServlet; 24 | import jakarta.servlet.http.HttpServletRequest; 25 | import jakarta.servlet.http.HttpServletResponse; 26 | import jakarta.servlet.http.HttpSession; 27 | import jakarta.servlet.http.Part; 28 | 29 | import java.io.IOException; 30 | import java.io.InputStream; 31 | import java.io.PrintWriter; 32 | import java.sql.Connection; 33 | import java.sql.DriverManager; 34 | import java.sql.PreparedStatement; 35 | import java.sql.ResultSet; 36 | import java.sql.SQLException; 37 | import java.sql.Statement; 38 | import java.text.SimpleDateFormat; 39 | import java.util.Date; 40 | import java.util.Locale; 41 | 42 | 43 | /** 44 | * Servlet implementation class MachineLearning 45 | */ 46 | public class MachineLearning extends HttpServlet { 47 | private static final long serialVersionUID = 1L; 48 | 49 | /** 50 | * @see HttpServlet#HttpServlet() 51 | */ 52 | public MachineLearning() { 53 | super(); 54 | // TODO Auto-generated constructor stub 55 | } 56 | 57 | /** 58 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) 59 | */ 60 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 61 | // TODO Auto-generated method stub 62 | response.getWriter().append("Served at: ").append(request.getContextPath()); 63 | } 64 | 65 | /** 66 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) 67 | */ 68 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 69 | // TODO Auto-generated method stub 70 | 71 | 72 | Connection con = null; 73 | 74 | try 75 | { 76 | Class.forName("com.mysql.cj.jdbc.Driver"); 77 | } 78 | catch(ClassNotFoundException e) 79 | { 80 | e.printStackTrace(); 81 | } 82 | try 83 | { 84 | con=DriverManager.getConnection("jdbc:mysql://localhost:3306/edms" , "root",""); 85 | } 86 | catch(SQLException e) 87 | { 88 | e.printStackTrace(); 89 | } 90 | 91 | 92 | ArrayList LocationUsername = new ArrayList(); 93 | ArrayList District = new ArrayList(); 94 | ArrayList Second = new ArrayList(); 95 | 96 | String queryU="select * from location_added"; 97 | Statement stmt0; 98 | try{ 99 | 100 | stmt0 = con.createStatement(); 101 | ResultSet rs0 = stmt0.executeQuery(queryU); 102 | while(rs0.next()){ 103 | String Username = rs0.getString("LocationUsername"); 104 | String DD = rs0.getString("District"); 105 | 106 | Long sec = rs0.getLong("Second"); 107 | 108 | District.add(DD); 109 | LocationUsername.add(Username); 110 | Second.add(sec); 111 | 112 | } 113 | }catch(Exception e){ 114 | 115 | } 116 | 117 | Date currentDate = new Date(); 118 | SimpleDateFormat dateFormat = new SimpleDateFormat("h:mma dd MMM, yyyy", Locale.ENGLISH); 119 | String formattedDateTime = dateFormat.format(currentDate); 120 | Date date; 121 | long secondsSinceEpoch=0; 122 | try { 123 | date = dateFormat.parse(formattedDateTime); 124 | secondsSinceEpoch = date.getTime() / 1000; 125 | 126 | } catch (ParseException e) { 127 | 128 | e.printStackTrace(); 129 | } 130 | 131 | int contribution = 0; 132 | int askhelp = 0; 133 | 134 | for(int i=0;i= "+yy+" AND second <= "+xx; 158 | Statement stmt12; 159 | try{ 160 | 161 | stmt12 = con.createStatement(); 162 | ResultSet rs12 = stmt12.executeQuery(query123); 163 | while(rs12.next()){ 164 | contribution = rs12.getInt(1); 165 | 166 | } 167 | }catch(Exception e){ 168 | 169 | } 170 | 171 | 172 | String query12311 = "SELECT COUNT(*) FROM " + LocationUsername.get(i) + "_askhelp WHERE second >= "+yy+" AND second <= "+xx; 173 | Statement stmt1211; 174 | try{ 175 | 176 | stmt1211 = con.createStatement(); 177 | ResultSet rs12 = stmt1211.executeQuery(query1231); 178 | while(rs12.next()){ 179 | askhelp = rs12.getInt(1); 180 | 181 | } 182 | }catch(Exception e){ 183 | 184 | } 185 | 186 | 187 | 188 | 189 | 190 | String Username=""; 191 | 192 | for(int j=0;j5) 228 | { 229 | 230 | try { 231 | // Establish a database connection 232 | 233 | 234 | // Define the SQL query with placeholders 235 | String sql = "UPDATE location_verified SET LocationUsername = ?"; 236 | 237 | // Create a prepared statement 238 | PreparedStatement preparedStatement = con.prepareStatement(sql); 239 | 240 | // Set the new total_priority, new priority, and condition values as parameters 241 | 242 | preparedStatement.setString(1,LocationUsername.get(i)); 243 | 244 | 245 | // Execute the update 246 | int rowsUpdated = preparedStatement.executeUpdate(); 247 | System.out.println("Rows updated: " + rowsUpdated); 248 | 249 | // Close the resources 250 | preparedStatement.close(); 251 | 252 | } catch (SQLException e) { 253 | e.printStackTrace(); 254 | } 255 | } 256 | 257 | 258 | if(MLvalue==1) 259 | { 260 | 261 | try { 262 | // Establish a database connection 263 | 264 | 265 | // Define the SQL query with placeholders 266 | String sql = "UPDATE location_added SET TotalPriority = ?, Activity = ? WHERE LocationUsername = ?"; 267 | 268 | // Create a prepared statement 269 | PreparedStatement preparedStatement = con.prepareStatement(sql); 270 | 271 | // Set the new total_priority, new priority, and condition values as parameters 272 | float x = (float)(Second.get(i)/1000000.00); 273 | preparedStatement.setFloat(1,x ); 274 | preparedStatement.setString(2 ,"Critical Help Needed"); 275 | preparedStatement.setString(3, LocationUsername.get(i)); 276 | 277 | // Execute the update 278 | int rowsUpdated = preparedStatement.executeUpdate(); 279 | System.out.println("Rows updated: " + rowsUpdated); 280 | 281 | // Close the resources 282 | preparedStatement.close(); 283 | 284 | } catch (SQLException e) { 285 | e.printStackTrace(); 286 | } 287 | 288 | 289 | 290 | 291 | try { 292 | // Establish a database connection 293 | 294 | 295 | // Define the SQL query with placeholders 296 | String sql = "UPDATE "+Username+"_location SET Activity = ? WHERE LocationUsername = ?"; 297 | 298 | // Create a prepared statement 299 | PreparedStatement preparedStatement = con.prepareStatement(sql); 300 | 301 | // Set the new total_priority, new priority, and condition values as parameters 302 | 303 | preparedStatement.setString(1 ,"Critical Help Needed"); 304 | preparedStatement.setString(2, LocationUsername.get(i)); 305 | 306 | // Execute the update 307 | int rowsUpdated = preparedStatement.executeUpdate(); 308 | System.out.println("Rows updated: " + rowsUpdated); 309 | 310 | // Close the resources 311 | preparedStatement.close(); 312 | 313 | } catch (SQLException e) { 314 | e.printStackTrace(); 315 | } 316 | 317 | } 318 | 319 | else 320 | { 321 | try { 322 | // Establish a database connection 323 | 324 | 325 | // Define the SQL query with placeholders 326 | String sql = "UPDATE location_added SET TotalPriority = ?, Activity = ? WHERE LocationUsername = ?"; 327 | 328 | // Create a prepared statement 329 | PreparedStatement preparedStatement = con.prepareStatement(sql); 330 | 331 | // Set the new total_priority, new priority, and condition values as parameters 332 | float x = (float)(Second.get(i)/10000000.00); 333 | preparedStatement.setFloat(1,x ); 334 | 335 | if(askhelp>0) 336 | { 337 | preparedStatement.setString(2 ,"Active"); 338 | } 339 | else 340 | { 341 | preparedStatement.setString(2 ,"Inactive"); 342 | } 343 | 344 | preparedStatement.setString(3, LocationUsername.get(i)); 345 | 346 | // Execute the update 347 | int rowsUpdated = preparedStatement.executeUpdate(); 348 | System.out.println("Rows updated: " + rowsUpdated); 349 | 350 | // Close the resources 351 | preparedStatement.close(); 352 | 353 | } catch (SQLException e) { 354 | e.printStackTrace(); 355 | } 356 | 357 | 358 | try { 359 | // Establish a database connection 360 | 361 | 362 | // Define the SQL query with placeholders 363 | String sql = "UPDATE "+Username+"_location SET Activity = ? WHERE LocationUsername = ?"; 364 | 365 | // Create a prepared statement 366 | PreparedStatement preparedStatement = con.prepareStatement(sql); 367 | 368 | // Set the new total_priority, new priority, and condition values as parameters 369 | 370 | if(askhelp>0) 371 | { 372 | preparedStatement.setString(1 ,"Active"); 373 | } 374 | else 375 | { 376 | preparedStatement.setString(1 ,"Inactive"); 377 | } 378 | 379 | preparedStatement.setString(2, LocationUsername.get(i)); 380 | 381 | // Execute the update 382 | int rowsUpdated = preparedStatement.executeUpdate(); 383 | System.out.println("Rows updated: " + rowsUpdated); 384 | 385 | // Close the resources 386 | preparedStatement.close(); 387 | 388 | } catch (SQLException e) { 389 | e.printStackTrace(); 390 | } 391 | 392 | 393 | } 394 | 395 | 396 | 397 | 398 | 399 | 400 | } 401 | 402 | response.sendRedirect("Profile.jsp"); 403 | 404 | 405 | 406 | } 407 | 408 | } 409 | -------------------------------------------------------------------------------- /EDMS/src/main/java/JavaFiles/Pair.java: -------------------------------------------------------------------------------- 1 | package JavaFiles; 2 | 3 | public class Pair 4 | { 5 | public double First; 6 | public double second; 7 | Pair(double a , double b) 8 | { 9 | First = a; 10 | second = b; 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /EDMS/src/main/java/JavaFiles/PredictWithModel.java: -------------------------------------------------------------------------------- 1 | package JavaFiles; 2 | 3 | import weka.classifiers.Classifier; 4 | import weka.core.Instances; 5 | import weka.core.SerializationHelper; 6 | import weka.core.DenseInstance; 7 | import weka.core.Attribute; 8 | 9 | import java.util.ArrayList; 10 | 11 | import org.jsoup.Jsoup; 12 | import org.jsoup.nodes.Document; 13 | import org.jsoup.nodes.Element; 14 | import org.jsoup.select.Elements; 15 | 16 | public class PredictWithModel { 17 | 18 | public int Predict(String District , int contribution , int askHelp) throws Exception { 19 | 20 | 21 | // Load the pre-trained model (replace "trained_model.model" with the actual model file) 22 | 23 | Classifier model = TrainModel.trainModel(); 24 | 25 | // Define the attributes (excluding the class attribute) 26 | ArrayList attributes = new ArrayList<>(); 27 | attributes.add(new Attribute("DangerLevel")); 28 | attributes.add(new Attribute("Day1")); 29 | attributes.add(new Attribute("Day2")); 30 | attributes.add(new Attribute("Day3")); 31 | attributes.add(new Attribute("Day4")); 32 | attributes.add(new Attribute("Day5")); 33 | attributes.add(new Attribute("Day6")); 34 | attributes.add(new Attribute("Day7")); 35 | attributes.add(new Attribute("ContributionCountInLast3Days")); 36 | attributes.add(new Attribute("AskForHelpInLast3Days")); 37 | 38 | // Create a new Instances object for prediction 39 | Instances newInstance = new Instances("PredictionData", attributes, 0); 40 | 41 | // Create a class attribute "CriticalHelpNeeded" (replace with the actual class values) 42 | ArrayList classValues = new ArrayList(); 43 | classValues.add("0"); // Not needed 44 | classValues.add("1"); // Critical help needed 45 | Attribute classAttribute = new Attribute("CriticalHelpNeeded", classValues); 46 | 47 | newInstance.insertAttributeAt(classAttribute, newInstance.numAttributes()); 48 | 49 | // Set class index to the newly added class attribute 50 | newInstance.setClassIndex(newInstance.numAttributes() - 1); 51 | 52 | // Create a new instance for prediction (replace with your data) 53 | 54 | 55 | 56 | String Sylhet[]=new String[10]; 57 | String Moulvibazar[]=new String[10]; 58 | Document doc = Jsoup.connect("http://www.ffwc.gov.bd/ffwc_charts/waterlevelfcast.php").get(); 59 | Element table = doc.select("table").get(0); 60 | Elements rows = table.select("tr"); 61 | 62 | for (int i = 3; i < rows.size(); i++) { 63 | Element row = rows.get(i); 64 | Elements td = row.getAllElements(); 65 | try { 66 | if(td.get(1).text().equals("Brahmaputra Basin")||td.get(1).text().equals("Ganges Basin")||td.get(1).text().equals("Meghna Basin")||td.get(1).text().equals("South Eastern Hill Basin")) { 67 | System.out.println(td.get(1).text()); 68 | System.out.println(); 69 | }else { 70 | if(td.get(2).text().equals("Sylhet")) { 71 | Sylhet[0]=td.get(3).text(); 72 | Sylhet[1]=td.get(4).text(); 73 | Sylhet[2]=td.get(5).text(); 74 | Sylhet[3]=td.get(6).text(); 75 | Sylhet[4]=td.get(7).text(); 76 | Sylhet[5]=td.get(8).text(); 77 | Sylhet[6]=td.get(9).text(); 78 | Sylhet[7]=td.get(10).text(); 79 | } 80 | if(td.get(2).text().equals("Moulvibazar")) { 81 | Moulvibazar[0]=td.get(3).text(); 82 | Moulvibazar[1]=td.get(4).text(); 83 | Moulvibazar[2]=td.get(5).text(); 84 | Moulvibazar[3]=td.get(6).text(); 85 | Moulvibazar[4]=td.get(7).text(); 86 | Moulvibazar[5]=td.get(8).text(); 87 | Moulvibazar[6]=td.get(9).text(); 88 | Moulvibazar[7]=td.get(10).text(); 89 | } 90 | //System.out.println("River Name: "+td.get(1).text()+" Station Name: "+td.get(2).text()+" Danger Level: "+td.get(3).text()+" Observe Level: "+td.get(4).text());System.out.println(); 91 | } 92 | }catch(Exception e) { 93 | System.out.print(""); 94 | } 95 | } 96 | 97 | 98 | double[] newValues = new double[10]; 99 | 100 | if(District == "Sylhet") 101 | { 102 | for(int i=0;i<8;i++) 103 | { 104 | newValues[i] = Double.parseDouble(Sylhet[i]); 105 | } 106 | } 107 | else 108 | { 109 | 110 | for(int i=0;i<8;i++) 111 | { 112 | newValues[i] = Double.parseDouble(Moulvibazar[i]); 113 | } 114 | } 115 | 116 | newValues[8] = contribution; 117 | newValues[9] = askHelp; 118 | 119 | 120 | 121 | 122 | 123 | DenseInstance instance = new DenseInstance(attributes.size() + 1); // +1 for the class attribute 124 | 125 | for (int i = 0; i < newValues.length; i++) { 126 | if (i == attributes.size()) { 127 | // Set class attribute 128 | instance.setValue(classAttribute, newValues[i]); 129 | } else { 130 | instance.setValue(attributes.get(i), newValues[i]); 131 | } 132 | } 133 | 134 | // Add the instance to the Instances object 135 | newInstance.add(instance); 136 | 137 | // Classify the new instance 138 | double predictedClass = model.classifyInstance(newInstance.firstInstance()); 139 | 140 | // Get the predicted class label 141 | String predictedDecision = newInstance.attribute(newInstance.numAttributes() - 1).value((int) predictedClass); 142 | System.out.println("Predicted Decision: " + predictedDecision); 143 | 144 | int val = Integer.parseInt(predictedDecision); 145 | 146 | return val; 147 | } 148 | } -------------------------------------------------------------------------------- /EDMS/src/main/java/JavaFiles/PrintCharacter.java: -------------------------------------------------------------------------------- 1 | package JavaFiles; 2 | 3 | public class PrintCharacter { 4 | 5 | public String Print_200_Characters(String a) 6 | { 7 | String temp=""; 8 | 9 | int min = 200; 10 | 11 | if(min>a.length()) 12 | { 13 | min = a.length(); 14 | } 15 | 16 | for(int i=0;i0) 113 | { 114 | 115 | request.setAttribute("message", "Username Already Exists"); 116 | request.getRequestDispatcher("Registration.jsp").forward(request, response); 117 | 118 | } 119 | else if(!password1.equals(password2)) 120 | { 121 | 122 | request.setAttribute("message", "Password and Re-Password doesn't match"); 123 | request.getRequestDispatcher("Registration.jsp").forward(request, response); 124 | 125 | } 126 | else { 127 | response.setContentType("text/html;charset=UTF-8"); 128 | out=response.getWriter(); 129 | int res=0; 130 | Part part=request.getPart("ImageName"); 131 | 132 | String contentType1 = part.getContentType(); 133 | if (!(contentType1 != null && (contentType1.startsWith("image/jpeg") || contentType1.startsWith("image/png") || contentType1.startsWith("image/gif") || contentType1.startsWith("image/jpg") || contentType1.startsWith("image/svg") || contentType1.startsWith("image/webp")|| contentType1.startsWith("image/JPEG") || contentType1.startsWith("image/PNG") || contentType1.startsWith("image/GIF") || contentType1.startsWith("image/JPG") || contentType1.startsWith("image/SVG") || contentType1.startsWith("image/WEBP")))) { 134 | request.setAttribute("message", "Give a proper image"); 135 | request.getRequestDispatcher("Registration.jsp").forward(request, response); 136 | } else { 137 | 138 | 139 | 140 | if(part!=null) { 141 | try { 142 | PreparedStatement ps=con.prepareStatement("insert into registrationinfo(Image,Name,Username,Password,Type,ContactNo,Email,Description,Location)values(?,?,?,?,?,?,?,?,?)"); 143 | 144 | InputStream is=part.getInputStream(); 145 | 146 | ps.setBlob(1, is); 147 | ps.setString(2, Name); 148 | ps.setString(3, Username); 149 | String hashedPassword = BCrypt.hashpw(password1, BCrypt.gensalt()); 150 | ps.setString(4, hashedPassword); 151 | ps.setString(5, TypeSelect); 152 | ps.setString(6, ContactNo); 153 | ps.setString(7, Email); 154 | ps.setString(8, Description); 155 | ps.setString(9, selectedUnion); 156 | 157 | res=ps.executeUpdate(); 158 | PreparedStatement ps1=con.prepareStatement("create table "+Username+"_post(Description text,Photo1 longblob,Photo2 longblob,Location text,Affected int,Date text,Second bigint);"); 159 | ps1.executeUpdate(); 160 | ps1=con.prepareStatement("create table "+Username+"_location(LocationUsername text,Name text,Type text,Description text,Photo1 longblob,Photo2 longblob,Location text,Location_URL text,Affected_Male int,Affected_Female int,Affected_Children int,Affected_Total int,ContactNo text,Activity text,Date text,Second bigint);"); 161 | ps1.executeUpdate(); 162 | 163 | if(res>0) { 164 | response.sendRedirect("Login.jsp"); 165 | } 166 | else { 167 | response.sendRedirect("Registration.jsp?message=Some+Error+Occured"); 168 | } 169 | }catch(SQLException e) { 170 | System.out.println("Add image a dhora"); 171 | e.printStackTrace(); 172 | } 173 | 174 | } 175 | } 176 | } 177 | } 178 | 179 | } 180 | -------------------------------------------------------------------------------- /EDMS/src/main/java/JavaFiles/TrainModel.java: -------------------------------------------------------------------------------- 1 | package JavaFiles; 2 | 3 | import weka.classifiers.trees.J48; 4 | import weka.core.Attribute; 5 | import weka.core.Instances; 6 | import weka.core.SerializationHelper; 7 | import weka.core.DenseInstance; 8 | 9 | import java.util.ArrayList; 10 | 11 | 12 | public class TrainModel { 13 | public static J48 trainModel() throws Exception { 14 | // Create attribute information (names and types) 15 | ArrayList attributes = new ArrayList<>(); 16 | 17 | attributes.add(new Attribute("DangerLevel")); 18 | attributes.add(new Attribute("Day1")); 19 | attributes.add(new Attribute("Day2")); 20 | attributes.add(new Attribute("Day3")); 21 | attributes.add(new Attribute("Day4")); 22 | attributes.add(new Attribute("Day5")); 23 | attributes.add(new Attribute("Day6")); 24 | attributes.add(new Attribute("Day7")); 25 | attributes.add(new Attribute("ContributionCountInLast3Days")); 26 | attributes.add(new Attribute("AskForHelpInLast3Days")); 27 | 28 | // Create class attribute "CriticalHelpNeeded" 29 | ArrayList classValues = new ArrayList<>(); 30 | classValues.add("0"); // Not needed 31 | classValues.add("1"); // Critical help needed 32 | Attribute classAttribute = new Attribute("CriticalHelpNeeded", classValues); 33 | 34 | attributes.add(classAttribute); 35 | 36 | // Create dataset 37 | Instances dataset = new Instances("ReliefCenterData", attributes, 0); 38 | dataset.setClassIndex(attributes.size() - 1); // Set class attribute 39 | 40 | 41 | 42 | 43 | // Add data instances (replace with your data) 44 | String[] dataLines = { 45 | "10.80,7.28,6.98,6.77,6.67,6.77,6.97,7.19,2,2,0", 46 | "10.80,9.28,9.98,9.77,9.67,10.77,9.97,9.19,1,5,1", 47 | "10.80,7.28,6.98,6.77,6.67,6.77,6.97,7.19,3,7,1", 48 | "10.80,11.28,9.98,11.77,9.67,10.77,9.97,9.19,1,1,0", 49 | "10.80,10.28,11.98,11.77,9.67,10.77,9.97,9.19,2,4,1" 50 | }; 51 | 52 | for (String dataLine : dataLines) { 53 | String[] values = dataLine.split(","); 54 | double[] instanceValues = new double[attributes.size()]; 55 | 56 | for (int i = 0; i < values.length; i++) { 57 | if (i == attributes.size() - 1) { 58 | // Set class attribute 59 | instanceValues[i] = classAttribute.indexOfValue(values[i]); 60 | } else { 61 | instanceValues[i] = Double.parseDouble(values[i]); 62 | } 63 | } 64 | 65 | dataset.add(new DenseInstance(1.0, instanceValues)); 66 | } 67 | 68 | // Create and train a J48 decision tree classifier 69 | J48 tree = new J48(); 70 | tree.buildClassifier(dataset); 71 | 72 | // Save the trained model to a file 73 | 74 | 75 | System.out.println("Model trained and saved successfully."); 76 | return tree; 77 | 78 | } 79 | } -------------------------------------------------------------------------------- /EDMS/src/main/java/JavaFiles/UpdateProfile.java: -------------------------------------------------------------------------------- 1 | package JavaFiles; 2 | 3 | import jakarta.servlet.ServletException; 4 | import jakarta.servlet.annotation.MultipartConfig; 5 | import jakarta.servlet.annotation.WebServlet; 6 | import jakarta.servlet.http.HttpServlet; 7 | import jakarta.servlet.http.HttpServletRequest; 8 | import jakarta.servlet.http.HttpServletResponse; 9 | import java.io.IOException; 10 | import java.sql.Connection; 11 | import java.sql.DriverManager; 12 | import java.sql.PreparedStatement; 13 | import java.sql.SQLException; 14 | import org.mindrot.jbcrypt.BCrypt; 15 | 16 | @MultipartConfig 17 | @WebServlet(name="UpdateProfile",urlPatterns= {"/UpdateProfile"}) 18 | public class UpdateProfile extends HttpServlet { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 23 | System.out.println("aise"); 24 | Connection con = null; 25 | 26 | try 27 | { 28 | Class.forName("com.mysql.cj.jdbc.Driver"); 29 | } 30 | catch(ClassNotFoundException e) 31 | { 32 | e.printStackTrace(); 33 | } 34 | try 35 | { 36 | con=DriverManager.getConnection("jdbc:mysql://localhost:3306/edms" , "root",""); 37 | } 38 | catch(SQLException e) 39 | { 40 | 41 | e.printStackTrace(); 42 | } 43 | String Username=request.getParameter("Username"); 44 | String Name=request.getParameter("Name"); 45 | String Cont=request.getParameter("Cont"); 46 | String Password=""; 47 | Password=request.getParameter("Password"); 48 | if(Password.equals("")) { 49 | String sql="update registrationinfo set Name = ?, ContactNo = ? where Username=?"; 50 | try { 51 | System.out.println("aise"); 52 | System.out.println(Name); 53 | System.out.println(Cont); 54 | System.out.println(Username); 55 | PreparedStatement stmtp=con.prepareStatement(sql); 56 | stmtp.setString(1, Name); 57 | stmtp.setString(2, Cont); 58 | stmtp.setString(3, Username); 59 | int row= stmtp.executeUpdate(); 60 | System.out.println("update"+row); 61 | stmtp.close(); 62 | con.close(); 63 | } catch (SQLException e) { 64 | // TODO Auto-generated catch block 65 | e.printStackTrace(); 66 | } 67 | } 68 | else { 69 | String sql="update registrationinfo set Name=?, ContactNo=?, Password=? where Username=?"; 70 | try { 71 | PreparedStatement stmtp=con.prepareStatement(sql); 72 | stmtp.setString(1, Name); 73 | stmtp.setString(2, Cont); 74 | String hashedPassword = BCrypt.hashpw(Password, BCrypt.gensalt()); 75 | stmtp.setString(3, hashedPassword); 76 | stmtp.setString(4, Username); 77 | stmtp.executeUpdate(); 78 | stmtp.close(); 79 | con.close(); 80 | } catch (SQLException e) { 81 | // TODO Auto-generated catch block 82 | e.printStackTrace(); 83 | } 84 | } 85 | response.sendRedirect("Profile.jsp"); 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /EDMS/src/main/java/JavaFiles/divisions.java: -------------------------------------------------------------------------------- 1 | 2 | package JavaFiles; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | public class divisions { 8 | public Map divisionCoordinates = new HashMap<>(); 9 | 10 | public void make() 11 | { 12 | divisionCoordinates.put("Dhaka", new Pair(23.8103, 90.4125)); 13 | divisionCoordinates.put("Chittagong", new Pair(22.3475, 91.8123)); 14 | divisionCoordinates.put("Khulna", new Pair(22.8150, 89.5687)); 15 | divisionCoordinates.put("Rajshahi", new Pair(24.3740, 88.6011)); 16 | divisionCoordinates.put("Barisal", new Pair(22.7029, 90.3466)); 17 | divisionCoordinates.put("Rangpur", new Pair(25.7465, 89.2514)); 18 | divisionCoordinates.put("Mymensingh", new Pair(24.7466, 90.4077)); 19 | divisionCoordinates.put("Sylhet", new Pair(24.8897, 91.8759)); 20 | divisionCoordinates.put("Habiganj", new Pair(24.3864, 91.4182)); 21 | divisionCoordinates.put("Moulvibazar", new Pair(24.3065, 91.7296)); 22 | divisionCoordinates.put("Sunamganj", new Pair(25.0657, 91.4059)); 23 | divisionCoordinates.put("Faridpur", new Pair(23.5228, 89.8500)); 24 | divisionCoordinates.put("Gazipur", new Pair(24.0022, 90.4266)); 25 | divisionCoordinates.put("Gopalganj", new Pair(23.0022, 89.8268)); 26 | divisionCoordinates.put("Kishoreganj", new Pair(24.4333, 90.7750)); 27 | divisionCoordinates.put("Madaripur", new Pair(23.1690, 90.1985)); 28 | divisionCoordinates.put("Manikganj", new Pair(23.8583, 90.0391)); 29 | divisionCoordinates.put("Munshiganj", new Pair(23.5429, 90.5039)); 30 | divisionCoordinates.put("Narayanganj", new Pair(23.6062, 90.4996)); 31 | divisionCoordinates.put("Bandarban", new Pair(21.8310, 92.3686)); 32 | divisionCoordinates.put("Brahmanbaria", new Pair(23.9571, 91.1119)); 33 | divisionCoordinates.put("Chandpur", new Pair(23.2255, 90.6715)); 34 | divisionCoordinates.put("Comilla", new Pair(23.4160, 91.1588)); 35 | divisionCoordinates.put("Coxs Bazar", new Pair(21.4272, 92.0058)); 36 | divisionCoordinates.put("Feni", new Pair(23.0238, 91.3849)); 37 | divisionCoordinates.put("Khagrachari", new Pair(23.1126, 91.9630)); 38 | divisionCoordinates.put("Lakshmipur", new Pair(22.9420, 90.8402)); 39 | divisionCoordinates.put("Noakhali", new Pair(22.8432, 91.1082)); 40 | divisionCoordinates.put("Rangamati", new Pair(22.6511, 92.1822)); 41 | divisionCoordinates.put("Bogra", new Pair(24.8500, 89.3672)); 42 | divisionCoordinates.put("Joypurhat", new Pair(25.0968, 89.0319)); 43 | divisionCoordinates.put("Naogaon", new Pair(24.7936, 88.9318)); 44 | divisionCoordinates.put("Natore", new Pair(24.4206, 88.9762)); 45 | divisionCoordinates.put("Nawabganj", new Pair(24.5965, 88.2746)); 46 | divisionCoordinates.put("Pabna", new Pair(24.0128, 89.2380)); 47 | divisionCoordinates.put("Rajshahi", new Pair(24.3740, 88.6011)); 48 | divisionCoordinates.put("Sirajgonj", new Pair(24.4513, 89.7082)); 49 | divisionCoordinates.put("Bagerhat", new Pair(22.6584, 89.7850)); 50 | divisionCoordinates.put("Chuadanga", new Pair(23.6438, 88.8415)); 51 | divisionCoordinates.put("Jessore", new Pair(23.1667, 89.2089)); 52 | divisionCoordinates.put("Jhenaidah", new Pair(23.5441, 89.1524)); 53 | divisionCoordinates.put("Khulna", new Pair(22.8150, 89.5687)); 54 | divisionCoordinates.put("Kushtia", new Pair(23.9032, 89.1214)); 55 | divisionCoordinates.put("Magura", new Pair(23.4874, 89.4195)); 56 | divisionCoordinates.put("Meherpur", new Pair(23.7622, 88.6363)); 57 | divisionCoordinates.put("Narail", new Pair(23.1724, 89.5124)); 58 | divisionCoordinates.put("Satkhira", new Pair(22.7185, 89.0705)); 59 | divisionCoordinates.put("Barguna", new Pair(22.1500, 90.1122)); 60 | divisionCoordinates.put("Barisal", new Pair(22.7010, 90.3285)); 61 | divisionCoordinates.put("Bhola", new Pair(22.6859, 90.6480)); 62 | divisionCoordinates.put("Jhalokati", new Pair(22.6236, 90.1973)); 63 | divisionCoordinates.put("Patuakhali", new Pair(22.3595, 90.3314)); 64 | divisionCoordinates.put("Pirojpur", new Pair(22.5856, 89.9720)); 65 | divisionCoordinates.put("Jamalpur", new Pair(24.9312, 89.9440)); 66 | divisionCoordinates.put("Mymensingh", new Pair(24.7570, 90.4069)); 67 | divisionCoordinates.put("Netrokona", new Pair(24.8896, 90.7270)); 68 | divisionCoordinates.put("Sherpur", new Pair(25.0205, 90.0153)); 69 | } 70 | 71 | public static double haversineDistance(double lat1, double lon1, double lat2, double lon2) { 72 | // Convert degrees to radians 73 | lat1 = Math.toRadians(lat1); 74 | lon1 = Math.toRadians(lon1); 75 | lat2 = Math.toRadians(lat2); 76 | lon2 = Math.toRadians(lon2); 77 | 78 | // Haversine formula 79 | double dlat = lat2 - lat1; 80 | double dlon = lon2 - lon1; 81 | double a = Math.pow(Math.sin(dlat / 2), 2) + Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(dlon / 2), 2); 82 | double c = 2 * Math.asin(Math.sqrt(a)); 83 | double r = 6371; // Earth's radius in kilometers 84 | double distance = c * r; 85 | 86 | return distance; 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /EDMS/src/main/webapp/AddAskHelp.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@page import="java.sql.*" %> 4 | 5 | 6 | 7 | 8 | 9 | Emergency Disaster Management System 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <% 25 | 26 | String LocationUsername = request.getParameter("LocationUsernameFromLocationProfile"); 27 | %> 28 |
29 |
30 |
31 |
32 | 39 | 40 |

Ask for Help

41 | 42 | 43 |
45 | 46 |
47 | 50 | 51 |
52 | 53 | 56 |
57 | 58 | 59 |
60 | 61 | 64 |
65 | 66 | 67 | 68 |
69 | > 70 | 71 | 72 |

${message}

73 |
74 | 75 |
76 |
77 |
78 |
79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /EDMS/src/main/webapp/AddContribution.jsp: -------------------------------------------------------------------------------- 1 | 2 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 3 | pageEncoding="ISO-8859-1"%> 4 | 5 | <%@page import="java.sql.*" %> 6 | 7 | 8 | 9 | 10 | Emergency Disaster Management System 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | <% 26 | 27 | String LocationUsername = request.getParameter("LocationUsernameFromLocationProfile"); 28 | 29 | %> 30 |
31 |
32 |
33 |
34 | 41 | 42 |

Add Contribution History

43 | 44 | 45 |
47 | 50 | 51 | 52 | 53 |
54 | 57 | 58 |
59 | 60 | 63 |
64 | 65 | 66 |
67 | 68 | > 69 | 70 |

${message}

71 |
72 | 73 |
74 |
75 |
76 |
77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /EDMS/src/main/webapp/AddLocation.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@page import="java.sql.*" %> 4 | <%@page import="java.sql.*" %> 5 | 6 | 7 | 8 | Emergency Disaster Management System 9 | 10 | 11 | 12 | 13 | 18 | 19 | 23 | 24 | 25 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | <% 37 | 38 | Connection con = null; 39 | 40 | try 41 | { 42 | Class.forName("com.mysql.cj.jdbc.Driver"); 43 | } 44 | catch(ClassNotFoundException e) 45 | { 46 | e.printStackTrace(); 47 | } 48 | try 49 | { 50 | con=DriverManager.getConnection("jdbc:mysql://localhost:3306/edms" , "root",""); 51 | } 52 | catch(SQLException e) 53 | { 54 | e.printStackTrace(); 55 | } 56 | String loggedInUser = (String) session.getAttribute("loggedInUser"); 57 | if (loggedInUser == null) { 58 | String currentURL = request.getRequestURI(); 59 | session.setAttribute("redirectURL", currentURL); 60 | response.sendRedirect("Login.jsp"); 61 | return; 62 | } 63 | System.out.println(loggedInUser); 64 | %> 65 | 66 | 302 | 303 | 304 |
305 |
306 |
307 |
308 | 315 | 316 | 317 |
323 | 324 | 329 | 335 | 336 | 344 | 345 | 348 | 354 | 355 | 360 | 367 | 374 | 375 | 376 | 379 |
380 | 381 | 387 | 393 |
394 | 395 | 396 | 399 | 405 | 406 | 407 | 410 | 418 | 419 | 420 | 438 | 439 | <% 440 | String selectedDistrict = request.getParameter("jsValue");%> 441 | 442 | 443 | 444 | 447 | 455 | 456 | 457 | 476 | 477 | <% 478 | 479 | String selectedUpazilla = request.getParameter("UpValue");%> 480 | 481 | 482 | 485 | 493 | 494 | 495 | 517 | 518 | <% 519 | 520 | String selectedUnion = request.getParameter("UnionValue"); 521 | 522 | 523 | %> 524 | 525 | /> 526 | 527 | 533 | 534 | 535 | 536 | 541 | 542 | 548 | 549 |

${message}

550 | 551 | 552 |
553 |
554 |
555 |
556 |
557 | 558 | 559 | -------------------------------------------------------------------------------- /EDMS/src/main/webapp/AddPost.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@page import="java.sql.*" %> 4 | 5 | <% 6 | 7 | Connection con = null; 8 | 9 | try 10 | { 11 | Class.forName("com.mysql.cj.jdbc.Driver"); 12 | } 13 | catch(ClassNotFoundException e) 14 | { 15 | e.printStackTrace(); 16 | } 17 | try 18 | { 19 | con=DriverManager.getConnection("jdbc:mysql://localhost:3306/edms" , "root",""); 20 | } 21 | catch(SQLException e) 22 | { 23 | e.printStackTrace(); 24 | } 25 | 26 | %> 27 | 28 | <% 29 | String loggedInUser = (String) session.getAttribute("loggedInUser"); 30 | if (loggedInUser == null) { 31 | String currentURL = request.getRequestURI(); 32 | session.setAttribute("redirectURL", currentURL); 33 | response.sendRedirect("Login.jsp"); 34 | return; 35 | } 36 | %> 37 | 38 | 39 | 40 | 41 | Emergency Disaster Management System 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 295 |
296 |
297 |
298 |
299 | 306 | 307 |

Post

308 | 309 | 310 |
312 | 313 |
314 | 317 | 318 |
319 | 320 | 323 |
324 | 325 | 326 |
327 | 328 | 329 | 332 | 333 | 334 | 342 | 343 | 344 | 362 | 363 | <% 364 | String selectedDistrict = request.getParameter("jsValue");%> 365 | 366 | 367 | 368 | 369 | 377 | 378 | 379 | 398 | 399 | <% 400 | 401 | String selectedUpazilla = request.getParameter("UpValue");%> 402 | 403 | 404 | 405 | 413 | 414 | 415 | 437 | 438 | <% 439 | 440 | String selectedUnion = request.getParameter("UnionValue");%> 441 | 442 | /> 443 | 444 | 450 | 451 | 452 | 453 | 454 | 455 |

${message}

456 |
457 | 458 |
459 |
460 |
461 |
462 | 463 | 464 | 465 | -------------------------------------------------------------------------------- /EDMS/src/main/webapp/CSS/Faq.css: -------------------------------------------------------------------------------- 1 | body, h1, h2, p { 2 | margin: 0; 3 | padding: 0; 4 | background-color: rgb(245, 242, 238); 5 | } 6 | 7 | .conttainer 8 | { 9 | 10 | margin: 0 auto; 11 | padding: 0px; 12 | background-color: rgb(245, 242, 238); 13 | 14 | } 15 | .container { 16 | max-width: 100vw; 17 | margin: 0 auto; 18 | padding: 4vw; 19 | } 20 | 21 | h1 { 22 | margin-bottom: 20px; 23 | font-size: 28px; 24 | color: #333; 25 | } 26 | 27 | .faq-item { 28 | margin-bottom: 30px; 29 | border-bottom: 1px solid #ccc; 30 | padding-bottom: 20px; 31 | } 32 | 33 | .faq-item h2 { 34 | margin-bottom: 10px; 35 | font-size: 20px; 36 | color: #333; 37 | } 38 | 39 | .faq-item p { 40 | color: #666; 41 | } 42 | .navbar 43 | { 44 | 45 | max-height: 9vh; 46 | background-color: orange; 47 | display:flex; 48 | justify-content: space-between; 49 | align-items: center; 50 | padding: 10px 0; 51 | border-bottom: 1px solid #967212; 52 | font-size:15px; 53 | margin-right:0px; 54 | flex: 1; 55 | 56 | } 57 | 58 | .logo 59 | { 60 | max-height: 50px; 61 | font-size: 35px; 62 | margin-left: 30px; 63 | 64 | } 65 | 66 | .navbar ul 67 | { 68 | list-style:none; 69 | display:flex; 70 | 71 | 72 | } 73 | .navbar li 74 | { 75 | margin-right:50px; 76 | font-size: 16px;; 77 | cursor: pointer; 78 | margin-top : auto; 79 | 80 | 81 | } 82 | 83 | .navbar a 84 | { 85 | text-decoration: none; 86 | color: #333; 87 | font-size: 17px; 88 | 89 | } 90 | .material-symbols-outlined { 91 | font-family: 'Material Icons'; 92 | font-size: 24px; 93 | vertical-align: middle; 94 | } 95 | -------------------------------------------------------------------------------- /EDMS/src/main/webapp/CSS/Home.css: -------------------------------------------------------------------------------- 1 | @charset "ISO-8859-1"; 2 | 3 | /* My styles */ 4 | /* Get fonts from google */ 5 | @import url('https://fonts.googleapis.com/css2?family=Poppins&family=Roboto+Slab&display=swap'); 6 | 7 | * { 8 | font-family: 'Poppins', sans-serif; 9 | /* font-family: 'Roboto Slab', serif; */ 10 | /* overflow: hidden; */ 11 | } 12 | 13 | .my-container { 14 | max-width: 2520px; 15 | margin-left: auto; 16 | margin-right: auto; 17 | padding-left: 16px; 18 | padding-right: 16px; 19 | } 20 | 21 | 22 | /* breakpoint for small size screen */ 23 | @media only screen and (max-width: 640px) { 24 | .my-container { 25 | padding-left: 0.5rem; 26 | padding-right: 0.5rem; 27 | } 28 | } 29 | 30 | /* breakpoint for medium size screen */ 31 | @media only screen and (max-width: 768px) { 32 | .my-container { 33 | padding-left: 2.5rem; 34 | padding-right: 2.5rem; 35 | } 36 | } 37 | 38 | /* breakpoint for xl size screen */ 39 | @media only screen and (max-width: 768px) { 40 | .my-container { 41 | padding-left: 5rem; 42 | padding-right: 5rem; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /EDMS/src/main/webapp/CSS/Location.css: -------------------------------------------------------------------------------- 1 | .container 2 | { 3 | 4 | margin: 0 auto; 5 | padding: 0px; 6 | background-color: rgb(238, 233, 228); 7 | 8 | } 9 | body{ 10 | background-color: rgb(238, 233, 228); 11 | } 12 | .navbar 13 | { 14 | 15 | max-height: 9vh; 16 | background-color: rgb(218, 182, 134)e; 17 | display:flex; 18 | justify-content: space-between; 19 | align-items: center; 20 | padding: 10px 0; 21 | 22 | font-size:15px; 23 | margin-right:0px; 24 | flex: 1; 25 | 26 | } 27 | .log{ 28 | width: 60%; 29 | margin: 8vh 20vh 20vh 40vh; 30 | height: 145vw; 31 | align-items: center; 32 | background-color: white; 33 | margin-bottom: 20vh; 34 | border-radius: 5%; 35 | } 36 | h2{ 37 | margin-right: 5vh; 38 | text-align: center; 39 | padding-top: 5vh; 40 | } 41 | input 42 | { 43 | width: 60%; 44 | height:6vh; 45 | margin-left:10vw; 46 | margin-top: 5vh; 47 | } 48 | .posss{ 49 | width: 60%; 50 | height:6vh; 51 | margin-left:10vw; 52 | margin-top: 70vh; 53 | } 54 | .gog_map{ 55 | width: 100%; 56 | height:60vh; 57 | 58 | margin-top: 5vh; 59 | } 60 | .dropbox{ 61 | width: 60%; 62 | height:6vh; 63 | margin-left:10vw; 64 | margin-top: 5vh; 65 | } 66 | p{ 67 | width: 60%; 68 | height:2vh; 69 | margin-left:10vw; 70 | margin-top: 5vh; 71 | } 72 | .sobi_tul{ 73 | width: 60%; 74 | height:6vh; 75 | margin-left:10vw; 76 | margin-top: 1vh; 77 | } 78 | .lekha_tul{ 79 | width: 60%; 80 | height:20vh; 81 | margin-left:10vw; 82 | margin-top: 5vh; 83 | } -------------------------------------------------------------------------------- /EDMS/src/main/webapp/CSS/LocationProfile.css: -------------------------------------------------------------------------------- 1 | @charset "ISO-8859-1"; 2 | @charset "ISO-8859-1"; 3 | 4 | /* My styles */ 5 | /* Get fonts from google */ 6 | @import url('https://fonts.googleapis.com/css2?family=Poppins&family=Roboto+Slab&display=swap'); 7 | 8 | * { 9 | font-family: 'Poppins', sans-serif; 10 | /* font-family: 'Roboto Slab', serif; */ 11 | /* overflow: hidden; */ 12 | } 13 | 14 | .my-container { 15 | max-width: 2520px; 16 | margin-left: auto; 17 | margin-right: auto; 18 | padding-left: 16px; 19 | padding-right: 16px; 20 | } 21 | 22 | 23 | /* breakpoint for small size screen */ 24 | @media only screen and (max-width: 640px) { 25 | .my-container { 26 | padding-left: 0.5rem; 27 | padding-right: 0.5rem; 28 | } 29 | } 30 | 31 | /* breakpoint for medium size screen */ 32 | @media only screen and (max-width: 768px) { 33 | .my-container { 34 | padding-left: 2.5rem; 35 | padding-right: 2.5rem; 36 | } 37 | } 38 | 39 | /* breakpoint for xl size screen */ 40 | @media only screen and (max-width: 768px) { 41 | .my-container { 42 | padding-left: 5rem; 43 | padding-right: 5rem; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /EDMS/src/main/webapp/CSS/Post.css: -------------------------------------------------------------------------------- 1 | .container 2 | { 3 | 4 | margin: 0 auto; 5 | padding: 0px; 6 | background-color: rgb(238, 233, 228); 7 | 8 | } 9 | body{ 10 | background-color: rgb(238, 233, 228); 11 | } 12 | .navbar 13 | { 14 | 15 | max-height: 9vh; 16 | background-color: rgb(218, 182, 134)e; 17 | display:flex; 18 | justify-content: space-between; 19 | align-items: center; 20 | padding: 10px 0; 21 | 22 | font-size:15px; 23 | margin-right:0px; 24 | flex: 1; 25 | 26 | } 27 | .log{ 28 | width: 60%; 29 | margin: 8vh 20vh 20vh 40vh; 30 | height: 75vw; 31 | align-items: center; 32 | background-color: white; 33 | margin-bottom: 20vh; 34 | border-radius: 5%; 35 | } 36 | h2{ 37 | margin-right: 5vh; 38 | text-align: center; 39 | padding-top: 5vh; 40 | } 41 | input 42 | { 43 | width: 60%; 44 | height:6vh; 45 | margin-left:10vw; 46 | margin-top: 5vh; 47 | } 48 | .dropbox{ 49 | width: 60%; 50 | height:6vh; 51 | margin-left:10vw; 52 | margin-top: 5vh; 53 | } 54 | p{ 55 | width: 60%; 56 | height:2vh; 57 | margin-left:10vw; 58 | margin-top: 5vh; 59 | } 60 | .sobi_tul{ 61 | width: 60%; 62 | height:6vh; 63 | margin-left:10vw; 64 | margin-top: 1vh; 65 | } 66 | .lekha_tul{ 67 | width: 60%; 68 | height:20vh; 69 | margin-left:10vw; 70 | margin-top: 5vh; 71 | } -------------------------------------------------------------------------------- /EDMS/src/main/webapp/CSS/Profile.css: -------------------------------------------------------------------------------- 1 | /* My styles */ 2 | /* Get fonts from google */ 3 | @import url('https://fonts.googleapis.com/css2?family=Poppins&family=Roboto+Slab&display=swap'); 4 | 5 | * { 6 | font-family: 'Poppins', sans-serif; 7 | /* font-family: 'Roboto Slab', serif; */ 8 | /* overflow: hidden; */ 9 | } 10 | 11 | .my-container { 12 | max-width: 2520px; 13 | margin-left: auto; 14 | margin-right: auto; 15 | padding-left: 16px; 16 | padding-right: 16px; 17 | } 18 | 19 | .center-cropped { 20 | object-fit: cover; 21 | object-position: center; 22 | height: 200px; 23 | width: 200px; 24 | } 25 | 26 | /* breakpoint for small size screen */ 27 | @media only screen and (max-width: 640px) { 28 | .my-container { 29 | padding-left: 0.5rem; 30 | padding-right: 0.5rem; 31 | } 32 | } 33 | 34 | /* breakpoint for medium size screen */ 35 | @media only screen and (max-width: 768px) { 36 | .my-container { 37 | padding-left: 2.5rem; 38 | padding-right: 2.5rem; 39 | } 40 | } 41 | 42 | /* breakpoint for xl size screen */ 43 | @media only screen and (max-width: 768px) { 44 | .my-container { 45 | padding-left: 5rem; 46 | padding-right: 5rem; 47 | } 48 | } -------------------------------------------------------------------------------- /EDMS/src/main/webapp/CSS/Regi.css: -------------------------------------------------------------------------------- 1 | .container 2 | { 3 | 4 | margin: 0 auto; 5 | padding: 0px; 6 | background-color: rgb(238, 233, 228); 7 | 8 | } 9 | body{ 10 | background-color: rgb(238, 233, 228); 11 | } 12 | .navbar 13 | { 14 | 15 | max-height: 9vh; 16 | background-color: rgb(218, 182, 134)e; 17 | display:flex; 18 | justify-content: space-between; 19 | align-items: center; 20 | padding: 10px 0; 21 | 22 | font-size:15px; 23 | margin-right:0px; 24 | flex: 1; 25 | 26 | } 27 | .log{ 28 | width: 60%; 29 | margin: 8vh 20vh 20vh 40vh; 30 | height: 75vw; 31 | align-items: center; 32 | background-color: white; 33 | margin-bottom: 20vh; 34 | border-radius: 5%; 35 | } 36 | h2{ 37 | margin-right: 5vh; 38 | text-align: center; 39 | padding-top: 5vh; 40 | } 41 | input 42 | { 43 | width: 60%; 44 | height:6vh; 45 | margin-left:10vw; 46 | margin-top: 5vh; 47 | } 48 | .dropbox{ 49 | width: 60%; 50 | height:6vh; 51 | margin-left:10vw; 52 | margin-top: 5vh; 53 | } 54 | p{ 55 | width: 60%; 56 | height:2vh; 57 | margin-left:10vw; 58 | margin-top: 5vh; 59 | } 60 | .sobi_tul{ 61 | width: 60%; 62 | height:6vh; 63 | margin-left:10vw; 64 | margin-top: 1vh; 65 | } 66 | .lekha_tul{ 67 | width: 60%; 68 | height:20vh; 69 | margin-left:10vw; 70 | margin-top: 5vh; 71 | } -------------------------------------------------------------------------------- /EDMS/src/main/webapp/CSS/Shelter_and_areas.css: -------------------------------------------------------------------------------- 1 | @charset "ISO-8859-1"; 2 | 3 | /* My styles */ 4 | /* Get fonts from google */ 5 | @import url('https://fonts.googleapis.com/css2?family=Poppins&family=Roboto+Slab&display=swap'); 6 | 7 | * { 8 | font-family: 'Poppins', sans-serif; 9 | /* font-family: 'Roboto Slab', serif; */ 10 | /* overflow: hidden; */ 11 | } 12 | 13 | .my-container { 14 | max-width: 2520px; 15 | margin-left: auto; 16 | margin-right: auto; 17 | padding-left: 16px; 18 | padding-right: 16px; 19 | } 20 | 21 | 22 | /* breakpoint for small size screen */ 23 | @media only screen and (max-width: 640px) { 24 | .my-container { 25 | padding-left: 0.5rem; 26 | padding-right: 0.5rem; 27 | } 28 | } 29 | 30 | /* breakpoint for medium size screen */ 31 | @media only screen and (max-width: 768px) { 32 | .my-container { 33 | padding-left: 2.5rem; 34 | padding-right: 2.5rem; 35 | } 36 | } 37 | 38 | /* breakpoint for xl size screen */ 39 | @media only screen and (max-width: 768px) { 40 | .my-container { 41 | padding-left: 5rem; 42 | padding-right: 5rem; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /EDMS/src/main/webapp/CSS/Social.css: -------------------------------------------------------------------------------- 1 | @charset "ISO-8859-1"; 2 | /* My styles */ 3 | /* Get fonts from google */ 4 | @import url('https://fonts.googleapis.com/css2?family=Poppins&family=Roboto+Slab&display=swap'); 5 | 6 | * { 7 | font-family: 'Poppins', sans-serif; 8 | /* font-family: 'Roboto Slab', serif; */ 9 | /* overflow: hidden; */ 10 | } 11 | 12 | .my-container { 13 | max-width: 2520px; 14 | margin-left: auto; 15 | margin-right: auto; 16 | padding-left: 16px; 17 | padding-right: 16px; 18 | } 19 | 20 | .center-cropped { 21 | object-fit: cover; 22 | object-position: center; 23 | height: 200px; 24 | width: 200px; 25 | } 26 | 27 | /* breakpoint for small size screen */ 28 | @media only screen and (max-width: 640px) { 29 | .my-container { 30 | padding-left: 0.5rem; 31 | padding-right: 0.5rem; 32 | } 33 | } 34 | 35 | /* breakpoint for medium size screen */ 36 | @media only screen and (max-width: 768px) { 37 | .my-container { 38 | padding-left: 2.5rem; 39 | padding-right: 2.5rem; 40 | } 41 | } 42 | 43 | /* breakpoint for xl size screen */ 44 | @media only screen and (max-width: 768px) { 45 | .my-container { 46 | padding-left: 5rem; 47 | padding-right: 5rem; 48 | } 49 | } -------------------------------------------------------------------------------- /EDMS/src/main/webapp/CSS/login.css: -------------------------------------------------------------------------------- 1 | .container 2 | { 3 | 4 | margin: 0 auto; 5 | padding: 0px; 6 | background-color: rgb(238, 233, 228); 7 | 8 | } 9 | body{ 10 | background-color: rgb(238, 233, 228); 11 | } 12 | .navbar 13 | { 14 | 15 | max-height: 9vh; 16 | background-color: rgb(218, 182, 134)e; 17 | display:flex; 18 | justify-content: space-between; 19 | align-items: center; 20 | padding: 10px 0; 21 | 22 | font-size:15px; 23 | margin-right:0px; 24 | flex: 1; 25 | 26 | } 27 | .log{ 28 | width: 30%; 29 | margin: 8vh 20vh 20vh 65vh; 30 | height: 30vw; 31 | align-items: center; 32 | background-color: white; 33 | margin-bottom: 20vh; 34 | border-radius: 5%; 35 | } 36 | h2{ 37 | text-align: center; 38 | padding-top: 5vh; 39 | } 40 | input 41 | { 42 | width: 60%; 43 | height:6vh; 44 | margin-left:6vw; 45 | margin-top: 5vh; 46 | } 47 | p a{ 48 | margin-left:6vw; 49 | 50 | color: orange; 51 | } -------------------------------------------------------------------------------- /EDMS/src/main/webapp/Faq.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | 4 | 5 | 6 | 7 | Emergency Disaster Management System 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 |
25 | 26 | 54 | 55 | 56 | 94 |
95 |
96 | 97 | 98 |
99 | 100 |

Frequently Asked Questions

101 | 102 |
103 |
104 | 105 |
106 | Q1: What is the purpose of the Emergency Disaster Management System (EDMS)? 107 |
108 |
109 |

A1: The EDMS is designed to provide real-time insights into critical areas during emergencies in Bangladesh. It empowers government officials, volunteer groups, and individuals to coordinate, share information, and take swift actions to mitigate disaster impacts.

110 |
111 |
112 |
113 | 114 |
115 | Q2: How can I get involved as a government official? 116 |
117 |
118 |

A2: If you're a government official at the City Corporation, Union Parishad, or Zilla Parishad levels, you will automatically receive an account upon which you can input vital information about your area. Your input will be given priority within the system to aid disaster response efforts.

119 |
120 |
121 |
122 | 123 |
124 | Q3: Can volunteer organizations participate in disaster management efforts through EDMS? 125 |
126 |
127 |

A3: Absolutely! Volunteer organizations and charitable funds can create accounts on the EDMS platform. They can log their service history and provide vital on-ground information during disaster situations to enhance coordination and response effectiveness.

128 |
129 |
130 |
131 | 132 |
133 | Q4: How can I sign up as an individual on the EDMS platform? 134 |
135 |
136 |

A4: Signing up as an individual is simple. Just navigate to the registration page and provide your details. Once registered, you can contribute real-time updates about your local area and request assistance when needed.

137 |
138 |
139 |
140 | 141 |
142 | Q5: What types of disasters does the EDMS cover? 143 |
144 |
145 |

A5: The EDMS is designed to handle a wide range of disasters, including natural disasters like floods, cyclones, and earthquakes, as well as man-made disasters such as fires and industrial accidents.

146 |
147 |
148 |
149 | 150 |
151 | Q6: Can I view critical areas and information without registering? 152 |
153 |
154 |

A6: Yes, non-registered users can access critical area information on the EDMS platform. While they cannot use social features or post information, this feature ensures widespread awareness and understanding during disaster situations.

155 |
156 |
157 |
158 | 159 |
160 | Q7: How often is the critical information updated on the platform? 161 |
162 |
163 |

A7: The critical information is updated in real time. The system continuously collects and displays the latest data about disaster-affected areas, individuals in distress, and ongoing relief efforts.

164 |
165 |
166 |
167 | 168 |
169 | Q8: How does the EDMS ensure the accuracy of the information provided? 170 |
171 |
172 |

A8: The EDMS encourages individuals and organizations to provide firsthand information, ensuring accuracy in disaster assessments. Additionally, government officials and volunteer groups verify and contribute to the information, enhancing its reliability.

173 |
174 |
175 |
176 | 177 |
178 | Q9: Is the EDMS accessible during power outages or network disruptions? 179 |
180 |
181 |

A9: The EDMS is designed to be accessible on various devices, including mobile phones. However, network disruptions during disasters might impact connectivity. It's recommended to have alternative means of communication during emergencies.

182 |
183 |
184 |
185 | 186 |
187 | Q10: How can I report a technical issue or suggest improvements for the EDMS platform 188 |
189 |
190 |

A10: You can reach out to our technical support team through the "Contact Us" section on the platform. We welcome feedback and are committed to continuously improving the EDMS based on user suggestions.

191 |
192 |
193 |
194 | 195 | 196 |
197 | 198 | 199 |
200 | 208 | 209 |
210 | 211 |

edms.

212 |
213 |

EDMS - Your comprehensive resource for shelter, 214 | assistance, and information during times of crisis

215 |

© 2023 EDMS. All rights reserved.

216 |
217 | 218 | 223 |
224 | 225 | 226 | -------------------------------------------------------------------------------- /EDMS/src/main/webapp/Home.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | 4 | 5 | 6 | 7 | Emergency Disaster Management System 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 |
25 | 26 | 55 | 56 | 57 | 95 |
96 |
97 | 98 | 99 | 100 |
101 |
102 |
103 |

104 | Emergency 105 | Disaster Management System

106 |

In a world prone to unexpected natural and man-made 107 | disasters, the need for efficient and swift emergency response systems cannot be overstated.

108 |
109 | 111 | More Info 112 | 113 | 114 |
115 | 116 | 117 | 141 | 142 |
143 |
144 |
145 | 146 | 147 |
148 | 149 | 150 |
151 |
152 |
153 |

154 | Collaborate with EDMS 155 |

156 | 157 |

158 | Within the EDMS platform, individuals in need can readily seek assistance, while volunteers can 159 | extend their support to others. This bidirectional functionality empowers disaster-affected 160 | individuals to request aid efficiently, fostering a sense of community support. 161 |

162 |
163 |
164 |
165 | 166 | 260 | 261 | 262 | 263 |
264 |
265 |
266 |

267 | Contact Us 268 |

269 | 270 |

271 | Reach out to our dedicated team of developers for inquiries, assistance, or collaboration. We're 272 | here to support you in any way we can. 273 |

274 |
275 | 276 |
277 | 278 |
279 |
280 |
281 | 282 |
283 |
284 |
285 |

Arfatul Islam Asif

286 |

Shahjalal University of Science and Technology

287 | 299 |
300 |
301 | 302 |
303 |
304 |
305 | 306 |
307 |
308 |
309 |

Unayes Ahmed Khan

310 |

Shahjalal University of Science and Technology

311 | 323 |
324 |
325 |
326 |
327 |
328 | 329 | 330 | 331 |
332 | 341 | 342 |
343 | 344 |

edms.

345 |
346 |

EDMS - Your comprehensive resource for shelter, 347 | assistance, and information during times of crisis

348 |

© 2023 EDMS. All rights reserved.

349 |
350 | 351 | 356 |
357 | 358 | 359 | 360 | 361 | 364 | 365 | 366 | -------------------------------------------------------------------------------- /EDMS/src/main/webapp/IMAGES/asif.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/src/main/webapp/IMAGES/asif.jpg -------------------------------------------------------------------------------- /EDMS/src/main/webapp/IMAGES/badge-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/src/main/webapp/IMAGES/badge-1.png -------------------------------------------------------------------------------- /EDMS/src/main/webapp/IMAGES/badge-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/src/main/webapp/IMAGES/badge-2.png -------------------------------------------------------------------------------- /EDMS/src/main/webapp/IMAGES/badge-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/src/main/webapp/IMAGES/badge-3.png -------------------------------------------------------------------------------- /EDMS/src/main/webapp/IMAGES/badge-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/src/main/webapp/IMAGES/badge-4.png -------------------------------------------------------------------------------- /EDMS/src/main/webapp/IMAGES/badge-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/src/main/webapp/IMAGES/badge-5.png -------------------------------------------------------------------------------- /EDMS/src/main/webapp/IMAGES/post1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/src/main/webapp/IMAGES/post1.jpg -------------------------------------------------------------------------------- /EDMS/src/main/webapp/IMAGES/post4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/src/main/webapp/IMAGES/post4.jpg -------------------------------------------------------------------------------- /EDMS/src/main/webapp/IMAGES/shakil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/src/main/webapp/IMAGES/shakil.png -------------------------------------------------------------------------------- /EDMS/src/main/webapp/IMAGES/unayes.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/src/main/webapp/IMAGES/unayes.jpeg -------------------------------------------------------------------------------- /EDMS/src/main/webapp/Login.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | 4 | 5 | 6 | Emergency Disaster Management System 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 |
23 |
24 |
25 | 32 | 33 | 34 |
36 | 37 | 38 | 41 | 42 | 43 | 46 | 47 | 48 | 49 |

${message}

50 |
51 |

Don't have an account? Register Now

52 | 53 |
54 |
55 |
56 |
57 | 58 | 59 | -------------------------------------------------------------------------------- /EDMS/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /EDMS/src/main/webapp/Registration.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@page import="java.sql.*" %> 4 | 5 | <% 6 | 7 | Connection con = null; 8 | 9 | try 10 | { 11 | Class.forName("com.mysql.cj.jdbc.Driver"); 12 | } 13 | catch(ClassNotFoundException e) 14 | { 15 | e.printStackTrace(); 16 | } 17 | try 18 | { 19 | con=DriverManager.getConnection("jdbc:mysql://localhost:3306/edms" , "root",""); 20 | } 21 | catch(SQLException e) 22 | { 23 | e.printStackTrace(); 24 | } 25 | 26 | %> 27 | 28 | 29 | 30 | 31 | Emergency Disaster Management System 32 | 33 | 34 | 35 | 36 | 41 | 42 | 46 | 47 | 48 | 49 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 295 | 296 | 297 |
298 |
299 |
300 |
301 | 308 | 309 | 310 |
311 | 312 | 315 | 316 | 317 | 320 | 321 | 322 | 325 | 326 | 327 | 330 | 335 | 336 | 339 | 344 | 345 | 348 | 353 | 354 | 357 | 361 | 362 | 363 | 364 | 382 | 383 | <% 384 | String selectedDistrict = request.getParameter("jsValue");%> 385 | 386 | 387 | 388 | 391 | 395 | 396 | 397 | 398 | 419 | 420 | <%String selectedUpazilla = request.getParameter("UpValue");%> 421 | 422 | 423 | 424 | 425 | 428 | 432 | 433 | 439 | 440 | 441 | 460 | 461 | <% 462 | 463 | String selectedUnion = request.getParameter("UnionValue"); 464 | 465 | /* String aise="null"; 466 | 467 | if(aise=="null"&& selectedUnion!=null){ 468 | 469 | PreparedStatement ps=con.prepareStatement("insert into setloc(Location)values(?)"); 470 | ps.setString(1,selectedUnion); 471 | ps.executeUpdate(); 472 | 473 | } */ 474 | %> 475 | 476 | 477 | 478 | 481 | 482 | 483 | 484 | 485 | 488 | 492 | 493 | 494 |

${message}

495 |
496 |
497 |
498 |
499 |
500 | 501 | 502 | 503 | -------------------------------------------------------------------------------- /EDMS/src/main/webapp/UpdateProfile.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@page import="java.sql.*" %> 4 | <%@page import="java.util.*" %> 5 | 6 | 7 | 8 | Emergency Disaster Management System 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | <% 23 | 24 | String loggedInUser = (String) session.getAttribute("loggedInUser"); 25 | 26 | if (loggedInUser == null) { 27 | String currentURL = request.getRequestURI(); 28 | session.setAttribute("redirectURL", currentURL); 29 | response.sendRedirect("Login.jsp"); 30 | return; 31 | } 32 | 33 | Connection con = null; 34 | 35 | try 36 | { 37 | Class.forName("com.mysql.cj.jdbc.Driver"); 38 | } 39 | catch(ClassNotFoundException e) 40 | { 41 | e.printStackTrace(); 42 | } 43 | try 44 | { 45 | con=DriverManager.getConnection("jdbc:mysql://localhost:3306/edms" , "root",""); 46 | } 47 | catch(SQLException e) 48 | { 49 | e.printStackTrace(); 50 | } 51 | 52 | String Name = null; 53 | String ContactNo = null; 54 | 55 | String query = "SELECT * FROM registrationinfo WHERE Username = '"+loggedInUser+"'"; 56 | Statement stmt; 57 | try 58 | { 59 | stmt = con.createStatement(); 60 | ResultSet rs = stmt.executeQuery(query); 61 | while(rs.next()) 62 | { 63 | Name = rs.getString("Name"); 64 | ContactNo = rs.getString("ContactNo"); 65 | 66 | } 67 | 68 | } 69 | catch(Exception e) 70 | { 71 | e.printStackTrace(); 72 | } 73 | 74 | 75 | %> 76 | 77 | 78 |
79 |
80 |
81 |
82 | 89 | 90 | 91 |
93 | 94 | 95 | 96 | class="input input-bordered w-full" /> 97 | 98 | 101 | class="input input-bordered w-full" /> 102 | 103 | 106 | class="input input-bordered w-full" /> 107 | 108 | 111 | 112 |
113 | 114 | Leave password blank to keep it unchanged. 115 |
116 | 117 | 118 |

${message}

119 |
120 |
121 |
122 |
123 |
124 | 125 | -------------------------------------------------------------------------------- /EDMS/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | EDMS 4 | 5 | index.html 6 | index.jsp 7 | index.htm 8 | default.html 9 | default.jsp 10 | default.htm 11 | 12 | 13 | 14 | AddAskHelp 15 | AddAskHelp 16 | JavaFiles.AddAskHelp 17 | 18 | 19 | AddAskHelp 20 | /AddAskHelp 21 | 22 | 23 | 24 | AddContribution 25 | AddContribution 26 | JavaFiles.AddContribution 27 | 28 | 29 | AddContribution 30 | /AddContribution 31 | 32 | 33 | 34 | AddLocation 35 | AddLocation 36 | JavaFiles.AddLocation 37 | 38 | 39 | AddLocation 40 | /AddLocation 41 | 42 | 43 | 44 | AddPost 45 | AddPost 46 | JavaFiles.AddPost 47 | 48 | 49 | AddPost 50 | /AddPost 51 | 52 | 53 | 54 | Login 55 | Login 56 | JavaFiles.Login 57 | 58 | 59 | Login 60 | /Login 61 | 62 | 63 | 64 | Registration 65 | Registration 66 | JavaFiles.Registration 67 | 68 | 69 | Registration 70 | /Registration 71 | 72 | 73 | 74 | DataServlet 75 | DataServlet 76 | JavaFiles.DataServlet 77 | 78 | 79 | DataServlet 80 | /DataServlet 81 | 82 | 83 | 84 | MachineLearning 85 | MachineLearning 86 | JavaFiles.MachineLearning 87 | 88 | 89 | MachineLearning 90 | /MachineLearning 91 | 92 | 93 | 94 | UpdateProfile 95 | UpdateProfile 96 | JavaFiles.UpdateProfile 97 | 98 | 99 | UpdateProfile 100 | /UpdateProfile 101 | 102 | -------------------------------------------------------------------------------- /EDMS/src/main/webapp/logout.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> 2 | <%@ page import="jakarta.servlet.http.HttpSession" %> 3 | <% 4 | // Invalidate the current session 5 | //session.setAttribute("loggedInUser", null); 6 | HttpSession sessin = request.getSession(false); 7 | if (sessin != null) { 8 | sessin.invalidate(); 9 | } 10 | // Redirect to the login page or any other appropriate page 11 | response.sendRedirect("Home.jsp"); // Replace "login.jsp" with your login page URL 12 | %> 13 | -------------------------------------------------------------------------------- /EDMS/target/classes/JavaFiles/AddAskHelp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/target/classes/JavaFiles/AddAskHelp.class -------------------------------------------------------------------------------- /EDMS/target/classes/JavaFiles/AddContribution.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/target/classes/JavaFiles/AddContribution.class -------------------------------------------------------------------------------- /EDMS/target/classes/JavaFiles/AddLocation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/target/classes/JavaFiles/AddLocation.class -------------------------------------------------------------------------------- /EDMS/target/classes/JavaFiles/AddPost.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/target/classes/JavaFiles/AddPost.class -------------------------------------------------------------------------------- /EDMS/target/classes/JavaFiles/DataServlet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/target/classes/JavaFiles/DataServlet.class -------------------------------------------------------------------------------- /EDMS/target/classes/JavaFiles/Login.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/target/classes/JavaFiles/Login.class -------------------------------------------------------------------------------- /EDMS/target/classes/JavaFiles/MachineLearning.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/target/classes/JavaFiles/MachineLearning.class -------------------------------------------------------------------------------- /EDMS/target/classes/JavaFiles/Pair.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/target/classes/JavaFiles/Pair.class -------------------------------------------------------------------------------- /EDMS/target/classes/JavaFiles/PredictWithModel.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/target/classes/JavaFiles/PredictWithModel.class -------------------------------------------------------------------------------- /EDMS/target/classes/JavaFiles/PrintCharacter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/target/classes/JavaFiles/PrintCharacter.class -------------------------------------------------------------------------------- /EDMS/target/classes/JavaFiles/Registration.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/target/classes/JavaFiles/Registration.class -------------------------------------------------------------------------------- /EDMS/target/classes/JavaFiles/TrainModel.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/target/classes/JavaFiles/TrainModel.class -------------------------------------------------------------------------------- /EDMS/target/classes/JavaFiles/UpdateProfile.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/target/classes/JavaFiles/UpdateProfile.class -------------------------------------------------------------------------------- /EDMS/target/classes/JavaFiles/divisions.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/target/classes/JavaFiles/divisions.class -------------------------------------------------------------------------------- /EDMS/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Build-Jdk-Spec: 17 3 | Created-By: Maven Integration for Eclipse 4 | 5 | -------------------------------------------------------------------------------- /EDMS/target/m2e-wtp/web-resources/META-INF/maven/EDMS/EDMS/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven Integration for Eclipse 2 | #Wed Sep 20 09:29:43 BDT 2023 3 | m2e.projectLocation=E\:\\Eclipse Project\\EDMS 4 | m2e.projectName=EDMS 5 | groupId=EDMS 6 | artifactId=EDMS 7 | version=0.0.1-SNAPSHOT 8 | -------------------------------------------------------------------------------- /EDMS/target/m2e-wtp/web-resources/META-INF/maven/EDMS/EDMS/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | EDMS 4 | EDMS 5 | 0.0.1-SNAPSHOT 6 | war 7 | 8 | 9 | 10 | 11 | 12 | org.apache.commons 13 | commons-lang3 14 | 3.12.0 15 | 16 | 17 | 18 | mysql 19 | mysql-connector-java 20 | 8.0.33 21 | 22 | 23 | 24 | org.jsoup 25 | jsoup 26 | 1.16.1 27 | 28 | 29 | 30 | javax.servlet 31 | servlet-api 32 | 2.5 33 | provided 34 | 35 | 36 | 37 | org.mindrot 38 | jbcrypt 39 | 0.4 40 | 41 | 42 | 43 | com.fasterxml.jackson.core 44 | jackson-databind 45 | 2.12.5 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | nz.ac.waikato.cms.weka 54 | weka-stable 55 | 3.8.0 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | maven-compiler-plugin 66 | 3.8.1 67 | 68 | 17 69 | 70 | 71 | 72 | maven-war-plugin 73 | 3.2.3 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /EDMS/trained_model.model: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/EDMS/trained_model.model -------------------------------------------------------------------------------- /Home1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/Home1.PNG -------------------------------------------------------------------------------- /Home2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/Home2.PNG -------------------------------------------------------------------------------- /Home3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/Home3.PNG -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Arfatul Islam Asif 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /LocProfile1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/LocProfile1.PNG -------------------------------------------------------------------------------- /LocProfile2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/LocProfile2.PNG -------------------------------------------------------------------------------- /Profile.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/Profile.PNG -------------------------------------------------------------------------------- /ProjectArchi.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/ProjectArchi.PNG -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) 2 | 3 | # Emergency Disaster Management System (EDMS) 4 | 5 | ### Visit Website 6 | 7 | ### Youtube Demonstration Video 8 | 9 | 10 | ## Achievements : 11 | 12 | Our Project has been selected as one of the top 10 finalist for the therap java fest 2023 in Bangladesh. 13 | 14 | 15 | 16 | ## Introduction 17 | 18 | Before we delve into the details of our project, it's essential to understand the story that inspired us to create the Emergency Disaster Management System (EDMS). In 2022, Sylhet experienced a devastating and prolonged flood that resulted in significant losses. During this challenging period, our team, along with some dedicated friends, organized a volunteer group. We collected funds, identified relief centers in the city, and regularly provided essential supplies such as food and water. We also extended our aid to rural areas. 19 | 20 | However, we encountered several challenges. One of the most significant issues was the lack of accurate information about where relief was needed most. Some areas received multiple rounds of assistance due to their proximity to roads, while more remote locations were often neglected. We had to rely on word-of-mouth information or local contacts to make critical decisions. 21 | 22 | We realized that having precise and real-time information was crucial during disaster situations. While social media platforms like Facebook helped to some extent, there was no dedicated system to provide comprehensive information about relief shelters, aid distribution, and the needs of affected areas. 23 | 24 | This experience led us to the idea of creating a robust Emergency Disaster Management System (EDMS). 25 | 26 | ## EDMS Description 27 | 28 | EDMS serves as an information hub for individuals, volunteer groups, and social welfare agencies during times of emergency. Users can add relief shelters or locations in need of assistance, request help, and provide essential details such as the number of affected individuals. Volunteer groups can search for relief shelters or areas based on specific criteria, and individuals can actively participate by contributing real-time updates about their local areas. EDMS also functions as a social platform where users can share their experiences related to disaster relief efforts. 29 | 30 | ## Table of Contents 31 | 32 | - [Introduction](#introduction) 33 | - [EDMS Description](#edms-description) 34 | - [Technologies and Libraries](#technologies-and-libraries) 35 | - [Table of Contents](#table-of-contents) 36 | - [Home Page](#home-page) 37 | - [Shelter and Areas](#shelter-and-areas) 38 | - [Register Page](#register-page) 39 | - [Login Page](#login-page) 40 | - [Profile Page](#profile-page) 41 | - [Add Post](#add-post) 42 | - [Add Location](#add-location) 43 | - [Update Profile](#update-profile) 44 | - [Location Profile](#location-profile) 45 | - [Ask For Help](#ask-for-help) 46 | - [Add Contribution](#add-contribution) 47 | - [Social Page](#social-page) 48 | 49 | ## Home Page 50 | 51 | 52 |
53 | 54 | 55 | This is the home page of EDMS. Here you can find a navbar. From there one can go 56 | to shelter and areas, social, FAQ, or profile page 57 | Here we have a brief description of EDMS . ... 58 | 59 | Also, there is a brief description of all the other pages. 60 | 61 | At the end, you can find contact information about us. As this is a pilot project 62 | one can contact us about any kind of queries they have. 63 | 64 | At the end, we have the footer section of EDMS. 65 | 66 | ## Shelter and Areas 67 | 68 | 69 | 70 | The page is the core of the emergency disaster management system. Here you can see a 71 | search bar. Right here you can see name-type activities of relief shelters and locations. 72 | 73 | If nothing is selected in the search bar, you will see locations and relief shelters for all places. 74 | If you choose a specific district, you will then see locations within that particular 75 | district. If you select a specific upazila (sub-district) within that district, 76 | the system will display relief shelters or locations specific to that upazila. 77 | Finally, if you select a particular union or ward within that upazila, you will see 78 | relief shelters located in that union or ward. This hierarchical filtering system 79 | allows users to narrow down their search and find relevant information based on their 80 | chosen location criteria. 81 | 82 | All locations and relief shelters are ranked by a priority value and categorized 83 | as active, inactive, or in critical need of help. The "active" status is assigned 84 | if there has been a recent request for assistance within the past 3 days, while 85 | locations without recent requests are automatically marked as "inactive." 86 | 87 | Utilizing a decision tree Machine Learning model, we determine which relief shelters 88 | are in "critical help needed" status, granting them the highest priority. 89 | We trained the model with some information that we gathered while working on the flood 90 | relief efforts.Besides taking into account how many times the request was asked 91 | this model also uses the river water's danger level and forecasted level for 7 days 92 | for a particular location to make the proper prediction. 93 | As EDMS shall evolve, 94 | we plan to incorporate more data sources to further enhance the model's precision 95 | in identifying areas where critical help is most urgently needed. 96 | 97 | Now, if you select a relief shelter, you will be redirected to the shelter's profile page. 98 | However, to access the profile page, users will be required to log in. 99 | 100 | ## Social Page 101 | 102 | 103 | 104 | Our social page is customized for each user. 105 | We employ algorithms to determine places that are geographically near to each user, 106 | taking into account their location data. 107 | Subsequently, we sort the posts on the page based on their proximity to the user's 108 | location and the recency of each post. 109 | 110 | If you click on any name on a post you will be redirected to the profile page. 111 | If it is an individual/volunteer group then you shall be redirected there. If it 112 | is a location/shelter name then you will be redirected to the location's profile page 113 | 114 | 115 | While our social page resembles a conventional social media news feed, 116 | its primary purpose is to serve as a platform for news updates related to 117 | disaster management efforts. 118 | 119 | ## Register Page 120 | 121 | Users can create accounts to access the full features of EDMS. 122 | 123 | ## Login Page 124 | 125 | Registered users can log in to access their profiles and utilize the system's features. 126 | 127 | ## Profile Page 128 | 129 | 130 | 131 | Individuals, government officials, and volunteer groups have their profiles where they can add posts, locations, and update their information. 132 | 133 | All the posts and locations you add will be displayed in your profile 134 | under the sections "Locations Added" and "Timeline." 135 | 136 | ## Add Post 137 | 138 | Registered users can share information or requests on the platform. 139 | 140 | ## Add Location 141 | 142 | Users can add details about locations that require assistance. 143 | 144 | ## Update Profile 145 | 146 | Profile owners can update their contact information and password as needed. 147 | 148 | ## Location Profile 149 | 150 | 151 |
152 | 153 | 154 | Each added location has its profile, where users can ask for help and add contribution information. 155 | 156 | ## Ask For Help 157 | 158 | Anyone can ask for help in any particular location. 159 | 160 | ## Add Contribution 161 | 162 | Anyone can add their contribution info in any particular location. 163 | 164 | ## Project Architecture 165 | 166 | 167 | 168 | 169 | ## Database 170 | 171 | 172 | 173 | 174 | ## Conclusion 175 | 176 | EDMS operates as an information-sharing platform, facilitating informed decision-making for individuals and volunteer groups. Users cannot delete posts or locations they've shared to maintain transparency and system integrity. 177 | 178 | ## Technologies and Libraries 179 | 180 | Our project relies on the following technologies, libraries, and tools: 181 | - **Backend:** Java 182 | - **Build Tools:** Maven 183 | - **Web Server:** Apache Tomcat 184 | - **Database:** MySQL 185 | - **Version Control:** GitHub 186 | - **Integrated Development Environment (IDE):** Eclipse IDE 187 | - **Frontend Technologies:** HTML, CSS, JavaScript 188 | - **Java Web Technologies:** Servlets and JSP 189 | - **Java Database Connectivity (JDBC)** 190 | - **Data Parsing:** Jsoup Library 191 | - **Password Hashing:** JBCrypt 192 | 193 | ## Authors 194 | 195 | - [Arfatul Islam Asif](https://github.com/ArfatulAsif) 196 | - [Unayes Ahmed Khan](https://github.com/Unayes09) 197 | 198 | --- 199 | 200 | **Note**: EDMS is a non-monetized platform focused solely on disaster management and relief coordination. 201 | 202 | 203 | -------------------------------------------------------------------------------- /Shelter.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/Shelter.PNG -------------------------------------------------------------------------------- /Social.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/Social.PNG -------------------------------------------------------------------------------- /Therap Java Fest Certificate1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/Therap Java Fest Certificate1.jpeg -------------------------------------------------------------------------------- /Therap Java Fest Finalist Certificate.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArfatulAsif/emergency-disaster-management-system-java-servlet-project/0f4ed0fb6c5b23ddc58e441ad7e136efea61cd67/Therap Java Fest Finalist Certificate.jpg --------------------------------------------------------------------------------