title: How to disable a button for the current day after a click CODEIGNITER?
body: <p>This is the code that I have tried. The disable button by checking the database does not seem to work. If there is another way to disable a button for a day,let me know. Thanks in advance.</p>
  
  <p>Checkin and checkout are columns in the table called checktime. 
      </p>
  
  <pre><code>&lt;?php $time=date('Hi'); ?&gt;
  
   &lt;body class='wrapper'&gt;
  &lt;?php
  $curdatein = $this-&gt;db-&gt;query("SELECT * FROM `checktime` WHERE DATE_FORMAT(checkin, '%m%d%Y') = DATE_FORMAT(NOW(), '%m%d%Y')");
  $curdateout = $this-&gt;db-&gt;query("SELECT * FROM `checktime` WHERE DATE_FORMAT(checkout, '%m%d%Y') = DATE_FORMAT(NOW(), '%m%d%Y')");
  //echo $curdatein;
  //echo $curdateout;
  if (($curdatein !='') &amp;&amp; ($curdateout !=''))
  { ?&gt;
  &lt;a href ="&lt;?php echo base_url("index.php/User_controller/checkintime"); ?&gt;"&gt;
  &lt;input type='button' id='bind'value='Check IN' name='intimebtn' class='btn btn-primary btn-md' disabled &gt;
  
  
  &lt;/a&gt;
  &lt;a href ="&lt;?php echo base_url("index.php/User_controller/checkouttime"); ?&gt;"&gt;
     &lt;input type='button' id ='unbind' value='Check Out' name='outtimebtn' class='btn btn-primary btn-md' disabled &gt;&lt;/a&gt;
  
  
  
   &lt;?php } else { ?&gt;
   &lt;div class="loginform"&gt;
  &lt;?php if (($time &gt;=0800) &amp;&amp; ($time &lt;=1200))  {?&gt;
  &lt;a href ="&lt;?php echo base_url("index.php/User_controller/checkintime"); ?&gt;"&gt;
  &lt;input type='button' id='bind'value='Check IN' name='intimebtn' class='btn btn-primary btn-md' &gt;
  &lt;script&gt;
  
     &lt;/a&gt;
   &lt;a href ="&lt;?php echo base_url("index.php/User_controller/checkouttime"); ?&gt;"&gt;
       &lt;input type='button' id ='unbind' value='Check Out' name='outtimebtn' class='btn btn-primary btn-md' disabled &gt;&lt;/a&gt;
  
  
       &lt;?php 
         }
      else if (($time &gt;=1600) &amp;&amp; ($time &lt;=2100))
       { ?&gt;
        &lt;a href ="&lt;?php echo base_url("index.php/User_controller/checkintime"); ?&gt;"&gt;
       &lt;input type='button' id='bind'value='Check IN' name='intimebtn' class='btn btn-primary btn-md'  disabled &gt;
      &lt;/a&gt;
      &lt;a href ="&lt;?php echo base_url("index.php/User_controller/checkouttime"); ?&gt;"&gt;
          &lt;input type='button' id ='unbind' value='Check Out' name='outtimebtn' class='btn btn-primary btn-md' onClick="this.disabled=true;" &gt;
      &lt;/a&gt;
         &lt;?php
       }
  
       else {
  ?&gt;
           &lt;a href ="&lt;?php echo base_url("index.php/User_controller/checkintime"); ?&gt;"&gt;
            &lt;input type='button' id='bind'value='Check IN' name='intimebtn' class='btn btn-primary btn-md' disabled&gt;
             &lt;/a&gt;
          &lt;a href ="&lt;?php echo base_url("index.php/User_controller/checkouttime"); ?&gt;"&gt;
            &lt;input type='button' id ='unbind' value='Check Out' name='outtimebtn' class='btn btn-primary btn-md' disabled &gt;
          &lt;?php } }?&gt;
         &lt;/a&gt;
          &lt;a href ="&lt;?php echo base_url("index.php/User_controller/getdetails"); ?&gt;"&gt;
          &lt;input type='button' id ='unbind' value='Get User Details' name='getDetails' class='btn btn-primary btn-md'  &gt;
  
  
     &lt;/a&gt;
      &lt;/div&gt;
      &lt;/body&gt;
       &lt;/html&gt;
  </code></pre>