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;
}









  
$(document).ready(function(){
  $("#btn1").click(function(){
    // alert("Name: " + $("#search").val() + "" + "Date: "  + $("#theDate").val());
    $.post("checkingsql.php", {
        lastname : $("#lastname").val(),
       firstname : $("#firstname").val(),
      CheckingDate : $("#theDate").val(),
      CheckingIn: $("#CheckingIn").val();
   
    },
    function( status ){
      alert("Check IN status is: " + status);
    }
  
  )

    

   

  });
  $("#btn2").click(function(){
    // alert("HTML: " + $("#test").html());

    $.post("db.php", {
      lastname : $("#lastname").val(),
       firstname : $("#firstname").val(),
      CheckingDate : $("#theDate").val(),
      CheckingOut: $("#CheckingOut").val()
    },

    function( status){
      alert("Check out status is: " + status);
    }
  );


  });
});
