<?php include("parent/callMe.php"); ?>
<?php  include("sessioncheck.php"); ?>
<?php

        $m->where("branch_id", $_SESSION['branch']);
        $branch=$m->get("edu_branch_config");

  if(isset($_REQUEST['emp'])){

     
          $data = array('status' => '1');
          $m->where("branch_id", $_SESSION['branch']);
          $m->where("user_id", $_REQUEST['emp']);

          $result =  $m->update ('edu_user_config', $data);
   
   
      header("location:view_emp.php?".session_id().session_id().session_id());


 }
   
     

     $branch=$_SESSION['branch'];


   $date=date('m-d');
  
  $sql="SELECT * FROM edu_student_details WHERE branch_id='$branch' and status='0' and dob like '%-$date'";

  $WorkAssignListings=$m->query($sql);
 
     ?>

<!DOCTYPE html>
<html lang="en">
  <head>
    
    <title>Birthday Students | EduPortal</title>
    <?php include('RootMe/css_links.php');?>
 
<style>

.tdStyle{border-bottom:1px solid lightgray;}
.thStyle{background-color:#00AFEF;color:white;}

</style>  
  </head>
  
  <body class="nav-md">
    <div class="container body">
      <div class="main_container">
        <div class="col-md-3 left_col">
     
            <?php include('RootMe/sidebar.php');?>

              <?php include('RootMe/header.php');?>
     
        <!-- page content -->
          <div class="right_col" role="main">
          <div class="" style="background-color: white;">
           
  <section class="add_sub_agent" id="table_sub_agent">
  <div class="container">

 <div class="" style="margin-top:10px;">
 
    </div>
    <br>

     
     
          
          <?php  if(isset($_SESSION['Added'])){?>


            <div class="alert alert-success" id="msg">
             <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
              <strong>Success!</strong> Message is sent successfully...
            </div>

          <?php  unset($_SESSION['Added']); } ?>


          
 
  <h3>List of Birthday Students</h3>


<input type="hidden" value="<?php echo $_REQUEST['class_id']; ?>" name="class_id" />
<input type="hidden" value="<?php echo $_REQUEST['section']; ?>" name="section" />


<div style="overflow-x:auto;">

<table id="listofstudents" class="table table-striped table-bordered" style="width:100%">
        <thead>
            <tr>

                <th width="5%">S.No</th>
                <th width="20%">Name</th>
                <th width="12%">Father Name </th>
                <th width="12%">Class</th>
                <th width="11%">Cell </th>
                <th width="10%">SMS </th>
               
                
            </tr>
        </thead>
        <tbody>


   
     
     <?php 

     $count=1;
      foreach($WorkAssignListings as $WorkAssignListVal)
      { 

        $m->where("class_id", $WorkAssignListVal['class_id']);
        $className=$m->get("edu_class_config");

        $m->where("department_id", $WorkAssignListVal['department_id']);
        $department=$m->get("eduportal_hrm_department_config");

      ?>

  <tr>
        
     <td style="text-align:center;"> <?php echo $count; $count++; ?>  </td>

<td>

  <!-- making a link   -->
<a style="padding: 0px 5px; font-size:14px;"  href="student_profile.php?<?php echo session_id().session_id().session_id().session_id().session_id(); ?>&student=<?php echo $WorkAssignListVal['student_id'];?>" style="cursor:pointer;">

      <?php if($WorkAssignListVal['attach_image']!=NULL){?>

        <img style="border-radius:50%;height:35px;with:35px;" src="<?php echo DOMAIN;?>Production/staff_pics/<?php echo $WorkAssignListVal['attach_image'];?>"  />
      <?php }else {?>

        <img style="border-radius:50%;height:35px;with:35px;" src="images/student.png" />

      <?php }?>
      
       &nbsp;&nbsp; <?php echo $WorkAssignListVal['first_name'];?>
</a>
                   
                   
</td>
      
      <td> <?php echo $WorkAssignListVal['last_name'];?> </td>
      <td> <?php echo $className[0]['Class_Name'];?> </td>
      <td style="text-align:center;"> <?php echo $WorkAssignListVal['cell_no'];?> </td>
      <td style="text-align:center;"> 



      <a data-toggle="modal" data-target="#BirthdaySMS<?php echo $WorkAssignListVal['student_id'];?>" style="padding: 0px 5px; font-size:14px;" href="#" class="btn btn-success">

                  Send SMS
                  
              </a>



    </td>


    <!-- Employee Experience Popup start -->


      <div id="BirthdaySMS<?php echo $WorkAssignListVal['student_id'];?>" class="modal fade" role="dialog">
        <div class="modal-dialog">

          <!-- Modal content-->
          <div class="modal-content">
            <div class="modal-header" style="border-bottom:none;">
              <button type="button" class="close" data-dismiss="modal">&times;</button>
              <h4 class="modal-title" style="text-align:center;"> Happy Birthday (<?php echo $WorkAssignListVal['first_name']." - ".$WorkAssignListVal['last_name']; ?>)  </h4>
            </div>

            <div class="modal-body">

<form class="form-style-7" action="<?php echo DOMAIN.AgentDirectory;?>parent/InsertMe.php" method="post"  enctype="multipart/form-data">

           <input type="hidden" name="action" value="birthday_SMS_Student"> 
           <input type="hidden" id="date"  name="experience" value="<?php echo $_SESSION['experience']; ?>" />
           <input type="hidden" id=""  name="student_name" value="<?php echo $WorkAssignListVal['first_name']; ?>" />

             
                  
                  <div class="col-md-12" style="padding:8px;"  id="">

                       <div class="form-group ">

                          <label class="required"> Mobile No</label>
                              <input name="cell_no"  id="cell_no_student" value="<?php echo $WorkAssignListVal['cell_no'];?>" type="number" class="form-control"/>
                       
                          </div>
                  </div>

                  <div class="col-md-12" style="padding:8px;"  id="col1">

                       <div class="form-group ">

                          <label class="required"> Birthday SMS</label>
                              <textarea name="birthday_SMS_student" rows="5"  id="from" value="" type="text" class="form-control">Dear <?php echo $WorkAssignListVal['first_name']; ?>,
Wishing you another wonderful year of happiness and joy. The more candles, the bigger the wish.
                                Happy Birthday!
                              </textarea>
                       
                          </div>
                  </div>
                                       
                  </div>
               
                

            <div class="modal-footer">

            <button type="submit" class="btn btn-primary" name="submit" >Submit </button>
              


            </div>



                 </form>

          </div>

          </div>

        </div>
      </div>

      <!-- Employee Experience popup ending -->

 

  <!-- Student Result popup start -->


      <div id="EmpPayroll<?php echo $WorkAssignListVal['user_id'];?>" class="modal fade" role="dialog">
        <div class="modal-dialog">

          <!-- Modal content-->
          <div class="modal-content">
            <div class="modal-header" style="border-bottom:none;">
              <button type="button" class="close" data-dismiss="modal">&times;</button>
              <h4 class="modal-title" style="text-align:center;"> Reasons of Delete (<?php echo $WorkAssignListVal['user_fname']." - ".$WorkAssignListVal['user_lname']; ?>)  </h4>
            </div>

            <div class="modal-body">


<form  action="<?php echo DOMAIN.AgentDirectory;?>parent/InsertMe.php" method="post">

           <input type="hidden" name="action" value="delete_employee"> 
           <input type="hidden" id="date"  name="month" value="<?php echo $_GET['month']; ?>" />
           <input type="hidden" name="session" value="<?php echo $student[0]['session_id']; ?>">
           <input type="hidden" name="branch" value="<?php echo $student[0]['branch_id']; ?>">
           <input type="hidden" name="employee" value="<?php echo $WorkAssignListVal['user_id']; ?>">
           
                   <div class="col-md-12" style="padding: 8px;">

                       <div class="form-group ">

                          <label class="required">Reasons</label>
                              <select required name="emp" onChange="HideDate(this.value);" class="form-control"  >

                                <option value=''>Select</option>
                                <option <?php if($_GET['emp']=="0"){echo 'selected';}?> value='Appointment In Government Sector'>Appointment In Government Sector</option>
                                <option <?php if($_GET['emp']=="0"){echo 'selected';}?> value='Migrate To Other Campus'>Migrate To Other Campus </option>
                                <option <?php if($_GET['emp']=="0"){echo 'selected';}?> value='Miss Behaviour'>Miss Behaviour</option>
                                <option <?php if($_GET['emp']=="0"){echo 'selected';}?> value='Went To Abroad'>Went To Abroad</option>
                                 <option <?php if($_GET['emp']=="0"){echo 'selected';}?> value='Regular Absents'>Regular Absents</option>
                                                                 
                                <option <?php if($_GET['emp']=="1"){echo 'selected';}?> value='1'>Other </option>
                                  
                              </select>
                            </div>


                    </div> 
                              
                  
                  <div class="col-md-12" style="padding:8px;<?php if(isset($_REQUEST['from']) && $_REQUEST['emp']==1){ echo 'display:block;';}else {echo 'display:none;';} ?>"  id="col1">

                       <div class="form-group ">

                          <label class="required"> Explain</label>
                              <textarea name="expln"  id="from" value="<?php echo $_POST['expln']?>" type="text" class="form-control"></textarea>
                       
                          </div>
                  </div>                      
      
            <div class="modal-footer">

            <button type="submit" class="btn btn-primary" name="submit" >Submit </button>
              


            </div>



                 </form>

          </div>

          </div>

        </div>
      </div>

      <!-- Student result popup ending -->   






              </tr>





              <?php
      } ?>



           
            
           
        </tbody>
        
    </table>

  </div>

  

    <br><br>


  </div>
  <div class="clearfix"></div>
</section>          
    

           
          </div>
        </div>

            </div>
          </div>
        </div>
        <!-- /page content -->
  

    
  <?php include('RootMe/js_linksscript.php');?>

  <script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
  <script src="https://cdn.ckeditor.com/4.12.1/standard/ckeditor.js"></script>
   <!-- jQuery -->
    <script src="js/ajax_functions.js"></script> 
  </body>
</html>
