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

<?php  include("sessioncheck.php"); ?>

<?php



$branch=$_SESSION['branch'];
$year=$_REQUEST['year'];

     

     $classes = $m->query("select * from edu_class_config where branch_id=".$branch." order by class_id asc limit 1");

     // print_r($classes);

     

     

     

    if($_REQUEST['student']!=NULL){





       $m->where("status", '1');

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

       $m->where("student_id", $_REQUEST['student']);



       $WorkAssignListVal = $m->get("edu_student_details");



      }





    if($_REQUEST['session']!=NULL){

    $session1=$_REQUEST['session'];



  }else { 



    $session1=$WorkAssignListVal[0]['session_id']; 

  }



    // $session1=$WorkAssignListVal[0]['session_id'];



        $m->where("class_id", $WorkAssignListVal[0]['class_id']);

        $class=$m->get("edu_class_config");



        $m->where("class_id", $WorkAssignListVal[0]['class_admited']);

        $classadm=$m->get("edu_class_config");



        $m->where("section_id", $WorkAssignListVal[0]['section_id']);

        $section=$m->get("edu_adm_section_detail");



        $m->where("session_id", $WorkAssignListVal[0]['session_id']);

        $session=$m->get("edu_session_config");



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

        $branch_details = $m->get("edu_branch_config");



  // settings month details



    $default;

    

    if($_GET["month"]!=NULL ){

      $default= $_GET["month"];

    }

    else{

      $default= date("m");

    }

  

      $m->where("Month_Id", $default);

      $month_name=$m->get("eduportal_month_config");

 

     ?>





<!DOCTYPE html>

<html lang="en">

  <head>

    

    <title>Student Profile | EduPortal</title>

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

   



<style>





.thStyle{background-color:gray;color:white;}



tr th {padding:2%;}

tr td {padding:2%;}

@media only screen and (max-width: 768px) {



/* For mobile phones: */

.popup_style{margin-top:20%;}



}

</style>



<input type="hidden" name="" value="<?php echo $_REQUEST['deleteLocalStorage'];?>" id="deleteLocalStorage">

  <script>

  var clr=document.getElementById("deleteLocalStorage").value;

  //alert(clr);

  if (clr=="delete") {

    //alert("786");

  localStorage.clear();

}

</script>
 
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
  </head>

  

<script>

function showResult1(str) {

  if (str.length==0) { 

    document.getElementById("livesearch1").innerHTML="";

    document.getElementById("livesearch1").style.border="0px";

    return;

  }

  if (window.XMLHttpRequest) {

    // code for IE7+, Firefox, Chrome, Opera, Safari

    xmlhttp=new XMLHttpRequest();

  } else {  // code for IE6, IE5

    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

  }

  xmlhttp.onreadystatechange=function() {

    if (this.readyState==4 && this.status==200) {

      document.getElementById("livesearch1").innerHTML=this.responseText;

      document.getElementById("livesearch1").style.border="1px solid #A5ACB2";

      //alert(this.responseText);

    }

  }

  xmlhttp.open("GET","livesearch_old.php?q="+str,true);

  xmlhttp.send();

}




function getsec(id){



            if (window.XMLHttpRequest) {



              // code for IE7+, Firefox, Chrome, Opera, Safari



              xmlhttp=new XMLHttpRequest();



            } else { // code for IE6, IE5



              xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");



            }



            xmlhttp.onreadystatechange=function() {



              if (xmlhttp.readyState==4 && xmlhttp.status==200) {



                document.getElementById("txt_section").innerHTML=xmlhttp.responseText;

                // alert(xmlhttp.responseText);



              }



            }



            xmlhttp.open("GET","get_sect.php?class_id="+id,true);



            xmlhttp.send();









          }

</script>







  <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="">



     <a href="<?php echo $_SESSION['dashboard'];?>">Dashboard </a> &nbsp; <i style="" class="fa fa-angle-double-right"></i>  &nbsp; 

    

     <a href="students_reports_link.php">Students Reports </a> &nbsp; <i style="" class="fa fa-angle-double-right"></i>  &nbsp; 

          

      Old/Struck Off Student



      <br><br>





           

  <section class="add_sub_agent" id="table_sub_agent">

  <div class="container">







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

      

        <div class="panel panel-default">

             <div class="panel-heading" id="std_section">

         



            <div class="col-md-4">  

            

              <form>

                <input type="text" class="form-control" placeholder="Search Student with | Name | Last Name | Roll No | Cell No" onkeyup="showResult1(this.value)" value="<?php echo $_GET['qr'];?>">

                <div id="livesearch1"></div>

              </form>

            

              <br>

             </div>      

            

                   

            <div class="col-md-8"> 

             



 

              <span style="float:right;margin-top: -7px;">



              

              <input type="hidden" value="<?php echo session_id().session_id().session_id().session_id().session_id(); ?>" name="session" />





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



  







</div>











<div class="panel-body">





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

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



<form action="old_student_profile.php" method="get">



<input type="hidden" value="<?php echo session_id().session_id().session_id().session_id(); ?>" name="<?php echo session_id().session_id().session_id().session_id(); ?>" />



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



   <div class="col-md-6"> </div>



   <div class="col-md-4 pull-right" style="margin-top:2px;"> 





        <div class="pull-left" style="width:70%;">

                  

             <select name="session"  id="session" class="form-control" >





              <?php

               $match;

                if(!isset($student[0]['session_id'])){

                  $match=$_SESSION['current_session'];

                }else { $match=$student[0]['session_id']; }

               

              $WorkAssignList = $m->get("edu_session_config");

              foreach($WorkAssignList as $WorkAssignListVal1)

              { ?>



                 <option <?php if($session1==$WorkAssignListVal1['session_id']){echo "selected";} ?> value="<?php echo $WorkAssignListVal1['session_id']; ?>"><?php echo $WorkAssignListVal1['session_year']; ?></option>





                      <?php

              } ?>



          </select>

          

        </div>



<input type="hidden" value="<?php echo session_id().session_id().session_id().session_id(); ?>" name="<?php echo session_id().session_id().session_id().session_id(); ?>" />



        <div class="pull-right"  style="width:27%;">

          <input type="submit" value="Search" class="btn-primary form-control" >

        </div>







   </div>





</form>





<div class="container">

  <div class="row" style="background-color: white;">





           <div class="col-md-11">

      

      <!-- Nav tabs -->

      <div class="card">

                <ul class="nav nav-tabs" role="tablist">

                    <li role="presentation" class="active"><a href="#profile<?php echo $WorkAssignListVal[0]['student_id'];?>" aria-controls="home" role="tab" data-toggle="tab">Profile</a></li>

           <li role="presentation"><a href="#Fee<?php echo $WorkAssignListVal[0]['student_id'];?>" aria-controls="messages" role="tab" data-toggle="tab">Fee History</a></li>

           

                    <li role="presentation"><a href="#Results<?php echo $WorkAssignListVal[0]['student_id'];?>" aria-controls="profile" role="tab" data-toggle="tab">Results</a></li>                   

                  

                </ul>



                <!-- Tab panes -->

                <div class="tab-content">





      <?php  if(isset($_GET['student'])){ ?> 



<p style=" margin: 10px;"> <b>Student Expel Date:</b> <?php echo date("d-M-Y",strtotime($WorkAssignListVal[0]['expel_date']));?> <b>Student Expel Reason: <?php echo $WorkAssignListVal[0]['expel_reason'];?></b> </p>



<a href="#" data-toggle="modal" data-target="#ReEnroll<?php echo $WorkAssignListVal[0]['student_id'];?>" class="btn btn-success pull-right" > Re-Enroll This Student </a>



<a href="print_monthly_fee_report_old_std.php?std=<?php echo $_REQUEST['student'];?>&session=<?php echo $session1;?>" target="_blank" class="btn btn-primary"> Print Fee History</a>







      <?php } ?>  





      <!-- Modal -->

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

        <div class="modal-dialog">



          <!-- Modal content-->

          <div class="modal-content popup_style">

            <div class="modal-header">

              

              <h4 class="modal-title"> <?php echo $WorkAssignListVal[0]['first_name']." - ".$WorkAssignListVal[0]['last_name']; ?>

              <br>

              Roll No: <?php echo $WorkAssignListVal[0]['candidate_roll_no']; ?>

                </h4>

            </div>



            <div class="modal-body">





            <?php 



       $m->where("status", '0');

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

       $m->where("candidate_roll_no", $WorkAssignListVal[0]['candidate_roll_no']);



       $record = $m->get("edu_student_details");



    ?>



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



          <input type="hidden" name="action" value="ReEnrollStudent">

          <input type="hidden" name="student"  value="<?php echo $_GET['student']; ?>" /> 

          <input type="hidden" name="fname"  value="<?php echo $WorkAssignListVal[0]['first_name']; ?>" />    

          <input type="hidden" name="cellNo"  value="<?php echo $WorkAssignListVal[0]['cell_no']; ?>" />     



          <br>



      <?php  if(count($record)>0){ ?>  



        <div class="col-md-12" >



          <div class="alert alert-danger" id="msg">

             <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>

              <strong>Warning!</strong> Sorry, You cannot re-enroll this because roll no is already associated.

            </div>





          </div>



        <?php } else { ?> 



          <h3> Are you sure you want to Re-Enroll this student? </h3>





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

                <div class="form-group ">

                  <label class="required">Session</label>

          <select name="session" class="form-control" >

                               



              <?php



               

              $WorkAssignList2 = $m->get("edu_session_config");

              foreach($WorkAssignList2 as $WorkAssignListVal2)

              { ?>



                 <option <?php if($_SESSION['current_session']==$WorkAssignListVal2['session_id']){echo 'selected';}?> value="<?php echo $WorkAssignListVal2['session_id']; ?>"><?php echo $WorkAssignListVal2['session_year']; ?></option>





                      <?php

              } ?>



          </select>

                </div>

        </div>





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

                <div class="form-group ">

                  <label class="required">Class</label>



            

                    <select name="class_id" onChange="getsec(this.value)" class="form-control" >

                     <option value="All">All</option> 

                    <?php

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

                    $WorkAssignList1 = $m->get("edu_class_config");

                    foreach($WorkAssignList1 as $WorkAssignListVal1)

                    { ?>



                       <option <?php if($_REQUEST['class_id']==$WorkAssignListVal1['class_id']){echo 'selected';}?> value="<?php echo $WorkAssignListVal1['class_id']; ?>"><?php echo $WorkAssignListVal1['Class_Name']; ?></option>





                            <?php

                    } ?>



                    </select>



                  

                </div>

              </div>





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

                <div class="form-group ">

                  <label class="required">Section</label>

                    <select name="section" id="txt_section" class="form-control" >

                      

                   <?php

                              if($_REQUEST['section']!='')

                              { 



                              $m->where("class_id", $_REQUEST['class_id']);    



                              $secondLevel = $m->get("edu_adm_section_detail");

                              

                              foreach($secondLevel as $secondLevel_val)

                              {

                              

                               ?>

                                <option <?php if($_REQUEST['section']==$secondLevel_val['section_id']){echo "selected";} ?> value="<?php echo $secondLevel_val['section_id']; ?>"><?php echo trim(utf8_encode_all($secondLevel_val['section_name'])); ?></option>



                              <?php }   ?>

                                

                          <?php } ?>



                    </select>



                  

                </div>

              </div>





              <div class="form-group ">



                  <label class="">Send Welcome SMS</label>

                  <select  name="sendSms" class="form-control"  >



                    <option value='YES'>YES</option>

                    <option value='NO'>NO</option>                   



                  </select>

              </div>

         



            <div class="modal-footer">



              <button type="submit" class="btn btn-success" name="submit" >YES! ENROLL NOW </button>

              <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>





            </div>



<?php } ?> 



                 </form>



          </div>



          </div>



        </div>

      </div>



      <!-- ending -->













                    <div role="tabpanel" class="tab-pane active" id="profile<?php echo $WorkAssignListVal[0]['student_id'];?>">



                      

                      <?php include('old_student_info.php');?>



                    </div>



                 <div role="tabpanel" class="tab-pane" id="Results<?php echo $WorkAssignListVal[0]['student_id'];?>">







          <br><br><br>





                    <?php include('old_student_result_history.php');?>







                    </div>















  <div role="tabpanel" class="tab-pane" id="Fee<?php echo $WorkAssignListVal[0]['student_id'];?>">





<?php include('old_student_fee_history.php');?>





                    </div>

                    





                </div>

      



      </div>



       </div> <!-- col 9 -->

  </div>

</div>  <!-- container -->





    <br><br>













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

</div>

</div>

      

    </div>

 







  </div>

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

</section>          

    



           

          </div>

        </div>



            </div>

          </div>

        </div>

        <!-- /page content -->

  



    <script src="js/ajax_functions.js"></script>



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


  </body>

</html>

