Create a new page called login.php perhaps based on insertproducts.php as you need a form and processing.  Change the first two form fields  to username and password.  Change the type of the second one to password.  Delete the other fields and the onsubmit

In the processing bit change the variable names etc. to suit the new form.  Delete the query and the echo and replace it with:

  1. query the database to SELECT the type field from user WHERE the username and password are the same as were put into the form
  2. create an if statement with the condition using mysqli_num_rows() to check if there is just one matching row in the result
    1. if there is just one result then the log in is successful so:
      1. echo some sort of welcome message
      2. extract the row from the result and put type into a variable called $type
      3. record the username, password and type in session variables for later use (in functions.php add session_start() as the new first line of PHP)
    2. if not show a message that they need to try again (and give them a link to load the log in form again)

The session now has a record if someone has successfully logged in.  Test the page with invalid log ins first and then finally with the samaira valid log in so you are logged in as a customer.