



<!DOCTYPE html>
<html>
<head>
   <title>Live Search using AJAX</title>
   <!-- Including jQuery is required. -->
   <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
   <!-- Including our scripting file. -->
   <script type="text/javascript" src="scripts6.js"></script>
   <script type="text/javascript" src="date.js"></script>
   <script type="text/javascript">
function SetDate()
{
var date = new Date();

var day = date.getDate();
var month = date.getMonth() + 1;
var year = date.getFullYear();

if (month < 10) month = "0" + month;
if (day < 10) day = "0" + day;

var today = year + "-" + month + "-" + day;


document.getElementById('theDate').value = today;
}
</script>




   <!-- Including CSS file. -->
   <link rel="stylesheet" type="text/css" href="style.css">

   <link rel="stylesheet" href="main.css">


   <script type="text/javascript" src="search6.js"></script>
</head>
<body onload="SetDate();">

  <?php
  if ($_SERVER["REQUEST_METHOD"] == "POST") {

    require 'db.php';

    $current_date = date("Y-m-d");
    // code...
    $sql = "INSERT INTO checking (CheckingName, CheckingDate, CheckingIn)
              VALUES ('" . mysqli_escape_string($con, $_POST['CheckingName']) . "', '"
                          . mysqli_escape_string($con, $_POST['CheckingDate']) . "','"
                          . mysqli_escape_string($con, $_POST['CheckingIn']) . "')";

    $results = mysqli_query($con, $sql);

    if ($results === false) {
      echo mysqli_error($con);
    } else {

      $id = mysqli_insert_id($con);
       echo "Inserted recond with $id";
    }


  }

   ?>


<!-- Search box. -->
<div class="register">
        <h1>Register</h1>
        <div>
         Search Member <input type="text" id="search" ></div>
         <!-- Suggestions will be displayed in below div. -->
  <div class="field" id="display"></div>
        </form><br>
               
        <form action="register.php" method="post" autocomplete="off">
        
            username<input type="text" name="username" placeholder="Username" id="searchResult" required></div><br>
            <div><label for="password">
                password
            </label>
            <input type="password" name="password" placeholder="Password" id="password" required></div><br>
            <div><label for="email">
                email</i>
            </label>
            <input type="email" name="email" placeholder="Email" id="email" required><br> </div></br>
            <div>
                <label for="level1">Level:</label> <br>
                
                <input type="radio" name="level1" value="tithes" placeholder="admin">tithes 
                <input type="radio" name="level1" value="pasteur" placeholder="pasteur">pasteur 
                <input type="radio" name="level1" value="checkin" placeholder="checkin">checkin 
                <input type="radio" name="level1" value="senior" placeholder="senior">seniorPasteur 
                <input type="radio" name="level1" value="children" placeholder="children"> Children Ministry
                <input type="radio" name="level1" value="frontdesk" placeholder="frontdesk"> Front Desk
            </div>
            
            <div><input type="submit" value="Register"></div>
        </form>
        

      <!-- Suggestions will be displayed in below div. -->
  <div class="field" id="display"></div>




</body>
</html>
