com.superrent.gui.SuperRent.java Source code

Java tutorial

Introduction

Here is the source code for com.superrent.gui.SuperRent.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
// this is a comment
package com.superrent.gui;

import com.superrent.DataBase.ConnectDB;
import com.superrent.modules.Report1;
import com.superrent.modules.CommonFunc;
import com.superrent.modules.Customer;
import com.superrent.modules.ManageFleet;
import com.superrent.modules.NewEmployee;
import com.superrent.modules.Rent;
import com.superrent.modules.Reserve;

import com.superrent.modules.Return;
import com.superrent.modules.crypt;
import java.awt.event.ActionEvent;
import java.awt.print.PrinterException;
import java.io.IOException;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JTable;

import javax.swing.SpinnerModel;
import javax.swing.SpinnerNumberModel;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumn;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.design.JasperDesign;
import net.sf.jasperreports.view.JasperViewer;
import net.sf.jasperreports.engine.xml.JRXmlLoader;
import net.sf.jasperreports.engine.design.JRDesignQuery;
import static org.eclipse.persistence.config.QueryType.Report;

/**
 *
 * @author Iniyan
 */

public class SuperRent extends javax.swing.JFrame {
    private String user;

    /**
     * Creates new form SuperRent
     */
    public SuperRent() throws ClassNotFoundException, SQLException, IOException {
        initComponents();

        initRent();
        initReturn();

        initEmployee();
        //initReserve();

        initManageFleet();
        modulepane.setVisible(false);

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        roleGroupRadio = new javax.swing.ButtonGroup();
        jLayeredPane1 = new javax.swing.JLayeredPane();
        loginpanel = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        userField = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        pwdField = new javax.swing.JPasswordField();
        loginBtn = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel4 = new javax.swing.JLabel();
        modulepane = new javax.swing.JPanel();
        ModulesTab = new javax.swing.JTabbedPane();
        Rent = new javax.swing.JPanel();
        dlNumLbl = new javax.swing.JLabel();
        dlNumField = new javax.swing.JTextField();
        ccNumField = new javax.swing.JTextField();
        ccNumLbl = new javax.swing.JLabel();
        expDateLbl = new javax.swing.JLabel();
        expDateCh = new com.toedter.calendar.JDateChooser();
        cardTypeLbl = new javax.swing.JLabel();
        cardTypeCombo = new javax.swing.JComboBox();
        rentConfirmationNO = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        rentbtn = new javax.swing.JButton();
        jLabel55 = new javax.swing.JLabel();
        rentPhoneNo = new javax.swing.JTextField();
        jScrollPane8 = new javax.swing.JScrollPane();
        reservedVehiTable = new javax.swing.JTable();
        serachRnt = new javax.swing.JButton();
        resetAll = new javax.swing.JButton();
        reservePanel = new javax.swing.JPanel();
        brnchIdLbl = new javax.swing.JLabel();
        brnchIdCombo = new javax.swing.JComboBox();
        pickupDt = new com.toedter.calendar.JDateChooser();
        jLabel3 = new javax.swing.JLabel();
        pickupHour = new javax.swing.JSpinner(modelPickHH);
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        pickupMin = new javax.swing.JSpinner(modelPickMM);
        jLabel8 = new javax.swing.JLabel();
        vehicleCatCombo = new javax.swing.JComboBox();
        jLabel10 = new javax.swing.JLabel();
        vehicleTypeCombo = new javax.swing.JComboBox();
        jScrollPane1 = new javax.swing.JScrollPane();
        unreservedVehiTable = new javax.swing.JTable();
        searchBtn = new javax.swing.JButton();
        resetBtn = new javax.swing.JButton();
        rentBtn = new javax.swing.JButton();
        jLabel13 = new javax.swing.JLabel();
        jLabel43 = new javax.swing.JLabel();
        dropOffDate = new com.toedter.calendar.JDateChooser();
        jLabel44 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        dropoffHHSpin = new javax.swing.JSpinner(modelDropHH);
        dropoffMMSpin = new javax.swing.JSpinner(modelDropMM);
        jScrollPane4 = new javax.swing.JScrollPane();
        equipmentsList = new javax.swing.JList();
        addEquipBtn = new javax.swing.JButton();
        removeEquipBtn = new javax.swing.JButton();
        jScrollPane5 = new javax.swing.JScrollPane();
        selectedList = new javax.swing.JList();
        searchEqupBtn = new javax.swing.JButton();
        cusNumLbl1 = new javax.swing.JLabel();
        cusNumField1 = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        confirmationNoDisplayField = new javax.swing.JTextField();
        jLabel25 = new javax.swing.JLabel();
        estimatePrice = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        cancelReservationField = new javax.swing.JTextField();
        cancelConfirmation = new javax.swing.JButton();
        jLabel57 = new javax.swing.JLabel();
        jLabel58 = new javax.swing.JLabel();
        jLabel59 = new javax.swing.JLabel();
        cancelPhoneField = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jLabel60 = new javax.swing.JLabel();
        cancelPickupDt = new com.toedter.calendar.JDateChooser();
        cancelDropoff = new com.toedter.calendar.JDateChooser();
        returnVehicles = new javax.swing.JPanel();
        ReturnCustomerPnobeNum_jLabel9 = new javax.swing.JLabel();
        ReturnVin_jTextField8 = new javax.swing.JTextField();
        ReturnDate_jLabel19 = new javax.swing.JLabel();
        ReturnDate_jDateChooser3 = new com.toedter.calendar.JDateChooser();
        ReturnTime_jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        ReturnOdoRead_jLabel23 = new javax.swing.JLabel();
        ReturnOdometer_jTextField9 = new javax.swing.JTextField();
        jLabel24 = new javax.swing.JLabel();
        ReturnRoadStar_jCheckBox2 = new javax.swing.JCheckBox();
        ReturnCalculate_jButton6 = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        ReturnCheckOverDueDis_jTable2 = new javax.swing.JTable();
        ReturnCheck_jButton2 = new javax.swing.JButton();
        ReturnFuelReading_jTextField2 = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        ReturnCheckOverDue_jButton2 = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        ReturnDisplay_jTable2 = new javax.swing.JTable();
        jScrollPane6 = new javax.swing.JScrollPane();
        ReturnDisplayFee_jTable2 = new javax.swing.JTable();
        ReturnRedeem_jCheckBox1 = new javax.swing.JCheckBox();
        ReturnTimeHH_jSpinner1 = new javax.swing.JSpinner();
        ReturnTimeMM_jSpinner1 = new javax.swing.JSpinner();
        jLabel16 = new javax.swing.JLabel();
        ReturnPay_jButton2 = new javax.swing.JButton();
        ReturnCreditCard_jTextField1 = new javax.swing.JTextField();
        ReturnCash_jTextField2 = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        manageCustomer = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jLabel26 = new javax.swing.JLabel();
        cusFristNameField = new javax.swing.JTextField();
        jLabel27 = new javax.swing.JLabel();
        cusLastNameField = new javax.swing.JTextField();
        streetAddField = new javax.swing.JTextField();
        jLabel28 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        provinceComboBox = new javax.swing.JComboBox();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        zipTextField = new javax.swing.JTextField();
        jLabel33 = new javax.swing.JLabel();
        phoneTextField = new javax.swing.JTextField();
        clubMemberCheckBox = new javax.swing.JCheckBox();
        Customer_RegisterBtn = new javax.swing.JButton();
        cityTextField = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        emailTextField = new javax.swing.JTextField();
        manageFleet = new javax.swing.JPanel();
        jButton2 = new javax.swing.JButton();
        mfremoveBtn = new javax.swing.JButton();
        mfaddpanel = new javax.swing.JPanel();
        jLabel34 = new javax.swing.JLabel();
        mfcartypeCombo = new javax.swing.JComboBox();
        jLabel35 = new javax.swing.JLabel();
        mfmanufacturerCombo = new javax.swing.JComboBox();
        addBtn = new javax.swing.JButton();
        mfcarCheckBox = new javax.swing.JCheckBox();
        mftruckCheckBox = new javax.swing.JCheckBox();
        jLabel22 = new javax.swing.JLabel();
        mfmodelTextField = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        mfotoTextField = new javax.swing.JTextField();
        jLabel29 = new javax.swing.JLabel();
        mfvinTextField = new javax.swing.JTextField();
        jLabel46 = new javax.swing.JLabel();
        mfothermnfTextField = new javax.swing.JTextField();
        mfotherclTextField = new javax.swing.JTextField();
        mfcolorCombo = new javax.swing.JComboBox();
        mfbranchCombo = new javax.swing.JComboBox();
        mfyearTextField = new javax.swing.JTextField();
        jButton15 = new javax.swing.JButton();
        mfeqpcombo = new javax.swing.JComboBox();
        jLabel67 = new javax.swing.JLabel();
        jLabel68 = new javax.swing.JLabel();
        jLabel69 = new javax.swing.JLabel();
        mfbranch = new javax.swing.JTextField();
        jLabel45 = new javax.swing.JLabel();
        mfnumber = new javax.swing.JTextField();
        mfremovepanel = new javax.swing.JPanel();
        mfs1Btn = new javax.swing.JButton();
        jLabel37 = new javax.swing.JLabel();
        mfscartypeCombo = new javax.swing.JComboBox();
        jLabel38 = new javax.swing.JLabel();
        mfsmanufacturerCombo = new javax.swing.JComboBox();
        jLabel39 = new javax.swing.JLabel();
        mfsmodelCombo = new javax.swing.JComboBox();
        jLabel42 = new javax.swing.JLabel();
        mfphonenum = new javax.swing.JTextField();
        jLabel41 = new javax.swing.JLabel();
        mfs2Btn = new javax.swing.JButton();
        mfs3Btn = new javax.swing.JButton();
        removeBtn = new javax.swing.JButton();
        setforrentBtn = new javax.swing.JButton();
        jLabel61 = new javax.swing.JLabel();
        mfcredit = new javax.swing.JTextField();
        jLabel62 = new javax.swing.JLabel();
        jLabel63 = new javax.swing.JLabel();
        mfcsh = new javax.swing.JTextField();
        mfchooer = new com.toedter.calendar.JDateChooser();
        jLabel64 = new javax.swing.JLabel();
        ReturnTime_jLabel21 = new javax.swing.JLabel();
        mfTimeHH_jSpinner = new javax.swing.JSpinner();
        jLabel65 = new javax.swing.JLabel();
        mfTimeMM_jSpinner = new javax.swing.JSpinner();
        jLabel66 = new javax.swing.JLabel();
        jScrollPane7 = new javax.swing.JScrollPane();
        cz = new javax.swing.JTable();
        mfremoveBtn1 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        managepointjpanel = new javax.swing.JPanel();
        jTextField2 = new javax.swing.JTextField();
        jLabel51 = new javax.swing.JLabel();
        jLabel52 = new javax.swing.JLabel();
        jButton5 = new javax.swing.JButton();
        jLabel36 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jLabel49 = new javax.swing.JLabel();
        jTextField3 = new javax.swing.JTextField();
        jLabel50 = new javax.swing.JLabel();
        jButton4 = new javax.swing.JButton();
        mftruckCheckBox3 = new javax.swing.JCheckBox();
        mfcarCheckBox3 = new javax.swing.JCheckBox();
        jLabel53 = new javax.swing.JLabel();
        mfcartypeCombo3 = new javax.swing.JComboBox();
        mfmanufacturerCombo3 = new javax.swing.JComboBox();
        jLabel54 = new javax.swing.JLabel();
        jButton10 = new javax.swing.JButton();
        jLabel56 = new javax.swing.JLabel();
        newvalue = new javax.swing.JTextField();
        jButton7 = new javax.swing.JButton();
        oldvaluejlabel = new javax.swing.JLabel();
        mfsetpanel = new javax.swing.JPanel();
        jLabel40 = new javax.swing.JLabel();
        jLabel47 = new javax.swing.JLabel();
        jLabel48 = new javax.swing.JLabel();
        mfsetcartypeCombo = new javax.swing.JComboBox();
        mfsetmanufacturerCombo = new javax.swing.JComboBox();
        mfsetmodelCombo = new javax.swing.JComboBox();
        mfset1Btn = new javax.swing.JButton();
        mfset2Btn = new javax.swing.JButton();
        mfset3Btn = new javax.swing.JButton();
        setforsaleBtn = new javax.swing.JButton();
        NewEmployee = new javax.swing.JPanel();
        firstnameLbl = new javax.swing.JLabel();
        firstNameField = new javax.swing.JTextField();
        lastNameLbl = new javax.swing.JLabel();
        lastNameField = new javax.swing.JTextField();
        userNameLbl = new javax.swing.JLabel();
        userNameField = new javax.swing.JTextField();
        emailIdLbl = new javax.swing.JLabel();
        emailIdField = new javax.swing.JTextField();
        passwordLbl = new javax.swing.JLabel();
        passwordField = new javax.swing.JPasswordField();
        AddEmployeeBtn = new javax.swing.JButton();
        branchIdCombo = new javax.swing.JComboBox();
        branchIdLbl = new javax.swing.JLabel();
        roleLbl = new javax.swing.JLabel();
        clerkComboBox = new javax.swing.JComboBox();
        RemoveEmployeeBtn = new javax.swing.JButton();
        jScrollPane9 = new javax.swing.JScrollPane();
        allEmployeeTbl = new javax.swing.JTable();
        SearchEmployeeBtn = new javax.swing.JButton();
        ModifyEmployeeBtn = new javax.swing.JButton();
        MoveEmployeeBtn = new javax.swing.JButton();
        reportGenerate = new javax.swing.JPanel();
        jLabel70 = new javax.swing.JLabel();
        branchReportRent = new javax.swing.JButton();
        branchNameRent = new javax.swing.JTextField();
        branchReportRentAll = new javax.swing.JButton();
        jLabel71 = new javax.swing.JLabel();
        branchReportReturnAll = new javax.swing.JButton();
        jLabel72 = new javax.swing.JLabel();
        jLabel73 = new javax.swing.JLabel();
        branchReportReturn = new javax.swing.JButton();
        branchNameReturn = new javax.swing.JTextField();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenu2 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        loginpanel.setPreferredSize(new java.awt.Dimension(890, 810));
        loginpanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel1.setText("User Name :");
        loginpanel.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 270, -1, -1));
        loginpanel.add(userField, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 270, 220, -1));

        jLabel2.setText("Password   :");
        loginpanel.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 320, -1, -1));
        loginpanel.add(pwdField, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 320, 220, -1));

        loginBtn.setText("Employee Login");
        loginBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                loginBtnActionPerformed(evt);
            }
        });
        loginpanel.add(loginBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 380, 160, -1));
        loginpanel.add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 250, 340, 10));

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N
        jLabel4.setText("Super Rent Login Page");
        loginpanel.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 70, 440, 70));

        modulepane.setPreferredSize(new java.awt.Dimension(1380, 810));
        modulepane.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        ModulesTab.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                ModulesTabMouseClicked(evt);
            }
        });

        Rent.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        dlNumLbl.setText("Driver License*                 :");
        Rent.add(dlNumLbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 110, -1, -1));
        Rent.add(dlNumField, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 110, 130, -1));
        Rent.add(ccNumField, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 100, 150, -1));

        ccNumLbl.setText("Credit Card Number*:");
        Rent.add(ccNumLbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 110, 130, -1));

        expDateLbl.setText("Expiry Date*                  :");
        Rent.add(expDateLbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 170, -1, -1));
        Rent.add(expDateCh, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 160, 160, -1));

        cardTypeLbl.setText("Card type*     :");
        Rent.add(cardTypeLbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(410, 160, -1, -1));

        cardTypeCombo.setModel(
                new javax.swing.DefaultComboBoxModel(new String[] { "American Express", "MasterCard", "Visa" }));
        Rent.add(cardTypeCombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(520, 160, 150, -1));
        Rent.add(rentConfirmationNO, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 50, 130, -1));

        jLabel14.setText("Confirmation Number         :");
        Rent.add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 50, -1, -1));

        rentbtn.setText("Rent");
        rentbtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rentbtnActionPerformed(evt);
            }
        });
        Rent.add(rentbtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(770, 230, -1, -1));

        jLabel55.setText("or  Phone Number     :");
        Rent.add(jLabel55, new org.netbeans.lib.awtextra.AbsoluteConstraints(360, 50, -1, -1));

        rentPhoneNo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rentPhoneNoActionPerformed(evt);
            }
        });
        Rent.add(rentPhoneNo, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 50, 150, -1));

        reservedVehiTable.setModel(new javax.swing.table.DefaultTableModel(new Object[100][7], new String[] {
                "confirmation_no", "vin", "customer_id", "phone", "pickup_time", "dropoff_time", "status" }));
        jScrollPane8.setViewportView(reservedVehiTable);

        Rent.add(jScrollPane8, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 280, 1160, 100));

        serachRnt.setText("Search");
        serachRnt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                serachRntActionPerformed(evt);
            }
        });
        Rent.add(serachRnt, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 230, -1, -1));

        resetAll.setText("Reset");
        resetAll.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                resetAllActionPerformed(evt);
            }
        });
        Rent.add(resetAll, new org.netbeans.lib.awtextra.AbsoluteConstraints(640, 230, -1, -1));

        ModulesTab.addTab("Rent", Rent);

        reservePanel.setMinimumSize(new java.awt.Dimension(1000, 615));
        reservePanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        brnchIdLbl.setText("Branch ID*                       :");
        reservePanel.add(brnchIdLbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 80, -1, -1));

        brnchIdCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Select" }));
        brnchIdCombo.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                brnchIdComboItemStateChanged(evt);
            }
        });
        brnchIdCombo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                brnchIdComboActionPerformed(evt);
            }
        });
        reservePanel.add(brnchIdCombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 80, 80, -1));
        reservePanel.add(pickupDt, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 130, 140, -1));

        jLabel3.setText("Pickup Date*                    :");
        reservePanel.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 130, -1, -1));
        reservePanel.add(pickupHour, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 130, 40, -1));

        jLabel6.setText("Pickup Time :");
        reservePanel.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 130, -1, -1));

        jLabel7.setText("HH");
        reservePanel.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 130, -1, -1));
        reservePanel.add(pickupMin, new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 130, 40, -1));

        jLabel8.setText("MM");
        reservePanel.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(580, 130, -1, -1));

        vehicleCatCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Select" }));
        vehicleCatCombo.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        vehicleCatCombo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                vehicleCatComboActionPerformed(evt);
            }
        });
        reservePanel.add(vehicleCatCombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 300, 220, -1));

        jLabel10.setText("Vehicle Type                    :");
        reservePanel.add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 250, 160, -1));

        vehicleTypeCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "CAR", "TRUCK" }));
        vehicleTypeCombo.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                vehicleTypeComboItemStateChanged(evt);
            }
        });
        reservePanel.add(vehicleTypeCombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 250, 220, -1));

        unreservedVehiTable.setModel(new javax.swing.table.DefaultTableModel(
                new Object[][] { { null, null, null, null, null }, { null, null, null, null, null },
                        { null, null, null, null, null }, { null, null, null, null, null },
                        { null, null, null, null, null }, { null, null, null, null, null },
                        { null, null, null, null, null }, { null, null, null, null, null },
                        { null, null, null, null, null }, { null, null, null, null, null },
                        { null, null, null, null, null } },
                new String[] { "Vehicle ID", "Make", "Vehicle Type", "Colour", "Doors" }));
        jScrollPane1.setViewportView(unreservedVehiTable);

        reservePanel.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 560, 1290, 120));

        searchBtn.setText("Search");
        searchBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                searchBtnActionPerformed(evt);
            }
        });
        reservePanel.add(searchBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 520, -1, -1));

        resetBtn.setText("Reset");
        resetBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                resetBtnActionPerformed(evt);
            }
        });
        reservePanel.add(resetBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(780, 520, -1, -1));

        rentBtn.setText("Reserve");
        rentBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rentBtnActionPerformed(evt);
            }
        });
        reservePanel.add(rentBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(660, 520, -1, -1));

        jLabel13.setText("Vehicle Category*             :");
        reservePanel.add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 300, -1, -1));

        jLabel43.setText("Dropoff*                          :");
        reservePanel.add(jLabel43, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 190, -1, -1));
        reservePanel.add(dropOffDate, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 190, 140, -1));

        jLabel44.setText("Dropoff Time :");
        reservePanel.add(jLabel44, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 190, -1, -1));

        jLabel5.setText("HH");
        reservePanel.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 190, -1, -1));

        jLabel12.setText("MM");
        reservePanel.add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(580, 190, -1, -1));
        reservePanel.add(dropoffHHSpin, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 190, 40, -1));
        reservePanel.add(dropoffMMSpin, new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 190, 40, -1));

        jScrollPane4.setViewportView(equipmentsList);

        reservePanel.add(jScrollPane4, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 400, 190, 100));

        addEquipBtn.setText(">>");
        addEquipBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addEquipBtnActionPerformed(evt);
            }
        });
        reservePanel.add(addEquipBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 420, -1, -1));

        removeEquipBtn.setText("<<");
        removeEquipBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                removeEquipBtnActionPerformed(evt);
            }
        });
        reservePanel.add(removeEquipBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 460, -1, -1));

        jScrollPane5.setViewportView(selectedList);

        reservePanel.add(jScrollPane5, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 400, 180, 100));

        searchEqupBtn.setText("Search Equipments");
        searchEqupBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                searchEqupBtnActionPerformed(evt);
            }
        });
        reservePanel.add(searchEqupBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 350, 180, -1));

        cusNumLbl1.setText("Customer Phone Number* :");
        reservePanel.add(cusNumLbl1, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 40, -1, -1));
        reservePanel.add(cusNumField1, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 40, 130, -1));

        jLabel17.setText("Confirmation Number          :");
        reservePanel.add(jLabel17, new org.netbeans.lib.awtextra.AbsoluteConstraints(820, 50, -1, -1));
        reservePanel.add(confirmationNoDisplayField,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(1010, 50, 170, -1));

        jLabel25.setText("Estimated Price                :");
        reservePanel.add(jLabel25, new org.netbeans.lib.awtextra.AbsoluteConstraints(830, 120, -1, -1));
        reservePanel.add(estimatePrice, new org.netbeans.lib.awtextra.AbsoluteConstraints(1010, 120, 170, -1));

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Cancel Reservation"));
        jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
        jPanel2.add(cancelReservationField, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 100, 170, -1));

        cancelConfirmation.setText("cancel");
        cancelConfirmation.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelConfirmationActionPerformed(evt);
            }
        });
        jPanel2.add(cancelConfirmation, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 250, -1, -1));

        jLabel57.setText("Phone Number                :");
        jPanel2.add(jLabel57, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 50, -1, -1));

        jLabel58.setText("or");
        jPanel2.add(jLabel58, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 50, -1, -1));

        jLabel59.setText("Confirmation Number       :");
        jPanel2.add(jLabel59, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 100, -1, -1));
        jPanel2.add(cancelPhoneField, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 50, 170, -1));

        jLabel11.setText("Pickup Date                     :");
        jPanel2.add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 150, -1, -1));

        jLabel60.setText("Dropoff Date                    :");
        jPanel2.add(jLabel60, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 200, -1, -1));
        jPanel2.add(cancelPickupDt, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 150, 170, -1));
        jPanel2.add(cancelDropoff, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 200, 170, -1));

        reservePanel.add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(810, 170, 480, 290));

        ModulesTab.addTab("Reserve", reservePanel);

        returnVehicles.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        ReturnCustomerPnobeNum_jLabel9.setText("Vin* :");
        returnVehicles.add(ReturnCustomerPnobeNum_jLabel9,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 20, -1, -1));

        ReturnVin_jTextField8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ReturnVin_jTextField8ActionPerformed(evt);
            }
        });
        returnVehicles.add(ReturnVin_jTextField8,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 10, 180, -1));

        ReturnDate_jLabel19.setText("Return Date* :");
        returnVehicles.add(ReturnDate_jLabel19,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(104, 106, -1, -1));
        returnVehicles.add(ReturnDate_jDateChooser3,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(199, 96, 180, -1));

        ReturnTime_jLabel20.setText("Return Time* :");
        returnVehicles.add(ReturnTime_jLabel20,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(102, 144, -1, -1));

        jLabel21.setText("HH");
        returnVehicles.add(jLabel21, new org.netbeans.lib.awtextra.AbsoluteConstraints(241, 144, -1, -1));

        ReturnOdoRead_jLabel23.setText("Current Odometer Reading* :");
        returnVehicles.add(ReturnOdoRead_jLabel23,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(11, 196, -1, -1));
        returnVehicles.add(ReturnOdometer_jTextField9,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(198, 190, 70, -1));

        jLabel24.setText("KM");
        returnVehicles.add(jLabel24, new org.netbeans.lib.awtextra.AbsoluteConstraints(274, 196, -1, -1));

        ReturnRoadStar_jCheckBox2.setText("Road Star");
        ReturnRoadStar_jCheckBox2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ReturnRoadStar_jCheckBox2ActionPerformed(evt);
            }
        });
        returnVehicles.add(ReturnRoadStar_jCheckBox2,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(198, 282, -1, -1));

        ReturnCalculate_jButton6.setText("Calculate");
        ReturnCalculate_jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ReturnCalculate_jButton6ActionPerformed(evt);
            }
        });
        returnVehicles.add(ReturnCalculate_jButton6,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 50, 145, -1));

        ReturnCheckOverDueDis_jTable2.setModel(new javax.swing.table.DefaultTableModel(
                new Object[][] { { null, null, null, null, null, null }, { null, null, null, null, null, null },
                        { null, null, null, null, null, null }, { null, null, null, null, null, null } },
                new String[] { "Confirmation No", "Customer ID", "Phone", "Branch ID", "Expected Time", "Vin" }) {
            Class[] types = new Class[] { java.lang.Integer.class, java.lang.Integer.class, java.lang.String.class,
                    java.lang.String.class, java.lang.Object.class, java.lang.Object.class };
            boolean[] canEdit = new boolean[] { false, false, false, false, false, false };

            public Class getColumnClass(int columnIndex) {
                return types[columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit[columnIndex];
            }
        });
        ReturnCheckOverDueDis_jTable2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                ReturnCheckOverDueDis_jTable2MouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(ReturnCheckOverDueDis_jTable2);

        returnVehicles.add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 440, 682, 182));

        ReturnCheck_jButton2.setText("Check");
        ReturnCheck_jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ReturnCheck_jButton2ActionPerformed(evt);
            }
        });
        returnVehicles.add(ReturnCheck_jButton2,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 10, 145, -1));

        ReturnFuelReading_jTextField2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ReturnFuelReading_jTextField2ActionPerformed(evt);
            }
        });
        returnVehicles.add(ReturnFuelReading_jTextField2,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(198, 236, 67, -1));

        jLabel9.setText("Fuel Reading* :");
        returnVehicles.add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(98, 242, -1, -1));

        ReturnCheckOverDue_jButton2.setText("Check Over Due");
        ReturnCheckOverDue_jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ReturnCheckOverDue_jButton2ActionPerformed(evt);
            }
        });
        returnVehicles.add(ReturnCheckOverDue_jButton2,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(6, 374, -1, -1));

        ReturnDisplay_jTable2.setModel(new javax.swing.table.DefaultTableModel(
                new Object[][] { { null, null, null, null }, { null, null, null, null }, { null, null, null, null },
                        { null, null, null, null } },
                new String[] { "Confirmation No", "First Name", "Last Name", "Phone" }) {
            boolean[] canEdit = new boolean[] { false, false, false, false };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit[columnIndex];
            }
        });
        jScrollPane3.setViewportView(ReturnDisplay_jTable2);

        returnVehicles.add(jScrollPane3, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 10, 710, 60));

        ReturnDisplayFee_jTable2.setFont(new java.awt.Font("Lucida Console", 0, 15)); // NOI18N
        ReturnDisplayFee_jTable2
                .setModel(new javax.swing.table.DefaultTableModel(
                        new Object[][] { { null, null, null }, { null, null, null }, { null, null, null },
                                { null, null, null }, { null, null, null } },
                        new String[] { "Entry", "Detail", "Cost" }) {
                    boolean[] canEdit = new boolean[] { false, false, false };

                    public boolean isCellEditable(int rowIndex, int columnIndex) {
                        return canEdit[columnIndex];
                    }
                });
        jScrollPane6.setViewportView(ReturnDisplayFee_jTable2);

        returnVehicles.add(jScrollPane6, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 80, 880, 350));

        ReturnRedeem_jCheckBox1.setText("Reedem");
        ReturnRedeem_jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ReturnRedeem_jCheckBox1ActionPerformed(evt);
            }
        });
        returnVehicles.add(ReturnRedeem_jCheckBox1,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(198, 311, -1, -1));
        returnVehicles.add(ReturnTimeHH_jSpinner1,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(198, 138, -1, -1));
        returnVehicles.add(ReturnTimeMM_jSpinner1,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(274, 138, -1, -1));

        jLabel16.setText("MM");
        returnVehicles.add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(314, 144, -1, -1));

        ReturnPay_jButton2.setText("Pay");
        ReturnPay_jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ReturnPay_jButton2ActionPerformed(evt);
            }
        });
        returnVehicles.add(ReturnPay_jButton2,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(830, 570, 145, -1));

        ReturnCreditCard_jTextField1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ReturnCreditCard_jTextField1ActionPerformed(evt);
            }
        });
        returnVehicles.add(ReturnCreditCard_jTextField1,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(883, 440, 87, -1));
        returnVehicles.add(ReturnCash_jTextField2,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(883, 506, 87, -1));

        jLabel15.setText("Credit Card:");
        returnVehicles.add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(802, 446, -1, -1));

        jLabel20.setText("Cash:");
        returnVehicles.add(jLabel20, new org.netbeans.lib.awtextra.AbsoluteConstraints(842, 512, -1, -1));

        ModulesTab.addTab("Return", returnVehicles);

        manageCustomer.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Add Customer"));
        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel26.setText("First Name*       :");
        jPanel1.add(jLabel26, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 40, -1, -1));
        jPanel1.add(cusFristNameField, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 40, 100, -1));

        jLabel27.setText("Last Name*    :");
        jPanel1.add(jLabel27, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 40, -1, -1));
        jPanel1.add(cusLastNameField, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 40, 110, -1));
        jPanel1.add(streetAddField, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 90, 230, -1));

        jLabel28.setText("Street Address* :");
        jPanel1.add(jLabel28, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 90, -1, -1));

        jLabel30.setText("Province*           :");
        jPanel1.add(jLabel30, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 140, 110, -1));

        provinceComboBox.setModel(new javax.swing.DefaultComboBoxModel(
                new String[] { "On", "Qc", "Ns", "Nb", "Mb", "Bc", "Pe", "Sk", "Ab", "Nl", "Nt", "Yt", "Nu" }));
        jPanel1.add(provinceComboBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 140, 120, -1));

        jLabel31.setText("City*   :");
        jPanel1.add(jLabel31, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 140, -1, -1));

        jLabel32.setText("Zip Code*   :");
        jPanel1.add(jLabel32, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 140, -1, -1));

        zipTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                zipTextFieldActionPerformed(evt);
            }
        });
        jPanel1.add(zipTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 140, 130, -1));

        jLabel33.setText("Phone No*         :");
        jPanel1.add(jLabel33, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 190, -1, -1));
        jPanel1.add(phoneTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 190, 220, -1));

        clubMemberCheckBox.setText("Club Member");
        clubMemberCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                clubMemberCheckBoxActionPerformed(evt);
            }
        });
        jPanel1.add(clubMemberCheckBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 240, -1, -1));

        Customer_RegisterBtn.setText("Register");
        Customer_RegisterBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Customer_RegisterBtnActionPerformed(evt);
            }
        });
        jPanel1.add(Customer_RegisterBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 290, -1, -1));
        jPanel1.add(cityTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 140, 80, -1));

        jLabel23.setText("email:");
        jPanel1.add(jLabel23, new org.netbeans.lib.awtextra.AbsoluteConstraints(410, 190, -1, -1));
        jPanel1.add(emailTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 190, 100, -1));

        manageCustomer.add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 0, 1010, 350));

        ModulesTab.addTab("Manage Customer", manageCustomer);

        jButton2.setText("Add New Car");
        jButton2.setActionCommand("");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        mfremoveBtn.setText("Remove Car");
        mfremoveBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mfremoveBtnActionPerformed(evt);
            }
        });

        mfaddpanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Add New Car"));
        mfaddpanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel34.setText("Car Type*            :");
        mfaddpanel.add(jLabel34, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 60, 120, -1));

        mfcartypeCombo.setModel(
                new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        mfaddpanel.add(mfcartypeCombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 60, 180, -1));

        jLabel35.setText("Manufacturer*     :");
        mfaddpanel.add(jLabel35, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 90, 120, -1));

        mfmanufacturerCombo.setModel(
                new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        mfmanufacturerCombo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mfmanufacturerComboActionPerformed(evt);
            }
        });
        mfaddpanel.add(mfmanufacturerCombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 90, 180, -1));

        addBtn.setText("Add");
        addBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addBtnActionPerformed(evt);
            }
        });
        mfaddpanel.add(addBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(610, 280, -1, -1));

        mfcarCheckBox.setText("Car");
        mfcarCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mfcarCheckBoxActionPerformed(evt);
            }
        });
        mfaddpanel.add(mfcarCheckBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 20, -1, -1));

        mftruckCheckBox.setText("Truck");
        mftruckCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mftruckCheckBoxActionPerformed(evt);
            }
        });
        mfaddpanel.add(mftruckCheckBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 20, -1, -1));

        jLabel22.setText("Model                 :");
        mfaddpanel.add(jLabel22, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 120, -1, -1));
        mfaddpanel.add(mfmodelTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 120, 180, -1));

        jLabel18.setText("Year                    :");
        mfaddpanel.add(jLabel18, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 150, -1, -1));

        jLabel19.setText("Otometer            :");
        mfaddpanel.add(jLabel19, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 180, -1, -1));
        mfaddpanel.add(mfotoTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 180, 180, -1));

        jLabel29.setText("Vin                     :");
        mfaddpanel.add(jLabel29, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 210, -1, -1));
        mfaddpanel.add(mfvinTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 210, 180, -1));

        jLabel46.setText("Color                 :");
        mfaddpanel.add(jLabel46, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 280, -1, -1));
        mfaddpanel.add(mfothermnfTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 90, 80, -1));
        mfaddpanel.add(mfotherclTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 280, 80, -1));

        mfcolorCombo.setModel(
                new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        mfcolorCombo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mfcolorComboActionPerformed(evt);
            }
        });
        mfaddpanel.add(mfcolorCombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 280, 180, -1));

        mfbranchCombo.setModel(
                new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        mfaddpanel.add(mfbranchCombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 240, 180, -1));
        mfaddpanel.add(mfyearTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 150, 180, -1));

        jButton15.setText("add");
        jButton15.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton15ActionPerformed(evt);
            }
        });
        mfaddpanel.add(jButton15, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 140, -1, -1));

        mfeqpcombo.setModel(
                new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        mfaddpanel.add(mfeqpcombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 70, -1, -1));

        jLabel67.setText("Branch*              :");
        mfaddpanel.add(jLabel67, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 40, -1, -1));

        jLabel68.setText("Branch*              :");
        mfaddpanel.add(jLabel68, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 240, -1, -1));

        jLabel69.setText("equipmentm      :");
        mfaddpanel.add(jLabel69, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 70, -1, -1));
        mfaddpanel.add(mfbranch, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 40, 60, -1));

        jLabel45.setText("number              :");
        mfaddpanel.add(jLabel45, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 110, -1, -1));
        mfaddpanel.add(mfnumber, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 100, 60, -1));

        mfremovepanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Remove Car"));
        mfremovepanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        mfs1Btn.setText("Select");
        mfs1Btn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mfs1BtnActionPerformed(evt);
            }
        });
        mfremovepanel.add(mfs1Btn, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 30, 100, 30));

        jLabel37.setText("Year          *       :");
        mfremovepanel.add(jLabel37, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, -1, -1));

        mfscartypeCombo.setModel(
                new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        mfscartypeCombo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mfscartypeComboActionPerformed(evt);
            }
        });
        mfremovepanel.add(mfscartypeCombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 30, 180, -1));

        jLabel38.setText("Car Type            :");
        mfremovepanel.add(jLabel38, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 70, -1, -1));

        mfsmanufacturerCombo.setModel(
                new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        mfsmanufacturerCombo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mfsmanufacturerComboActionPerformed(evt);
            }
        });
        mfremovepanel.add(mfsmanufacturerCombo,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 70, 180, -1));

        jLabel39.setText("Location            :");
        mfremovepanel.add(jLabel39, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 110, -1, -1));

        mfsmodelCombo.setModel(
                new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        mfremovepanel.add(mfsmodelCombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 110, 180, -1));

        jLabel42.setText("CAD");
        mfremovepanel.add(jLabel42, new org.netbeans.lib.awtextra.AbsoluteConstraints(690, 70, -1, -1));
        mfremovepanel.add(mfphonenum, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 100, 110, -1));

        jLabel41.setText("Phone number:");
        mfremovepanel.add(jLabel41, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 110, -1, -1));

        mfs2Btn.setText("Select");
        mfs2Btn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mfs2BtnActionPerformed(evt);
            }
        });
        mfremovepanel.add(mfs2Btn, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 70, 100, -1));

        mfs3Btn.setText("Select");
        mfs3Btn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mfs3BtnActionPerformed(evt);
            }
        });
        mfremovepanel.add(mfs3Btn, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 110, 100, -1));

        removeBtn.setText("Remove");
        removeBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                removeBtnActionPerformed(evt);
            }
        });
        mfremovepanel.add(removeBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(680, 200, -1, -1));

        setforrentBtn.setText("Back to Rent");
        setforrentBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                setforrentBtnActionPerformed(evt);
            }
        });
        mfremovepanel.add(setforrentBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 200, -1, -1));

        jLabel61.setText("Credit card:");
        mfremovepanel.add(jLabel61, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 30, -1, -1));
        mfremovepanel.add(mfcredit, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 20, 90, -1));

        jLabel62.setText("CAD");
        mfremovepanel.add(jLabel62, new org.netbeans.lib.awtextra.AbsoluteConstraints(690, 30, -1, -1));

        jLabel63.setText("Date         :");
        mfremovepanel.add(jLabel63, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 150, -1, -1));
        mfremovepanel.add(mfcsh, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 60, 90, -1));
        mfremovepanel.add(mfchooer, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 140, 180, -1));

        jLabel64.setText("Cash         :");
        mfremovepanel.add(jLabel64, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 70, -1, 20));

        ReturnTime_jLabel21.setText("Return Time* :");
        mfremovepanel.add(ReturnTime_jLabel21, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 180, -1, -1));
        mfremovepanel.add(mfTimeHH_jSpinner, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 170, -1, -1));

        jLabel65.setText("HH");
        mfremovepanel.add(jLabel65, new org.netbeans.lib.awtextra.AbsoluteConstraints(630, 180, -1, -1));
        mfremovepanel.add(mfTimeMM_jSpinner, new org.netbeans.lib.awtextra.AbsoluteConstraints(670, 170, -1, -1));

        jLabel66.setText("MM");
        mfremovepanel.add(jLabel66, new org.netbeans.lib.awtextra.AbsoluteConstraints(710, 180, -1, -1));

        cz.setModel(new javax.swing.table.DefaultTableModel(new Object[][] {

        }, new String[] { "VIN", "Branch", "Car Type", "Manufacturer", "Model", "Year" }) {
            Class[] types = new Class[] { java.lang.String.class, java.lang.Integer.class, java.lang.String.class,
                    java.lang.String.class, java.lang.String.class, java.lang.String.class };

            public Class getColumnClass(int columnIndex) {
                return types[columnIndex];
            }
        });
        jScrollPane7.setViewportView(cz);

        mfremoveBtn1.setText("Set Car for Sale");
        mfremoveBtn1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mfremoveBtn1ActionPerformed(evt);
            }
        });

        jButton6.setText("Manage Points");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        managepointjpanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        managepointjpanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jTextField2.setText("5.00");
        jTextField2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField2ActionPerformed(evt);
            }
        });
        managepointjpanel.add(jTextField2, new org.netbeans.lib.awtextra.AbsoluteConstraints(8, 30, 84, -1));

        jLabel51.setText("Please set the strategy of points");
        managepointjpanel.add(jLabel51, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 10, 337, -1));

        jLabel52.setText("Dollors per point");
        managepointjpanel.add(jLabel52, new org.netbeans.lib.awtextra.AbsoluteConstraints(98, 36, -1, -1));

        jButton5.setText("Confirm");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });
        managepointjpanel.add(jButton5, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 40, -1, -1));

        jLabel36.setText("Please enter the number of Points to redeem one day");
        managepointjpanel.add(jLabel36, new org.netbeans.lib.awtextra.AbsoluteConstraints(14, 64, -1, -1));

        jTextField1.setText("1000");
        jTextField1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField1ActionPerformed(evt);
            }
        });
        managepointjpanel.add(jTextField1, new org.netbeans.lib.awtextra.AbsoluteConstraints(8, 86, 84, -1));

        jLabel49.setText("premium or lower-ranking car");
        managepointjpanel.add(jLabel49, new org.netbeans.lib.awtextra.AbsoluteConstraints(98, 92, -1, -1));

        jTextField3.setText("1500");
        managepointjpanel.add(jTextField3, new org.netbeans.lib.awtextra.AbsoluteConstraints(8, 120, 84, -1));

        jLabel50.setText("Luxury car, SUV, van or truck");
        managepointjpanel.add(jLabel50, new org.netbeans.lib.awtextra.AbsoluteConstraints(98, 126, -1, -1));

        jButton4.setText("Confirm");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });
        managepointjpanel.add(jButton4, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 160, -1, -1));

        mftruckCheckBox3.setText("Truck");
        mftruckCheckBox3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mftruckCheckBox3ActionPerformed(evt);
            }
        });
        managepointjpanel.add(mftruckCheckBox3,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 218, -1, -1));

        mfcarCheckBox3.setText("Car");
        mfcarCheckBox3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mfcarCheckBox3ActionPerformed(evt);
            }
        });
        managepointjpanel.add(mfcarCheckBox3, new org.netbeans.lib.awtextra.AbsoluteConstraints(16, 218, -1, -1));

        jLabel53.setText("Car Type*            :");
        managepointjpanel.add(jLabel53, new org.netbeans.lib.awtextra.AbsoluteConstraints(16, 263, 120, -1));

        mfcartypeCombo3.setModel(
                new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        mfcartypeCombo3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mfcartypeCombo3ActionPerformed(evt);
            }
        });
        managepointjpanel.add(mfcartypeCombo3,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(142, 259, 180, -1));

        mfmanufacturerCombo3.setModel(
                new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        managepointjpanel.add(mfmanufacturerCombo3,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(142, 298, 180, -1));

        jLabel54.setText("Rate Type*          :");
        managepointjpanel.add(jLabel54, new org.netbeans.lib.awtextra.AbsoluteConstraints(16, 302, 120, -1));

        jButton10.setText("Check oldvalue: ");
        jButton10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton10ActionPerformed(evt);
            }
        });
        managepointjpanel.add(jButton10, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 350, -1, -1));

        jLabel56.setText("New Value   :");
        managepointjpanel.add(jLabel56, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 390, -1, -1));

        newvalue.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newvalueActionPerformed(evt);
            }
        });
        managepointjpanel.add(newvalue, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 380, 90, -1));

        jButton7.setText("Confirm");
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });
        managepointjpanel.add(jButton7, new org.netbeans.lib.awtextra.AbsoluteConstraints(205, 380, 80, -1));

        oldvaluejlabel.setText(" ");
        managepointjpanel.add(oldvaluejlabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 360, 100, -1));

        mfsetpanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Set Car for Sale"));

        jLabel40.setText("Year*            :");

        jLabel47.setText("Car Type*     :");

        jLabel48.setText("Location *     :");

        mfsetcartypeCombo.setModel(
                new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        mfsetcartypeCombo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mfsetcartypeComboActionPerformed(evt);
            }
        });

        mfsetmanufacturerCombo.setModel(
                new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        mfsetmanufacturerCombo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mfsetmanufacturerComboActionPerformed(evt);
            }
        });

        mfsetmodelCombo.setModel(
                new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        mfset1Btn.setText("Select");
        mfset1Btn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mfset1BtnActionPerformed(evt);
            }
        });

        mfset2Btn.setText("Select");
        mfset2Btn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mfset2BtnActionPerformed(evt);
            }
        });

        mfset3Btn.setText("Select");
        mfset3Btn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mfset3BtnActionPerformed(evt);
            }
        });

        setforsaleBtn.setText("Set for Sale");
        setforsaleBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                setforsaleBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout mfsetpanelLayout = new javax.swing.GroupLayout(mfsetpanel);
        mfsetpanel.setLayout(mfsetpanelLayout);
        mfsetpanelLayout.setHorizontalGroup(mfsetpanelLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(mfsetpanelLayout.createSequentialGroup().addGap(17, 17, 17)
                        .addGroup(mfsetpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel40).addComponent(jLabel47).addComponent(jLabel48))
                        .addGap(18, 18, 18)
                        .addGroup(mfsetpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(mfsetcartypeCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 180,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(mfsetmanufacturerCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 180,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(mfsetmodelCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 180,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(mfsetpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(mfsetpanelLayout.createSequentialGroup().addGap(6, 6, 6)
                                        .addComponent(setforsaleBtn))
                                .addComponent(mfset1Btn, javax.swing.GroupLayout.PREFERRED_SIZE, 100,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(mfset2Btn, javax.swing.GroupLayout.PREFERRED_SIZE, 100,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(mfset3Btn, javax.swing.GroupLayout.PREFERRED_SIZE, 100,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(287, Short.MAX_VALUE)));
        mfsetpanelLayout
                .setVerticalGroup(mfsetpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(mfsetpanelLayout.createSequentialGroup().addGroup(mfsetpanelLayout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
                                        mfsetpanelLayout.createSequentialGroup().addGap(12, 12, 12)
                                                .addComponent(
                                                        jLabel40)
                                                .addGap(18, 18, 18).addComponent(jLabel47).addGap(18, 18, 18)
                                                .addComponent(jLabel48))
                                .addGroup(mfsetpanelLayout.createSequentialGroup().addContainerGap()
                                        .addGroup(mfsetpanelLayout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(mfsetcartypeCombo,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(mfset1Btn, javax.swing.GroupLayout.PREFERRED_SIZE, 30,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(mfsetpanelLayout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(mfsetmanufacturerCombo,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(mfset2Btn))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(mfsetpanelLayout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(mfsetmodelCombo,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(mfset3Btn))))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(setforsaleBtn)
                                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

        javax.swing.GroupLayout manageFleetLayout = new javax.swing.GroupLayout(manageFleet);
        manageFleet.setLayout(manageFleetLayout);
        manageFleetLayout.setHorizontalGroup(manageFleetLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(manageFleetLayout.createSequentialGroup().addGap(30, 30, 30).addGroup(manageFleetLayout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(manageFleetLayout.createSequentialGroup()
                                .addComponent(managepointjpanel, javax.swing.GroupLayout.PREFERRED_SIZE, 378,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 0, Short.MAX_VALUE))
                        .addGroup(manageFleetLayout.createSequentialGroup().addGroup(manageFleetLayout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(mfremovepanel, javax.swing.GroupLayout.PREFERRED_SIZE, 787,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(manageFleetLayout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addComponent(mfaddpanel, javax.swing.GroupLayout.Alignment.LEADING,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                                manageFleetLayout.createSequentialGroup().addGap(6, 6, 6)
                                                        .addComponent(mfsetpanel,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 543,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGroup(manageFleetLayout.createSequentialGroup()
                                .addGroup(manageFleetLayout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(manageFleetLayout.createSequentialGroup().addGap(120, 120, 120)
                                                .addComponent(mfremoveBtn))
                                        .addComponent(jButton2))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(mfremoveBtn1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jButton6)
                                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))));
        manageFleetLayout.setVerticalGroup(manageFleetLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(manageFleetLayout.createSequentialGroup().addGap(10, 10, 10).addGroup(manageFleetLayout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(manageFleetLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(mfremoveBtn).addComponent(mfremoveBtn1).addComponent(jButton6))
                        .addComponent(jButton2)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(manageFleetLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(manageFleetLayout.createSequentialGroup()
                                        .addComponent(mfsetpanel, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(mfaddpanel, javax.swing.GroupLayout.PREFERRED_SIZE, 320,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(10, 10, 10).addComponent(mfremovepanel,
                                                javax.swing.GroupLayout.PREFERRED_SIZE, 234,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(managepointjpanel, javax.swing.GroupLayout.PREFERRED_SIZE, 469,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

        ModulesTab.addTab("Manage Fleet", manageFleet);

        NewEmployee.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        firstnameLbl.setText("First Name*   :");
        NewEmployee.add(firstnameLbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 70, -1, -1));

        firstNameField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                firstNameFieldActionPerformed(evt);
            }
        });
        NewEmployee.add(firstNameField, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 70, 210, -1));

        lastNameLbl.setText("Last Name*    :");
        NewEmployee.add(lastNameLbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 120, -1, -1));

        lastNameField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                lastNameFieldActionPerformed(evt);
            }
        });
        NewEmployee.add(lastNameField, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 120, 210, -1));

        userNameLbl.setText("User Name*    :");
        NewEmployee.add(userNameLbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 170, -1, -1));

        userNameField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                userNameFieldActionPerformed(evt);
            }
        });
        NewEmployee.add(userNameField, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 170, 210, -1));

        emailIdLbl.setText("Email ID*        :");
        NewEmployee.add(emailIdLbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 230, -1, -1));

        emailIdField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                emailIdFieldActionPerformed(evt);
            }
        });
        NewEmployee.add(emailIdField, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 230, 210, -1));

        passwordLbl.setText("Password*      :");
        NewEmployee.add(passwordLbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 280, -1, -1));
        NewEmployee.add(passwordField, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 280, 210, -1));

        AddEmployeeBtn.setText("Add Employee");
        AddEmployeeBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddEmployeeBtnActionPerformed(evt);
            }
        });
        NewEmployee.add(AddEmployeeBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 480, -1, -1));

        branchIdCombo.setName(""); // NOI18N
        NewEmployee.add(branchIdCombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 330, 200, -1));

        branchIdLbl.setText("Branch ID*      :");
        NewEmployee.add(branchIdLbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 330, -1, -1));

        roleLbl.setText("Role*            :");
        NewEmployee.add(roleLbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 390, -1, -1));

        clerkComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "CLERK", "MANAGER" }));
        clerkComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                clerkComboBoxActionPerformed(evt);
            }
        });
        NewEmployee.add(clerkComboBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 380, 200, -1));

        RemoveEmployeeBtn.setText("Remove Employee");
        RemoveEmployeeBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RemoveEmployeeBtnActionPerformed(evt);
            }
        });
        NewEmployee.add(RemoveEmployeeBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(960, 480, -1, -1));

        allEmployeeTbl.setModel(new javax.swing.table.DefaultTableModel(new String[100][7],
                new String[] { "staff_id", "email", "username", "lastname", "firstname", "role", "branch_id" }));
        jScrollPane9.setViewportView(allEmployeeTbl);

        NewEmployee.add(jScrollPane9, new org.netbeans.lib.awtextra.AbsoluteConstraints(610, 30, 660, 380));

        SearchEmployeeBtn.setText("Search");
        SearchEmployeeBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SearchEmployeeBtnActionPerformed(evt);
            }
        });
        NewEmployee.add(SearchEmployeeBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(760, 480, -1, -1));

        ModifyEmployeeBtn.setText("Modify");
        ModifyEmployeeBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ModifyEmployeeBtnActionPerformed(evt);
            }
        });
        NewEmployee.add(ModifyEmployeeBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 480, -1, -1));

        MoveEmployeeBtn.setText("<<");
        MoveEmployeeBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MoveEmployeeBtnActionPerformed(evt);
            }
        });
        NewEmployee.add(MoveEmployeeBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 200, -1, -1));

        ModulesTab.addTab("New Employee", NewEmployee);

        jLabel70.setText("Daily Rentals");

        branchReportRent.setText("Branch Report");
        branchReportRent.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                branchReportRentActionPerformed(evt);
            }
        });

        branchNameRent.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                branchNameRentActionPerformed(evt);
            }
        });

        branchReportRentAll.setText("All Branch Report");
        branchReportRentAll.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                branchReportRentAllActionPerformed(evt);
            }
        });

        jLabel71.setText("(Branch Name)");

        branchReportReturnAll.setText("All Branch Report");
        branchReportReturnAll.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                branchReportReturnAllActionPerformed(evt);
            }
        });

        jLabel72.setText("(Branch Name)");

        jLabel73.setText("Daily Returns");

        branchReportReturn.setText("Branch Report");
        branchReportReturn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                branchReportReturnActionPerformed(evt);
            }
        });

        branchNameReturn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                branchNameReturnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout reportGenerateLayout = new javax.swing.GroupLayout(reportGenerate);
        reportGenerate.setLayout(reportGenerateLayout);
        reportGenerateLayout.setHorizontalGroup(reportGenerateLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(reportGenerateLayout.createSequentialGroup().addGap(65, 65, 65)
                        .addGroup(reportGenerateLayout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel73, javax.swing.GroupLayout.PREFERRED_SIZE, 109,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(reportGenerateLayout.createSequentialGroup().addGroup(reportGenerateLayout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(branchReportReturnAll, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(branchReportReturn, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                130, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(branchNameReturn, javax.swing.GroupLayout.PREFERRED_SIZE, 127,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jLabel72))
                                .addComponent(jLabel70, javax.swing.GroupLayout.PREFERRED_SIZE, 109,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(reportGenerateLayout.createSequentialGroup().addGroup(reportGenerateLayout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(branchReportRentAll, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                130, Short.MAX_VALUE)
                                        .addComponent(branchReportRent, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(branchNameRent, javax.swing.GroupLayout.PREFERRED_SIZE, 127,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jLabel71)))
                        .addContainerGap(951, Short.MAX_VALUE)));
        reportGenerateLayout.setVerticalGroup(
                reportGenerateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(reportGenerateLayout.createSequentialGroup().addGap(42, 42, 42)
                                .addComponent(jLabel70, javax.swing.GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE)
                                .addGap(18, 18, 18)
                                .addGroup(reportGenerateLayout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(jLabel71, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(branchReportRent, javax.swing.GroupLayout.DEFAULT_SIZE, 35,
                                                Short.MAX_VALUE)
                                        .addComponent(branchNameRent))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(branchReportRentAll, javax.swing.GroupLayout.PREFERRED_SIZE, 36,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(26, 26, 26)
                                .addComponent(jLabel73, javax.swing.GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE)
                                .addGap(18, 18, 18)
                                .addGroup(reportGenerateLayout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(jLabel72, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(branchReportReturn, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(branchNameReturn, javax.swing.GroupLayout.PREFERRED_SIZE, 35,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(branchReportReturnAll, javax.swing.GroupLayout.PREFERRED_SIZE, 36,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(418, 418, 418)));

        ModulesTab.addTab("Reports", reportGenerate);

        modulepane.add(ModulesTab, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1380, 810));
        ModulesTab.getAccessibleContext().setAccessibleName("Reservation");

        javax.swing.GroupLayout jLayeredPane1Layout = new javax.swing.GroupLayout(jLayeredPane1);
        jLayeredPane1.setLayout(jLayeredPane1Layout);
        jLayeredPane1Layout.setHorizontalGroup(
                jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(loginpanel, javax.swing.GroupLayout.DEFAULT_SIZE, 1392, Short.MAX_VALUE)
                        .addGroup(jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jLayeredPane1Layout.createSequentialGroup()
                                        .addComponent(modulepane, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addContainerGap())));
        jLayeredPane1Layout
                .setVerticalGroup(jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(loginpanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jLayeredPane1Layout.createSequentialGroup()
                                        .addComponent(modulepane, javax.swing.GroupLayout.PREFERRED_SIZE, 810,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(0, 0, Short.MAX_VALUE))));
        jLayeredPane1.setLayer(loginpanel, javax.swing.JLayeredPane.DEFAULT_LAYER);
        jLayeredPane1.setLayer(modulepane, javax.swing.JLayeredPane.DEFAULT_LAYER);

        getContentPane().add(jLayeredPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1380, 810));

        jMenu1.setText("File");
        jMenuBar1.add(jMenu1);

        jMenu2.setText("Edit");
        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void loginBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginBtnActionPerformed
        try {
            String username = userField.getText();
            user = username;
            String pass = pwdField.getText();

            ConnectDB.exeQuery("select * from Accounts where username='" + username + "'");

            while (ConnectDB.resultSet().next()) {
                System.out.println(crypt.decrypt(ConnectDB.resultSet().getString("password")));
                if (username.contains(ConnectDB.resultSet().getString("username"))
                        & pass.contains(crypt.decrypt(ConnectDB.resultSet().getString("password")))) {

                    if (ConnectDB.resultSet().getString("role").contains("CLERK")) {

                        loginpanel.setVisible(false);
                        modulepane.setVisible(true);
                        ModulesTab.setEnabledAt(4, false);
                        ModulesTab.setEnabledAt(5, false);
                        ModulesTab.setEnabledAt(6, false);
                    } else if (ConnectDB.resultSet().getString("role").contains("MANAGER")) {
                        loginpanel.setVisible(false);
                        ModulesTab.setEnabledAt(6, false);
                        modulepane.setVisible(true);
                    } else if (ConnectDB.resultSet().getString("role").contains("SYSTEM")) {
                        loginpanel.setVisible(false);
                        modulepane.setVisible(true);
                    }
                    CommonFunc.username = username;
                } else {
                    JOptionPane.showMessageDialog(null, "Wrong username or password");
                    return;
                }

            }

        } catch (ClassNotFoundException | SQLException | IOException ex) {
            JOptionPane.showMessageDialog(null, ex);
        } catch (Exception ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } finally {
            try {
                ConnectDB.clearResultSet();
            } catch (SQLException ex) {
                JOptionPane.showMessageDialog(null, ex);
            }
        }
    }//GEN-LAST:event_loginBtnActionPerformed

    private void searchBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchBtnActionPerformed
        try {

            Date pickupDate = CommonFunc.changeDateFormat(pickupDt);
            Date dropoffDate = CommonFunc.changeDateFormat(dropOffDate);
            String pickuptime = CommonFunc.sqlTime(pickupHour, pickupMin);
            String dropofftime = CommonFunc.sqlTime(dropoffHHSpin, dropoffMMSpin);

            String cat = vehicleCatCombo.getSelectedItem().toString();
            String type = vehicleTypeCombo.getSelectedItem().toString();

            unreservedVehiTable = new JTable(
                    rt.getAvailableVehicles(cat, Integer.parseInt(brnchIdCombo.getSelectedItem().toString()), type,
                            pickupDate, dropoffDate, pickuptime, dropofftime));
        } catch (SQLException | IOException | ParseException | ClassNotFoundException ex) {
            JOptionPane.showMessageDialog(null, ex);
        }
        jScrollPane1.setViewportView(unreservedVehiTable);
    }//GEN-LAST:event_searchBtnActionPerformed

    private void resetTable() {
        unreservedVehiTable.setModel(new javax.swing.table.DefaultTableModel(
                new Object[][] { { null, null, null, null, null }, { null, null, null, null, null },
                        { null, null, null, null, null }, { null, null, null, null, null },
                        { null, null, null, null, null }, { null, null, null, null, null },
                        { null, null, null, null, null }, { null, null, null, null, null },
                        { null, null, null, null, null }, { null, null, null, null, null },
                        { null, null, null, null, null } },
                new String[] { "Vehicle ID", "Make", "Vehicle Type", "Colour", "Doors" }));
        jScrollPane1.setViewportView(unreservedVehiTable);
    }

    private void resetBtnActionPerformed(java.awt.event.ActionEvent evt) {
        rentPhoneNo.setText("");
        cusNumField1.setText("");
        dlNumField.setText("");
        ccNumField.setText("");
        expDateCh.cleanup();
        cardTypeCombo.setSelectedIndex(1);
        brnchIdCombo.setSelectedIndex(0);
        vehicleCatCombo.setSelectedItem("Select");
        pickupDt.setDate(null);
        pickupHour.setValue(0);
        pickupMin.setValue(0);
        dropOffDate.setDate(null);
        dropoffHHSpin.setValue(0);
        dropoffMMSpin.setValue(0);

        cancelReservationField.setText("");
        confirmationNoDisplayField.setText("");
        estimatePrice.setText("");
        cancelPhoneField.setText("");
        cancelReservationField.setText("");
        cancelPickupDt.setDate(null);
        cancelDropoff.setDate(null);
        resetTable();
    }

    private void ModulesTabMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ModulesTabMouseClicked

    }//GEN-LAST:event_ModulesTabMouseClicked

    private void brnchIdComboItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_brnchIdComboItemStateChanged
        vehicleCatCombo.removeAllItems();

        try {
            rt.fillVehicleCatCombo(vehicleCatCombo, brnchIdCombo, vehicleTypeCombo);

        } catch (ClassNotFoundException | SQLException | IOException ex) {
            JOptionPane.showMessageDialog(null, ex);
        }
        clearEqupList();
    }//GEN-LAST:event_brnchIdComboItemStateChanged

    private void rentBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rentBtnActionPerformed
        long ReservationID = rt.genUniqueID();
        try {
            if (rt.validateCustomerInfo(cusNumField1) > 0) {
                int cusID = rt.validateCustomerInfo(cusNumField1);
                int brnchID = Integer.parseInt(brnchIdCombo.getSelectedItem().toString());
                String vehicleTyp = vehicleCatCombo.getSelectedItem().toString();
                Date pickupDate = CommonFunc.changeDateFormat(pickupDt);
                Date dropoffDate = CommonFunc.changeDateFormat(dropOffDate);
                String pickuptime = CommonFunc.sqlTime(pickupHour, pickupMin);
                String dropofftime = CommonFunc.sqlTime(dropoffHHSpin, dropoffMMSpin);
                DateTime dt = new DateTime();
                DateTimeFormatter format = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
                String now = format.print(dt);

                if (CommonFunc.compareDates(pickupDate + " " + pickuptime, now) < 0 || CommonFunc
                        .compareDates(pickupDate + " " + pickuptime, dropoffDate + " " + dropofftime) > 0) {
                    JOptionPane.showMessageDialog(null,
                            "Pickup date should be greater than or equal to current date \n\n "
                                    + "Dropoff date should be equal to pickup date or greater than pickup date");
                    return;
                } else {

                    String vehicleId = (String) unreservedVehiTable.getValueAt(unreservedVehiTable.getSelectedRow(),
                            0);

                    ConnectDB.exeUpdate(
                            "INSERT INTO reserve (`confirmation_no`, `vin`, `customer_id`, `branch_id`, `phone`,  `pickup_time`, `dropoff_time`,`status`,  `create_time` )"
                                    + " VALUES (" + ReservationID + ", '" + vehicleId + "', " + cusID + ", "
                                    + brnchID + ",  " + Double.parseDouble(cusNumField1.getText()) + ",'"
                                    + pickupDate + " " + pickuptime + "', '" + dropoffDate + " " + dropofftime
                                    + "','reserved', '" + pickupDate + " " + pickuptime + "')");
                    ConnectDB.clearResultSet();
                    Iterator it = equipSelectedUnits.entrySet().iterator();
                    if (equipSelectedUnits.size() > 0) {
                        while (it.hasNext()) {
                            Map.Entry pair = (Map.Entry) it.next();
                            String[] equp = pair.getKey().toString().split(": ");
                            int quantity = (int) pair.getValue();

                            ConnectDB.exeUpdate(
                                    "INSERT INTO `team01`.`equipment_reserved` (`confirmation_no`, `equipment_type`, `quantity`) "
                                            + "VALUES (" + ReservationID + ", '" + equp[0] + "', " + quantity
                                            + ");");
                            ConnectDB.clearResultSet();
                        }
                    }
                    equipSelectedUnits.clear();
                    confirmationNoDisplayField.setText(String.valueOf(ReservationID));
                    confirmationNoDisplayField.setEnabled(false);
                    if (CommonFunc.compareDates(pickupDate + " " + pickuptime, now) == 0) {
                        rentConfirmationNO.setText(String.valueOf(ReservationID));
                        rentPhoneNo.setText(cusNumField1.getText());
                    }

                    JOptionPane.showMessageDialog(null,
                            "Resvervation done successfully and the Confirmation No is " + ReservationID);
                    resetTable();
                    Return ret = new Return();
                    estimatePrice.setText(ret.getEstimateFee(vehicleId, dropoffDate));
                    CommonFunc.triggerMail(CommonFunc.getEmail(String.valueOf(ReservationID)),
                            "Super Rent Confimation",
                            "Dear customr,\n\n Thank you for choosing SuperRent. Reservation details are below: \n\n"
                                    + "    Confimation NO:    " + ReservationID + "\n\n"
                                    + "    Pick up time:        " + pickupDate + " " + pickuptime + " \n\n"
                                    + "    Drop off time:       " + dropoffDate + " " + dropofftime + "\n\n"
                                    + "    Estimated price:    $ " + estimatePrice.getText() + "\n\n"
                                    + "\n\n\n                                                                   "
                                    + "                                             Super Rent");
                }

            } else {
                JOptionPane.showMessageDialog(null, "Not a valid customer phone number");

            }
        } catch (ClassNotFoundException ex) {
            JOptionPane.showMessageDialog(null, ex);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex);
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(null, ex);
        } catch (ParseException ex) {
            JOptionPane.showMessageDialog(null, ex);
        } finally {
            clearEqupList();
        }
    }//GEN-LAST:event_rentBtnActionPerformed

    //private void initReserve() throws ClassNotFoundException, SQLException, IOException{

    private void vehicleTypeComboItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_vehicleTypeComboItemStateChanged
        if (!brnchIdCombo.getSelectedItem().toString().equals("Select")) {
            vehicleCatCombo.removeAllItems();
            try {
                rt.fillVehicleCatCombo(vehicleCatCombo, brnchIdCombo, vehicleTypeCombo);
            } catch (ClassNotFoundException | SQLException | IOException ex) {
                JOptionPane.showMessageDialog(null, ex);
            }
        }
        clearEqupList();
    }//GEN-LAST:event_vehicleTypeComboItemStateChanged

    private void vehicleCatComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vehicleCatComboActionPerformed
        clearEqupList();
    }//GEN-LAST:event_vehicleCatComboActionPerformed

    private void clearEqupList() {
        equipSelected.clear();
        selectedList = new JList();
        equipmentsList = new JList();
        equipSelectedUnits.clear();
        jScrollPane5.setViewportView(selectedList);
        jScrollPane4.setViewportView(equipmentsList);
    }

    private void searchEqupBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchEqupBtnActionPerformed
        DefaultListModel ar = null;
        if (!brnchIdCombo.getSelectedItem().toString().equals("Select")) {
            try {

                ar = rt.fillEquipmentList(equipmentsList, vehicleTypeCombo, brnchIdCombo);
            } catch (ClassNotFoundException | SQLException | IOException | InterruptedException ex) {
                JOptionPane.showMessageDialog(null, ex);
            }
            equipmentsList = new JList(ar);
            jScrollPane4.setViewportView(equipmentsList);
        }

    }//GEN-LAST:event_searchEqupBtnActionPerformed

    private void addEquipBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addEquipBtnActionPerformed
        selectedList.removeAll();

        if (equipmentsList.getSelectedValuesList().size() > 0) {
            for (int i = 0; i < equipmentsList.getSelectedValuesList().size(); i++) {
                equipSelected.add(equipmentsList.getSelectedValuesList().get(i).toString());
            }

            Set<String> unique = new HashSet<String>(equipSelected);
            for (String key : unique) {

                equipSelectedUnits.put(key + ": ", Collections.frequency(equipSelected, key));
            }

            selectedList = new JList(equipSelectedUnits.entrySet().toArray());
            jScrollPane5.setViewportView(selectedList);

        }
    }//GEN-LAST:event_addEquipBtnActionPerformed

    private void removeEquipBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeEquipBtnActionPerformed
        selectedList.removeAll();

        if (selectedList.getSelectedValuesList().size() > 0) {
            String[] toRemove = selectedList.getSelectedValue().toString().split(":");
            equipSelected.remove(toRemove[0]);
            Set<String> unique = new HashSet<String>(equipSelected);

            for (String key : unique) {
                equipSelectedUnits.put(key + ": ", Collections.frequency(equipSelected, key));
            }
            selectedList = new JList(equipSelectedUnits.entrySet().toArray());
            jScrollPane5.setViewportView(selectedList);

            if (equipSelected.size() == 0) {
                equipSelectedUnits.clear();
                selectedList = new JList(equipSelectedUnits.entrySet().toArray());
                jScrollPane5.setViewportView(selectedList);
            }

        }
    }//GEN-LAST:event_removeEquipBtnActionPerformed

    private void cancelConfirmationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelConfirmationActionPerformed

        try {
            rt.cancelReservation(cancelReservationField, cancelPhoneField, cancelPickupDt, cancelDropoff);
        } catch (ParseException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//GEN-LAST:event_cancelConfirmationActionPerformed

    private void ReturnVin_jTextField8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ReturnVin_jTextField8ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_ReturnVin_jTextField8ActionPerformed

    private void ReturnRoadStar_jCheckBox2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ReturnRoadStar_jCheckBox2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_ReturnRoadStar_jCheckBox2ActionPerformed

    private void ReturnCalculate_jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ReturnCalculate_jButton6ActionPerformed
        // TODO add your handling code here:
        String vin = ReturnVin_jTextField8.getText();
        String OdeReading = ReturnOdometer_jTextField9.getText();

        double previous_ode = MyReturn.getOde(vin);

        if (!ReturnVin_jTextField8.getText().isEmpty() && !ReturnOdoRead_jLabel23.getText().isEmpty()
                && !ReturnFuelReading_jTextField2.getText().isEmpty()
                && previous_ode < Double.parseDouble(OdeReading)) {
            vin = ReturnVin_jTextField8.getText();
            String[] ResrTime = new String[2];
            OdeReading = ReturnOdometer_jTextField9.getText();
            String FuelReading = ReturnFuelReading_jTextField2.getText();
            boolean RoadStar = ReturnRoadStar_jCheckBox2.isSelected();
            boolean Reedeem = ReturnRedeem_jCheckBox1.isSelected();
            try {
                Date dropoffDate = CommonFunc.changeDateFormat(ReturnDate_jDateChooser3);
                String dropofftime = CommonFunc.sqlTime(ReturnTimeHH_jSpinner1, ReturnTimeMM_jSpinner1);//? need minutes?
                //dropofftime
                ReturnDisplayFee_jTable2.setModel(new javax.swing.table.DefaultTableModel(
                        MyReturn.getCalculateFee(vin, RoadStar, FuelReading, OdeReading, Reedeem, dropoffDate),
                        new String[] { "Entry", "Details", "Cost" }));
                TableColumn firsetColumn = ReturnDisplayFee_jTable2.getColumnModel().getColumn(0);
                firsetColumn.setMaxWidth(200);
                firsetColumn.setMinWidth(200);
                //            TableColumn SecColumn = ReturnDisplayFee_jTable2.getColumnModel().getColumn(1);
                //            SecColumn.setMinWidth(200);
                TableColumn ThirdColumn = ReturnDisplayFee_jTable2.getColumnModel().getColumn(2);
                ThirdColumn.setMaxWidth(120);
                ThirdColumn.setMinWidth(120);

            } catch (ParseException ex) {
                Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
                JOptionPane.showMessageDialog(null, ex);
            }
        } else {
            JOptionPane.showMessageDialog(null, "Please input necessary and correct  information.");
        }
    }//GEN-LAST:event_ReturnCalculate_jButton6ActionPerformed

    private void ReturnCheckOverDueDis_jTable2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ReturnCheckOverDueDis_jTable2MouseClicked
        // TODO add your handling code here:
        String Return_Date = ReturnDate_jDateChooser3.getDateFormatString();
        //System.out.println("The return date is" + Return_Date);
    }//GEN-LAST:event_ReturnCheckOverDueDis_jTable2MouseClicked

    private void ReturnCheck_jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ReturnCheck_jButton2ActionPerformed
        // TODO add your handling code here:
        String vin = ReturnVin_jTextField8.getText();
        String[][] ReserInfo = new String[1][7];
        ReserInfo = Return.getResrInfo(vin);
        double previous_ode = MyReturn.getOde(vin);
        String[][] InfoDisplay = new String[1][5];
        InfoDisplay[0][0] = ReserInfo[0][0];
        InfoDisplay[0][1] = ReserInfo[0][4];
        InfoDisplay[0][2] = ReserInfo[0][5];
        InfoDisplay[0][3] = ReserInfo[0][6];
        InfoDisplay[0][4] = String.valueOf(previous_ode);

        if (!vin.isEmpty()) {
            if (InfoDisplay[0][0] == null) {
                InfoDisplay[0][4] = "";
            }
            ReturnDisplay_jTable2.setModel(new javax.swing.table.DefaultTableModel(InfoDisplay,
                    new String[] { "Confirmation No", "First Name", "Last Name", "Phone", "Previous Ode" }));

        } else {
            JOptionPane.showMessageDialog(null, "Please input the Vin.");
        }
    }//GEN-LAST:event_ReturnCheck_jButton2ActionPerformed

    private void ReturnFuelReading_jTextField2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ReturnFuelReading_jTextField2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_ReturnFuelReading_jTextField2ActionPerformed

    private void ReturnCheckOverDue_jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ReturnCheckOverDue_jButton2ActionPerformed
        // TODO add your handling code here:
        ReturnCheckOverDueDis_jTable2
                .setModel(new javax.swing.table.DefaultTableModel(MyReturn.getOverDue(), new String[] {
                        "Confirmation No", "Customer ID", "Phone No", "Branch ID", "Expected Time", "Vin" }));
    }//GEN-LAST:event_ReturnCheckOverDue_jButton2ActionPerformed

    private void ReturnRedeem_jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ReturnRedeem_jCheckBox1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_ReturnRedeem_jCheckBox1ActionPerformed

    private void ReturnPay_jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ReturnPay_jButton2ActionPerformed
        // TODO add your handling code here:
        String vin = "";
        String[] ResrTime = new String[2];
        String OdeReading = "";
        String FuelReading = "";
        boolean RoadStar = false;
        boolean Reedeem = false;
        String[][] CalcuResult = new String[15][3];
        String username = "";
        String staff_id = "";
        String branch_id = "";
        String car_status = "";
        String confirmationID = "";
        String customeID = "";

        OdeReading = ReturnOdometer_jTextField9.getText();

        double previous_ode = MyReturn.getOde(vin);

        if (!ReturnVin_jTextField8.getText().isEmpty() && !ReturnOdoRead_jLabel23.getText().isEmpty()
                && !ReturnFuelReading_jTextField2.getText().isEmpty()
                && previous_ode < Double.parseDouble(OdeReading)) {
            vin = ReturnVin_jTextField8.getText();
            OdeReading = ReturnOdometer_jTextField9.getText();
            FuelReading = ReturnFuelReading_jTextField2.getText();
            RoadStar = ReturnRoadStar_jCheckBox2.isSelected();
            Reedeem = ReturnRedeem_jCheckBox1.isSelected();
            try {
                String[][] ReserInfo = new String[1][7];
                ReserInfo = Return.getResrInfo(vin);
                car_status = ReserInfo[0][3];
                confirmationID = ReserInfo[0][0];
                customeID = ReserInfo[0][1];

                Date dropoffDate = CommonFunc.changeDateFormat(ReturnDate_jDateChooser3);
                //                dropofftime = CommonFunc.sqlTime(ReturnTimeHH_jSpinner1, ReturnTimeMM_jSpinner1);//? need minutes?
                //dropofftime
                CalcuResult = MyReturn.getCalculateFee(vin, RoadStar, FuelReading, OdeReading, Reedeem,
                        dropoffDate);
                ReturnDisplayFee_jTable2.setModel(new javax.swing.table.DefaultTableModel(CalcuResult,
                        new String[] { "Entry", "Details", "Cost" }));
                TableColumn firsetColumn = ReturnDisplayFee_jTable2.getColumnModel().getColumn(0);
                firsetColumn.setMaxWidth(150);
                firsetColumn.setMinWidth(150);
                //            TableColumn SecColumn = ReturnDisplayFee_jTable2.getColumnModel().getColumn(1);
                //            SecColumn.setMinWidth(200);
                TableColumn ThirdColumn = ReturnDisplayFee_jTable2.getColumnModel().getColumn(2);
                ThirdColumn.setMaxWidth(120);
                ThirdColumn.setMinWidth(120);

            } catch (ParseException ex) {
                Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
                JOptionPane.showMessageDialog(null, ex);
            }
        } else {
            JOptionPane.showMessageDialog(null, "Please input all returning information.");
        }

        //Update tables;
        if (!ReturnCash_jTextField2.getText().isEmpty() && !ReturnCreditCard_jTextField1.getText().isEmpty()
                && (Double.parseDouble(ReturnCash_jTextField2.getText())
                        + Double.parseDouble(ReturnCreditCard_jTextField1.getText()) >= Double
                                .parseDouble(CalcuResult[14][2]))
                && previous_ode < Double.parseDouble(OdeReading)) {
            try {
                username = CommonFunc.username;
                staff_id = MyReturn.getStaffInfo(username)[0];
                branch_id = MyReturn.getStaffInfo(username)[1];

                Date dropOffDate_upd = CommonFunc.changeDateFormat(ReturnDate_jDateChooser3);
                String dropOffTime = CommonFunc.sqlTime(ReturnTimeHH_jSpinner1, ReturnTimeMM_jSpinner1);

                //update fleet table.
                ConnectDB.exeUpdate("update fleet set odometer = '" + ReturnOdometer_jTextField9.getText()
                        + "', branch_id = '" + branch_id + "'" + " where vin = '" + vin + "'");
                ConnectDB.clearResultSet();

                //update payment table
                long paymentID = Reserve.genUniqueID();

                ConnectDB.exeUpdate(
                        "insert into payment ( payment_id, customer_id, purpose, total, cash, credit, points,"
                                + " create_time, id, branch_id, staff_id) " + "values ( " + paymentID + ",'"
                                + customeID + "','rent','" + CalcuResult[14][2] + "','"
                                + ReturnCash_jTextField2.getText() + "','" + ReturnCreditCard_jTextField1.getText()
                                + "'," + "'" + Double.parseDouble(CalcuResult[14][2]) / 5 + "','" + dropOffDate_upd
                                + " " + dropOffTime + "','" + confirmationID + "','" + branch_id + "','" + staff_id
                                + "')");
                ConnectDB.clearResultSet();
                //update dropoff table ???
                String[] FeeRate = new String[8];
                FeeRate = MyReturn.getFeeRate(vin);

                ConnectDB.exeUpdate(
                        "insert into dropoff (confirmation_no, passed_odometer, gas_rate, gas_not_filled_by_liter, road_star)"
                                + "values ('" + confirmationID + "','" + OdeReading + "','" + FeeRate[7] + "','"
                                + FuelReading + "'," + RoadStar + ")");
                ConnectDB.clearResultSet();

                //update member table: points
                if (Reedeem) {
                    int pointsEX = MyReturn.getVechilePointsEX(vin);
                    int[] pointsInfo = MyReturn.getRedeemInfo(vin);
                    int remainPoints = pointsInfo[0] - pointsEX * pointsInfo[1]
                            + (int) (Double.parseDouble(CalcuResult[14][2]) / 5);
                    ConnectDB.exeUpdate("update member set points = " + remainPoints + " where member_id = '"
                            + pointsInfo[2] + "'");
                    ConnectDB.clearResultSet();
                }
                //update equipment
                int equ_length = MyReturn.getEquipInfo(vin).length;
                String[] EquipInfo = new String[equ_length];
                EquipInfo = MyReturn.getEquipInfo(vin);

                if (equ_length == 4) {
                    int equ_pre_num = MyReturn.getEquipNum(EquipInfo[0], branch_id);
                    ConnectDB.exeUpdate("update equipment set Units = '"
                            + (equ_pre_num + Integer.parseInt(EquipInfo[3])) + "' " + "where equipment_type = '"
                            + EquipInfo[0] + "' and branch_id = '" + branch_id + "'");
                    ConnectDB.clearResultSet();
                } else if (equ_length == 8) {
                    int equ_pre_num = MyReturn.getEquipNum(EquipInfo[0], branch_id);
                    ConnectDB.exeUpdate("update equipment set Units = '"
                            + (equ_pre_num + Integer.parseInt(EquipInfo[3])) + "' " + "where equipment_type = '"
                            + EquipInfo[0] + "' and branch_id = '" + branch_id + "'");
                    ConnectDB.clearResultSet();

                    equ_pre_num = MyReturn.getEquipNum(EquipInfo[4], branch_id);
                    ConnectDB.exeUpdate("update equipment set Units = '"
                            + (equ_pre_num + Integer.parseInt(EquipInfo[7])) + "' " + "where equipment_type = '"
                            + EquipInfo[4] + "' and branch_id = '" + branch_id + "'");
                    ConnectDB.clearResultSet();
                }

                //update reserve table
                ConnectDB.exeUpdate("update reserve set status = 'returned', dropoff_time = '" + dropOffDate_upd
                        + " " + dropOffTime + "' where vin = '" + vin + "' and status = 'rented' ");
                ConnectDB.clearResultSet();
                JOptionPane.showMessageDialog(null, "Return successful!");
                ReturnDisplayFee_jTable2.print();
                //                    CommonFunc.triggerMail(CommonFunc.getEmail(confirmationID),"Super Rent Status", "Dear customr,\n\n Thank you for choosing SuperRent. The receipt is as follows: \n\n"
                //                            + "    Payment ID:    "+paymentID+"\n\n"
                //                            + "'"+ReturnDisplayFee_jTable2+"'"
                //                            + "\n\n\n                                                                   "
                //                            + "                                             Super Rent");
            } catch (ClassNotFoundException | SQLException | IOException | ParseException ex) {
                Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
                JOptionPane.showMessageDialog(null, ex);
            } catch (PrinterException ex) {
                Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
            }

        } else {
            JOptionPane.showMessageDialog(null, "Please input the correct payment information. ");
        }

    }//GEN-LAST:event_ReturnPay_jButton2ActionPerformed

    private void ReturnCreditCard_jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ReturnCreditCard_jTextField1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_ReturnCreditCard_jTextField1ActionPerformed

    private void rentbtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rentbtnActionPerformed
        try {
            String con_no = null;
            if ((rentConfirmationNO.getText().length() != 0 || rentPhoneNo.getText().length() != 0)
                    && dlNumField.getText().length() != 0 && ccNumField.getText().length() != 0
                    && expDateCh.getDate() != null) {
                if (reservedVehiTable.getRowCount() > 0) {
                    int row = reservedVehiTable.getSelectedRow();
                    con_no = reservedVehiTable.getValueAt(row, 0).toString();
                }

                rent.rentVehicle(dlNumField, con_no);
                JOptionPane.showMessageDialog(null, "Vehicle rented successfully");
            } else {
                JOptionPane.showMessageDialog(null, "Please enter all the required fields");
            }
        } catch (Exception ex) {
            JOptionPane.showMessageDialog(null, ex);
        }

    }//GEN-LAST:event_rentbtnActionPerformed

    private void brnchIdComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_brnchIdComboActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_brnchIdComboActionPerformed

    private void serachRntActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_serachRntActionPerformed
        try {

            reservedVehiTable = new JTable(
                    rent.getReservedVehicles(rentConfirmationNO.getText(), rentPhoneNo.getText()));
            jScrollPane8.setViewportView(reservedVehiTable);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_serachRntActionPerformed

    private void resetAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resetAllActionPerformed
        rentConfirmationNO.setText("");
        rentPhoneNo.setText("");
        dlNumField.setText("");
        ccNumField.setText("");
        expDateCh.setDate(null);

    }//GEN-LAST:event_resetAllActionPerformed

    public void clearRentFields() {
        rentConfirmationNO.setText("");
        rentPhoneNo.setText("");
        dlNumField.setText("");
        ccNumField.setText("");
        expDateCh.setDate(null);
    }

    public void clearEmpFields() {
        emailIdField.setText("");
        userNameField.setText("");
        lastNameField.setText("");
        firstNameField.setText("");

    }

    private void jButton14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton14ActionPerformed
        int row = allEmployeeTbl.getSelectedRow();

        String[] col = new String[7];
        for (int i = 0; i < 7; i++) {

            col[i] = allEmployeeTbl.getValueAt(row, i).toString();

        }
        emailIdField.setText(col[1]);
        userNameField.setText(col[2]);
        lastNameField.setText(col[3]);
        firstNameField.setText(col[4]);
        clerkComboBox.setSelectedItem(col[5]);
        branchIdCombo.setSelectedItem(col[6]);
        ne.modEmployee("sd", col[0], col[1], col[2], col[3], col[4], col[5], col[6]); // TODO add your handling code here:
    }//GEN-LAST:event_jButton14ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
        mfaddpanel.setVisible(true);
        mfremovepanel.setVisible(false);
        jScrollPane7.setVisible(false);
        // removeBtn.setVisible(false);
        mfsetpanel.setVisible(false);
        managepointjpanel.setVisible(false);
    }//GEN-LAST:event_jButton2ActionPerformed

    private void mfremoveBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mfremoveBtnActionPerformed
        // TODO add your handling code here:
        mfremovepanel.setVisible(true);
        mfaddpanel.setVisible(false);
        mfsetpanel.setVisible(false);
        jScrollPane7.setVisible(true);
        managepointjpanel.setVisible(false);
        mf.settable(0, null, null, null, cz);
    }//GEN-LAST:event_mfremoveBtnActionPerformed

    private void mfmanufacturerComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mfmanufacturerComboActionPerformed
        // TODO add your handling code here:
        if (mfmanufacturerCombo.getSelectedItem() == "other")
            mfothermnfTextField.setVisible(true);
    }//GEN-LAST:event_mfmanufacturerComboActionPerformed

    private void addBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addBtnActionPerformed
        try {
            // TODO add your handling code here:{

            String car_or_truck = null;
            if (mfcarCheckBox.isSelected()) {
                car_or_truck = "car";
            } else if (mftruckCheckBox.isSelected()) {
                car_or_truck = "truck";
            } else {
                mf.showerror("Select car or truck");
                return;
            }

            String category = null;
            if (!mfcartypeCombo.getSelectedItem().toString().isEmpty()) {
                category = mfcartypeCombo.getSelectedItem().toString();
            } else {
                mf.showerror("car type cannot be empty");
                return;
            }

            String maker = null;

            if (!mfmanufacturerCombo.getSelectedItem().toString().isEmpty()) {
                maker = mfmanufacturerCombo.getSelectedItem().toString();
            }

            if (mfmanufacturerCombo.getSelectedItem() == "other") {
                if (!mfothermnfTextField.getText().isEmpty())
                    maker = mfothermnfTextField.getText();
                else {
                    mf.showerror("manufacturer cannot be empty");
                    return;
                }
            }

            String model = null;
            if (!mfmodelTextField.getText().isEmpty()) {
                model = mfmodelTextField.getText();
            } else {
                //                    System.out.println(mfmodelTextField.getText());
                mf.showerror("please fill in the model");
                return;
            }

            String branch = null;
            if (!mfbranchCombo.getSelectedItem().toString().isEmpty()) {
                branch = mfbranchCombo.getSelectedItem().toString(); //category, car_or_truck, branc
            } else {
                mf.showerror("please fill branch ID");
                return;
            }
            int branch_id = Integer.parseInt(branch);

            String year = null;
            if (!mfyearTextField.getText().isEmpty()) {
                year = mfyearTextField.getText();
            } else {
                mf.showerror("please fill in year");
                return;
            }

            String oto = null;
            if (!mfotoTextField.getText().isEmpty()) {
                oto = mfotoTextField.getText();
            } else {
                mf.showerror("please fill in otometer");
                return;
            }
            double otometer = Double.parseDouble(oto);

            String color = null;
            if (mfcolorCombo.getSelectedItem() != null) {
                color = mfcolorCombo.getSelectedItem().toString();
            }
            if (mfcolorCombo.getSelectedItem() == "other") {
                if (!mfotherclTextField.getText().isEmpty())
                    color = mfotherclTextField.getText();
                else {
                    mf.showerror("please fill in the color");
                    return;
                }

            }
            String vin = null;
            if (!mfvinTextField.getText().isEmpty()) {
                vin = mfvinTextField.getText();
            } else {
                mf.showerror("please fill in vin");
                return;
            }
            // String SQL =
            PreparedStatement ps = ConnectDB.exeUpdateprestatement(
                    "INSERT INTO fleet (category, car_or_truck, branch_id,year, odometer,color, maker, model, doors, status, description,vin) VALUES (?, ?, ?, ? ,?, ?, ?,?, 4, ?,?,?);");
            ps.setString(1, category);
            ps.setString(2, car_or_truck);
            ps.setInt(3, branch_id);
            //System.out.println(year);
            ps.setString(4, year);
            ps.setDouble(5, otometer);
            ps.setString(6, color);
            ps.setString(7, maker);
            ps.setString(8, model);
            ps.setString(9, "rent");
            ps.setString(10, null);
            ps.setString(11, vin);
            ps.executeUpdate();
        } catch (ClassNotFoundException ex) {
            JOptionPane.showMessageDialog(null, ex);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex);
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(null, ex);
        }
        mf.showerror("Added succefully!");
    }//GEN-LAST:event_addBtnActionPerformed

    private void mfcarCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mfcarCheckBoxActionPerformed
        // TODO add your handling code here:
        if (mfcarCheckBox.isSelected()) {
            mftruckCheckBox.setEnabled(false);
            mf.getCar_or_truck(0);
            mfcartypeCombo.removeAllItems();
            mf.fillCarType(mfcartypeCombo);
        } else if (!mfcarCheckBox.isSelected()) {
            mfcartypeCombo.removeAllItems();
            mftruckCheckBox.setEnabled(true);
        }
    }//GEN-LAST:event_mfcarCheckBoxActionPerformed

    private void mftruckCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mftruckCheckBoxActionPerformed
        // TODO add your handling code here:
        if (mftruckCheckBox.isSelected()) {
            mfcarCheckBox.setEnabled(false);
            mf.getCar_or_truck(1);
            mfcartypeCombo.removeAllItems();
            mf.fillCarType(mfcartypeCombo);
        } else if (!mftruckCheckBox.isSelected()) {
            mfcartypeCombo.removeAllItems();
            mfcarCheckBox.setEnabled(true);
        }
    }//GEN-LAST:event_mftruckCheckBoxActionPerformed

    private void mfcolorComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mfcolorComboActionPerformed
        // TODO add your handling code here:
        if (mfcolorCombo.getSelectedItem() == "other")
            mfotherclTextField.setVisible(true);
    }//GEN-LAST:event_mfcolorComboActionPerformed

    private void jButton15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton15ActionPerformed
        // TODO add your handling code here:
        //        int branch_id = Integer.getInteger(mfbranch.getText().toString());
        String sbranch_id = mfbranch.getText().toString();

        String snum = mfnumber.getText().toString();
        if (sbranch_id.isEmpty()) {
            mf.showerror("Please specify the branch");
            return;
        }
        if (snum.isEmpty()) {
            mf.showerror("Please specify number");
            return;
        }
        int branch_id = Integer.parseInt(sbranch_id);
        int num = Integer.parseInt(snum);

        String eqp = mfeqpcombo.getSelectedItem().toString();

        try {
            ConnectDB.exeUpdate("update equipment set Units = Units +" + num + " where equipment_type = '" + eqp
                    + "' and branch_id ='" + branch_id + "'");
            ConnectDB.clearResultSet();
            mf.showerror("add successfully!");
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//GEN-LAST:event_jButton15ActionPerformed

    private void mfs1BtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mfs1BtnActionPerformed
        // TODO add your handling code here:
        String cartype = null;
        try {
            // TODO add your handling code here:
            if (mfscartypeCombo.getSelectedItem() != null) {
                cartype = mfscartypeCombo.getSelectedItem().toString();
            }
            mf.fillssManufacturer(mfsmanufacturerCombo, cartype);
        } catch (ClassNotFoundException ex) {
            JOptionPane.showMessageDialog(null, ex);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex);
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(null, ex);
        }
        //clear the table
        // mf.clearTable(mfremoveTable);
        // mf.setsqlinfo(0,cartype, null, null);
        mf.settable(1, cartype, null, null, cz);
    }//GEN-LAST:event_mfs1BtnActionPerformed

    private void mfscartypeComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mfscartypeComboActionPerformed
        mfsmanufacturerCombo.removeAllItems();
    }//GEN-LAST:event_mfscartypeComboActionPerformed

    private void mfsmanufacturerComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mfsmanufacturerComboActionPerformed
        mfsmodelCombo.removeAllItems();
    }//GEN-LAST:event_mfsmanufacturerComboActionPerformed

    private void mfs2BtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mfs2BtnActionPerformed
        // TODO add your handling code here:
        // TODO add your handling code here:
        String manufacturer = null;
        String cartype = null;
        try {
            // TODO add your handling code here:
            if (mfsmanufacturerCombo.getSelectedItem() != null) {
                manufacturer = mfsmanufacturerCombo.getSelectedItem().toString();
            }
            if (mfscartypeCombo.getSelectedItem() != null) {
                cartype = mfscartypeCombo.getSelectedItem().toString();
            }
            mf.fillssModel(mfsmodelCombo, manufacturer, cartype);

        } catch (ClassNotFoundException ex) {
            JOptionPane.showMessageDialog(null, ex);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex);
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(null, ex);
        }
        mf.settable(2, cartype, manufacturer, role, cz);
    }//GEN-LAST:event_mfs2BtnActionPerformed

    private void mfs3BtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mfs3BtnActionPerformed
        // TODO add your handling code here:
        //clear the table
        String cartype = null;
        String manufacturer = null;
        String model = null;
        cartype = mfscartypeCombo.getSelectedItem().toString();
        manufacturer = mfsmanufacturerCombo.getSelectedItem().toString();
        model = mfsmodelCombo.getSelectedItem().toString();
        mf.settable(3, cartype, manufacturer, model, cz);
    }//GEN-LAST:event_mfs3BtnActionPerformed

    private void removeBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeBtnActionPerformed
        // TODO add your handling code here:
        try {
            // TODO add your handling code here:
            if (cz.getSelectedRow() == -1) {
                JOptionPane.showMessageDialog(null, "Please select a vehicle");
                return;
            }
            mf.remove(cz);
            DefaultTableModel model = (DefaultTableModel) cz.getModel();

            long paymentID = Reserve.genUniqueID();
            int customeID = 0;
            String phonenum = mfphonenum.getText().toString();
            double cash = Double.parseDouble(mfcsh.getText().toString());
            double credit = Double.parseDouble(mfcredit.getText().toString());
            double total = cash + credit;
            Date mfDate_upd = CommonFunc.changeDateFormat(mfchooer);
            String dropOffTime = CommonFunc.sqlTime(mfTimeHH_jSpinner, mfTimeMM_jSpinner);
            int id = 0;
            int branch_id = 0;
            int staff_id = 0;
            ConnectDB.exeQuery("select customer_id from customer where phone =" + phonenum);
            while (ConnectDB.resultSet().next()) {
                customeID = ConnectDB.resultSet().getInt("customer_id");
            }
            ConnectDB.clearResultSet();

            ConnectDB.exeQuery("select staff_id from Accounts where username='" + user + "'");
            while (ConnectDB.resultSet().next()) {
                staff_id = ConnectDB.resultSet().getInt("staff_id");
            }
            ConnectDB.clearResultSet();

            ConnectDB.exeQuery("select branch_id from Accounts where username='" + user + "'");
            while (ConnectDB.resultSet().next()) {
                branch_id = ConnectDB.resultSet().getInt("branch_id");
            }
            ConnectDB.clearResultSet();

            int row = cz.getSelectedRow();
            //   System.out.println(row);
            String vin = cz.getValueAt(row, 0).toString();
            //        System.out.println(vin);

            ConnectDB.exeUpdate(
                    "insert into payment ( payment_id, customer_id, purpose, total, cash, credit, points,"
                            + " create_time, id, branch_id, staff_id) " + "values ( " + paymentID + ",'" + customeID
                            + "','buyout','" + total + "','" + cash + "','" + credit + "'," + "'0','" + mfDate_upd
                            + " " + dropOffTime + "','" + vin + "','" + branch_id + "','" + staff_id + "')");
            ConnectDB.clearResultSet();
            model.removeRow(cz.getSelectedRow());

        } catch (ClassNotFoundException ex) {
            JOptionPane.showMessageDialog(null, ex);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex);
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(null, ex);
        } catch (ParseException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        }
        mf.showerror("Remove succefully!");
    }//GEN-LAST:event_removeBtnActionPerformed

    private void setforrentBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_setforrentBtnActionPerformed
        // TODO add your handling code here:
        try {
            // TODO add your handling code here:
            if (cz.getSelectedRow() == -1) {
                JOptionPane.showMessageDialog(null, "Please select a vehicle");
                return;
            }
            mf.sendback(cz);
            DefaultTableModel model = (DefaultTableModel) cz.getModel();
            model.removeRow(cz.getSelectedRow());
        } catch (ClassNotFoundException ex) {
            JOptionPane.showMessageDialog(null, ex);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex);
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(null, ex);
        }
        mf.showerror("back to rent succefully!");
    }//GEN-LAST:event_setforrentBtnActionPerformed

    private void mfremoveBtn1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mfremoveBtn1ActionPerformed
        // TODO add your handling code here:
        mfsetpanel.setVisible(true);
        mfremovepanel.setVisible(false);
        mfaddpanel.setVisible(false);
        jScrollPane7.setVisible(true);
        managepointjpanel.setVisible(false);
        mf2.settable(0, null, null, null, cz);
    }//GEN-LAST:event_mfremoveBtn1ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        // TODO add your handling code here:
        managepointjpanel.setVisible(true);
        mfaddpanel.setVisible(false);
        mfremovepanel.setVisible(false);
        jScrollPane7.setVisible(false);
        // removeBtn.setVisible(false);
        mfsetpanel.setVisible(false);
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jTextField2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField2ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        try {
            // TODO add your handling code here:
            mf.changepoint(Double.parseDouble(jTextField2.getText()));
        } catch (ClassNotFoundException | IOException | SQLException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        }

        mf.showerror("Confirmed!");
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField1ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        // TODO add your handling code here:
        int i = Integer.parseInt(jTextField1.getText());
        int j = Integer.parseInt(jTextField3.getText());
        try {
            mf.managepoint(i, j);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        }
        mf.showerror("Confirmed!");
    }//GEN-LAST:event_jButton4ActionPerformed

    private void mftruckCheckBox3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mftruckCheckBox3ActionPerformed
        // TODO add your handling code here:
        if (mftruckCheckBox3.isSelected()) {
            mfcarCheckBox3.setEnabled(false);
            mf3.getCar_or_truck(1);
            mfcartypeCombo3.removeAllItems();
            mf3.fillCarType(mfcartypeCombo3);
        } else if (!mftruckCheckBox3.isSelected()) {
            mfcartypeCombo3.removeAllItems();
            mfcarCheckBox3.setEnabled(true);
        }
    }//GEN-LAST:event_mftruckCheckBox3ActionPerformed

    private void mfcarCheckBox3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mfcarCheckBox3ActionPerformed
        // TODO add your handling code here:
        //  System.out.println("@@@@@@@@@@@@@");
        if (mfcarCheckBox3.isSelected()) {
            mftruckCheckBox3.setEnabled(false);
            mf3.getCar_or_truck(0);
            mfcartypeCombo3.removeAllItems();
            mf3.fillCarType(mfcartypeCombo3);
        } else if (!mfcarCheckBox3.isSelected()) {
            mfcartypeCombo3.removeAllItems();
            mftruckCheckBox3.setEnabled(true);
        }
    }//GEN-LAST:event_mfcarCheckBox3ActionPerformed

    private void mfcartypeCombo3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mfcartypeCombo3ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_mfcartypeCombo3ActionPerformed

    private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
        // TODO add your handling code here:
        //  System.out.println("'@@@@@@@!!!");

        String cartype = mfcartypeCombo3.getSelectedItem().toString();
        String ratetype = mfmanufacturerCombo3.getSelectedItem().toString();
        try {
            mf3.filloldvalue(oldvaluejlabel, cartype, ratetype, 0);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jButton10ActionPerformed

    private void newvalueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newvalueActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_newvalueActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed

        // TODO add your handling code here:
        if (newvalue.getText().isEmpty()) {
            JOptionPane.showMessageDialog(null, "please enter a value!");
            return;
        }

        String cartype = mfcartypeCombo3.getSelectedItem().toString();
        String ratetype = mfmanufacturerCombo3.getSelectedItem().toString();

        double n = Double.parseDouble(newvalue.getText());
        try {
            mf3.filloldvalue(oldvaluejlabel, cartype, ratetype, n);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        }
        mf.showerror("Confirmed!");
    }//GEN-LAST:event_jButton7ActionPerformed

    private void mfsetcartypeComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mfsetcartypeComboActionPerformed
        // TODO add your handling code here:
        mfsetmanufacturerCombo.removeAllItems();
    }//GEN-LAST:event_mfsetcartypeComboActionPerformed

    private void mfsetmanufacturerComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mfsetmanufacturerComboActionPerformed
        // TODO add your handling code here:
        mfsetmodelCombo.removeAllItems();
    }//GEN-LAST:event_mfsetmanufacturerComboActionPerformed

    private void mfset1BtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mfset1BtnActionPerformed
        // TODO add your handling code here:
        String cartype = null;
        try {
            // TODO add your handling code here:
            if (mfsetcartypeCombo.getSelectedItem() != null) {
                cartype = mfsetcartypeCombo.getSelectedItem().toString();
            }
            mf2.fillssManufacturer(mfsetmanufacturerCombo, cartype);
        } catch (ClassNotFoundException | SQLException | IOException ex) {
            JOptionPane.showMessageDialog(null, ex);
        }
        //clear the table
        // mf.clearTable(mfremoveTable);
        // mf.setsqlinfo(0,cartype, null, null);
        mf2.settable(1, cartype, null, null, cz);
    }//GEN-LAST:event_mfset1BtnActionPerformed

    private void mfset2BtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mfset2BtnActionPerformed
        // TODO add your handling code here:
        String manufacturer = null;
        String cartype = null;
        try {
            // TODO add your handling code here:
            if (mfsetmanufacturerCombo.getSelectedItem() != null) {
                manufacturer = mfsetmanufacturerCombo.getSelectedItem().toString();
            }
            if (mfsetcartypeCombo.getSelectedItem() != null) {
                cartype = mfsetcartypeCombo.getSelectedItem().toString();
            }
            mf2.fillssModel(mfsetmodelCombo, manufacturer, cartype);
            //System.out.println(manufacturer+cartype);
        } catch (ClassNotFoundException | SQLException | IOException ex) {
            JOptionPane.showMessageDialog(null, ex);
        }
        mf2.settable(2, cartype, manufacturer, role, cz);
    }//GEN-LAST:event_mfset2BtnActionPerformed

    private void mfset3BtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mfset3BtnActionPerformed
        // TODO add your handling code here:
        String cartype = null;
        String manufacturer = null;
        String model = null;
        cartype = mfsetcartypeCombo.getSelectedItem().toString();
        manufacturer = mfsetmanufacturerCombo.getSelectedItem().toString();
        model = mfsetmodelCombo.getSelectedItem().toString();
        mf2.settable(3, cartype, manufacturer, model, cz);
    }//GEN-LAST:event_mfset3BtnActionPerformed

    private void setforsaleBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_setforsaleBtnActionPerformed
        // TODO add your handling code he
        if (cz.getSelectedRow() == -1) {
            JOptionPane.showMessageDialog(null, "please select a vehicle!");
            return;
        }

        try {
            // TODO add your handling code here:
            mf2.remove(cz);
            DefaultTableModel model = (DefaultTableModel) cz.getModel();
            model.removeRow(cz.getSelectedRow());
        } catch (ClassNotFoundException | SQLException | IOException ex) {
            JOptionPane.showMessageDialog(null, ex);
        }

        mf.showerror("Set for sale succefully!");
    }//GEN-LAST:event_setforsaleBtnActionPerformed

    private void firstNameFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_firstNameFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_firstNameFieldActionPerformed

    private void lastNameFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_lastNameFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_lastNameFieldActionPerformed

    private void userNameFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_userNameFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_userNameFieldActionPerformed

    private void emailIdFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_emailIdFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_emailIdFieldActionPerformed

    private void AddEmployeeBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddEmployeeBtnActionPerformed
        try {
            //Encrypt en = new Encrypt();
            String firstName = firstNameField.getText();
            String lastName = lastNameField.getText();
            String userName = userNameField.getText();
            String email = emailIdField.getText();
            String password = crypt.encrypt(passwordField.getText());
            String branchId = branchIdCombo.getSelectedItem().toString();
            String role = clerkComboBox.getSelectedItem().toString();
            int countusers = 0;
            if (!firstName.isEmpty() && !lastName.isEmpty() && !userName.isEmpty() && !email.isEmpty()
                    && !password.isEmpty() && !role.isEmpty() && !branchId.isEmpty()) {
                try {
                    ConnectDB
                            .exeQuery("SELECT COUNT(*) AS COUNT FROM Accounts WHERE USERNAME = '" + userName + "'");
                    while (ConnectDB.resultSet().next()) {

                        countusers = Integer.parseInt(ConnectDB.resultSet().getString("COUNT"));
                    }
                    ConnectDB.clearResultSet();
                    if (countusers == 0) {
                        ConnectDB.exeUpdate("INSERT INTO Accounts VALUES ('" + email + "', '" + userName + "', '"
                                + password + "', '" + lastName + "', '" + firstName + "', '" + role + "', '"
                                + branchId + "', 0);");
                        //                 ConnectDB.exeUpdate("INSERT INTO customer VALUES (0, '"+firstName+"', '"+lastName+"', '"+address+"', '"+province+"', '"+city+"', '"+zip+"', '"+phone+"', '"+email+"');");
                        ConnectDB.clearResultSet();
                        JOptionPane.showMessageDialog(null, "Employee Created!");
                    } else {
                        JOptionPane.showMessageDialog(null, "This user name has been used already");
                    }

                } catch (ClassNotFoundException | SQLException | IOException ex) {
                    Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
                }

            } else {
                JOptionPane.showMessageDialog(null, "Should enter all the mandatory fields (*)");
            }
        } catch (Exception e) {
            JOptionPane.showMessageDialog(null, e);
        }

    }//GEN-LAST:event_AddEmployeeBtnActionPerformed

    private void clerkComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clerkComboBoxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_clerkComboBoxActionPerformed

    private void RemoveEmployeeBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RemoveEmployeeBtnActionPerformed
        if (allEmployeeTbl.getRowCount() > 0) {
            try {
                //allEmployeeTbl = new JTable(ne.getAllEmployee());
                int row = allEmployeeTbl.getSelectedRow();

                String staff_id = allEmployeeTbl.getValueAt(row, 0).toString();

                ne.delEmployee(staff_id);

                allEmployeeTbl = new JTable(ne.getAllEmployee());
                jScrollPane9.setViewportView(allEmployeeTbl);

            } catch (ClassNotFoundException | SQLException | IOException ex) {
                Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }//GEN-LAST:event_RemoveEmployeeBtnActionPerformed

    private void SearchEmployeeBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SearchEmployeeBtnActionPerformed
        try {
            allEmployeeTbl = new JTable(ne.getAllEmployee());
            jScrollPane9.setViewportView(allEmployeeTbl);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_SearchEmployeeBtnActionPerformed

    private void ModifyEmployeeBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ModifyEmployeeBtnActionPerformed
        try {
            String firstName = firstNameField.getText();
            String lastName = lastNameField.getText();
            String userName = userNameField.getText();
            String email = emailIdField.getText();
            String password;

            password = crypt.encrypt(passwordField.getText());

            String branchId = branchIdCombo.getSelectedItem().toString();
            String role = clerkComboBox.getSelectedItem().toString();
            if (!firstName.isEmpty() && !lastName.isEmpty() && !userName.isEmpty() && !email.isEmpty()
                    && !password.isEmpty() && !role.isEmpty() && !branchId.isEmpty()) {

                ne.modEmployee(password, staffid, email, userName, firstName, lastName, role, branchId);
                clearEmpFields();
            } else {
                JOptionPane.showMessageDialog(null, "Please enter all the fields");
            }
        } catch (Exception ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_ModifyEmployeeBtnActionPerformed

    public String staffid;

    private void MoveEmployeeBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MoveEmployeeBtnActionPerformed
        int row = allEmployeeTbl.getSelectedRow();

        String[] col = new String[7];
        for (int i = 0; i < 7; i++) {

            col[i] = allEmployeeTbl.getValueAt(row, i).toString();

        }
        staffid = col[0];
        emailIdField.setText(col[1]);
        userNameField.setText(col[2]);
        lastNameField.setText(col[3]);
        firstNameField.setText(col[4]);
        clerkComboBox.setSelectedItem(col[5]);
        branchIdCombo.setSelectedItem(col[6]);
        // TODO add your handling code here:
    }//GEN-LAST:event_MoveEmployeeBtnActionPerformed

    private void zipTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_zipTextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_zipTextFieldActionPerformed

    private void clubMemberCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clubMemberCheckBoxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_clubMemberCheckBoxActionPerformed

    private void Customer_RegisterBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Customer_RegisterBtnActionPerformed
        // TODO add your handling code here:

        // Create an instance of Customer Class
        Customer myCustomer = new Customer();

        // Gather information from forms
        String firstName = cusFristNameField.getText();
        String lastName = cusLastNameField.getText();
        String address = streetAddField.getText();
        String province = provinceComboBox.getSelectedItem().toString();
        String city = cityTextField.getText();
        String zip = zipTextField.getText();
        String phone = phoneTextField.getText();
        String email = emailTextField.getText();

        // set a test boolean
        boolean test = true;

        // test that all fields were completed
        if (!(!firstName.isEmpty() && !lastName.isEmpty() && !address.isEmpty() && !province.isEmpty()
                && !city.isEmpty() && !zip.isEmpty() && !phone.isEmpty() && !email.isEmpty())) {
            test = false;
            JOptionPane.showMessageDialog(null, "All text fields are required");
        }

        // test phone number
        if (test) {
            try {
                test = myCustomer.testPhone(phone);
                if (!test)
                    JOptionPane.showMessageDialog(null, "Phone number: " + phone + "\nalready registered");
                //else
                //JOptionPane.showMessageDialog(null, "Phone number: " +phone+" ACCEPTED");

            } catch (SQLException | ClassNotFoundException | IOException ex) {
                Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

        // test first name
        if (test) {
            test = myCustomer.testName(firstName);
            if (!test)
                JOptionPane.showMessageDialog(null, "First Name Rejected");
        }

        // test last name
        if (test) {
            test = myCustomer.testName(lastName);
            if (!test)
                JOptionPane.showMessageDialog(null, "Last Name Rejected");
        }

        if (test) {
            test = myCustomer.testZip(zip);
            if (!test)
                JOptionPane.showMessageDialog(null, "Zip Rejected");
        }

        // do stuff
        if (test) {
            try {
                ConnectDB.exeUpdate("INSERT INTO customer VALUES (0, '" + firstName + "', '" + lastName + "', '"
                        + city + "', '" + province + "', '" + address + "', '" + zip + "', '" + phone + "', '"
                        + email + "');");
                ConnectDB.clearResultSet();
                JOptionPane.showMessageDialog(null, "Customer Added!");

                // Add charge for club membership if applicable.
                if (clubMemberCheckBox.isSelected()) {
                    String username = CommonFunc.username;
                    // Prepare information for payment table
                    // payment_id
                    // customer_id
                    int customer_id = -1;

                    ConnectDB.exeQuery("SELECT customer_id FROM customer WHERE phone ='" + phone + "'");
                    if (ConnectDB.resultSet().next())
                        customer_id = Integer.parseInt(ConnectDB.resultSet().getString("customer_id"));

                    //JOptionPane.showMessageDialog(null, "STEP 2");
                    ConnectDB.clearResultSet();

                    // purpose
                    String purpose = "membership";

                    // total
                    double total = -1.0;

                    ConnectDB.exeQuery("SELECT fee_per_year FROM membership_fee");
                    if (ConnectDB.resultSet().next())
                        total = (Double) ConnectDB.resultSet().getObject("fee_per_year");

                    //JOptionPane.showMessageDialog(null, "STEP 3");
                    ConnectDB.clearResultSet();

                    // cash
                    // credit
                    // points
                    double points = 500;

                    // create_time
                    java.sql.Timestamp create_time = new java.sql.Timestamp(new java.util.Date().getTime());

                    // id
                    // branch_id
                    // staff_id

                    int branch_id = -1;
                    int staff_id = -1;

                    ConnectDB.exeQuery(
                            "SELECT branch_id, staff_id FROM Accounts WHERE username ='" + username + "'");
                    if (ConnectDB.resultSet().next()) {
                        branch_id = Integer.parseInt(ConnectDB.resultSet().getString("branch_id"));
                        staff_id = Integer.parseInt(ConnectDB.resultSet().getString("staff_id"));
                    }

                    //JOptionPane.showMessageDialog(null, "STEP 4");

                    ConnectDB.clearResultSet();

                    ConnectDB.exeUpdate("INSERT INTO payment VALUES (0, '" + customer_id + "', '" + purpose + "', '"
                            + total + "', '0', '" + total + "', '" + points + "', '" + create_time + "', '"
                            + customer_id + "', '" + branch_id + "', '" + staff_id + "');");

                    //JOptionPane.showMessageDialog(null, "STEP 5");

                    ConnectDB.clearResultSet();
                }
                /*
                    
                */

                //ConnectDB.clearResultSet();
                //JOptionPane.showMessageDialog(null, "Customer Added!");
            } catch (ClassNotFoundException | SQLException | IOException ex) {
                JOptionPane.showMessageDialog(null, ex);
            } //finally{
              //try {
              // ConnectDB.clearResultSet();
              //} catch (SQLException ex) {
              //    JOptionPane.showMessageDialog(null, ex);
              //}
              //}

        } else {
            //            JOptionPane.showMessageDialog(null, "Should enter all the mandatory fields (*)");
        }
    }//GEN-LAST:event_Customer_RegisterBtnActionPerformed

    private void rentPhoneNoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rentPhoneNoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_rentPhoneNoActionPerformed

    private void branchReportRentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_branchReportRentActionPerformed
        //Report1 ret = new Report1();
        Report1 ret = new Report1();
        //String query=ret.generateReportBranch(branchNameRent);
        String query = "select status,vin,category,branch_id from fleet WHERE (status='rent' and branch_id='"
                + ret.generateReportBranch(branchNameRent) + "') order by branch_id desc,category";
        //String uniinque = ret.generateReportBranch(branchNameRent);

        try {
            //String Report = "C:\\Users\\mohammad\\Documents\\NetBeansProjects\\JavaApplication1\\src\\report2.jrxml";
            JasperDesign jd = JRXmlLoader.load(System.getProperty("user.dir") + "\\src\\report3.jrxml");
            //query ="select status,vin,category,branch_id from fleet WHERE (status='rent') order by branch_id desc,category";
            //query ="select status,vin,category,branch_id from fleet WHERE (status='rent' and branch_id=unique) order by branch_id desc,category";
            //query ="select status,vin,category,branch_id from fleet WHERE (status='rent' and branch_id like '%"+unique.toString()+"%') order by branch_id desc,category";

            JRDesignQuery newQuery = new JRDesignQuery();
            newQuery.setText(query);
            jd.setQuery(newQuery);
            JasperReport JASP_REP = JasperCompileManager.compileReport(jd);

            ConnectDB.connect();
            JasperPrint JASP_PRINT = JasperFillManager.fillReport(JASP_REP, null, ConnectDB.conn);
            JasperViewer.viewReport(JASP_PRINT, false);

        } catch (JRException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);

        } catch (IOException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_branchReportRentActionPerformed

    private void branchNameRentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_branchNameRentActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_branchNameRentActionPerformed

    private void branchReportRentAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_branchReportRentAllActionPerformed

        Report1 ret = new Report1();
        //String query=ret.generateReportBranch(branchNameRent);
        String query = "select status,vin,category,branch_id from fleet WHERE (status='rent' and branch_id='"
                + ret.generateReportBranch(branchNameRent) + "') order by branch_id desc,category";
        //String uniinque = ret.generateReportBranch(branchNameRent);

        try {
            String Report = System.getProperty("user.dir") + "\\src\\report2.jrxml";
            //String Report = "C:\\Users\\mohammad\\Documents\\NetBeansProjects\\JavaApplication1\\src\\report1.jrxml";
            JasperReport JASP_REP = JasperCompileManager.compileReport(Report);

            ConnectDB.connect();
            JasperPrint JASP_PRINT = JasperFillManager.fillReport(JASP_REP, null, ConnectDB.conn);
            JasperViewer.viewReport(JASP_PRINT, false);

        } catch (JRException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);

        } catch (IOException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_branchReportRentAllActionPerformed

    private void branchReportReturnAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_branchReportReturnAllActionPerformed
        Report1 ret = new Report1();
        //String query=ret.generateReportBranch(branchNameRent);
        String query = "select status,vin,category,branch_id from fleet WHERE (status='rent' and branch_id='"
                + ret.generateReportBranch(branchNameRent) + "') order by branch_id desc,category";
        //String uniinque = ret.generateReportBranch(branchNameRent);

        try {
            String Report_new = System.getProperty("user.dir") + "\\src\\report4.jrxml";
            //String Report = "C:\\Users\\mohammad\\Documents\\NetBeansProjects\\JavaApplication1\\src\\report1.jrxml";
            JasperReport JASP_REP = JasperCompileManager.compileReport(Report_new);

            ConnectDB.connect();
            JasperPrint JASP_PRINT = JasperFillManager.fillReport(JASP_REP, null, ConnectDB.conn);
            JasperViewer.viewReport(JASP_PRINT, false);

        } catch (JRException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);

        } catch (IOException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } // TODO add your handling code here:
    }//GEN-LAST:event_branchReportReturnAllActionPerformed

    private void branchReportReturnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_branchReportReturnActionPerformed
        //Report1 ret = new Report1();
        Report1 ret = new Report1();
        //String query=ret.generateReportBranch(branchNameRent);
        //String query="select status,vin,category,branch_id from fleet WHERE (status='rent' and branch_id='"+ret.generateReportBranch(branchNameRent)+"') order by branch_id desc,category";
        String query1 = "select res.status, res.vin, res.branch_id, fl.category from reserve as res inner join fleet as fl on res.vin=fl.vin where (res.status= 'returned' and res.branch_id=1) order by fl.category";
        //String uniinque = ret.generateReportBranch(branchNameRent);

        try {
            //String Report = "C:\\Users\\mohammad\\Documents\\NetBeansProjects\\JavaApplication1\\src\\report2.jrxml";
            JasperDesign jd = JRXmlLoader.load(System.getProperty("user.dir") + "\\src\\report5.jrxml");
            //query ="select status,vin,category,branch_id from fleet WHERE (status='rent') order by branch_id desc,category";
            //query ="select status,vin,category,branch_id from fleet WHERE (status='rent' and branch_id=unique) order by branch_id desc,category";
            //query ="select status,vin,category,branch_id from fleet WHERE (status='rent' and branch_id like '%"+unique.toString()+"%') order by branch_id desc,category";

            JRDesignQuery newQuery = new JRDesignQuery();
            newQuery.setText(query1);
            jd.setQuery(newQuery);
            JasperReport JASP_REP = JasperCompileManager.compileReport(jd);

            ConnectDB.connect();
            JasperPrint JASP_PRINT = JasperFillManager.fillReport(JASP_REP, null, ConnectDB.conn);
            JasperViewer.viewReport(JASP_PRINT, false);

        } catch (JRException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);

        } catch (IOException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(SuperRent.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_branchReportReturnActionPerformed

    private void branchNameReturnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_branchNameReturnActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_branchNameReturnActionPerformed

    private void rentRemove() {
        rentConfirmationNO.setText("");
        rentPhoneNo.setText("");
        dlNumField.setText("");
        ccNumField.setText("");
        expDateCh.setDate(null);
        reservedVehiTable.setModel(new javax.swing.table.DefaultTableModel(new Object[100][7], new String[] {
                "confirmation_no", "vin", "customer_id", "phone", "pickup_time", "dropoff_time", "status" }));
        jScrollPane8.setViewportView(reservedVehiTable);

    }

    private void initRent() throws ClassNotFoundException, SQLException, IOException {

        rt.fillBranchIDCombo(brnchIdCombo);
        pickupHour.setValue(now.get(Calendar.HOUR_OF_DAY));
        pickupMin.setValue(now.get(Calendar.MINUTE));

    }

    private void initEmployee() throws ClassNotFoundException, SQLException, IOException {

        rt.fillBranchIDCombo(branchIdCombo);

    }

    private void initReturn() throws ClassNotFoundException, SQLException, IOException {
        ReturnTimeHH_jSpinner1.setValue(now.get(Calendar.HOUR_OF_DAY));
        ReturnDate_jDateChooser3.setDate(now.getTime());

    }

    private void initManageFleet() throws ClassNotFoundException, SQLException, IOException {
        mfcartypeCombo.removeAllItems();
        mfmanufacturerCombo.removeAllItems();
        mfbranchCombo.removeAllItems();
        mfcolorCombo.removeAllItems();
        mfscartypeCombo.removeAllItems();
        mfsmanufacturerCombo.removeAllItems();
        mfsmodelCombo.removeAllItems();
        mfsetcartypeCombo.removeAllItems();
        mfsetmanufacturerCombo.removeAllItems();
        mfsetmodelCombo.removeAllItems();
        mfmanufacturerCombo3.removeAllItems();
        mfcartypeCombo3.removeAllItems();
        mfeqpcombo.removeAllItems();
        mfothermnfTextField.setVisible(false);
        mfotherclTextField.setVisible(false);
        mfaddpanel.setVisible(false);
        mfremovepanel.setVisible(false);
        mfsetpanel.setVisible(false);
        jScrollPane7.setVisible(false);
        managepointjpanel.setVisible(false);

        mf.fillManufacturer(mfmanufacturerCombo);
        mf.fillBranch(mfbranchCombo);
        mf.fillColor(mfcolorCombo);
        mf.fillsCarType(mfscartypeCombo);
        mf2.fillsCarType(mfsetcartypeCombo);
        mf2.fillBranch(mfbranchCombo);
        mf2.fillColor(mfcolorCombo);
        mf3.fillratetype(mfmanufacturerCombo3);
        mf.filleqp(mfeqpcombo);
        if (mfcarCheckBox.isSelected()) {
            mf.getCar_or_truck(0);
        } else if (mftruckCheckBox.isSelected()) {
            mf.getCar_or_truck(1);
        }
    }

    /**
     * @param args the command line arguments
     */

    //private javax.swing.JPasswordField jTextField3;
    SpinnerModel modelPickHH = new SpinnerNumberModel(0, 0, 23, 1);
    SpinnerModel modelPickMM = new SpinnerNumberModel(0, 0, 59, 1);
    SpinnerModel modelDropHH = new SpinnerNumberModel(0, 0, 23, 1);
    SpinnerModel modelDropMM = new SpinnerNumberModel(0, 0, 59, 1);
    NewEmployee ne = new NewEmployee();
    Calendar now = Calendar.getInstance();
    private Reserve rt = new Reserve();
    private String role;

    private Rent rent = new Rent();

    // Alex added

    // Yaoyao added
    private Return MyReturn = new Return();
    private ArrayList<String> equipSelected = new ArrayList<String>();
    private HashMap<String, Integer> equipSelectedUnits = new HashMap<String, Integer>();
    private ManageFleet mf = new ManageFleet("sale");
    private ManageFleet mf2 = new ManageFleet("rent");
    private ManageFleet mf3 = new ManageFleet("setrate");
    //private String role;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton AddEmployeeBtn;
    private javax.swing.JButton Customer_RegisterBtn;
    private javax.swing.JButton ModifyEmployeeBtn;
    private javax.swing.JTabbedPane ModulesTab;
    private javax.swing.JButton MoveEmployeeBtn;
    private javax.swing.JPanel NewEmployee;
    private javax.swing.JButton RemoveEmployeeBtn;
    private javax.swing.JPanel Rent;
    private javax.swing.JButton ReturnCalculate_jButton6;
    private javax.swing.JTextField ReturnCash_jTextField2;
    private javax.swing.JTable ReturnCheckOverDueDis_jTable2;
    private javax.swing.JButton ReturnCheckOverDue_jButton2;
    private javax.swing.JButton ReturnCheck_jButton2;
    private javax.swing.JTextField ReturnCreditCard_jTextField1;
    private javax.swing.JLabel ReturnCustomerPnobeNum_jLabel9;
    private com.toedter.calendar.JDateChooser ReturnDate_jDateChooser3;
    private javax.swing.JLabel ReturnDate_jLabel19;
    private javax.swing.JTable ReturnDisplayFee_jTable2;
    private javax.swing.JTable ReturnDisplay_jTable2;
    private javax.swing.JTextField ReturnFuelReading_jTextField2;
    private javax.swing.JLabel ReturnOdoRead_jLabel23;
    private javax.swing.JTextField ReturnOdometer_jTextField9;
    private javax.swing.JButton ReturnPay_jButton2;
    private javax.swing.JCheckBox ReturnRedeem_jCheckBox1;
    private javax.swing.JCheckBox ReturnRoadStar_jCheckBox2;
    private javax.swing.JSpinner ReturnTimeHH_jSpinner1;
    private javax.swing.JSpinner ReturnTimeMM_jSpinner1;
    private javax.swing.JLabel ReturnTime_jLabel20;
    private javax.swing.JLabel ReturnTime_jLabel21;
    private javax.swing.JTextField ReturnVin_jTextField8;
    private javax.swing.JButton SearchEmployeeBtn;
    private javax.swing.JButton addBtn;
    private javax.swing.JButton addEquipBtn;
    private javax.swing.JTable allEmployeeTbl;
    private javax.swing.JComboBox branchIdCombo;
    private javax.swing.JLabel branchIdLbl;
    private javax.swing.JTextField branchNameRent;
    private javax.swing.JTextField branchNameReturn;
    private javax.swing.JButton branchReportRent;
    private javax.swing.JButton branchReportRentAll;
    private javax.swing.JButton branchReportReturn;
    private javax.swing.JButton branchReportReturnAll;
    private javax.swing.JComboBox brnchIdCombo;
    private javax.swing.JLabel brnchIdLbl;
    private javax.swing.JButton cancelConfirmation;
    private com.toedter.calendar.JDateChooser cancelDropoff;
    private javax.swing.JTextField cancelPhoneField;
    private com.toedter.calendar.JDateChooser cancelPickupDt;
    private javax.swing.JTextField cancelReservationField;
    private javax.swing.JComboBox cardTypeCombo;
    private javax.swing.JLabel cardTypeLbl;
    private javax.swing.JTextField ccNumField;
    private javax.swing.JLabel ccNumLbl;
    private javax.swing.JTextField cityTextField;
    private javax.swing.JComboBox clerkComboBox;
    private javax.swing.JCheckBox clubMemberCheckBox;
    private javax.swing.JTextField confirmationNoDisplayField;
    private javax.swing.JTextField cusFristNameField;
    private javax.swing.JTextField cusLastNameField;
    private javax.swing.JTextField cusNumField1;
    private javax.swing.JLabel cusNumLbl1;
    private javax.swing.JTable cz;
    private javax.swing.JTextField dlNumField;
    private javax.swing.JLabel dlNumLbl;
    private com.toedter.calendar.JDateChooser dropOffDate;
    private javax.swing.JSpinner dropoffHHSpin;
    private javax.swing.JSpinner dropoffMMSpin;
    private javax.swing.JTextField emailIdField;
    private javax.swing.JLabel emailIdLbl;
    private javax.swing.JTextField emailTextField;
    private javax.swing.JList equipmentsList;
    private javax.swing.JTextField estimatePrice;
    private com.toedter.calendar.JDateChooser expDateCh;
    private javax.swing.JLabel expDateLbl;
    private javax.swing.JTextField firstNameField;
    private javax.swing.JLabel firstnameLbl;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton15;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel49;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel50;
    private javax.swing.JLabel jLabel51;
    private javax.swing.JLabel jLabel52;
    private javax.swing.JLabel jLabel53;
    private javax.swing.JLabel jLabel54;
    private javax.swing.JLabel jLabel55;
    private javax.swing.JLabel jLabel56;
    private javax.swing.JLabel jLabel57;
    private javax.swing.JLabel jLabel58;
    private javax.swing.JLabel jLabel59;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel60;
    private javax.swing.JLabel jLabel61;
    private javax.swing.JLabel jLabel62;
    private javax.swing.JLabel jLabel63;
    private javax.swing.JLabel jLabel64;
    private javax.swing.JLabel jLabel65;
    private javax.swing.JLabel jLabel66;
    private javax.swing.JLabel jLabel67;
    private javax.swing.JLabel jLabel68;
    private javax.swing.JLabel jLabel69;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel70;
    private javax.swing.JLabel jLabel71;
    private javax.swing.JLabel jLabel72;
    private javax.swing.JLabel jLabel73;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLayeredPane jLayeredPane1;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField lastNameField;
    private javax.swing.JLabel lastNameLbl;
    private javax.swing.JButton loginBtn;
    private javax.swing.JPanel loginpanel;
    private javax.swing.JPanel manageCustomer;
    private javax.swing.JPanel manageFleet;
    private javax.swing.JPanel managepointjpanel;
    private javax.swing.JSpinner mfTimeHH_jSpinner;
    private javax.swing.JSpinner mfTimeMM_jSpinner;
    private javax.swing.JPanel mfaddpanel;
    private javax.swing.JTextField mfbranch;
    private javax.swing.JComboBox mfbranchCombo;
    private javax.swing.JCheckBox mfcarCheckBox;
    private javax.swing.JCheckBox mfcarCheckBox3;
    private javax.swing.JComboBox mfcartypeCombo;
    private javax.swing.JComboBox mfcartypeCombo3;
    private com.toedter.calendar.JDateChooser mfchooer;
    private javax.swing.JComboBox mfcolorCombo;
    private javax.swing.JTextField mfcredit;
    private javax.swing.JTextField mfcsh;
    private javax.swing.JComboBox mfeqpcombo;
    private javax.swing.JComboBox mfmanufacturerCombo;
    private javax.swing.JComboBox mfmanufacturerCombo3;
    private javax.swing.JTextField mfmodelTextField;
    private javax.swing.JTextField mfnumber;
    private javax.swing.JTextField mfotherclTextField;
    private javax.swing.JTextField mfothermnfTextField;
    private javax.swing.JTextField mfotoTextField;
    private javax.swing.JTextField mfphonenum;
    private javax.swing.JButton mfremoveBtn;
    private javax.swing.JButton mfremoveBtn1;
    private javax.swing.JPanel mfremovepanel;
    private javax.swing.JButton mfs1Btn;
    private javax.swing.JButton mfs2Btn;
    private javax.swing.JButton mfs3Btn;
    private javax.swing.JComboBox mfscartypeCombo;
    private javax.swing.JButton mfset1Btn;
    private javax.swing.JButton mfset2Btn;
    private javax.swing.JButton mfset3Btn;
    private javax.swing.JComboBox mfsetcartypeCombo;
    private javax.swing.JComboBox mfsetmanufacturerCombo;
    private javax.swing.JComboBox mfsetmodelCombo;
    private javax.swing.JPanel mfsetpanel;
    private javax.swing.JComboBox mfsmanufacturerCombo;
    private javax.swing.JComboBox mfsmodelCombo;
    private javax.swing.JCheckBox mftruckCheckBox;
    private javax.swing.JCheckBox mftruckCheckBox3;
    private javax.swing.JTextField mfvinTextField;
    private javax.swing.JTextField mfyearTextField;
    private javax.swing.JPanel modulepane;
    private javax.swing.JTextField newvalue;
    private javax.swing.JLabel oldvaluejlabel;
    private javax.swing.JTextField passwordField;
    private javax.swing.JLabel passwordLbl;
    private javax.swing.JTextField phoneTextField;
    private com.toedter.calendar.JDateChooser pickupDt;
    private javax.swing.JSpinner pickupHour;
    private javax.swing.JSpinner pickupMin;
    private javax.swing.JComboBox provinceComboBox;
    private javax.swing.JTextField pwdField;
    private javax.swing.JButton removeBtn;
    private javax.swing.JButton removeEquipBtn;
    private javax.swing.JButton rentBtn;
    private javax.swing.JTextField rentConfirmationNO;
    private javax.swing.JTextField rentPhoneNo;
    private javax.swing.JButton rentbtn;
    private javax.swing.JPanel reportGenerate;
    private javax.swing.JPanel reservePanel;
    private javax.swing.JTable reservedVehiTable;
    private javax.swing.JButton resetAll;
    private javax.swing.JButton resetBtn;
    private javax.swing.JPanel returnVehicles;
    private javax.swing.ButtonGroup roleGroupRadio;
    private javax.swing.JLabel roleLbl;
    private javax.swing.JButton searchBtn;
    private javax.swing.JButton searchEqupBtn;
    private javax.swing.JList selectedList;
    private javax.swing.JButton serachRnt;
    private javax.swing.JButton setforrentBtn;
    private javax.swing.JButton setforsaleBtn;
    private javax.swing.JTextField streetAddField;
    private javax.swing.JTable unreservedVehiTable;
    private javax.swing.JTextField userField;
    private javax.swing.JTextField userNameField;
    private javax.swing.JLabel userNameLbl;
    private javax.swing.JComboBox vehicleCatCombo;
    private javax.swing.JComboBox vehicleTypeCombo;
    private javax.swing.JTextField zipTextField;
    // End of variables declaration//GEN-END:variables
}