diff --git a/book_cab/Cabriolet_Schema.sql b/book_cab/Cabriolet_Schema.sql new file mode 100644 index 0000000..da2d9e4 --- /dev/null +++ b/book_cab/Cabriolet_Schema.sql @@ -0,0 +1,153 @@ +-- MySQL dump 10.13 Distrib 5.6.16, for debian-linux-gnu (x86_64) +-- +-- Host: localhost Database: Cabriolet1 +-- ------------------------------------------------------ +-- Server version 5.6.16-1~exp1 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `Cab` +-- + +DROP TABLE IF EXISTS `Cab`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Cab` ( + `cabNumber` varchar(30) NOT NULL DEFAULT '', + `type` varchar(30) NOT NULL DEFAULT '', + `name` varchar(30) NOT NULL DEFAULT '', + `costPerkm` decimal(2,2) NOT NULL DEFAULT '0.00', + PRIMARY KEY (`cabNumber`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Cab` +-- + +LOCK TABLES `Cab` WRITE; +/*!40000 ALTER TABLE `Cab` DISABLE KEYS */; +INSERT INTO `Cab` VALUES ('','','',0.00),('TS12A1234','Micro','Indica',0.99); +/*!40000 ALTER TABLE `Cab` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Customer` +-- + +DROP TABLE IF EXISTS `Customer`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Customer` ( + `firstName` varchar(30) NOT NULL DEFAULT '', + `lastName` varchar(30) NOT NULL DEFAULT '', + `emailId` varchar(30) DEFAULT '', + `phoneNumber` varchar(30) NOT NULL DEFAULT '', + `gender` varchar(1) DEFAULT NULL, + `DOB` date DEFAULT NULL, + `password` text, + PRIMARY KEY (`phoneNumber`), + UNIQUE KEY `emailId` (`emailId`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Customer` +-- + +LOCK TABLES `Customer` WRITE; +/*!40000 ALTER TABLE `Customer` DISABLE KEYS */; +INSERT INTO `Customer` VALUES ('Aaakanksha','Shastri','aak1998@gmail.com','1234567890','F','1998-01-29','371ab955fdc11c44c980779c3135b155'),('Justin ','Foley','justin@gmail.com','1234567891','M','1985-09-06','202cb962ac59075b964b07152d234b70'),('Rachel','Green','rachel.green@gmail.com','1234567897','F','1964-06-12','202cb962ac59075b964b07152d234b70'),('Rajula','Pavani','rpavani1998@gmail.com','7207874257','F','1998-11-13','202cb962ac59075b964b07152d234b70'),('rahul','verma','rahul@gmail.com','7418529631','M','1998-09-12','b65cb28b7c2569d90631cef9c8a8c29e'),('pinki','papa','pinki@gmail.com','9502960298','F','1998-03-20','2285558b87a3ba5a4238a7b5acd850f5'),('tina','malhotra','tina@gmail.com','9874563210','F','2012-12-12','b5c0b187fe309af0f4d35982fd961d7e'),('Hanna','Baker','hanna.baker@gmail.com','9876543210','F','1989-06-12','202cb962ac59075b964b07152d234b70'); +/*!40000 ALTER TABLE `Customer` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Driver` +-- + +DROP TABLE IF EXISTS `Driver`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Driver` ( + `firstName` varchar(30) NOT NULL DEFAULT '', + `lastName` varchar(30) NOT NULL DEFAULT '', + `emailId` varchar(30) DEFAULT '', + `phoneNumber` varchar(30) NOT NULL DEFAULT '', + `gender` varchar(1) DEFAULT NULL, + `DOB` date NOT NULL, + `password` varchar(30) NOT NULL, + `licenseNumber` varchar(30) NOT NULL, + `city` varchar(30) NOT NULL, + `status` varchar(20) DEFAULT NULL, + `cabNumber` varchar(30) DEFAULT NULL, + PRIMARY KEY (`phoneNumber`), + UNIQUE KEY `licenseNumber` (`licenseNumber`), + UNIQUE KEY `emailId` (`emailId`), + UNIQUE KEY `cabNumber` (`cabNumber`), + CONSTRAINT `Driver_ibfk_1` FOREIGN KEY (`cabNumber`) REFERENCES `Cab` (`cabNumber`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Driver` +-- + +LOCK TABLES `Driver` WRITE; +/*!40000 ALTER TABLE `Driver` DISABLE KEYS */; +INSERT INTO `Driver` VALUES ('k','Raju','k.raju@gmail.com','1234567890','M','1964-12-13','123456','12sd1','Hyderabad','Available','TS12A1234'); +/*!40000 ALTER TABLE `Driver` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Ride` +-- + +DROP TABLE IF EXISTS `Ride`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Ride` ( + `driverId` varchar(30) NOT NULL DEFAULT '', + `customerId` varchar(30) NOT NULL DEFAULT '', + `source` text, + `destination` text NOT NULL, + `status` varchar(30) DEFAULT ' ', + `amount` double DEFAULT '0', + `bookingTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `carType` varchar(10) DEFAULT NULL, + PRIMARY KEY (`driverId`,`customerId`,`bookingTime`), + KEY `customerId` (`customerId`), + CONSTRAINT `Ride_ibfk_1` FOREIGN KEY (`driverId`) REFERENCES `Driver` (`phoneNumber`), + CONSTRAINT `Ride_ibfk_2` FOREIGN KEY (`customerId`) REFERENCES `Customer` (`phoneNumber`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Ride` +-- + +LOCK TABLES `Ride` WRITE; +/*!40000 ALTER TABLE `Ride` DISABLE KEYS */; +INSERT INTO `Ride` VALUES ('1234567890','1234567890','Kukatpally, Hyderabad, Telangana, India','Nallakunta, Hyderabad, Telangana, India','Ride SuccessFul',181.86,'2017-06-07 04:50:36',NULL),('1234567890','7207874257','KukatPally','BVRITH','Ride SuccessFul',9.999,'2017-06-05 10:27:09',NULL),('1234567890','7207874257','Kuakhia, Chandipur, Odisha, India','Odisha Tourism, Greenlands Road, Begumpet, Hyderabad, Telangana, India','Ride SuccessFul',11378.49,'2017-06-06 09:55:45',NULL),('1234567890','7207874257','Kukatpally, Hyderabad, Telangana, India','Ashok Nagar, Hyderabad, Telangana, India','Ride SuccessFul',160.41,'2017-06-06 10:43:54',NULL),('1234567890','7207874257','A.S.Rao Nagar Bus Stop, Doctor A S Rao Nagar Road, Swamik Nagar, Secunderabad, Telangana, India','Begumpet, Hyderabad, Telangana, India','Ride SuccessFul',124.1,'2017-06-06 10:48:48',NULL),('1234567890','7207874257','Kukatpally, Hyderabad, Telangana, India','Nallakunta, Hyderabad, Telangana, India','Ride SuccessFul',181.86,'2017-06-06 10:50:10',NULL),('1234567890','7207874257','Kukatpally, Hyderabad, Telangana, India','Necklace Road, Hussain Nagar Colony, Begumpet, Hyderabad, Telangana, India','Ride SuccessFul',86,'2017-06-08 03:55:59',NULL); +/*!40000 ALTER TABLE `Ride` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2017-06-08 11:44:19 diff --git a/book_cab/README.md b/book_cab/README.md new file mode 100644 index 0000000..f05ae14 --- /dev/null +++ b/book_cab/README.md @@ -0,0 +1,2 @@ +# Cabriolet-Online-Cab-Booking +Web application for online cab booking designed using MVC FrameWork, JDBC, Servlets, JSP, HTML,Bootstrap & CSS. diff --git a/book_cab/WebContent/CSS/Change_Password.css b/book_cab/WebContent/CSS/Change_Password.css new file mode 100644 index 0000000..3be9ff8 --- /dev/null +++ b/book_cab/WebContent/CSS/Change_Password.css @@ -0,0 +1,141 @@ +body,h1,h5 { +font-family: "Raleway", sans-serif !important; +} + +.w3-allerta { + font-family: "Allerta Stencil", Sans-serif; + font-size: 80px; +} + +body, html{height: 100%} + +.bgimg { + background-image: url('../CSS/Images/backgroundcar.jpg'); + min-height: 100%; + background-position: center; + background-size: cover; +} + +h4, .close { + background-color: black; + color:white !important; + text-align: center; + font-size: 30px !important; + height: 100% +} + +.container-header { + background-color: black; + color:white !important; + text-align: center; + font-size: 30px; +} + +.footer { + background-color: #f9f9f9; +} + +.container{ + width: 400px !important; + margin-left: auto; + margin-right: auto; + background: white; + align-content: center; + padding-right: 0px !important; + padding-left: 0px !important; +} + +.etc-login-form { + color: black; + padding: 10px 20px; +} + +.etc-login-form p { + margin-bottom: 5px; +} + +.login-form-1 { + max-width: 100%; + border-radius: 5px; + display: inline-block; +} + +.main-login-form { + position: relative; +} + +.login-form-1 .form-control { + border: 0; + box-shadow: 0 0 0; + background: transparent; + color: #555555; + padding: 7px; + font-weight: bold; + height: auto; + border: 1px solid #ccc; + border-radius: 4px; +} + +.login-group { + background: #ffffff; + color: black; + border-radius: 8px; + padding: 10px 20px; +} + + +label.form-invalid { + position: absolute; + top: 0; + right: 0; + z-index: 5; + display: block; + margin-top: -25px; + padding: 7px 9px; + background: #777777; + color: #ffffff; + border-radius: 5px; + font-weight: bold; + font-size: 11px; +} + +label.form-invalid:after { + top: 100%; + right: 10px; + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; + pointer-events: none; + border-color: transparent; + border-top-color: #777777; + border-width: 6px; +} + +.login-form-main-message { + background: #ffffff; + color: #999999; + border-left: 3px solid transparent; + border-radius: 3px; + margin-bottom: 8px; + font-weight: bold; + height: 0; + padding: 0 20px 0 17px; + opacity: 0; + transition: all ease-in-out 200ms; +} + +.login-form-main-message.show { + height: auto; + opacity: 1; + padding: 10px 20px 10px 17px; +} + +.login-form-main-message.success { + border-left-color: #2ecc71; +} + +.login-form-main-message.error { + border-left-color: #e74c3c; +} diff --git a/book_cab/WebContent/CSS/ConfirmBookingPage.css b/book_cab/WebContent/CSS/ConfirmBookingPage.css new file mode 100644 index 0000000..5cb3214 --- /dev/null +++ b/book_cab/WebContent/CSS/ConfirmBookingPage.css @@ -0,0 +1,135 @@ +html, body { + height: 100%; + margin: 0; + padding: 0; +} + +h { + font-size: 40px; + font-family: Times New Roman; + text-align: center !important; + color: black !important; +} + +p { + font-size: 30px; + font-family: Ubuntu; + text-align: center !important; + color: black !important; +} + +h1 { + font-size: 25px !important; + margin-top: 20px !important; + margin-bottom: 20px !important; +} + +.submit { + font-size: 1.1em; + width: 200px; + background-color: #424242 !important; + color: white !important; + float: right; +} + +.glyphicon { + margin-bottom: 10px; + margin-right: 10px; +} + +p1{ + font-size: 18px !important; +} +.sidenav { + height: 100%; + width: 0; + position: fixed; + z-index: 1; + top: 0; + right: 0; + background-color: #111; + overflow-x: hidden; + transition: 0.5s; + padding-top: 60px; + text-align: left; +} + +.sidenav a { + padding: 8px 8px 8px 32px; + text-decoration: none; + font-size: 25px; + color: #818181; + display: block; + transition: 0.3s; +} + +.sidenav a:hover, .offcanvas a:focus { + color: #f1f1f1; +} + +.sidenav .closebtn { + position: absolute; + top: 0; + right: 25px; + font-size: 36px; + margin-left: 50px; +} + +#main { + transition: margin-right .5s; + padding: 16px; + float: right; + color: white; +} + +#title { + font-family: "Allerta Stencil", Sans-serif; + font-size: 50px; + text-align: center; + float: center; + padding: 16px; + background-color: #424242; + color: white; +} + +@media screen and (max-height: 450px) { + .sidenav { + padding-top: 15px; + } + .sidenav a { + font-size: 18px; + } +} + +.input-group-addon img { + height: 50px; + margin-right: -5px; + margin-bottom: -10px; + vertical-align: text-bottom; /* align the text */ +} + +.heading { + font-size: 50px; + font-family: "Allerta Stencil", Sans-serif; + text-align: center; + background-color: #424242; + color: white; +} + + +hr { + margin-top: 0px !important; + margin-bottom: 2px !important; + border: 0; + border-top: 2px solid black !important; +} + +.thead{ + color: white; + background-color: black; + border-color: #9e9e9e; +} + +.table-responsive{ + border-color: black; +} diff --git a/book_cab/WebContent/CSS/ForgetPassword.css b/book_cab/WebContent/CSS/ForgetPassword.css new file mode 100644 index 0000000..6a2ed8b --- /dev/null +++ b/book_cab/WebContent/CSS/ForgetPassword.css @@ -0,0 +1,139 @@ +body,h1,h5 {font-family: "Raleway", sans-serif} + +.w3-allerta { + font-family: "Allerta Stencil", Sans-serif; + font-size: 80px; +} + +body, html{height: 100%} + +.bgimg { + background-image: url('../CSS/Images/backgroundcar.jpg'); + min-height: 100%; + background-position: center; + background-size: cover; +} + +h4, .close { + background-color: black; + color:white !important; + text-align: center; + font-size: 30px; + height: 100% +} + +.container-header { + background-color: black; + color:white !important; + text-align: center; + font-size: 30px; +} + +.footer { + background-color: #f9f9f9; +} + +.container{ + width: 400px; + margin-left: auto; + margin-right: auto; + background: white; + align-content: center; + padding-right: 0px; + padding-left: 0px; +} + +.etc-login-form { + color: black; + padding: 10px 20px; +} + +.etc-login-form p { + margin-bottom: 5px; +} + +.login-form-1 { + max-width: 300px; + border-radius: 5px; + display: inline-block; +} + +.main-login-form { + position: relative; +} + +.login-form-1 .form-control { + border: 0; + box-shadow: 0 0 0; + border-radius: 0; + background: transparent; + color: #555555; + padding: 7px 0; + font-weight: bold; + height: auto; +} + +.login-group { + background: #ffffff; + color: black; + border-radius: 8px; + padding: 10px 20px; +} + + +label.form-invalid { + position: absolute; + top: 0; + right: 0; + z-index: 5; + display: block; + margin-top: -25px; + padding: 7px 9px; + background: #777777; + color: #ffffff; + border-radius: 5px; + font-weight: bold; + font-size: 11px; +} + +label.form-invalid:after { + top: 100%; + right: 10px; + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; + pointer-events: none; + border-color: transparent; + border-top-color: #777777; + border-width: 6px; +} + +.login-form-main-message { + background: #ffffff; + color: #999999; + border-left: 3px solid transparent; + border-radius: 3px; + margin-bottom: 8px; + font-weight: bold; + height: 0; + padding: 0 20px 0 17px; + opacity: 0; + transition: all ease-in-out 200ms; +} + +.login-form-main-message.show { + height: auto; + opacity: 1; + padding: 10px 20px 10px 17px; +} + +.login-form-main-message.success { + border-left-color: #2ecc71; +} + +.login-form-main-message.error { + border-left-color: #e74c3c; +} + diff --git a/book_cab/WebContent/CSS/Home_Page.css b/book_cab/WebContent/CSS/Home_Page.css new file mode 100644 index 0000000..3b6b61f --- /dev/null +++ b/book_cab/WebContent/CSS/Home_Page.css @@ -0,0 +1,234 @@ +#map { + height: 83%; + width: 70%; + float: left; +} + + +html, body { + height: 100%; + margin: 0; + padding: 0; +} + +h { + font-family: Times New Roman; + font-size: 20px; + line-height: 1.42857143; + color: #333; +} + +span.tab-space { + padding-left:6em; +} + +.controls { + border: 1px solid transparent; + border-radius: 2px 0 0 2px; + box-sizing: border-box; + -moz-box-sizing: border-box; + height: 32px; + outline: none; + +} + +.control { + border: 1px solid transparent; + border-radius: 2px 0 0 2px; + box-sizing: border-box; + -moz-box-sizing: border-box; + height: 32px; + outline: none; + text-align: center; + width: 350px; + font: 20px; +} + +#origin-input .style { + z-index: 0; + position: absolute; + left: 76px; + top: 10px; +} + +#destination-input .absolute { + z-index: 0; + position: absolute; + left: 2px; + top: 53px; +} + +#origin-input { + background-color: #212121; + color: white !important; + font-family: -webkit-pictograph; + font-size: 20px; + font-weight: 300; + margin-left: 12px; + padding: 0 11px 0 13px; + text-overflow: ellipsis; + width: 300px; +} + +#origin-input:focus { + border-color: #4d90fe; +} + +#destination-input { + background-color: #212121; + color: white !important; + font-family: -webkit-pictograph; + font-size: 20px; + font-weight: 300; + margin-left: 12px; + padding: 0 11px 0 13px; + text-overflow: ellipsis; + width: 300px; + z-index: 0; + position: absolute; + left: 2px; + top: 53px; +} + +#destination-input:focus { + border-color: #4d90fe; +} + +#mode-selector { + color: rgba(255, 255, 255, 0); + background-color: rgba(33, 33, 33, 0); + margin-left: 12px; + padding: 5px 11px 0px 11px; +} + +#mode-selector label { + font-family: Roboto; + font-size: 13px; + +} + +.sidenav { + height: 100%; + width: 0; + position: fixed; + z-index: 1; + top: 0; + right: 0; + background-color: #111; + overflow-x: hidden; + transition: 0.5s; + padding-top: 60px; + text-align: left; +} + +.sidenav a { + padding: 8px 8px 8px 32px; + text-decoration: none; + font-size: 25px; + color: #818181; + display: block; + transition: 0.3s; +} + +.sidenav a:hover, .offcanvas a:focus { + color: #f1f1f1; +} + +.sidenav .closebtn { + position: absolute; + top: 0; + right: 25px; + font-size: 36px; + margin-left: 50px; +} + +#main { + transition: margin-right .5s; + padding: 16px; + float: right; + color: white; +} + +#home { + + padding: 16px; + float: left; + color: white; +} + +#title { + font-family: "Allerta Stencil", Sans-serif; + font-size: 50px; + text-align: center; + float: center; + padding: 16px; + background-color: #424242; + color: white; +} + +@media screen and (max-height: 450px) { + .sidenav { + padding-top: 15px; + } + .sidenav a { + font-size: 18px; + } +} + +.input-group-addon img { + height: 50px; + margin-right: -5px; + margin-bottom: -10px; + vertical-align: text-bottom; /* align the text */ +} + +.heading { + font-size: 50px; + font-family: "Allerta Stencil", Sans-serif; + text-align: center; + background-color: #424242; + color: white; +} + +.submit { + font-size: 1.1em; + width: 200px; + background-color: #424242 !important; + color: white !important; + font-family: "Comic Sans MS", cursive, sans-serif; +} + +.selectpicker { + font-size: 1.3em !important; + width: 150px; + background-color: white !important; + color: #424242 !important; + font-family: Times New Roman !important; + border-color: #424242; + border-radius: 2px; +} + +.d-flex flex-row-reverse { + padding-right: 0px !important; + padding-left: 0px !important; + margin-right: 0px !important; + margin-left: 0px !important; + width: 30%; +} + +.col-md-offset-6 { + background-color: #fafafa; +} + +#source, #destination, #costEstimate, #timeEstimate, #distanceEstimate { + font-size: 20px; + font-family: Times New Roman; + color: #616161; +} + +hr { + margin-top: 0px !important; + margin-bottom: 2px !important; + border: 0; + border-top: 2px solid black !important; +} \ No newline at end of file diff --git a/book_cab/WebContent/CSS/Images/1.jpg b/book_cab/WebContent/CSS/Images/1.jpg new file mode 100644 index 0000000..5783ca6 Binary files /dev/null and b/book_cab/WebContent/CSS/Images/1.jpg differ diff --git a/book_cab/WebContent/CSS/Images/Micro.png b/book_cab/WebContent/CSS/Images/Micro.png new file mode 100644 index 0000000..e194a77 Binary files /dev/null and b/book_cab/WebContent/CSS/Images/Micro.png differ diff --git a/book_cab/WebContent/CSS/Images/Mini.png b/book_cab/WebContent/CSS/Images/Mini.png new file mode 100644 index 0000000..dd9feaa Binary files /dev/null and b/book_cab/WebContent/CSS/Images/Mini.png differ diff --git a/book_cab/WebContent/CSS/Images/SUV.png b/book_cab/WebContent/CSS/Images/SUV.png new file mode 100644 index 0000000..11946bc Binary files /dev/null and b/book_cab/WebContent/CSS/Images/SUV.png differ diff --git a/book_cab/WebContent/CSS/Images/backgroundcar.jpg b/book_cab/WebContent/CSS/Images/backgroundcar.jpg new file mode 100644 index 0000000..9e1c25b Binary files /dev/null and b/book_cab/WebContent/CSS/Images/backgroundcar.jpg differ diff --git a/book_cab/WebContent/CSS/Images/backgroundcar2.jpg b/book_cab/WebContent/CSS/Images/backgroundcar2.jpg new file mode 100644 index 0000000..9e1c25b Binary files /dev/null and b/book_cab/WebContent/CSS/Images/backgroundcar2.jpg differ diff --git a/book_cab/WebContent/CSS/Images/gif11.gif b/book_cab/WebContent/CSS/Images/gif11.gif new file mode 100644 index 0000000..4f55c09 Binary files /dev/null and b/book_cab/WebContent/CSS/Images/gif11.gif differ diff --git a/book_cab/WebContent/CSS/Images/marker.png b/book_cab/WebContent/CSS/Images/marker.png new file mode 100644 index 0000000..b4183e1 Binary files /dev/null and b/book_cab/WebContent/CSS/Images/marker.png differ diff --git a/book_cab/WebContent/CSS/Images/pointer.png b/book_cab/WebContent/CSS/Images/pointer.png new file mode 100644 index 0000000..c54f88c Binary files /dev/null and b/book_cab/WebContent/CSS/Images/pointer.png differ diff --git a/book_cab/WebContent/CSS/Images/riding.gif b/book_cab/WebContent/CSS/Images/riding.gif new file mode 100644 index 0000000..f304e4f Binary files /dev/null and b/book_cab/WebContent/CSS/Images/riding.gif differ diff --git a/book_cab/WebContent/CSS/LoadingPage.css b/book_cab/WebContent/CSS/LoadingPage.css new file mode 100644 index 0000000..8553bb1 --- /dev/null +++ b/book_cab/WebContent/CSS/LoadingPage.css @@ -0,0 +1,334 @@ +@CHARSET "UTF-8"; + +html, body { + height: 100%; + margin: 0; + padding: 0; +} +.sidenav { + height: 100%; + width: 0; + position: fixed; + z-index: 1; + top: 0; + right: 0; + background-color: #111; + overflow-x: hidden; + transition: 0.5s; + padding-top: 60px; + text-align: left; +} + +.sidenav a { + padding: 8px 8px 8px 32px; + text-decoration: none; + font-size: 25px; + color: #818181; + display: block; + transition: 0.3s; +} + +.sidenav a:hover, .offcanvas a:focus{ + color: #f1f1f1; +} + +.sidenav .closebtn { + position: absolute; + top: 0; + right: 25px; + font-size: 36px; + margin-left: 50px; +} + +#main { + transition: margin-right .5s; + padding: 16px; + float: right; + color: white; +} + +#title { + font-family: "Allerta Stencil", Sans-serif; + font-size: 50px; + text-align: center; + float: center; + padding: 16px; + background-color: black; + color: white; +} + +@media screen and (max-height: 450px) { + .sidenav {padding-top: 15px;} + .sidenav a {font-size: 18px;} +} + +#loader-wrapper { + position: absolute; + left: 0; + top: 16%; + right: 0; + bottom: 0; + background: #000; + z-index: 15; + overflow: hidden; +} + +.loader { + width: 150px; + height: 150px; + border: 1px #fff solid; + position: absolute; + left: 50%; + top: 50%; + margin: -75px 0 0 -75px; + border-radius: 50%; +} + +.loader .loading { + font-size: 10px; + position: absolute; + width: 100%; + text-align: center; + line-height: 14px; + font-family: 'Century Gothic', sans-serif; + font-style: italic; + left: 0; + top: 50%; + margin-top: 20px; + color: #fff; + font-weight: bold; + text-transform: uppercase; +} + +.loader-circle-1 { + width: 138px; + height: 138px; + left: 5px; + top: 5px; + border: 1px #fff solid; + border-radius: 50%; + position: absolute; + border-right-color: transparent; + -webkit-animation: spin 3s linear infinite; + animation: spin 3s linear infinite; +} + +.loader-circle-2 { + width: 126px; + height: 126px; + left: 5px; + top: 5px; + border: 1px transparent solid; + border-radius: 50%; + position: absolute; + border-right-color: #e81512; + -webkit-animation: spin 5s linear infinite; + animation: spin 5s linear infinite; +} + +.loader .line { + width: 10px; + height: 2px; + background: #fff; + position: absolute; +} + +.loader .line:nth-child(1) { + left: 16px; + top: 50%; + margin-top: -1px; +} + +.loader .line:nth-child(2) { + transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + left: 33px; + top: 33px; +} + +.loader .line:nth-child(3) { + top: 16px; + left: 50%; + width: 2px; + height: 10px; +} + +.loader .line:nth-child(4) { + transform: rotate(135deg); + -moz-transform: rotate(135deg); + -webkit-transform: rotate(135deg); + -ms-transform: rotate(135deg); + right: 33px; + top: 33px; +} + +.loader .line:nth-child(5) { + right: 16px; + top: 50%; + margin-top: -1px; +} + +.loader .line:nth-child(6) { + transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + right: 33px; + bottom: 33px; + background: #e81512; +} + +.loader .subline { + position: absolute; + width: 3px; + height: 2px; + background: #fff; +} + +.loader .subline:nth-child(7) { + transform: rotate(22.5deg); + -moz-transform: rotate(22.5deg); + -webkit-transform: rotate(22.5deg); + -ms-transform: rotate(22.5deg); + left: 21px; + top: 50px; +} + +.loader .subline:nth-child(8) { + transform: rotate(67.5deg); + -moz-transform: rotate(67.5deg); + -webkit-transform: rotate(67.5deg); + -ms-transform: rotate(67.5deg); + left: 50px; + top: 21px; +} + +.loader .subline:nth-child(9) { + transform: rotate(112.5deg); + -moz-transform: rotate(112.5deg); + -webkit-transform: rotate(112.5deg); + -ms-transform: rotate(112.5deg); + right: 50px; + top: 21px; +} + +.loader .subline:nth-child(10) { + transform: rotate(157.5deg); + -moz-transform: rotate(157.5deg); + -webkit-transform: rotate(157.5deg); + -ms-transform: rotate(157.5deg); + right: 21px; + top: 50px; +} + +.loader .subline:nth-child(11) { + transform: rotate(22.5deg); + -moz-transform: rotate(22.5deg); + -webkit-transform: rotate(22.5deg); + -ms-transform: rotate(22.5deg); + right: 20px; + bottom: 49px; + background: #e81512; +} + +.loader .needle { + width: 14px; + height: 14px; + border-radius: 50%; + border: 1px #fff solid; + position: absolute; + left: 50%; + top: 50%; + margin: -8px 0 0 -8px; + z-index: 1; + -webkit-animation: pegIt 3s infinite ease-in-out; + animation: pegIt 3s infinite ease-in-out; +} + +.loader .needle:before { + content: ""; + width: 0; + height: 0; + border-style: solid; + border-width: 3.5px 50px 3.5px 0; + border-color: transparent #e81512 transparent transparent; + position: absolute; + right: 50%; + top: 50%; + margin: -3.5px 0 0 0; + border-radius: 0 50% 50% 0; +} + +@keyframes pegIt { + 0% { + transform: rotate(0deg); + } + 16% { + transform: rotate(75deg); + } + 25% { + transform: rotate(55deg); + } + 30% { + transform: rotate(90deg); + } + 36% { + transform: rotate(170deg); + } + 42% { + transform: rotate(150deg); + } + 50% { + transform: rotate(227deg); + } + 100% { + transform: rotate(0deg); + } +} + +@-webkit-keyframes pegIt { + 0% { + -webkit-transform: rotate(0deg); + } + 16% { + -webkit-transform: rotate(75deg); + } + 25% { + -webkit-transform: rotate(55deg); + } + 30% { + -webkit-transform: rotate(90deg); + } + 36% { + -webkit-transform: rotate(170deg); + } + 42% { + -webkit-transform: rotate(150deg); + } + 50% { + -webkit-transform: rotate(227deg); + } + 100% { + -webkit-transform: rotate(0deg); + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + } +} +@keyframes spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} + diff --git a/book_cab/WebContent/CSS/Register_.css b/book_cab/WebContent/CSS/Register_.css new file mode 100644 index 0000000..87b70cd --- /dev/null +++ b/book_cab/WebContent/CSS/Register_.css @@ -0,0 +1,55 @@ +body, h1, h5 { + font-family: "Raleway", sans-serif +} + +.w3-allerta { + font-family: "Allerta Stencil", Sans-serif; + font-size: 80px; +} + +body, html { + height: 100% +} + +.bgimg { + background-image: url('../CSS/Images/backgroundcar.jpg'); + min-height: 100%; + background-position: center; + background-size: cover; +} + +hr { + margin-top: 0px !important; + margin-bottom: 2px !important; + border: 0; + border-top: 2px solid black !important; +} + +h4, .close { + background-color: black; + color: white !important; + text-align: center; + font-size: 30px; + height: 100% +} + +.container-header { + background-color: black; + color: white !important; + text-align: center; + font-size: 30px; +} + +.footer { + background-color: #f9f9f9; +} + +.container { + width: 400px; + margin-left: auto; + margin-right: auto; + background: white; + align-content: center; + padding-right: 0px; + padding-left: 0px; +} \ No newline at end of file diff --git a/book_cab/WebContent/CSS/RideCompleted.css b/book_cab/WebContent/CSS/RideCompleted.css new file mode 100644 index 0000000..06cc384 --- /dev/null +++ b/book_cab/WebContent/CSS/RideCompleted.css @@ -0,0 +1,154 @@ +#map { + height: 100%; +} + +html, body { + height: 100%; + margin: 0; + padding: 0; +} + +h { + font-size: 40px; + font-family: Times New Roman; + text-align: center !important; + color: black !important; +} + +p { + font-size: 30px; + font-family: Ubuntu; + text-align: center !important; + color: black !important; +} + +p1 { + font-size: 40px; + font-family: Ubuntu; + text-align: center !important; + color: black !important; +} + +h1 { + font-family: Arvo !important; + font-size: 25px !important; + margin-top: 20px !important; + margin-bottom: 20px !important; +} + +h2 { + font-family: Arvo !important; + font-size: 25px !important; + margin-top: 20px !important; + margin-bottom: 20px !important; + float: right; +} + +.sidenav { + height: 100%; + width: 0; + position: fixed; + z-index: 1; + top: 0; + right: 0; + background-color: #111; + overflow-x: hidden; + transition: 0.5s; + padding-top: 60px; + text-align: left; +} + +.sidenav a { + padding: 8px 8px 8px 32px; + text-decoration: none; + font-size: 25px; + color: #818181; + display: block; + transition: 0.3s; +} + +.sidenav a:hover, .offcanvas a:focus { + color: #f1f1f1; +} + +.sidenav .closebtn { + position: absolute; + top: 0; + right: 25px; + font-size: 36px; + margin-left: 50px; +} + +#main { + transition: margin-right .5s; + padding: 16px; + float: right; + color: white; +} + +#title { + font-family: "Allerta Stencil", Sans-serif; + font-size: 50px; + text-align: center; + float: center; + padding: 16px; + background-color: #424242; + color: white; +} + +@media screen and (max-height: 450px) { + .sidenav { + padding-top: 15px; + } + .sidenav a { + font-size: 18px; + } +} + +.submit { + font-size: 18px !important; + width: 150px; + background-color: #424242 !important; + color: white !important; + font-family: 'Quattrocento Sans'; +} + +hr { + margin-top: 0px !important; + margin-bottom: 2px !important; + border: 0; + border-top: 2px solid black !important; +} + + +.rating { + float:left; + width:300px; +} +.rating span { float:right; position:relative; } +.rating span input { + position:absolute; + top:0px; + left:0px; + opacity:0; +} +.rating span label { + display:inline-block; + width:30px; + height:30px; + text-align:center; + color:#FFF; + background:#ccc; + font-size:30px; + margin-right:2px; + line-height:30px; + border-radius:50%; + -webkit-border-radius:50%; +} +.rating span:hover ~ span label, +.rating span:hover label, +.rating span.checked label, +.rating span.checked ~ span label { + background:#F90; + color:#FFF; +} \ No newline at end of file diff --git a/book_cab/WebContent/CSS/RideHistory.css b/book_cab/WebContent/CSS/RideHistory.css new file mode 100644 index 0000000..d05443d --- /dev/null +++ b/book_cab/WebContent/CSS/RideHistory.css @@ -0,0 +1,133 @@ +html, body { + height: 100%; + margin: 0; + padding: 0; +} + +h { + font-size: 40px; + font-family: "Allerta Stencil", Sans-serif; + text-align: center !important; + color: black !important; +} + +h1{ + font-size: 200px; + font-family: "Carter One" !important; + text-align: center; + color: white !important; + margin: 0px !important; + padding-top: 20px; +} + +#main{ + transition: margin-right .5s; + color: white; +} +.bgimg { + background-image: url('Images/gif11.gif'); + min-height: 80%; + background-position: center; + background-size: cover; +} +.sidenav { + height: 100%; + width: 0; + position: fixed; + z-index: 1; + top: 0; + right: 0; + background-color: #111; + overflow-x: hidden; + transition: 0.5s; + padding-top: 60px; + text-align: left; +} + +.sidenav a { + padding: 8px 8px 8px 32px; + text-decoration: none; + font-size: 25px; + color: #818181; + display: block; + transition: 0.3s; +} + +.sidenav a:hover, .offcanvas a:focus { + color: #f1f1f1; +} + +.sidenav .closebtn { + position: absolute; + top: 0; + right: 25px; + font-size: 36px; + margin-left: 50px; +} + +#main { + transition: margin-right .5s; + padding: 16px; + float: right; + color: white; +} + +#title { + font-family: "Allerta Stencil", Sans-serif; + font-size: 50px; + text-align: center; + float: center; + padding: 16px; + background-color: #424242; + color: white; +} + +@media screen and (max-height: 450px) { + .sidenav { + padding-top: 15px; + } + .sidenav a { + font-size: 18px; + } +} + +.input-group-addon img { + height: 50px; + margin-right: -5px; + margin-bottom: -10px; + vertical-align: text-bottom; /* align the text */ +} + +.heading { + font-size: 50px; + font-family: "Allerta Stencil", Sans-serif; + text-align: center; + background-color: #424242; + color: white; +} +h1{ + font-size: 200px; + font-family: "Convergence" ,Bold !important; + text-align: center; + color: black; + +} + + +hr { + margin-top: 0px !important; + margin-bottom: 2px !important; + border: 0; + border-top: 2px solid black !important; +} + +.thead{ + color: white; + background-color: black; + border-color: #9e9e9e; +} + +.table-responsive{ + border-color: black; + +} diff --git a/book_cab/WebContent/CSS/SelectionPage.css b/book_cab/WebContent/CSS/SelectionPage.css new file mode 100644 index 0000000..c6a1ea6 --- /dev/null +++ b/book_cab/WebContent/CSS/SelectionPage.css @@ -0,0 +1,119 @@ +html, body { + height: 100%; + margin: 0; + padding: 0; +} +.sidenav { + height: 100%; + width: 0; + position: fixed; + z-index: 1; + top: 0; + right: 0; + background-color: #111; + overflow-x: hidden; + transition: 0.5s; + padding-top: 60px; + text-align: left; +} + +.sidenav a { + padding: 8px 8px 8px 32px; + text-decoration: none; + font-size: 25px; + color: #818181; + display: block; + transition: 0.3s; +} + +.sidenav a:hover, .offcanvas a:focus{ + color: #f1f1f1; +} + +.sidenav .closebtn { + position: absolute; + top: 0; + right: 25px; + font-size: 36px; + margin-left: 50px; +} + +#main { + transition: margin-right .5s; + padding: 16px; + float: right; + color: white; +} + +#title { + font-family: "Allerta Stencil", Sans-serif; + font-size: 50px; + text-align: center; + float: center; + padding: 16px; + background-color: black; + color: white; +} + +@media screen and (max-height: 450px) { + .sidenav {padding-top: 15px;} + .sidenav a {font-size: 18px;} +} + +#details li{ + list-style-type: none; + font-family: Cuprum !important; + font-size: 20px; + color: black !important; +} + +ul{ + padding-left: 0px !important; + margin-bottom: 26px !important; +} + +hr{ + margin-top: 0px !important; +} + +h1{ + font-family: "Francois One" !important; + color: black !important; + font-size: 40px !important; + margin-top: 10px !important; +} + +.bgimg { + background-image: url('Images/backgroundcar.jpg'); + min-height: 85%; + background-position: center; + background-size: cover; +} + +.media{ + padding-left: 10px !important; + padding-top: 10px !important; +} + +.container { + background-color: rgba(255, 255, 255, 0.4); +} + +.divider{ + border-right: 1px solid black; +} + +.col-md-5{ + height: 80%; +} + +.btn-lg { + padding: 10px 40px; + font-size: 30px; + border-radius: 10px; + font-family: "Convergence" !important; +} + +.spacing{ + padding: 90px; +} \ No newline at end of file diff --git a/book_cab/WebContent/CSS/UserProfile.css b/book_cab/WebContent/CSS/UserProfile.css new file mode 100644 index 0000000..b670804 --- /dev/null +++ b/book_cab/WebContent/CSS/UserProfile.css @@ -0,0 +1,84 @@ +html, body { + height: 100%; + margin: 0; + padding: 0; +} +.sidenav { + height: 100%; + width: 0; + position: fixed; + z-index: 1; + top: 0; + right: 0; + background-color: #111; + overflow-x: hidden; + transition: 0.5s; + padding-top: 60px; + text-align: left; +} + +.sidenav a { + padding: 8px 8px 8px 32px; + text-decoration: none; + font-size: 25px; + color: #818181; + display: block; + transition: 0.3s; +} + +.sidenav a:hover, .offcanvas a:focus{ + color: #f1f1f1; +} + +.sidenav .closebtn { + position: absolute; + top: 0; + right: 25px; + font-size: 36px; + margin-left: 50px; +} + +#main { + transition: margin-right .5s; + padding: 16px; + float: right; + color: white; +} + +#title { + font-family: "Allerta Stencil", Sans-serif; + font-size: 50px; + text-align: center; + float: center; + padding: 16px; + background-color: #424242; + color: white; +} + +@media screen and (max-height: 450px) { + .sidenav {padding-top: 15px;} + .sidenav a {font-size: 18px;} +} + +h1{ + font-family: "Allerta Stencil", Sans-serif !important; + text-align: center; + font-size: 50px !important; + margin-top: 20px !important; + margin-bottom: 20px !important; +} + +h2{ + font-size: 25px !important; + margin-top: 20px !important; + margin-bottom: 20px !important; +} + +.glyphicon { + margin-bottom: 10px; + margin-right: 10px; +} + +p{ + font-size: 18px !important; +} \ No newline at end of file diff --git a/book_cab/WebContent/CSS/WelcomePage.css b/book_cab/WebContent/CSS/WelcomePage.css new file mode 100644 index 0000000..ba4545b --- /dev/null +++ b/book_cab/WebContent/CSS/WelcomePage.css @@ -0,0 +1,81 @@ +body, h1, h5 { + font-family: "Raleway", sans-serif +} + +.w3-allerta { + font-family: "Allerta Stencil", Sans-serif; + font-size: 80px; +} + +body, html { + height: 100% +} + +.bgimg { + background-image: url('Images/backgroundcar.jpg'); + min-height: 100%; + background-position: center; + background-size: cover; +} + +.wrapper { + margin-top: 80px; + margin-bottom: 20px; +} + +.form-signin { + max-width: 420px; + padding: 30px 38px 66px; + margin: 0 auto; + background-color: #eee; + border: 3px dotted rgba(0, 0, 0, 0.1); +} + +.form-signin-heading { + text-align: center; + margin-bottom: 30px; +} + +.form-control { + position: relative; + font-size: 16px; + height: auto; + padding: 10px; +} + +input[type="text"] { + margin-bottom: 0px; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; +} + +input[type="password"] { + margin-bottom: 20px; + border-top-left-radius: 0; + border-top-right-radius: 0; +} + +.modal-header, h4, .close { + background-color: black; + color: white !important; + text-align: center; + font-size: 30px; +} + +.modal-footer { + background-color: #f9f9f9; +} + +hr { + margin-top: 0px !important; + margin-bottom: 2px !important; + border: 0; + border-top: 2px solid black !important; +} + +.btn-lg { + padding: 10px 40px; + font-size: 40px; + border-radius: 10px; + font-family: "Allerta Stencil", Sans-serif; +} \ No newline at end of file diff --git a/book_cab/WebContent/Cancellation.jsp b/book_cab/WebContent/Cancellation.jsp new file mode 100644 index 0000000..f95f671 --- /dev/null +++ b/book_cab/WebContent/Cancellation.jsp @@ -0,0 +1,75 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> + + + + + + + + + + + + + +Booking Confirmed + + + +
+
+ × +
  Your Account +   Your Ride +   Payment +   Rides History +   Log Out +
+ + + + update Ride set status = "Cancelled" where customerID = <%=session.getAttribute("customerID") %> order by bookingTime desc limit 1; + +
+ +
+ + +
+
+
+ Your Booking has been Cancelled!! +
+
+
+ +
+ + + \ No newline at end of file diff --git a/book_cab/WebContent/ChangePassword.jsp b/book_cab/WebContent/ChangePassword.jsp new file mode 100644 index 0000000..849bb05 --- /dev/null +++ b/book_cab/WebContent/ChangePassword.jsp @@ -0,0 +1,64 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + + + + + + + + Change Password + + + +
+


+
+
+

Change Password

+
+ +
+ + + +
+ + + +
+
+ + + \ No newline at end of file diff --git a/book_cab/WebContent/CheckStatus.jsp b/book_cab/WebContent/CheckStatus.jsp new file mode 100644 index 0000000..2a84b11 --- /dev/null +++ b/book_cab/WebContent/CheckStatus.jsp @@ -0,0 +1,101 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + +<%@page import="java.sql.ResultSet"%> +<%@page import="java.sql.Statement"%> +<%@page import="java.sql.DriverManager"%> +<%@page import="java.sql.Connection"%> +<%@page import="java.sql.SQLException"%> +<%@page import="java.sql.*"%> + +<%@page import="javax.script.*"%> +<%@page import="java.util.Date"%> +<%@page import="java.io.Reader"%> +<%@page import="java.io.Reader.*"%> +<%@page import="java.nio.file.Paths"%> +<%@page import="java.nio.file.Path"%> +<%@page import="java.nio.file.Files"%> + + + + + + + + + + + \ No newline at end of file diff --git a/book_cab/WebContent/CheckStatus2.jsp b/book_cab/WebContent/CheckStatus2.jsp new file mode 100644 index 0000000..929cb12 --- /dev/null +++ b/book_cab/WebContent/CheckStatus2.jsp @@ -0,0 +1,105 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + +<%@page import="java.sql.ResultSet"%> +<%@page import="java.sql.Statement"%> +<%@page import="java.sql.DriverManager"%> +<%@page import="java.sql.Connection"%> +<%@page import="java.sql.SQLException"%> +<%@page import="java.sql.*"%> + +<%@page import="javax.script.*"%> +<%@page import="java.util.Date"%> +<%@page import="java.io.Reader"%> +<%@page import="java.io.Reader.*"%> +<%@page import="java.nio.file.Paths"%> +<%@page import="java.nio.file.Path"%> +<%@page import="java.nio.file.Files"%> + + + + + + + + + + + \ No newline at end of file diff --git a/book_cab/WebContent/ConfirmBookingPage.jsp b/book_cab/WebContent/ConfirmBookingPage.jsp new file mode 100644 index 0000000..5ca74cf --- /dev/null +++ b/book_cab/WebContent/ConfirmBookingPage.jsp @@ -0,0 +1,125 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> + + + + + + + + + + + + + +Booking Confirmed + + + +
+ + +
+ +
+ + +
+
+
+ Your Booking has been confirmed! +

Here are your driver's details:

+
+ + + +<%System.out.print("Inside"); %> + + select d.firstName,d.lastName,d.emailId,d.phoneNumber,d.gender,d.DOB,d.cabNumber from Driver d where phoneNumber = (select driverId from Ride order by bookingTime desc limit 1); + + + + select c.type,c.name from Cab c where c.cabNumber = (select cabNumber from Driver where phoneNumber = (select driverId from Ride order by bookingTime desc limit 1)); + + +
+
+
+
+
+
+
+ +
+
+ +

+ + +

+ +
+ +
+ Male
+ +
+ ${row.cabNumber}
+
+
+
+
+
+
+
+
+
+

Enjoy your ride!

+
+ + + + + \ No newline at end of file diff --git a/book_cab/WebContent/ForgetPassword.jsp b/book_cab/WebContent/ForgetPassword.jsp new file mode 100644 index 0000000..7c2c601 --- /dev/null +++ b/book_cab/WebContent/ForgetPassword.jsp @@ -0,0 +1,62 @@ + + + +Cabriolet Registration + + + + + + + + + + + + + +
+


+
+
+

Forgot Password

+
+ +
+ +
+ + + +
+
+ + + + + diff --git a/book_cab/WebContent/FriendDetails.jsp b/book_cab/WebContent/FriendDetails.jsp new file mode 100644 index 0000000..662d9fb --- /dev/null +++ b/book_cab/WebContent/FriendDetails.jsp @@ -0,0 +1,70 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + +Book For A Friend + + + + + + + + + + + + + + + + +

+
+
+
+

+ Friend's Details +

+
+
+
+ +
+ + + +
+ + + +
+
+
+ + + + + \ No newline at end of file diff --git a/book_cab/WebContent/HomePage.jsp b/book_cab/WebContent/HomePage.jsp new file mode 100644 index 0000000..1107d52 --- /dev/null +++ b/book_cab/WebContent/HomePage.jsp @@ -0,0 +1,117 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + +HomePage + + + + + + + + + + + + + + + + + +
+ +
+ + +
+ + + + +
+ + +
+ + +
+ + +
+
Take a Ride
+
+
+
+
+
  + Source: +
  + Destination: + +
  + Car Type: +   

+ +  

  + Estimated Distance : +
  + Estimated Ride Cost :(in Rs.) +
  + Estimated Ride Time : +
+ +
+
+
+
+
+ + diff --git a/book_cab/WebContent/Images/1.jpg b/book_cab/WebContent/Images/1.jpg new file mode 100644 index 0000000..5783ca6 Binary files /dev/null and b/book_cab/WebContent/Images/1.jpg differ diff --git a/book_cab/WebContent/Images/Micro.png b/book_cab/WebContent/Images/Micro.png new file mode 100644 index 0000000..e194a77 Binary files /dev/null and b/book_cab/WebContent/Images/Micro.png differ diff --git a/book_cab/WebContent/Images/Mini.png b/book_cab/WebContent/Images/Mini.png new file mode 100644 index 0000000..dd9feaa Binary files /dev/null and b/book_cab/WebContent/Images/Mini.png differ diff --git a/book_cab/WebContent/Images/SUV.png b/book_cab/WebContent/Images/SUV.png new file mode 100644 index 0000000..11946bc Binary files /dev/null and b/book_cab/WebContent/Images/SUV.png differ diff --git a/book_cab/WebContent/Images/backgroundcar.jpg b/book_cab/WebContent/Images/backgroundcar.jpg new file mode 100644 index 0000000..9e1c25b Binary files /dev/null and b/book_cab/WebContent/Images/backgroundcar.jpg differ diff --git a/book_cab/WebContent/Images/icon.png b/book_cab/WebContent/Images/icon.png new file mode 100644 index 0000000..33a5736 Binary files /dev/null and b/book_cab/WebContent/Images/icon.png differ diff --git a/book_cab/src/com/talentsprint/beans/CabBean.java b/book_cab/src/com/talentsprint/beans/CabBean.java new file mode 100644 index 0000000..07020b8 --- /dev/null +++ b/book_cab/src/com/talentsprint/beans/CabBean.java @@ -0,0 +1,41 @@ +package com.talentsprint.beans; + +public class CabBean { + String cabNumber; + String cabType; + String cabName; + double costPerKm; + + public String getCabNumber() { + return cabNumber; + } + + public void setCabNumber(String cabNumber) { + this.cabNumber = cabNumber; + } + + public String getCabType() { + return cabType; + } + + public void setCabType(String cabType) { + this.cabType = cabType; + } + + public String getCabName() { + return cabName; + } + + public void setCabName(String cabName) { + this.cabName = cabName; + } + + public double getCostPerKm() { + return costPerKm; + } + + public void setCostPerKm(double costPerKm) { + this.costPerKm = costPerKm; + } + +} diff --git a/book_cab/src/com/talentsprint/beans/RideBean.java b/book_cab/src/com/talentsprint/beans/RideBean.java new file mode 100644 index 0000000..467e8f6 --- /dev/null +++ b/book_cab/src/com/talentsprint/beans/RideBean.java @@ -0,0 +1,84 @@ + package com.talentsprint.beans; + +public class RideBean { + String source; + String destination; + String customerId; + String driverId; + Double amount; + String status; + String carType; + String FriendMobileNumber,FriendName; + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getSource() { + return source; + } + + public String getCarType() { + return carType; + } + + public void setCarType(String carType) { + this.carType = carType; + } + + public void setSource(String source) { + this.source = source; + } + + public String getDestination() { + return destination; + } + + public void setDestination(String destination) { + this.destination = destination; + } + + public String getCustomerId() { + return customerId; + } + + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + + public String getDriverId() { + return driverId; + } + public String getFriendMobileNumber() { + return FriendMobileNumber; + } + + public void setFriendMobileNumber(String FriendMobileNumber) { + this.FriendMobileNumber = FriendMobileNumber; + } + public String getFriendName() { + return FriendName; + } + + public void setFriendName(String FriendName) { + this.FriendName = FriendName; + } + + + public void setDriverId(String driverId) { + this.driverId = driverId; + } + + public double getAmount() { + return amount; + } + + public void setAmount(double d) { + this.amount = d; + } + +} \ No newline at end of file diff --git a/book_cab/src/com/talentsprint/beans/UserBean.java b/book_cab/src/com/talentsprint/beans/UserBean.java new file mode 100644 index 0000000..c134622 --- /dev/null +++ b/book_cab/src/com/talentsprint/beans/UserBean.java @@ -0,0 +1,66 @@ +package com.talentsprint.beans; + +import java.math.BigDecimal; +import java.math.BigInteger; + +public class UserBean { + private String firstName, lastName, emailId, password, gender, dateOfBirth; + private String mobileNumber; + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getEmailId() { + return emailId; + } + + public void setEmailId(String emailId) { + this.emailId = emailId; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getGender() { + return gender; + } + + public void setGender(String gender) { + this.gender = gender; + } + + public String getDateOfBirth() { + return dateOfBirth; + } + + public void setDateOfBirth(String dateOfBirth) { + this.dateOfBirth = dateOfBirth; + } + + public String getMobileNumber() { + return mobileNumber; + } + + public void setMobileNumber(String mobileNumber) { + this.mobileNumber = mobileNumber; + } + +} diff --git a/book_cab/src/com/talentsprint/controllers/CancellationController.java b/book_cab/src/com/talentsprint/controllers/CancellationController.java new file mode 100644 index 0000000..b266bd3 --- /dev/null +++ b/book_cab/src/com/talentsprint/controllers/CancellationController.java @@ -0,0 +1,65 @@ +package com.talentsprint.controllers; + +import java.io.IOException; +import java.sql.SQLException; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import com.talentsprint.beans.RideBean; +import com.talentsprint.beans.UserBean; +import com.talentsprint.dbconnection.RideDAO; + +/** + * Servlet implementation class CancellationController + */ +@WebServlet("/CancellationController") +public class CancellationController extends HttpServlet { + private static final long serialVersionUID = 1L; + + /** + * @see HttpServlet#HttpServlet() + */ + public CancellationController() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse + * response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + // TODO Auto-generated method stub + response.getWriter().append("Served at: ").append(request.getContextPath()); + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse + * response) + */ + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + // TODO Auto-generated method stub + HttpSession session = request.getSession(); + RideBean rideBean = (RideBean) session.getAttribute("rideBean"); + + rideBean.setStatus("Ride Cancelled"); + try { + RideDAO.bookARide(rideBean); + RequestDispatcher requestDispatcher = request.getRequestDispatcher("Cancellation.jsp"); + requestDispatcher.forward(request, response); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + +} diff --git a/book_cab/src/com/talentsprint/controllers/ChangePasswordController.java b/book_cab/src/com/talentsprint/controllers/ChangePasswordController.java new file mode 100644 index 0000000..0b9d7b7 --- /dev/null +++ b/book_cab/src/com/talentsprint/controllers/ChangePasswordController.java @@ -0,0 +1,63 @@ +package com.talentsprint.controllers; + +import java.io.IOException; + +import javax.mail.Session; +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import com.talentsprint.dbconnection.UserDAOImplementation; + +/** + * Servlet implementation class ChangePasswordController + */ +@WebServlet("/ChangePasswordController") +public class ChangePasswordController extends HttpServlet { + private static final long serialVersionUID = 1L; + + /** + * @see HttpServlet#HttpServlet() + */ + public ChangePasswordController() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + response.getWriter().append("Served at: ").append(request.getContextPath()); + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + HttpSession session = request.getSession(); + UserDAOImplementation userDAO = new UserDAOImplementation(); + String verificationCode = request.getParameter("verificationCode"); + String newPassword = request.getParameter("password1"); + String reEnterPassword = request.getParameter("password2"); + String userId = (String)session.getAttribute("UserId"); + System.out.println(userId+ "" + newPassword + ""+ reEnterPassword); + if(newPassword.equals(reEnterPassword)){ + System.out.println("1111" + newPassword + ""+ reEnterPassword); + userDAO.changePassword(userId, verificationCode, newPassword); + RequestDispatcher rd = request.getRequestDispatcher("WelcomePage.html"); + rd.forward(request, response); + }else{ + userDAO.msgbox("Passwords do not match!!"); + } + + + } + +} diff --git a/book_cab/src/com/talentsprint/controllers/CreateUser.java b/book_cab/src/com/talentsprint/controllers/CreateUser.java new file mode 100644 index 0000000..b55f54d --- /dev/null +++ b/book_cab/src/com/talentsprint/controllers/CreateUser.java @@ -0,0 +1,77 @@ +package com.talentsprint.controllers; + +import java.io.IOException; +import java.io.PrintWriter; +import java.math.BigInteger; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.swing.JOptionPane; + +import com.talentsprint.beans.UserBean; +import com.talentsprint.dbconnection.UserDAOImplementation; + +/** + * Servlet implementation class CreateUser + */ +@WebServlet("/CreateUser") +public class CreateUser extends HttpServlet { + private static final long serialVersionUID = 1L; + + /** + * Default constructor. + */ + + private void msgbox(String s){ + JOptionPane.showMessageDialog(null, s); + } + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse + * response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + // TODO Auto-generated method stub + response.getWriter().append("Served at: ").append(request.getContextPath()); + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse + * response) + */ + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + // TODO Auto-generated method stub + + doGet(request, response); + int result = 0; + UserBean user = new UserBean(); + PrintWriter out = response.getWriter(); + if(request.getParameter("password").equals(request.getParameter("reEnterPassword"))){ + System.out.println(request.getParameter("password") + "" +request.getParameter("reEnterPassword")); + user.setFirstName(request.getParameter("firstName")); + user.setLastName(request.getParameter("lastName")); + user.setEmailId(request.getParameter("emailID")); + user.setGender(request.getParameter("gender")); + user.setDateOfBirth(request.getParameter("dateOfBirth")); + user.setMobileNumber(request.getParameter("mobileNumber")); + user.setPassword(request.getParameter("password")); + + UserDAOImplementation dao = new UserDAOImplementation(); + result = dao.createUser(user); + RequestDispatcher rd = request.getRequestDispatcher("WelcomePage.html"); + rd.forward(request, response); + + }else { + msgbox("Passwords do not match!!"); + RequestDispatcher rd = request.getRequestDispatcher("Register.jsp"); + rd.forward(request, response); + } + + } + +} diff --git a/book_cab/src/com/talentsprint/controllers/ForgetPaswordController.java b/book_cab/src/com/talentsprint/controllers/ForgetPaswordController.java new file mode 100644 index 0000000..d3a836c --- /dev/null +++ b/book_cab/src/com/talentsprint/controllers/ForgetPaswordController.java @@ -0,0 +1,72 @@ +package com.talentsprint.controllers; + +import java.io.IOException; +import java.net.URLEncoder; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import com.talentsprint.beans.UserBean; +import com.talentsprint.dbconnection.UserDAOImplementation; + +import sun.applet.resources.MsgAppletViewer_pt_BR; + +/** + * Servlet implementation class ForgetPaswordController + */ +@WebServlet("/ForgetPaswordController") +public class ForgetPaswordController extends HttpServlet { + private static final long serialVersionUID = 1L; + + /** + * @see HttpServlet#HttpServlet() + */ + public ForgetPaswordController() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + response.getWriter().append("Served at: ").append(request.getContextPath()); + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + HttpSession session = request.getSession(); + UserDAOImplementation userDAO = new UserDAOImplementation(); + String Id = ((String)request.getParameter("fp_phoneNumber").trim()); + String email = ((String)request.getParameter("fp_email").trim()); + String emailId = userDAO.forgetPasswordGetEmail(Id); + session.setAttribute("UserId",Id); + System.out.println(email +" " + emailId); + if(emailId.equals(email)){ + String[] to = { emailId }; + String subject = "Change Password"; + String msg = "You can reset your password using this verification code '"+userDAO.getPassword(Id)+"'"; + + userDAO.sendMail(to, subject, msg); + RequestDispatcher rd = request.getRequestDispatcher("ChangePassword.jsp"); + rd.forward(request, response); + + }else { + userDAO.msgbox("Please enter the registerd E-mailId!!"); + RequestDispatcher rd = request.getRequestDispatcher("ForgetPassword.jsp"); + rd.forward(request, response); + + + } + } + +} diff --git a/book_cab/src/com/talentsprint/controllers/FriendDetailsController.java b/book_cab/src/com/talentsprint/controllers/FriendDetailsController.java new file mode 100644 index 0000000..3571839 --- /dev/null +++ b/book_cab/src/com/talentsprint/controllers/FriendDetailsController.java @@ -0,0 +1,53 @@ +package com.talentsprint.controllers; + +import java.io.IOException; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + + +/** + * Servlet implementation class FriendDetailsController + */ +@WebServlet("/FriendDetailsController") +public class FriendDetailsController extends HttpServlet { + private static final long serialVersionUID = 1L; + + /** + * @see HttpServlet#HttpServlet() + */ + public FriendDetailsController() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + doPost(request,response); + response.getWriter().append("Served at: ").append(request.getContextPath()); + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + System.out.println("in FriendDetails"); + HttpSession session = request.getSession(); + session.setAttribute("F_Name",request.getParameter("name1")); + session.setAttribute("F_MobileNumber1",request.getParameter("mobileNumber")); + RequestDispatcher rd = request.getRequestDispatcher("HomePage.jsp"); + rd.forward(request, response); + + + } + +} \ No newline at end of file diff --git a/book_cab/src/com/talentsprint/controllers/RideController.java b/book_cab/src/com/talentsprint/controllers/RideController.java new file mode 100644 index 0000000..6e74ce1 --- /dev/null +++ b/book_cab/src/com/talentsprint/controllers/RideController.java @@ -0,0 +1,107 @@ +package com.talentsprint.controllers; + +import java.io.IOException; +import java.io.PrintWriter; +import java.sql.SQLException; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import com.talentsprint.beans.RideBean; +import com.talentsprint.dbconnection.RideDAO; + + +/** + * Servlet implementation class RideController + */ +@WebServlet("/RideController") +public class RideController extends HttpServlet { + private static final long serialVersionUID = 1L; + + /** + * @see HttpServlet#HttpServlet() + */ + public RideController() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse + * response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + // TODO Auto-generated method stub + doPost(request,response); + response.getWriter().append("Served at: ").append(request.getContextPath()); + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse + * response) + */ + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + // TODO Auto-generated method stub + PrintWriter out = response.getWriter(); + System.out.println("in RideController"); + HttpSession session = request.getSession(); + RideBean rideBean = new RideBean(); + rideBean.setSource((String)request.getParameter("source")); + System.out.println(request.getParameter("source")); + rideBean.setDestination((String)request.getParameter("destination")); + String customerID = (String) (session.getAttribute("customerID")); + rideBean.setCustomerId(customerID); + System.out.println(request.getParameter("costEstimate")); + rideBean.setAmount(Double.parseDouble(request.getParameter("costEstimate"))); + rideBean.setStatus("Waiting"); + String val = request.getParameter("type"); + session.setAttribute("RideBean", rideBean); + String riderName = (String) (session.getAttribute("F_Name")); + String riderNumber = (String) (session.getAttribute("F_MobileNumber1")); + + rideBean.setFriendName(riderName); + System.out.println(riderName); + rideBean.setFriendMobileNumber(riderNumber); + System.out.println(val); + String type = null; + if(val.equals("6")){ + type = "Micro"; + }if(val.equals("8")){ + type = "Mini"; + }if(val.equals("18")){ + type ="SUV"; + } + System.out.println(type); + rideBean.setCarType(type); + try { + + int flag = RideDAO.bookARide(rideBean); + System.out.println(flag); + if(flag == -1){ + out.println(""); + + }else { + System.out.println(flag); + RequestDispatcher requestDispatcher = request.getRequestDispatcher("LoadingPage.jsp"); + requestDispatcher.forward(request, response); + //RequestDispatcher requestDispatcher = request.getRequestDispatcher("HomePage.jsp"); + //requestDispatcher.forward(request, response); + } + + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + +} diff --git a/book_cab/src/com/talentsprint/controllers/UserLoginController.java b/book_cab/src/com/talentsprint/controllers/UserLoginController.java new file mode 100644 index 0000000..6eeb231 --- /dev/null +++ b/book_cab/src/com/talentsprint/controllers/UserLoginController.java @@ -0,0 +1,91 @@ +package com.talentsprint.controllers; + +import java.io.IOException; +import java.io.PrintWriter; +import java.sql.SQLException; +import java.util.Properties; + +import javax.mail.Message; +import javax.mail.MessagingException; +import javax.mail.PasswordAuthentication; +import javax.mail.Session; +import javax.mail.Transport; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeMessage; +import javax.script.Invocable; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import com.talentsprint.beans.RideBean; +import com.talentsprint.dbconnection.LoginDAO; + +/** + * Servlet implementation class LoginServlet + */ +@WebServlet("/UserLoginController") +public class UserLoginController extends HttpServlet { + private static final long serialVersionUID = 1L; + + /** + * @see HttpServlet#HttpServlet() + */ + public UserLoginController() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse + * response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + // TODO Auto-generated method stub + response.getWriter().append("Served at: ").append(request.getContextPath()); + doPost(request, response); + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse + * response) + */ + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + String phoneNumber = request.getParameter("phoneNumber"); + String password = request.getParameter("password"); + PrintWriter out = response.getWriter(); + HttpSession session = request.getSession(true); + session.setAttribute("customerID", phoneNumber); + request.setAttribute("customerID", phoneNumber); + + LoginDAO loginDAO = new LoginDAO(); + try { + boolean result = loginDAO.validate(phoneNumber, password); + if (result) { + RequestDispatcher requestDispatcher = request.getRequestDispatcher("SelectionPage.jsp"); + requestDispatcher.forward(request, response); + + } else { + out.println(""); + + } + } catch (SQLException e) { + e.printStackTrace(); + } + + } + + + +} diff --git a/book_cab/src/com/talentsprint/dbconnection/ConnectionFactory.java b/book_cab/src/com/talentsprint/dbconnection/ConnectionFactory.java new file mode 100644 index 0000000..1b80bf2 --- /dev/null +++ b/book_cab/src/com/talentsprint/dbconnection/ConnectionFactory.java @@ -0,0 +1,21 @@ +package com.talentsprint.dbconnection; + +import java.sql.Connection; +import java.sql.DriverManager; + +class ConnectionFactory { + public static Connection getConnection() { + Connection connection = null; + try { + Class.forName("com.mysql.jdbc.Driver"); + + connection = DriverManager.getConnection("jdbc:mysql://192.168.3.247:3306/cabriolet", "srividya", "srividyaswamy");//("jdbc:mysql://localhost:3306/Cabriolet1","root","rajula"); + // + + } catch (Exception e) { + System.out.println("Exception: " + e.getMessage()); + } + + return connection; + } +} \ No newline at end of file diff --git a/book_cab/src/com/talentsprint/dbconnection/LoginDAO.java b/book_cab/src/com/talentsprint/dbconnection/LoginDAO.java new file mode 100644 index 0000000..f1fd4e0 --- /dev/null +++ b/book_cab/src/com/talentsprint/dbconnection/LoginDAO.java @@ -0,0 +1,41 @@ +package com.talentsprint.dbconnection; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +public class LoginDAO { + ConnectionFactory connectionFactory = new ConnectionFactory(); + Connection con = connectionFactory.getConnection(); + + public boolean validate(String phoneNum, String password) throws SQLException { + + String phoneNumber = null; + String password1 = null; + System.out.println(phoneNum); + Statement statement = con.createStatement(); + String query = "select password from Customer where phoneNumber ='" + phoneNum + "'"; + String query1 = "SELECT MD5('" + password + "')"; + ResultSet resultSet = statement.executeQuery(query); + + if (resultSet.next()) { + password1 = resultSet.getString(1); + + } + resultSet.close(); + ResultSet resultSet2 = statement.executeQuery(query1); + if (resultSet2.next()) { + password = resultSet2.getString(1); + + } + resultSet2.close(); + + if ((password.equals(password1))) { + + return true; + } + + return false; + } +} diff --git a/book_cab/src/com/talentsprint/dbconnection/RideDAO.java b/book_cab/src/com/talentsprint/dbconnection/RideDAO.java new file mode 100644 index 0000000..ad3d537 --- /dev/null +++ b/book_cab/src/com/talentsprint/dbconnection/RideDAO.java @@ -0,0 +1,72 @@ +package com.talentsprint.dbconnection; + +import java.io.PrintWriter; +import java.sql.Connection; +import java.sql.Statement; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + + +import javax.swing.JOptionPane; + +import com.talentsprint.beans.RideBean; + +public class RideDAO { + + public static int bookARide(RideBean rideBean) throws SQLException { + int result = 0; + String CustomerName = null; + try { + Connection connection = ConnectionFactory.getConnection(); + PreparedStatement query = connection.prepareStatement( + "insert into Ride(driverId,customerId,source,destination,status,amount,bookingTime,carType,riderName,riderNumber) values(?,?,?,?,?,?,NOW(),?,?,?)"); + query.setString(2, rideBean.getCustomerId()); + System.out.println(rideBean.getCustomerId()); + query.setString(3, rideBean.getSource()); + query.setString(4, rideBean.getDestination()); + query.setString(5, rideBean.getStatus()); + query.setDouble(6, rideBean.getAmount()); + String type = rideBean.getCarType(); + query.setString(7, type); + String idOfCustomer = rideBean.getCustomerId(); + Statement s = connection.createStatement(); + ResultSet rs = s.executeQuery("select concat(firstName,' ',lastName) from Customer where phoneNumber = '"+idOfCustomer+"' "); + if(rs.next()) { + CustomerName = rs.getString(1); + System.out.println(CustomerName); + } + if(rideBean.getFriendName() != null) { + query.setString(8, rideBean.getFriendName()); + } else { + query.setString(8, CustomerName); + } + if(rideBean.getFriendMobileNumber() != null) { + query.setString(9, rideBean.getFriendMobileNumber()); + } else { + query.setString(9, rideBean.getCustomerId()); + } + + + PreparedStatement query1 = connection.prepareStatement("select phoneNumber from Driver where cabNumber = (select distinct(d.cabNumber) from driver d, cab c where d.status = 'available' and c.type = '"+type+"' order by RAND() LIMIT 1 )"); + ResultSet resultSet = query1.executeQuery(); + + if(resultSet.next()){ + System.out.println(resultSet.getString(1)); + query.setString(1, resultSet.getString(1)); + } else { + + return -1; + } + + result = query.executeUpdate(); + connection.close(); + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } + + + +} \ No newline at end of file diff --git a/book_cab/src/com/talentsprint/dbconnection/UserDAO.java b/book_cab/src/com/talentsprint/dbconnection/UserDAO.java new file mode 100644 index 0000000..a36f211 --- /dev/null +++ b/book_cab/src/com/talentsprint/dbconnection/UserDAO.java @@ -0,0 +1,10 @@ +package com.talentsprint.dbconnection; + +import java.util.ArrayList; + +import com.talentsprint.beans.UserBean; + +public interface UserDAO { + public int createUser(UserBean userBean); + +} \ No newline at end of file diff --git a/book_cab/src/com/talentsprint/dbconnection/UserDAOImplementation.java b/book_cab/src/com/talentsprint/dbconnection/UserDAOImplementation.java new file mode 100644 index 0000000..672787f --- /dev/null +++ b/book_cab/src/com/talentsprint/dbconnection/UserDAOImplementation.java @@ -0,0 +1,153 @@ + package com.talentsprint.dbconnection; + +import java.sql.*; +import java.util.Properties; + +import javax.mail.Message; +import javax.mail.MessagingException; +import javax.mail.PasswordAuthentication; +import javax.mail.Session; +import javax.mail.Transport; +import javax.mail.internet.AddressException; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeMessage; +import javax.swing.JOptionPane; + +import com.talentsprint.beans.UserBean; + +public class UserDAOImplementation implements UserDAO { + @Override + public int createUser(UserBean user) { + int result = 0; + try { + Connection connection = ConnectionFactory.getConnection(); + PreparedStatement query = connection.prepareStatement( + "insert into Customer(firstName,lastName,emailID,phoneNumber,gender,DOB,password) values(?,?,?,?,?,?,md5(?))"); + + query.setString(1, user.getFirstName()); + query.setString(2, user.getLastName()); + query.setString(3, user.getEmailId()); + query.setString(5, user.getGender()); + query.setString(6, user.getDateOfBirth()); + query.setString(4, user.getMobileNumber()); + query.setString(7, user.getPassword()); + + result = query.executeUpdate(); + System.out.println(result); + connection.close(); + } catch (Exception e) { + msgbox("This user already has an account with the same PhoneNumber/emailId"); + + } + return result; + } + + public String forgetPasswordGetEmail(String customerId) { + try { + Connection connection = ConnectionFactory.getConnection(); + Statement statement = connection.createStatement(); + String query = "select emailId from Customer where phoneNumber ='" + customerId + "'"; + ResultSet resultSet = statement.executeQuery(query); + + if (resultSet.next()) { + return (resultSet.getString(1)); + + } + resultSet.close(); + connection.close(); + } catch (Exception e) { + msgbox("This user already has an account with the same PhoneNumber/emailId"); + + } + return null; + + } + + public String getPassword(String customerId) { + try { + Connection connection = ConnectionFactory.getConnection(); + Statement statement = connection.createStatement(); + String query = "select password from Customer where phoneNumber ='" + customerId + "'"; + ResultSet resultSet = statement.executeQuery(query); + + if (resultSet.next()) { + return (resultSet.getString(1)); + + } + resultSet.close(); + connection.close(); + } catch (Exception e) { + msgbox("This user already has an account with the same PhoneNumber/emailId"); + + } + return null; + + } + + public void msgbox(String s) { + JOptionPane.showMessageDialog(null, s); + } + + public void sendMail(String[] to, String sub, String msg) { + final String from = "lekya.sheral05@gmail.com"; + final String pass = "ryandee05"; + Properties props = System.getProperties(); + String host = "smtp.gmail.com"; + props.put("mail.smtp.starttls.enable", "true"); + props.put("mail.smtp.host", host); + props.put("mail.smtp.user", from); + props.put("mail.smtp.password", pass); + props.put("mail.smtp.port", "587"); + props.put("mail.smtp.auth", "true"); + props.put("mail.smtp.ssl.trust", "smtp.gmail.com"); + + Session session = Session.getDefaultInstance(props); + MimeMessage message = new MimeMessage(session); + + try { + message.setFrom(new InternetAddress(from)); + InternetAddress[] toAddress = new InternetAddress[to.length]; + + // To get the array of addresses + for (int i = 0; i < to.length; i++) { + toAddress[i] = new InternetAddress(to[i]); + } + + for (int i = 0; i < toAddress.length; i++) { + message.addRecipient(Message.RecipientType.TO, toAddress[i]); + } + + message.setSubject(sub); + message.setText(msg); + Transport transport = session.getTransport("smtp"); + transport.connect(host, from, pass); + transport.sendMessage(message, message.getAllRecipients()); + transport.close(); + } catch (AddressException ae) { + ae.printStackTrace(); + } catch (MessagingException me) { + me.printStackTrace(); + } + } + + public void changePassword(String userId,String verificationCode, String Password){ + try { + Connection connection = ConnectionFactory.getConnection(); + Statement statement = connection.createStatement(); + String query = "select * from Customer where phoneNumber = '"+userId+"' and password = '"+verificationCode+"'"; + ResultSet resultSet = statement.executeQuery(query); + if (resultSet.next()) { + String query1 = "update Customer set password =MD5('" + Password + "') where phoneNumber = '"+userId+"'"; + int result = statement.executeUpdate(query1); + } + resultSet.close(); + connection.close(); + } catch (Exception e) { + msgbox("Enter the correct verification Code!!"); + + } + } + + } + +