Professional Documents
Culture Documents
Project in Database Management System: Car Rental System Documentation
Project in Database Management System: Car Rental System Documentation
In
Database Management System
CAR RENTAL SYSTEM DOCUMENTATION
Submitted By:
Cabunot, Joanna Marie
Lubrico, Janen
Magallanes, Mary Cris
Nahudan, Eiman
Submitted To:
Ms. Marinella T. Tose
Car Rental System Analysis
A Car company rents a car. Car (Plate_no, Car_Name, Color, Speed, and
no_of_days are kept. In returning the car the date_returned, date_rented and
This System will facilitate the functioning of a "typical" Rental Car store.
Each type of car should have a different rental fee per day. Rental fee depends
on number of day, brand and how fast the car runs.
The system should have the following functionalities:
Pick Up: The system process a Car Pick Up. Customer walks
in and supplies either the confirmation number, or name. The system should
pull up all the reservation information about this customer. The customer is
then asked to supply a drivers’ license.
Return: The system process a return. The system should record the
date, time and processed by Depending on these parameters, the system
calculate the final rental amount.
Name: Cabunot, Joana Marie Z.
Address: San Roque, Z.C
Birthday: November 5, 1989
Work Assigned: System Analyst (is responsible for researching, planning, coordinating and
recommending software and system choices to meet an organization's business requirements)
Contribution: bond papers, folder, venue, food, and latop
N
CUSTOMER N
Cus_Id
Deposit N Lastname N Date_rented
Date_rent RENTS Firstname Date_returned
RETURN
No_of_days Birthdate Processed_By
Amount Telephone_No Car_Id *
Car_Id* Address Cus_Id*
Cus_Id* N N
CAR
Car_Id
Plate_no
Car_name
Brand
Color
Speed
Rental
ISSUED BY
Car_Id*
Emp_Id Emp_Id
1 Lastname
Firstname
EMPLOYEE Address
Position
Birthdate
Telephone_no
Cellphone_no
CAR RENTAL SYSTEM TABLES
cartable
Car_Id Plate_no Brand Color Speed Rental Status
1 JKL 900 CRV RED 230 mph 200 1
2 KLI 567 RANGER BLUE 300 mph 300 1
3 AAZ 123 HONDA CIVIC GREY 300 mph 300 1
4 ZXC 435 TOYOTA BLACK 250mph 500 1
5 QQQ 123 adventure blue 550mph 1000 1
customertable
Cus_Id Lastname Firstname Address Telephone_no Cellphone_no Birthdate
1 Magallanes Marycris caumpang 584641976 4545485 12/25/2008
2 Bacus Ricky RQEREQR 56624 776 10/6/2008
3 Columbres Rheanette XFGVSZDV 65378 5464563 9/30/2008
4 De asis Shiella sdjfsadkjfsd 992 0918 10/6/2008
5 Ablao Gian Carlo SDFASDFDS 9919191 0919 3/18/1989
6 Gubantes Ferr Jane jdafsda 9912345 0905123456 9/29/2008
employeetable
Emp_Id Lastname Firstname Address Telephone_no cellphone_no Birthdate Date_hired MyPosition
1 LUBRICO JANEN FDGHDF 756765765 5475456 10/14/2008 10/6/2008 Cashier
2 TWIEUTIWRUT TIRUTIR TWTWT 4545 4545 9/30/2008 12:00:00 cashier
AM
3 DACAY SHEENAMAE TABUK 993 90512345 10/6/2008 12:00:00 manager
AM
4 PANDAY HAZEL CHCO 993 9076543221 10/22/2008 12:00:00 cashier
AM
renttable
Car_Id Cus_Id Date_Rented No_of_days Amount Deposit Status
1 2 10/15/2008 2 1500 1500 2
returntable
Lastname Firstname Plate_No Carname Date_Rented Date_Returned Process_by
Magallanes Marycris QQQ 123 CRV 10/05/2008 10/07/2008 Janen
FORM CARRENTAL
If you click Customer Profile, Customer Table will appear.
When you click the transaction details at the menu bar, this form
will appear.
CAR RENTAL SYSTEM CODES
FRMCARRENTAL
FRMCUSTBL
did = DataGrid1.Columns(0).Text
If Not did = "" Then
custid = did
cust_opt = 2
frmnewcust.cmd_save.Caption = "Update"
frmnewcust.Show (1)
End If
End Sub
Call connectme
conn.Open
pr = InputBox("Please Enter Any Key to Search!" & Chr(10) & Chr(13) & "CUS ID/LASTNAME/FIRSTNAME",
"Searching...")
If pr = "" Then
Else
query = "SELECT * FROM customertable WHERE Lastname LIKE '" & pr & "%' or Firstname LIKE '" & pr & "%'
ORDER BY Lastname"
rs.Open query, conn
Set DataGrid1.DataSource = rs
End If
End Sub
did = DataGrid1.Columns(0).Text
Call myquery
If userlevel = 3 Then
Command1.Enabled = False
Command2.Enabled = False
Command4.Enabled = False
Else
Command1.Enabled = True
Command2.Enabled = True
Command4.Enabled = True
End If
End Sub
End Sub
FRMEMPTBL
did = DataGrid1.Columns(0).Text
If Not did = "" Then
empid = did
emp_opt = 2
frmnewemp.cmd_save.Caption = "Update"
frmnewemp.Show (1)
End If
End Sub
Call connectme
conn.Open
pr = InputBox("Please Enter Any Key to Search!" & Chr(10) & Chr(13) & "EMP ID/LASTNAME/FIRSTNAME",
"Searching...")
If pr = "" Then
Else
query = "SELECT * FROM employeetable WHERE Lastname LIKE '" & pr & "%' or Firstname LIKE '" & pr & "%'
ORDER BY Lastname"
rs.Open query, conn
Set DataGrid1.DataSource = rs
End If
End Sub
did = DataGrid1.Columns(0).Text
Call myquery
''************ USER LEVEL
If userlevel = 1 Then
Command1.Enabled = True
Command2.Enabled = True
Command4.Enabled = True
Else
Command1.Enabled = False
Command2.Enabled = False
Command4.Enabled = False
End If
End Sub
Call connectme
conn.Open
End Sub
Public Sub datgrid()
DataGrid1.Font.Size = 11
DataGrid1.Font.Name = "Arial"
DataGrid1.HeadFont.Size = 11
DataGrid1.HeadFont.Bold = True
DataGrid1.HeadFont.Name = "Arial"
DataGrid1.Columns(0).Caption = "Emp ID"
DataGrid1.Columns(0).Width = 1000
DataGrid1.Columns(4).Caption = "Telephone No."
DataGrid1.Columns(4).Width = 1700
DataGrid1.Columns(5).Caption = "CellPhone No."
DataGrid1.Columns(5).Width = 1600
DataGrid1.Columns(7).Caption = "Date Hired"
DataGrid1.Columns(7).Width = 1600
End Sub
FRMLOGIN
Call connectme
conn.Open
ssql = "SELECT * FROM myusers WHERE myusername='" & txt_user.Text & "' AND mypassword='" & txt_pass.Text
& "'"
rs.Open ssql, conn
If Not rs.EOF Then
With rs
userlevel = !user_level
myuser = txt_user.Text
frmcarrental.Enabled = True
Unload Me
End With
Else
MsgBox "Invalid username and password !", vbCritical, "KRIN"
txt_user.SetFocus
frmcarrental.Enabled = False
End If
conn.Close
End Sub
FRMNEWCUST
Else
If cust_opt = 1 Then
Call addrec
MsgBox "Record was successfully saved!", vbInformation, "KRIN"
Unload Me
ElseIf cust_opt = 2 Then
Call editrec
MsgBox "Record was successfully updated!", vbInformation, "KRIN"
End If
Call frmcustbl.myquery
End If
End Sub
Call connectme
If cust_opt = 2 Then
conn.Open
ssqlsub = "SELECT * FROM customertable WHERE Cus_Id=" & custid
rs2.Open ssqlsub, conn
End Sub
Public Sub addrec()
End Sub
Public Sub editrec()
End Sub
FRMNEWEMP
Else
If emp_opt = 1 Then
Call addrec
MsgBox "Record was successfully saved!", vbInformation, "KRIN"
Unload Me
ElseIf emp_opt = 2 Then
Call editrec
MsgBox "Record was successfully updated!", vbInformation, "KRIN"
End If
Call frmemptbl.myquery
End If
End Sub
Call connectme
If emp_opt = 2 Then
conn.Open
ssqlsub = "SELECT * FROM employeetable WHERE Emp_Id=" & empid
rs2.Open ssqlsub, conn
End With
End If
conn.Close
End If
End Sub
Public Sub addrec()
End Sub
Public Sub editrec()
End Sub
FRMNEWRENT
Else
If rent_opt = 1 Then
Call addrec
MsgBox "Record was successfully saved!", vbInformation, "KRIN"
Unload Me
ElseIf rent_opt = 2 Then
Call editrec
MsgBox "Record was successfully updated!", vbInformation, "KRIN"
End If
Call frmrenttbl.myquery
End If
End Sub
End If
End Sub
If rent_opt = 2 Then
End With
txt_days.Text = !No_of_days
txt_due.Text = !Amount
txt_deposit.Text = !Deposit
End With
End If
End If
End Sub
Public Sub addrec()
End Sub
Public Sub editrec()
End Sub
Private Sub txt_days_Change()
If Not txt_days.Text = "" Then
txt_due.Text = Val(txt_rental.Text) * Val(txt_days.Text)
txt_due.Text = Format(txt_due.Text, "#########.00")
End If
End Sub
ssqlsub = "SELECT * FROM cartable WHERE Plate_no='" & Trim(txt_plateno.Text) & "' AND Status='1'"
rs.Open ssqlsub, conn
If Not rs.EOF Then
With rs
txt_carid.Text = !Car_Id
txt_carname.Text = !Brand
txt_color.Text = !Color
txt_rental.Text = !Rental
End With
Else
MsgBox "The Car is not Available at the moment!", vbCritical
Call clearme
End If
rs.Close
End If
End If
End Sub
Public Sub clearme()
txt_carid.Text = ""
txt_carname.Text = ""
txt_color.Text = ""
txt_rental.Text = ""
End Sub
FRMRENTBL
did = DataGrid1.Columns(0).Text
If Not did = "" Then
rentid = did
rent_opt = 1
frmnewrent.cmd_save.Caption = "Update"
frmnewrent.Show (1)
End If
End Sub
Call connectme
conn.Open
pr = InputBox("Please Enter Any Key to Search!" & Chr(10) & Chr(13) & "PLATE NO./CUSTOMER ", "Searching...")
If pr = "" Then
End Sub
did = DataGrid1.Columns(0).Text
lastname = DataGrid1.Columns(1).Text
firstname = DataGrid1.Columns(2).Text
plateno = DataGrid1.Columns(3).Text
carname = DataGrid1.Columns(4).Text
daterent = DataGrid1.Columns(5).Text
dateret = Format(Now, "mm/dd/yyyy")
If Not did = "" Then
confirm = MsgBox("This will RETURN the Car Now?..proceed anyway!", vbOKCancel + vbExclamation,
"Warning!")
If confirm = vbOK Then
Call connectme
conn.Open
conn.Execute "Update cartable set Status='1' WHERE Plate_no='" & plateno & "'"
conn.Execute "Update renttable set Status='2' WHERE Rent_Id=" & did
conn.Execute "Insert into
returntable(Rent_Id,lastname,firstname,Plate_No,Carname,Date_Rented,Date_Returned,Process_by) VALUES ('"
& did & "','" & lastname & "','" & firstname & "','" & plateno & "','" & carname & "','" & daterent & "','" & dateret
& "','" & myuser & "')"
MsgBox "The Return Transaction was successfully saved!", vbInformation
conn.Close
Call myquery
End If
Else
MsgBox "There are no records to delete!", vbCritical
End If
End Sub
Call myquery
If userlevel = 3 Then
Command1.Enabled = False
Command2.Enabled = False
Command4.Enabled = False
Else
Command1.Enabled = True
Command2.Enabled = True
Command4.Enabled = True
End If
End Sub
conn.Open
End Sub
Public Sub datgrid()
DataGrid1.Font.Size = 11
DataGrid1.Font.Name = "Arial"
DataGrid1.HeadFont.Size = 11
DataGrid1.HeadFont.Bold = True
DataGrid1.HeadFont.Name = "Arial"
DataGrid1.Columns(0).Caption = "Rent ID"
DataGrid1.Columns(0).Width = 1000
DataGrid1.Columns(1).Caption = "Lastname"
DataGrid1.Columns(1).Width = 2000
DataGrid1.Columns(2).Caption = "Firstname"
DataGrid1.Columns(2).Width = 2000
DataGrid1.Columns(3).Caption = "Plate NO."
DataGrid1.Columns(3).Width = 1200
DataGrid1.Columns(4).Caption = "Car Name"
DataGrid1.Columns(4).Width = 2400
DataGrid1.Columns(5).Caption = "Date Rented"
DataGrid1.Columns(5).Width = 1200
DataGrid1.Columns(6).Caption = "No.Days"
DataGrid1.Columns(6).Width = 1200
End Sub
FRMRETURNTBL
End Sub
Call connectme
conn.Open
pr = InputBox("Please Enter Any Key to Search!" & Chr(10) & Chr(13) & "LASTNAME/FIRSTNAME", "Searching...")
If pr = "" Then
ElseIf Val(pr) >= 1 Then
Else
query = "SELECT * FROM returntable WHERE Lastname LIKE '" & pr & "%' or Firstname LIKE '" & pr & "%'"
rs.Open query, conn
Set DataGrid1.DataSource = rs
End If
End Sub
Private Sub Command5_Click()
Unload Me
End Sub
Call myquery
End Sub
Call connectme
conn.Open
End Sub
Public Sub datgrid()
DataGrid1.Font.Size = 11
DataGrid1.Font.Name = "Arial"
DataGrid1.HeadFont.Size = 11
DataGrid1.HeadFont.Bold = True
DataGrid1.HeadFont.Name = "Arial"
DataGrid1.Columns(0).Caption = "Ret. ID"
DataGrid1.Columns(0).Width = 1000
DataGrid1.Columns(1).Width = 0
DataGrid1.Columns(2).Width = 3200
End Sub
Call editrec
MsgBox "Record was successfully updated!", vbInformation, "KRIN"
Unload Me
End If
Call frmcartbl.myquery
End If
End Sub
Call connectme
If car_opt = 2 Then
conn.Open
ssqlsub = "SELECT * FROM cartable WHERE Car_Id=" & carid
rs2.Open ssqlsub, conn
End With
End If
conn.Close
End If
End Sub
Public Sub addrec()
'******** save record
Call connectme
conn.Open
conn.Execute "INSERT INTO cartable(Plate_no, Brand, Color, Speed, Rental, Status) VALUES('" & txt_plate_no &
"','" & txt_brand & "','" & txt_color & "','" & txt_speed.Text & "','" & txt_rental.Text & "','" & txt_status.Text & "')"
End Sub
Public Sub editrec()
End Sub
Class Module
Global variable
Public userlevel
Public myuser
Public rent_opt
Public rentid
Public emp_opt
Public empid
Public cust_opt
Public custid
Public car_opt
Public carid
Option Explicit
Public conn As ADODB.Connection
Public rs As ADODB.Recordset
End Function