<?php
  include ('include_fns.php');


  session_start();

  function Show_BenefitCheck_Header()
  {

    if(!check_admin_user())
    {
     echo "You do not seem to be logged in.";
     exit;
    }
    
    ?>

    <style>
      .apptbtns.ui-button.ui-widget{
         width : 160;
      }

      .dialog { display: none; }
    </style>

    <script>

      $(function() {

        

        $('#btnSearch').button({ icons: { primary: 'ui-icon-search'} }).click(function(event, ui) {
          
          var surname      = $('#edtSurname').val().toUpperCase();
          var idnumber     = $('#edtIDNo').val();
          var membershipno = $('#edtMembershipNo').val();

          $( "#divBenefitCheck" ).empty();
          
          if (surname == '')
            alert('The Surname is required to be entered !');
          else
          if ((idnumber == '')&&(membershipno == ''))
            alert('Either the ID No. or Membership No. is required to be entered !')
          else
            $('#divBenefitCheck').load("BenefitCheck.php?surname=" + surname + "&idnumber=" + idnumber + "&membershipno=" + membershipno);        });

        function Refresh()
        {
          
         };     

         

      });
    </script>

    <p></p>


    <?php

    
    echo '<table cellspacing = 0 cellpadding = 3 border = 0 class="shadetable indented" >';
    echo '<tr>';
    echo '  <th colspan = "3" bgcolor="#184214">Benefit Check</th>';
    echo '</tr>';

    
    echo '<tr>';
    echo '     <td width = 150><label>Surname</label></td>';
    echo '     <td width = 150> <input type="text" name="edtSurname" id="edtSurname" style="text-transform: uppercase"></td>';
    echo '</tr>';

    echo '<tr>';
    echo '   <td width = 150>ID No.</td>';
    echo '   <td width = 150> <input type="text" name="edtIDNo" id="edtIDNo" style="text-transform: uppercase"></td>';
    echo '</tr>';
    echo '<tr>';
    echo '   <td width = 150>Membership No.</td>';
    echo '   <td width = 150> <input type="text" name="edtMembershipNo" id="edtMembershipNo" style="text-transform: uppercase"></td>';
    echo '   <td> <button id="btnSearch">Search</button></td>';
    
    echo '</tr>';
    echo '</table>';
    


    ?>
    
    <p></p>
    <div id="divBenefitCheck"></div>

    <?php
  }


?>
