<repo_name>LeQuangVinh0201/VaccineProject<file_sep>/QLVaccine/src/main/java/com/softech/FrameApp/ui/User/Home.java
/*
 * 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.
 */
package com.softech.FrameApp.ui.User;

/**
 *
 * @author leduc
 */
public class Home extends javax.swing.JPanel {

    /**
     * Creates new form Home
     */
    public Home() {
        initComponents();
    }

    /**
     * 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() {

        jpnHome = new javax.swing.JPanel();
        jpnPersonalInfo = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jSeparator4 = new javax.swing.JSeparator();
        jpnCertification = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jSeparator3 = new javax.swing.JSeparator();
        jpnSchedule = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jSeparator2 = new javax.swing.JSeparator();

        jpnHome.setBackground(new java.awt.Color(204, 255, 204));

        jpnPersonalInfo.setBackground(new java.awt.Color(0, 204, 204));
        jpnPersonalInfo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jpnPersonalInfoMouseClicked(evt);
            }
        });

        jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/softech/appqlsv/icons/calendar (1).png"))); // NOI18N

        jLabel8.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
        jLabel8.setForeground(new java.awt.Color(255, 255, 255));
        jLabel8.setText("Thông tin cá nhân");

        jSeparator4.setOrientation(javax.swing.SwingConstants.VERTICAL);

        javax.swing.GroupLayout jpnPersonalInfoLayout = new javax.swing.GroupLayout(jpnPersonalInfo);
        jpnPersonalInfo.setLayout(jpnPersonalInfoLayout);
        jpnPersonalInfoLayout.setHorizontalGroup(
            jpnPersonalInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpnPersonalInfoLayout.createSequentialGroup()
                .addGap(27, 27, 27)
                .addComponent(jLabel7)
                .addGap(18, 18, 18)
                .addComponent(jSeparator4, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel8)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jpnPersonalInfoLayout.setVerticalGroup(
            jpnPersonalInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpnPersonalInfoLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jpnPersonalInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpnPersonalInfoLayout.createSequentialGroup()
                        .addGroup(jpnPersonalInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jSeparator4, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel7))
                        .addGap(32, 32, 32))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpnPersonalInfoLayout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addGap(83, 83, 83))))
        );

        jpnCertification.setBackground(new java.awt.Color(153, 153, 255));

        jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/softech/appqlsv/icons/calendar (1).png"))); // NOI18N

        jLabel6.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
        jLabel6.setForeground(new java.awt.Color(255, 255, 255));
        jLabel6.setText("Chứng nhận ");

        jSeparator3.setOrientation(javax.swing.SwingConstants.VERTICAL);

        javax.swing.GroupLayout jpnCertificationLayout = new javax.swing.GroupLayout(jpnCertification);
        jpnCertification.setLayout(jpnCertificationLayout);
        jpnCertificationLayout.setHorizontalGroup(
            jpnCertificationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpnCertificationLayout.createSequentialGroup()
                .addGap(27, 27, 27)
                .addComponent(jLabel5)
                .addGap(18, 18, 18)
                .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel6)
                .addContainerGap(54, Short.MAX_VALUE))
        );
        jpnCertificationLayout.setVerticalGroup(
            jpnCertificationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpnCertificationLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jpnCertificationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpnCertificationLayout.createSequentialGroup()
                        .addGroup(jpnCertificationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel5))
                        .addGap(32, 32, 32))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpnCertificationLayout.createSequentialGroup()
                        .addComponent(jLabel6)
                        .addGap(83, 83, 83))))
        );

        jpnSchedule.setBackground(new java.awt.Color(255, 102, 153));

        jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/softech/appqlsv/icons/calendar (1).png"))); // NOI18N

        jLabel4.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
        jLabel4.setForeground(new java.awt.Color(255, 255, 255));
        jLabel4.setText("<NAME>");

        jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);

        javax.swing.GroupLayout jpnScheduleLayout = new javax.swing.GroupLayout(jpnSchedule);
        jpnSchedule.setLayout(jpnScheduleLayout);
        jpnScheduleLayout.setHorizontalGroup(
            jpnScheduleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpnScheduleLayout.createSequentialGroup()
                .addGap(27, 27, 27)
                .addComponent(jLabel3)
                .addGap(18, 18, 18)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel4)
                .addContainerGap(105, Short.MAX_VALUE))
        );
        jpnScheduleLayout.setVerticalGroup(
            jpnScheduleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpnScheduleLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jpnScheduleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3))
                .addGap(32, 32, 32))
            .addGroup(jpnScheduleLayout.createSequentialGroup()
                .addGap(59, 59, 59)
                .addComponent(jLabel4)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jpnHomeLayout = new javax.swing.GroupLayout(jpnHome);
        jpnHome.setLayout(jpnHomeLayout);
        jpnHomeLayout.setHorizontalGroup(
            jpnHomeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpnHomeLayout.createSequentialGroup()
                .addGap(56, 56, 56)
                .addComponent(jpnPersonalInfo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(46, 46, 46)
                .addComponent(jpnSchedule, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(51, 51, 51)
                .addComponent(jpnCertification, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(62, Short.MAX_VALUE))
        );
        jpnHomeLayout.setVerticalGroup(
            jpnHomeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpnHomeLayout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(jpnHomeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jpnCertification, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jpnPersonalInfo, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jpnSchedule, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(746, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jpnHome, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jpnHome, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents

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

    }//GEN-LAST:event_jpnPersonalInfoMouseClicked

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator4;
    private javax.swing.JPanel jpnCertification;
    private javax.swing.JPanel jpnHome;
    private javax.swing.JPanel jpnPersonalInfo;
    private javax.swing.JPanel jpnSchedule;
    // End of variables declaration//GEN-END:variables
}
<file_sep>/QLVaccine/src/main/java/com/softech/FrameApp/ui/Login_Register/RegisterUser.java
/*
 * 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.
 */
package com.softech.FrameApp.ui.Login_Register;

import com.softech.Login.userDAO;
import com.softech.Login.userLogin;
import java.awt.Color;
import javax.swing.JOptionPane;

/**
 *
 * @author leduc
 */
public class RegisterUser extends javax.swing.JPanel {

    /**
     * Creates new form RegisterUser1
     */
    public RegisterUser() {
        initComponents();
    }

    /**
     * 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() {

        jpnRegister = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        txtEmail = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        txtPassword = new javax.swing.JPasswordField();
        txtfullName = new javax.swing.JTextField();
        txtConfirmPassword = new <PASSWORD>.swing.JPasswordField();
        jSeparator1 = new javax.swing.JSeparator();
        btnRegister = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JSeparator();
        txtPhoneNumber = new javax.swing.JFormattedTextField();

        setPreferredSize(new java.awt.Dimension(650, 470));

        jLabel3.setFont(new java.awt.Font("Arial", 1, 30)); // NOI18N
        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel3.setText("Đăng ký");

        jLabel4.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel4.setText("Vui lòng cung cấp thông tin chính xác");

        txtEmail.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
        txtEmail.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtEmailKeyPressed(evt);
            }
        });

        jLabel5.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        jLabel5.setText("Họ và tên:");

        jLabel8.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        jLabel8.setText("Số điện thoại:");

        jLabel9.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        jLabel9.setText("Email:");

        jLabel6.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        jLabel6.setText("Mật khẩu:");

        jLabel7.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        jLabel7.setText("Xác nhận mật khẩu");

        txtPassword.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtPasswordActionPerformed(evt);
            }
        });
        txtPassword.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtPasswordKeyPressed(evt);
            }
        });

        txtfullName.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
        txtfullName.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtfullNameKeyPressed(evt);
            }
        });

        txtConfirmPassword.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtConfirmPasswordActionPerformed(evt);
            }
        });
        txtConfirmPassword.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtConfirmPasswordKeyPressed(evt);
            }
        });

        btnRegister.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
        btnRegister.setText("Đăng ký");
        btnRegister.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnRegisterActionPerformed(evt);
            }
        });

        try {
            txtPhoneNumber.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##########")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        javax.swing.GroupLayout jpnRegisterLayout = new javax.swing.GroupLayout(jpnRegister);
        jpnRegister.setLayout(jpnRegisterLayout);
        jpnRegisterLayout.setHorizontalGroup(
            jpnRegisterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpnRegisterLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btnRegister, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(139, 139, 139))
            .addGroup(jpnRegisterLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpnRegisterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 417, Short.MAX_VALUE)
                    .addGroup(jpnRegisterLayout.createSequentialGroup()
                        .addGroup(jpnRegisterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jSeparator1)
                            .addComponent(txtConfirmPassword)
                            .addComponent(txtPassword)
                            .addComponent(txtEmail, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(txtfullName)
                            .addComponent(jSeparator2, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jpnRegisterLayout.createSequentialGroup()
                                .addGroup(jpnRegisterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel5)
                                    .addComponent(jLabel8)
                                    .addComponent(jLabel9)
                                    .addComponent(jLabel6)
                                    .addComponent(jLabel7))
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addComponent(txtPhoneNumber))
                        .addContainerGap())))
        );
        jpnRegisterLayout.setVerticalGroup(
            jpnRegisterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpnRegisterLayout.createSequentialGroup()
                .addGap(16, 16, 16)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(21, 21, 21)
                .addComponent(jLabel5)
                .addGap(18, 18, 18)
                .addComponent(txtfullName, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel8)
                .addGap(18, 18, 18)
                .addComponent(txtPhoneNumber, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel9)
                .addGap(18, 18, 18)
                .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(txtPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(25, 25, 25)
                .addComponent(jLabel7)
                .addGap(18, 18, 18)
                .addComponent(txtConfirmPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(16, 16, 16)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(btnRegister)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jpnRegister, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jpnRegister, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents

    private void txtfullNameKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtfullNameKeyPressed
        txtfullName.setBackground(Color.white);
    }//GEN-LAST:event_txtfullNameKeyPressed

    private void btnRegisterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRegisterActionPerformed
        try {
            userLogin admin = new userLogin();
            admin.setUsername(txtPhoneNumber.getText());
            admin.setPassword(new String(txtPassword.getPassword()));
            admin.setFullname(txtfullName.getText());
            admin.setEmail(txtEmail.getText());

            String username = txtPhoneNumber.getText();
            String fullname = txtfullName.getText();
            String comfirmP = new String(txtConfirmPassword.getPassword());
            String password = new String(txtPassword.getPassword());
            String email = txtEmail.getText();

            if (username.equals("")) {
                JOptionPane.showMessageDialog(this, "vui lòng điền thông tin");
                txtPhoneNumber.setBackground(Color.red);
                txtfullName.setBackground(Color.red);
                txtEmail.setBackground(Color.red);
                txtPassword.setBackground(Color.red);
                txtConfirmPassword.setBackground(Color.red);
            } else {
                if (comfirmP.equals(password)) {
                    if (email.contains("<EMAIL>")) {
                        userDAO dao = new userDAO();
                        dao.insert(admin);
                        JOptionPane.showMessageDialog(this, "đăng ký thành công!");
                    } else {
                        txtEmail.setBackground(Color.red);
                        JOptionPane.showMessageDialog(this, "email không đúng");
                    }
                } else {
                    txtConfirmPassword.setBackground(Color.red);
                    JOptionPane.showMessageDialog(this, "password is correct");
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            JOptionPane.showMessageDialog(this, "Error :" + e);
        }
    }//GEN-LAST:event_btnRegisterActionPerformed

    private void txtEmailKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtEmailKeyPressed
        txtEmail.setBackground(Color.white);
    }//GEN-LAST:event_txtEmailKeyPressed

    private void txtPasswordKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtPasswordKeyPressed
        txtPassword.setBackground(Color.white);
    }//GEN-LAST:event_txtPasswordKeyPressed

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

    private void txtConfirmPasswordKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtConfirmPasswordKeyPressed
        txtConfirmPassword.setBackground(Color.white);
    }//GEN-LAST:event_txtConfirmPasswordKeyPressed

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


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnRegister;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JPanel jpnRegister;
    private javax.swing.JPasswordField txtConfirmPassword;
    private javax.swing.JTextField txtEmail;
    private javax.swing.JPasswordField txtPassword;
    private javax.swing.JFormattedTextField txtPhoneNumber;
    private javax.swing.JTextField txtfullName;
    // End of variables declaration//GEN-END:variables
}
<file_sep>/QLVaccine/src/main/java/com/softech/user/dao/NguoiDanDao.java
/*
 * 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.
 */
package com.softech.user.dao;

import com.softech.ConnectDB.connectDbManagerVaccine;
import com.softech.FrameApp.ui.Login_Register.Login;
import com.softech.user.model.NguoiDan;
import java.sql.Blob;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.sql.rowset.serial.SerialBlob;

/**
 *
 * @author PC
 */
public class NguoiDanDao {

    
    public boolean update(NguoiDan nd)
            throws Exception {
        String sql = "UPDATE dbo.NguoiTiem"+ " SET name = ?,gender = ?,dateOfBirth = ?,identification_ID = ?, bhyt_number = ?, email= ?, address = ?, image = ?"
                + " WHERE userName_phoneNumber = ?";
        try (
                 Connection con = connectDbManagerVaccine.OpenConnection();  PreparedStatement pstmt = con.prepareStatement(sql);) {
            pstmt.setString(1, nd.getName());
            pstmt.setInt(2, nd.getGender());
            pstmt.setString(3, nd.getDateOfBirth());
            pstmt.setString(4, nd.getIdentification_ID());
            pstmt.setString(5, nd.getBhyt_number());
            pstmt.setString(6, nd.getEmail());
            pstmt.setString(7, nd.getAddress());
            pstmt.setString(9, nd.getUserName_phoneNumber());
            
            if (nd.getImage()!= null) {
                Blob hinh = new SerialBlob(nd.getImage());
                pstmt.setBlob(8, hinh);
            } else {
                Blob hinh = null;
                pstmt.setBlob(8, hinh);
            }
            

            return pstmt.executeUpdate() > 0; // neu lon hon 0 return true, nguoc lai return false

        }
    }
    
    public boolean delete(String userName_phoneNumber)
            throws Exception {
         // phai co 1 khoang trang sau "  , khong thoi se loi sql
        String sql = "delete from VaccineApp" +
                     " where userName_phoneNumber = ?";
        try (
                 Connection con = connectDbManagerVaccine.OpenConnection(); 
                PreparedStatement pstmt = con.prepareStatement(sql);
            ){
            pstmt.setString(1, userName_phoneNumber);
           
            return pstmt.executeUpdate() > 0; // neu lon hon 0 return true, nguoc lai return false

        }
    }
    
    public NguoiDan findByUserName(String userName)
            throws Exception {
         // phai co 1 khoang trang sau "  , khong thoi se loi sql
        String sql = "select *, CONVERT(varchar,NguoiTiem.dateOfBirth,103) as newDateOfBirth"
                + " from NguoiTiem where UserName_phoneNumber = ?";
        
        try (
                 Connection con = connectDbManagerVaccine.OpenConnection(); 
                PreparedStatement pstmt = con.prepareStatement(sql);
                
            ){
            pstmt.setString(1, userName);
            
            try(ResultSet rs = pstmt.executeQuery()){
                if(rs.next()){
                   NguoiDan nd = new NguoiDan();
                   
                    nd.setName(rs.getString("name"));
                    nd.setDateOfBirth(rs.getString("newDateOfBirth"));
                    nd.setIdentification_ID(rs.getString("identification_ID"));
                    nd.setEmail(rs.getString("email"));
                    nd.setAddress(rs.getString("address"));
                    nd.setGender(rs.getInt("gender"));
                    nd.setBhyt_number(rs.getString("bhyt_number"));
                    Blob blob =rs.getBlob("image");
                    if(blob != null){
                    nd.setImage(blob.getBytes(1, (int) blob.length()));
        }
                   
                   return nd;
                }
            
            }
            return null;
        }
    }
    
    public int getCertificattion(String userName)
            throws Exception {
         // phai co 1 khoang trang sau "  , khong thoi se loi sql
        String sql = "select * from NguoiTiem, LichTiem where UserName_phoneNumber = ?";
        
        try (
                 Connection con = connectDbManagerVaccine.OpenConnection(); 
                PreparedStatement pstmt = con.prepareStatement(sql);
                
            ){
            pstmt.setString(1, userName);
            
            try(ResultSet rs = pstmt.executeQuery()){
                int max = 0;
                while (rs.next()) {
                    if (rs.getInt("confirmation") == 0) {
                        if (max > 0) {
                            return max;
                        } else {
                            max = 0;
                        }
                    } else {
                        if (rs.getInt("shot") == 1) {
                            max = 1;
                        } else {
                            max = 2;
                            break;
                        }

                    }
                }
                return max;
            }

        }
         
      }
        
        
}
    
    
    
<file_sep>/QLVaccine/src/main/java/com/softech/FrameApp/ui/Login_Register/Login.java
/*
 * 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.
 */
package com.softech.FrameApp.ui.Login_Register;

import com.softech.FrameApp.ui.Admin.MainJFrameAdmin;
import com.softech.FrameApp.ui.User.MainJFrameUser;
import com.softech.Login.userDAO;
import com.softech.Login.userLogin;
import java.awt.Color;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JTabbedPane;

/*
 * 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.
 *//**
 *
 * @author leduc
 */
public class Login extends javax.swing.JPanel {

    private userDAO udao = new userDAO();
    public static String username_verified;

    /**
     * Creates new form RegisterUser1
     */
    public Login() {
        initComponents();
        
    }

    public Login(JFrame jFrame, boolean b) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    /**
     * 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() {

        jPanel1 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel6 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        btnRegister = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JSeparator();
        txtPassword = new javax.swing.JPasswordField();
        jSeparator3 = new javax.swing.JSeparator();
        jcheckAdmin = new javax.swing.JCheckBox();
        txtUserName = new javax.swing.JFormattedTextField();

        setPreferredSize(new java.awt.Dimension(427, 743));

        jPanel1.setBackground(new java.awt.Color(102, 255, 204));

        jLabel3.setFont(new java.awt.Font("Arial", 1, 30)); // NOI18N
        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel3.setText("Đăng nhập");

        jLabel4.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel4.setText("Vui lòng cung cấp thông tin chính xác");

        jSeparator1.setBackground(new java.awt.Color(0, 0, 0));

        jLabel6.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        jLabel6.setText("Mật khẩu:");

        jLabel8.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        jLabel8.setText("Số điện thoại:");

        btnRegister.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
        btnRegister.setText("Đăng nhập");
        btnRegister.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnRegisterActionPerformed(evt);
            }
        });

        txtPassword.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtPasswordActionPerformed(evt);
            }
        });
        txtPassword.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtPasswordKeyPressed(evt);
            }
        });

        jSeparator3.setBackground(new java.awt.Color(0, 0, 0));

        jcheckAdmin.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
        jcheckAdmin.setText("Truy cập quyền Admin");
        jcheckAdmin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcheckAdminActionPerformed(evt);
            }
        });

        try {
            txtUserName.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##########")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        txtUserName.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                txtUserNameMouseExited(evt);
            }
        });
        txtUserName.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtUserNameActionPerformed(evt);
            }
        });
        txtUserName.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtUserNameKeyPressed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 7, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnRegister, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jSeparator1)
                            .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 407, Short.MAX_VALUE)
                            .addComponent(txtUserName)
                            .addComponent(txtPassword)
                            .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jSeparator3)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel8)
                                    .addComponent(jLabel6))
                                .addGap(0, 0, Short.MAX_VALUE))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jcheckAdmin)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(45, 45, 45)
                .addComponent(jLabel3)
                .addGap(29, 29, 29)
                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel8)
                .addGap(18, 18, 18)
                .addComponent(txtUserName, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel6)
                .addGap(18, 18, 18)
                .addComponent(txtPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(40, 40, 40)
                .addComponent(jcheckAdmin)
                .addGap(18, 18, 18)
                .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 112, Short.MAX_VALUE)
                .addComponent(btnRegister)
                .addGap(37, 37, 37)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(76, 76, 76))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void btnRegisterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRegisterActionPerformed
        try {
            if (txtUserName.getText().equals("")) {
                txtUserName.setBackground(Color.red);
                txtPassword.setBackground(Color.red);
            } else {
                if (jcheckAdmin.isSelected()) {
                    userLogin admin = udao.findbyAdmin(txtUserName.getText());
                    if (admin != null) {
                        String password = new String(txtPassword.getPassword());
                        String passwordCurrent = admin.getPassword();
                        if (passwordCurrent.equals(password)) {
                            JOptionPane.showMessageDialog(this, "đăng nhập thành công");
                            MainJFrameAdmin mainJFrameAdmin = new MainJFrameAdmin();
                            mainJFrameAdmin.setVisible(true);
                            mainJFrameAdmin.pack();
                            mainJFrameAdmin.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                        } else {
                            JOptionPane.showMessageDialog(this, "tài khoản hoặc đăng nhập không đúng !");
                        }
                    } else {
                        JOptionPane.showMessageDialog(this, "tài khoản hoặc đăng nhập không đúng !");
                    }
                } else {
                    userLogin user = udao.findbyUser(txtUserName.getText());
                    if (user != null) {
                        String password = new String(txtPassword.getPassword());
                        String passwordCurrent = user.getPassword();
                        if (passwordCurrent.equals(password)) {
                            JOptionPane.showMessageDialog(this, "đăng nhập thành công");
                            MainJFrameUser mainJFrameUser = new MainJFrameUser();
                            mainJFrameUser.setVisible(true);
                            mainJFrameUser.pack();
                            mainJFrameUser.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                           username_verified = user.getUsername();
                        } else {
                            JOptionPane.showMessageDialog(this, "tài khoản hoặc đăng nhập không đúng !");
                        }
                    } else {
                        JOptionPane.showMessageDialog(this, "tài khoản hoặc đăng nhập không đúng !");
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            JOptionPane.showMessageDialog(this, "Error :" + e);
        }
    }//GEN-LAST:event_btnRegisterActionPerformed
    private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {                                          
        JOptionPane.showConfirmDialog(this, "bạn có muốn thoát không ? ");
        System.exit(0);
    } 
    private void txtPasswordKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtPasswordKeyPressed
        txtPassword.setBackground(Color.white);
    }//GEN-LAST:event_txtPasswordKeyPressed

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

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

    private void txtUserNameKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtUserNameKeyPressed
        txtPassword.setBackground(Color.white);
    }//GEN-LAST:event_txtUserNameKeyPressed

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

    private void txtUserNameMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_txtUserNameMouseExited
        // TODO add your handling code here:
    }//GEN-LAST:event_txtUserNameMouseExited


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnRegister;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JCheckBox jcheckAdmin;
    private javax.swing.JPasswordField txtPassword;
    private javax.swing.JFormattedTextField txtUserName;
    // End of variables declaration//GEN-END:variables
}
<file_sep>/README.md
# VaccineProject
create vaccine app
<file_sep>/QLVaccine/pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.softech</groupId>
    <artifactId>QLVaccine</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>15</maven.compiler.source>
        <maven.compiler.target>15</maven.compiler.target>
    </properties>
    <dependencies>
        <!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
        <dependency>
            <groupId>com.microsoft.sqlserver</groupId>
            <artifactId>mssql-jdbc</artifactId>
            <version>9.4.0.jre11</version>
        </dependency>
        
        
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.15</version>
        </dependency>
        
        <dependency>
            <groupId>com.sun.mail</groupId>
            <artifactId>javax.mail</artifactId>
            <version>1.6.2</version>
        </dependency>
            
            
        
    </dependencies>
    <name>QLVaccine</name>
</project><file_sep>/QLVaccine/src/main/java/com/softech/FrameApp/ui/User/LichTiem.java
/*
 * 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.
 */
package com.softech.FrameApp.ui.User;

import com.softech.ConnectDB.connectDbManagerVaccine;
import com.softech.FrameApp.ui.Login_Register.Login;
import com.softech.user.dao.NguoiDanDao;
import com.softech.user.model.NguoiDan;
import java.sql.Blob;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.List;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author leduc
 */
public class LichTiem extends javax.swing.JPanel {
    private DefaultTableModel tblModel;
    /**
     * Creates new form LichTiem1
     */
    public LichTiem() {
        initComponents();
        initTable();
        loadSchedule();
    }
    
    private void initTable(){
        tblModel = new DefaultTableModel();
        tblModel.setColumnIdentifiers(new String[]{
            "Họ tên","Ngày sinh","Số ĐT","Số CMND","Mũi thứ","Loại vaccine","Nhà sản xuất","Lịch tiêm"
        });
        
        tblSchedule.setModel(tblModel);
    }
    
    private void loadSchedule(){
        try {

            String sql = "select NguoiTiem.name, CONVERT(varchar,NguoiTiem.dateOfBirth,103) as dateOfBirth, NguoiTiem.userName_phoneNumber," +
                         " NguoiTiem.identification_ID, LichTiem.shot, Vaccine.nameOfVaccine, Vaccine.manufacturer, CONVERT(varchar,LichTiem.schedule,103) as schedule from NguoiTiem, LichTiem, Vaccine where NguoiTiem.userName_phoneNumber = LichTiem.phoneNumber_ID" +
                         " and LichTiem.vaccine_ID = Vaccine.vaccine_ID and NguoiTiem.userName_phoneNumber = ?";
        
        try (
                 Connection con = connectDbManagerVaccine.OpenConnection(); 
                PreparedStatement pstmt = con.prepareStatement(sql);
                
            ){
            Login lg = new Login();
            String userName = lg.username_verified;
            pstmt.setString(1, userName);
            
            try(ResultSet rs = pstmt.executeQuery()){
                tblModel.setRowCount(0);
                
                boolean result = rs.next();
                if(!result){
                    NguoiDanDao dao = new NguoiDanDao();
                    NguoiDan nd = dao.findByUserName(userName);
                    
                    tblModel.addRow(new Object[]{
                    nd.getName(), nd.getDateOfBirth(),userName,
                    nd.getIdentification_ID(), " ", " "," ", " "});
                }
                while(result){
                   tblModel.addRow(new Object[]{
                   rs.getString("name"), rs.getString("dateOfBirth"),rs.getString("userName_phoneNumber"),
                   rs.getString("identification_ID"), rs.getInt("shot"), rs.getString("nameOfVaccine"),
                   rs.getString("manufacturer"), rs.getString("schedule")
                        }); 
                   result = rs.next();
                }
                
               
            
            }
            
        }

            tblModel.fireTableDataChanged();
        } catch (Exception e) {
            e.printStackTrace();
        }
  
    }
    /**
     * 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() {

        jScrollPane1 = new javax.swing.JScrollPane();
        tblSchedule = new javax.swing.JTable();

        tblSchedule.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}
            },
            new String [] {
                "STT", "Họ và tên", "Số điện thoại", "Ngày tiêm mũi 1", "Ngày tiêm mũi 2"
            }
        ));
        jScrollPane1.setViewportView(tblSchedule);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1269, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 646, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable tblSchedule;
    // End of variables declaration//GEN-END:variables
}
<file_sep>/QLVaccine/src/main/java/com/softech/user/model/NguoiDan.java
/*
 * 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.
 */
package com.softech.user.model;


/**
 *
 * @author PC
 */
public class NguoiDan {
    private String userName_phoneNumber, passWord, name, identification_ID, bhyt_number, email, address;
    private String dateOfBirth, vaccine1_schedule, vaccine2_schedule;
    private int gender;
    private byte[] image;

    public NguoiDan() {
    }

    public NguoiDan(String userName_phoneNumber, String passWord, String name, String identification_ID, String bhyt_number, String email, String address, String dateOfBirth, String vaccine1_schedule, String vaccine2_schedule, int gender, byte[] image) {
        this.userName_phoneNumber = userName_phoneNumber;
        this.passWord = <PASSWORD>;
        this.name = name;
        this.identification_ID = identification_ID;
        this.bhyt_number = bhyt_number;
        this.email = email;
        this.address = address;
        this.dateOfBirth = dateOfBirth;
        this.vaccine1_schedule = vaccine1_schedule;
        this.vaccine2_schedule = vaccine2_schedule;
        this.gender = gender;
        this.image = image;
    }

    

    public String getUserName_phoneNumber() {
        return userName_phoneNumber;
    }

    public void setUserName_phoneNumber(String userName_phoneNumber) {
        this.userName_phoneNumber = userName_phoneNumber;
    }

    

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIdentification_ID() {
        return identification_ID;
    }

    public void setIdentification_ID(String identification_ID) {
        this.identification_ID = identification_ID;
    }

    public String getBhyt_number() {
        return bhyt_number;
    }

    public void setBhyt_number(String bhyt_number) {
        this.bhyt_number = bhyt_number;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getDateOfBirth() {
        return dateOfBirth;
    }

    public void setDateOfBirth(String dateOfBirth) {
        this.dateOfBirth = dateOfBirth;
    }

    public String getVaccine1_schedule() {
        return vaccine1_schedule;
    }

    public void setVaccine1_schedule(String vaccine1_schedule) {
        this.vaccine1_schedule = vaccine1_schedule;
    }

    public String getVaccine2_schedule() {
        return vaccine2_schedule;
    }

    public void setVaccine2_schedule(String vaccine2_schedule) {
        this.vaccine2_schedule = vaccine2_schedule;
    }

    public int getGender() {
        return gender;
    }

    public void setGender(int gender) {
        this.gender = gender;
    }

    public byte[] getImage() {
        return image;
    }

    public void setImage(byte[] image) {
        this.image = image;
    }
    
    
    
    
}
<file_sep>/QLVaccine/src/main/java/com/softech/Login/mailPassword.java
    /*
 * 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.
 */
package com.softech.Login;

import java.util.Properties;
import javax.mail.Address;
import javax.mail.Authenticator;
import javax.mail.Message;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

/**
 *
 * @author admin
 */
public class mailPassword {

    public static void send(Email email) throws Exception {

               Properties prop = new Properties();//cau hinh mail
        prop.put("mail.smtp.host", "smtp.gmail.com"); //SMTP host
        prop.put("mail.smtp.port", "587"); //TLS Port
        prop.put("mail.smtp.auth", "true"); //enable authentication
        prop.put("mail.smtp.starttls.enable", "true"); //enable 

        Session session = Session.getInstance(prop, new Authenticator() { // lop cho phep thuc hien cac xac thuc khi ket noi voi mail
            protected PasswordAuthentication getPasswordAuthentication() { //email gui mail
                return new PasswordAuthentication(email.getFrom(), email.getFromPassword());
            }
        });

        try {

            Message message = new MimeMessage(session);
            message.setFrom(new InternetAddress(email.getFrom())); // dia chi mail gui 
            message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(email.getTo())); // danh sach ng nhan
            message.setSubject(email.getSubject()); // tieu de mail
            message.setContent(email.getContent(), "text/html; charset=utf-8"); // noi dung mail . kieu noi dung va kieu dinh dang

            Transport.send(message);// method send mail
        } catch (Exception e) {
            e.printStackTrace();

            throw e;
        }
    }

}
