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

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

<?php



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

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

$m->where("page_id", 7);

$access = $m->get("users_privilege_detail");



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


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

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

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

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


	}



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

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



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

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





     $default;

    

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

      $default= $_GET["month"];

    }

    else{

      $default= date("m");

    }



  $user_session;



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

    $user_session=$_REQUEST['session'];

  }else { $user_session=$_SESSION['current_session']; }

//echo $match; 


   $m->where("session_id", $user_session);
  $sessionYear=$m->get("edu_session_config");

  $yearParts = explode('-', $sessionYear[0]['session_year']);
  $year = $yearParts[0];



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

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



 

  $branch=$_SESSION['branch'];

  $cellParents=$WorkAssignListVal[0]['cell_no'];

  $sql = "SELECT * FROM  eduportal_parents_access  WHERE branch_id='$branch' and parents_cellno='$cellParents'";



  $parentsIdPaswrd1 = $m->query($sql);

  $parentsIdPaswrd1[0]['password'];





  $whatsapp = ltrim($WorkAssignListVal[0]['whatsapp_number'], "0"); 

  //print_r($sql);

   ?>





<!DOCTYPE html>

<html lang="en">

  <head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <!-- Meta, title, CSS, favicons, etc. -->

    <meta charset="utf-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Student Profile | EduPortal</title>

   

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

   

  </head>



  <!-- load counter functions -->

<script type="text/javascript" src="js/counter_funcs.js"></script>

<!-- set the maximum character length value for the field -->



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

 <script>

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

  if (clr=="delete") {

  localStorage.clear();

}

</script>

  

<style>



#hideMe {

  animation: hideAnimation 0s ease-in 18s;

  animation-fill-mode: forwards;

}



@keyframes hideAnimation {

  to {

    visibility: hidden;

    width: 0;

    height: 0;

  }

}



.thStyle{background-color:#00AFEF;color:white;}



tr th {padding:1.5%;border:1px solid white;}

tr td {padding:1%;}





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



/* For mobile phones: */

.popup_style{margin-top:20%;}



}

</style>





</head>











<script>  







function PayFullFee() {



 //alert("786");

 // others fee parameters

 var adm=document.getElementById("adm").value;

 var pap=document.getElementById("pap").value;

 var lab=document.getElementById("lab").value;

 var lib=document.getElementById("lib").value;

 var other=document.getElementById("other").value;

//alert(adm);

// general parameters to submit the fee

 var student=document.getElementById("student").value;

 var fine=document.getElementById("fine").value;

 var challan_id=document.getElementById("challan_id").value;

 var fee_recv_sms=document.getElementById("fee_recv_sms").value;

 var std_name=document.getElementById("std_name").value;

 var std_no=document.getElementById("std_no").value;

 var totalAmount=document.getElementById("totalAmount").value;

//alert(totalAmount);





 others=parseFloat(adm)+parseFloat(pap)+parseFloat(lab)+parseFloat(lib)+parseFloat(other);

 var collected=parseFloat(others)+parseFloat(totalAmount);



 // alert(others+"==="+totalAmount);



   if (window.XMLHttpRequest) {

      xmlhttp=new XMLHttpRequest();

    } else { // code for IE6, IE5

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

    }

  xmlhttp.onreadystatechange=function() {



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



       if(xmlhttp.responseText=="1" || xmlhttp.responseText==1){

         

          document.getElementById("paynow").style.display="none";

          document.getElementById("pay").style.display="none";

          document.getElementById("fullpaid").style.display="block";



       }// ending main if condition 



      }



    }





  xmlhttp.open("GET","PayFullFee.php?action=PayChallan&adm="+adm+"&paper="+pap+"&lab="+lab+"&lib="+lib+"&other="+other+"&collected="+collected+"&challan_id="+challan_id+"&fee_recv_sms="+fee_recv_sms+"&student="+student+"&fine="+fine+"&std_name="+std_name+"&std_no="+std_no+"&totalAmount="+totalAmount,true);

  //xmlhttp.open("GET","PayFullFee.php",true);



  xmlhttp.send();



}





 function FamilyData(studentid,cell_no)

    {

     // alert(studentid+"=="+cell_no);



   

        mySelectFunction(studentid);



        var ajx;  // The variable that makes Ajax possible!



        if (window.XMLHttpRequest)

            ajx = new XMLHttpRequest();

        ajx.onreadystatechange = function ()

        {

          //alert("786");

            if (ajx.readyState == 4)

            {

               // alert(ajx.responseText);  

                document.getElementById("myID"+studentid).innerHTML = ajx.responseText;



            }

        }

        

        ajx.open("GET", "get_family_data_withoutfee.php?student_id="+studentid+"&cell_no="+cell_no);

        ajx.send();



    }







    function FamilyDataWithCodeNo(studentid,familycode)

    {

     // alert(studentid+"=="+cell_no);



   

        mySelectFunction(studentid);



        var ajx;  // The variable that makes Ajax possible!



        if (window.XMLHttpRequest)

            ajx = new XMLHttpRequest();

        ajx.onreadystatechange = function ()

        {

          //alert("786");

            if (ajx.readyState == 4)

            {

               // alert(ajx.responseText);  

                document.getElementById("myID"+studentid).innerHTML = ajx.responseText;



            }

        }

        

        ajx.open("GET", "get_familycode_data_withoutfee.php?student_id="+studentid+"&family_code="+familycode);

        ajx.send();



    }







function mySelectFunction(studentid) {



  var x = document.getElementById("myID"+studentid);

  if (x.style.display === "none") {

    x.style.display = "block";

  } else {

    x.style.display = "none";

  }

}





function HideDate(str){



  //alert(str);

  

  if(str=="Other" ){

    

   // document.getElementById("fee").style.display="block";

    document.getElementById("col1").style.display="block";

   

  }

  else {

    

   // document.getElementById("fee").style.display="none";

    document.getElementById("col1").style.display="none";

   

   

  }

}







 function StudentResultData()

    {

      //alert("786");



      var session_id=document.getElementById("session").value;

      var student_id=document.getElementById("student_id").value;

//alert(student_id+"=="+session_id);

        var ajx;  // The variable that makes Ajax possible!



        if (window.XMLHttpRequest)

            ajx = new XMLHttpRequest();

        ajx.onreadystatechange = function ()

        {

          //alert("786");

            if (ajx.readyState == 4)

            {

                //alert(ajx.responseText);  

                document.getElementById("myIDmyID").innerHTML = ajx.responseText;



            }

        }

        

        ajx.open("GET", "get_student_result_history.php?student_id="+student_id+"&session_id="+session_id);

        ajx.send();



    }





function myFunction() {

var x = document.getElementById("myDIV");

if (x.style.display === "none") {

x.style.display = "block";

} else {

x.style.display = "none";

}

}





function apply(str) {

// alert(str);  

if (str != null || str != "" ) {

var x = document.getElementById("text").value=str;

} else {

var x = document.getElementById("text").value="";

}

}



 </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 -->



        <a href="watch_video.php?videourl=RmjfbeBVAqA" target="_blank" class="btn btn-success" style="padding: 5px 5px; font-size:14px;color:white;float: right;"><i class="fa fa-play"></i>&nbsp;&nbsp;Watch Video</a>



        <a href="https://wa.me/+92<?php echo $whatsapp;?>" target="_blank" class="btn btn-success" style="padding: 5px 5px; font-size:14px;color:white;float: right;"><i class="fa fa-whatsapp"></i>&nbsp;&nbsp;Whatsapp SMS</a>>



        <a href="student_sms_history.php?jdfkjadsfdkadjascfkjadsfjdklsfckjcnjasdfkldasfkljdsfkjndsckjamefkdsncdkjasnfjkhdasfkj&cell=<?php echo $WorkAssignListVal[0]['cell_no'];?>&student=<?php echo $WorkAssignListVal[0]['student_id'];?>" target="_blank" class="btn btn-success" style="padding: 5px 5px; font-size:14px;color:white;float: right;"><i class="fa fa-envelope"></i>&nbsp;&nbsp;Student SMS History</a>



        <a style="padding:5px 5px; font-size:14px;float: right;" class="btn btn-warning" data-toggle="modal" data-target="#SMSsend<?php echo $WorkAssignListVal[0]['student_id'];?>,<?php echo $_SESSION['branch'];?>"> Send SMS </a>

        

          <div class="right_col" role="main">

          <div class="">

            <div class="page-title">

              <div class="title_left" style="width:100%;">

                

             <span style="font-size:20px; float:left;"> Student Profile:  &nbsp; <?php echo $WorkAssignListVal[0]['first_name']." | ".$WorkAssignListVal[0]['last_name']." | ".$class[0]['Class_Name']."-".$section[0]['section_name']." | ".$WorkAssignListVal[0]['candidate_roll_no']." | ".$WorkAssignListVal[0]['ref_no'];?> </span>







              </div>



              <div class="title_right">

                <div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search">

                  

                </div>

              </div>

            </div>

            

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



            <div class="row">

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

                <div class="x_panel">

                  <div class="x_title">

                    

                    

                    <ul class="nav navbar-right panel_toolbox">

                    

                      <a class="btn btn-success" href="edit_student.php?<?php echo session_id().session_id().session_id().session_id().session_id();?>&student=<?php echo $WorkAssignListVal[0]['student_id'];?>&year=<?php echo $WorkAssignListVal[0]['year'];?>#sec"><i class="fa fa-edit m-right-xs"></i>&nbsp;Edit Profile</a>



                      <a style="padding:7px; font-size:14px;" data-toggle="modal" data-target="#stdTrack<?php echo $WorkAssignListVal[0]['student_id'];?>,<?php echo $_SESSION['branch'];?>"; class="btn btn-success"> Student Track </a>



                       <a class="btn btn-primary" href="pay_fee.php?<?php echo session_id().session_id().session_id().session_id().session_id();?>&student=<?php echo $WorkAssignListVal[0]['student_id'];?>&session=<?php echo $user_session;?>#sec"><i class="fa fa-dollar"></i>&nbsp;Pay Student Fee</a>



               <?php if ($access[0]['delete_access']!=NULL) { ?>



                     <a style="padding:7px; font-size:14px;" data-toggle="modal" data-target="#EmpPayroll<?php echo $WorkAssignListVal[0]['student_id'];?>,<?php echo $_SESSION['branch'];?>"; class="btn btn-danger"> Struck off Student </a>



               <?php } ?>





            <div class="btn-group" >



              

                <button style="padding:7%;" data-toggle="dropdown" class="btn btn-success dropdown-toggle btn-sm" type="button" aria-expanded="true"><i class="fa fa-print m-right-xs"></i>&nbsp;Print Student <span class="caret"></span>

                </button>









                <ul role="menu" class="dropdown-menu">                

                



                  <li><a href="student_profile_details.php?a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156&amp;student=<?php echo $WorkAssignListVal[0]['student_id'];?>&class_id=<?php echo $WorkAssignListVal[0]['class_id'];?>&section_id=<?php echo $WorkAssignListVal[0]['section_id'];?>&session=<?php echo $_REQUEST['session'];?>" target="_blank">Performance Report</a></li>



                  <li>

                  <a data-toggle="modal" data-target="#AttendanceHistory<?php echo $WorkAssignListVal[0]['student_id'];?>"> Attendance History </a></li>





                  <li><a href="print_resultattendance_graph.php?a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156&amp;&std=<?php echo $WorkAssignListVal[0]['student_id'];?>" target="_blank"> Performance Graph</li>



              

            	  <li><a href="adm_form_standard.php?a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156&amp;student=<?php echo $WorkAssignListVal[0]['student_id'];?>" target="_blank"> Admission Form</a></li>



                  <li><a href="character_certificate.php?a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156&amp;student_id=<?php echo $WorkAssignListVal[0]['student_id'];?>" target="_blank">Character Certificate</a></li>



                  <li><a href="provisional_certificate.php?a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156&amp;student_id=<?php echo $WorkAssignListVal[0]['student_id'];?>" target="_blank">Provisional Certificate</a></li>



                  <li><a href="sports_certificate.php?a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156&amp;student_id=<?php echo $WorkAssignListVal[0]['student_id'];?>" target="_blank">Sports Certificate</a></li>



                  <li><a href="appreciation_certificate.php?a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156&amp;student_id=<?php echo $WorkAssignListVal[0]['student_id'];?>" target="_blank">Appreciation Certificate</a></li>



                  <li><a href="school_leaving_certificate.php?a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156&amp;student_id=<?php echo $WorkAssignListVal[0]['student_id'];?>" target="_blank"> Leaving Certificate</a></li>



                  <li><a href="birth_certificate.php?a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156&amp;student_id=<?php echo $WorkAssignListVal[0]['student_id'];?>" target="_blank"> Birth Certificate</a></li>



                  <li><a href="study_certificate.php?a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156&amp;student_id=<?php echo $WorkAssignListVal[0]['student_id'];?>" target="_blank"> Study Certificate</a></li>



                  <li><a data-toggle="modal" data-target="#StudentCard<?php echo $WorkAssignListVal[0]['student_id'];?>" target="_blank"> Student Card</a></li>



                  <li><a data-toggle="modal" data-target="#StudentCardLandscape<?php echo $WorkAssignListVal[0]['student_id'];?>" target="_blank"> Student Card LandScape</a></li>



              



                    </ul>

              </div>





                    </ul>



                    <!-- Student Card Portrait Popup start -->





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

        <div class="modal-dialog">



          <!-- Modal content-->

          <div class="modal-content" style="width: 100%;">

            <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;"> Choose Color   </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="StudentCardcolorscheme"> 

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

           <input type="hidden" id="date"  name="section" value="<?php echo $WorkAssignListVal['section_id']; ?>" />

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

                  <label>Please Choose Color Scheme</label>  

                  <input class="form-control" type="Color" name="color" style="height: 52px;">              

                  </div>

               

                 <br><br><br><br>



            <div class="modal-footer">



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

              





            </div>







                 </form>



          </div>



          </div>



        </div>

      </div>



      <!-- Student Card Portrait popup ending -->





       <!-- Student Card Landscape Popup start -->





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

        <div class="modal-dialog">



          <!-- Modal content-->

          <div class="modal-content" style="width: 100%;">

            <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;"> Choose Color   </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="StudentCardLandscapeColorScheme"> 

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

           <input type="hidden" id="date"  name="section" value="<?php echo $WorkAssignListVal['section_id']; ?>" />

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

                  <label>Please Choose Color Scheme</label>  

                  <input class="form-control" type="Color" name="color" style="height: 52px;">              

                  </div>

               

                 <br><br><br><br>



            <div class="modal-footer">



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

              





            </div>







                 </form>



          </div>



          </div>



        </div>

      </div>



      <!-- Student Card Landscape popup ending -->



       <!-- Student Result popup start -->





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





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

   

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





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

          

<?php 



  $match;

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

        $match=$_REQUEST['session'];

      }else { $match=$_SESSION['current_session']; }

  //echo $match; 



?>



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



              <?php

                 

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

              foreach($WorkAssignList as $sessionss)

              { ?>



                 <option <?php if($match==$sessionss['session_id']){echo "selected";} ?> value="<?php echo $sessionss['session_id']; ?>">

                  <?php echo $sessionss['session_year']; ?></option>



          <?php } ?>



          </select>

          

        </div>





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

          <input type="submit" value="Search" class="btn-success form-control" style="border-radius:5px;border:none;" >

        </div>







   </div>





</form>



      <!-- start popup code stdent struck off -->



      <div id="EmpPayroll<?php echo $WorkAssignListVal[0]['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;"> Reason of Struck Off (<?php echo $WorkAssignListVal[0]['first_name']." - ".$WorkAssignListVal[0]['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_student"> 

     <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="student" value="<?php echo $WorkAssignListVal[0]['student_id']; ?>">

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

     <input type="hidden" name="deleteLocalStorage" value="delete">

           

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



 <div class="form-group ">



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

        <select required name="fee" id="fee" onChange="HideDate(this.value);" class="form-control"  >



          <option value=''>Select</option>

          <option <?php if($_GET['fee']=="0"){echo 'selected';}?> value='Completed'>Class/Course Completed</option>

          <option <?php if($_GET['fee']=="0"){echo 'selected';}?> value='Migration'>Migration </option>

          <option <?php if($_GET['fee']=="0"){echo 'selected';}?> value='Miss Behaviour'>Miss Behaviour</option>

          <option <?php if($_GET['fee']=="0"){echo 'selected';}?> value='Fee Defaulter'>Fee Defaulter</option>

           <option <?php if($_GET['fee']=="0"){echo 'selected';}?> value='Regular Absents'>Regular Absents</option>



           <option <?php if($_GET['fee']=="0"){echo 'selected';}?> value='Duplicate Entry'>Duplicate Entry </option>

          

          <option <?php if($_GET['fee']=="0"){echo 'selected';}?> value='Wrong Entry'>Wrong Entry </option>

                                           

          <option <?php if($_GET['fee']=="Other"){echo 'selected';}?> value='Other'>Other </option>

           

          



        </select>

      </div>



      <div class="form-group ">



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

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



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

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



        </select>

      </div>



       <div class="form-group ">



          <label class="required">Struck off Date</label>



          <input type="date" name="struck_date" class="form-control"

          value="<?php echo date("Y-m-d");?>"  />

        

        </div>

</div> 

                   

              

                  

                  <div class="col-md-12" style="padding:8px;<?php if(isset($_REQUEST['from']) && $_REQUEST['fee']=='Other'){ 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 -->





       <!-- Student Attendance History Popup Start -->

      

      <div id="AttendanceHistory<?php echo $WorkAssignListVal[0]['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;"> Attendance History (<?php echo $WorkAssignListVal[0]['first_name']." - ".$WorkAssignListVal[0]['user_lname']; ?>)  </h4>

            </div>



            <div class="modal-body">









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



    

     <input type="hidden" id="date"  name="student" value="<?php echo $WorkAssignListVal[0]['student_id'];?>" />

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

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

    

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



 <div class="form-group ">



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

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



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

              



             <?php



                 $match;

                  if(!isset($_REQUEST['session'])){

                    $match=$_SESSION['current_session'];

                  }else { $match=$_REQUEST['session']; }

                 

                           

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

                  foreach($WorkAssignList11 as $WorkAssignListVal11)

                  { ?>



                     <option <?php if($match==$WorkAssignListVal11['session_id']){echo 'selected';}?> value="<?php echo $WorkAssignListVal11['session_id']; ?>">

                      <?php  $val1=explode("-",$WorkAssignListVal11['session_year']); echo $val1[0];?></option>





                          <?php

                  } ?>



          </select>

      </div>



           

</div> 

                                   

      

        <div class="modal-footer">



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

          





        </div>







        </form>



          </div>



          </div>



        </div>

      </div>



      <!-- Student Attendance History popup ending -->



      



      <!-- Student SMS popup -->



       <div id="SMSsend<?php echo $WorkAssignListVal[0]['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;"> Send SMS (<?php echo $WorkAssignListVal[0]['first_name']." - ".$WorkAssignListVal[0]['user_lname']; ?>)  </h4>

            </div>



            <div class="modal-body">

<input type="button" onClick="myFunction()" id="button" class="btn btn-primary pull-right" style="padding:4px 10px 4px 10px;" value="Add Template" /> 

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



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

         

           <input type="hidden" name="student" value="<?php echo $WorkAssignListVal[0]['student_id']; ?>">



<div class="col-md-12 col-xs-12" style="display:none;" id="myDIV" >



<div class="form-group" >







<div style="float:left;">  <label >  Select Template </label> 



</div>





<select name="class" id="template" class="select_add" style="width: 100%;height: 32px;" onChange="apply(this.value)"  >

<option value="">Choose Template </option>



<?php

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

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

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

foreach($WorkAssignList1 as $WorkAssignListVal1)

{ ?>



<option <?php if($student[0]['template_title']==$WorkAssignListVal1['template_title']){echo "selected";} ?> value="<?php echo $WorkAssignListVal1['template_detail']; ?>"><?php echo $WorkAssignListVal1['template_title']; ?></option>





<?php  } ?>



</select>

</div>

</div>

                    

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



    <div class="form-group ">



    <label class="required">Cell Number</label>

        <input type="text" name="cell_no" class="form-control" value="<?php echo $WorkAssignListVal[0]['cell_no']; ?>">

    </div>



       <div class="form-group ">



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



          <textarea class="form-control" name="message" id="text" rows="8"></textarea>

        

        </div>

</div> 



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





                          <div class="msg-count">



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

                              <strong><span>Total:<span id="char">0</span></span></strong>



                            </div>



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

                              <strong>Contacts:<span id="recipient">0</span></strong>

                            </div>

                            

                            

                            <div class="col-md-4 col-sm-4" style="text-align:right;">

                              <strong class="text-right" ><span>Left:<span id="leavechar">160</span></span></strong>                            

                            </div>

                            

                            

                            <div class="col-md-4 col-sm-4" style="text-align:right;">

                              <strong class="text-right" ><span class="text-right">MAX:<span id="maxcount">612</span></span></strong>

                            

                            </div>

                            

                            <div class="col-md-4 col-sm-4" style="text-align:right;">

                              <strong class="text-right" ><span class="text-right">Count:<span onChange="msg_count();" id="msgcount">0 

                              </span></span></strong>

                             <input type="hidden" name="msgcount1" id="msgcount1" value="0" />

                            </div>





                              <input type="hidden" name="id" id="id" value="">

                         

                          </div>







                   </div>

                                                         

      

            <div class="modal-footer">



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

              





            </div>







                 </form>



          </div>



          </div>



        </div>

      </div>



      <!-- Student SMS ending Popup -->



       <!-- Student Track popup ending -->



      <div id="stdTrack<?php echo $WorkAssignListVal[0]['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;"> Promote/Demote Track (<?php echo $WorkAssignListVal[0]['first_name']." - ".$WorkAssignListVal[0]['user_lname']; ?>)  </h4>

            </div>



            <div class="modal-body">









           

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



           <table border="1" width="100%" id="paid_table">  



              <tr>  

                <th style="background-color: #337ab7;color: white;"> Date</th>

                <th style="background-color: #337ab7;color: white;"> From  </th>

                <th style="background-color: #337ab7;color: white;"> To  </th>

                <th style="background-color: #337ab7;color: white;"> Remarks  </th>

                

              </tr>     





                

                <?php 

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

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

                $std_tracks = $m->get("eduportal_students_promotion_track");

//print_r($std_tracks);

                $count=1;

                foreach ($std_tracks as $std_track) { 





                  $m->where("session_id", $std_track['from_session']);

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



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

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



            $m->where("section_id", $std_track['from_section']);

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





            $m->where("session_id", $std_track['to_session']);

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



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

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



            $m->where("section_id", $std_track['to_section']);

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



                  ?>



                  

                <tr> 

                

                  <td style="color: black;text-align: left;padding: 1%;"><?php echo date("d-M-Y",strtotime($std_track['action_date']));?></td>

                  <td style="color: black;text-align: left;padding: 1%;"><?php echo $sessionFrom[0]['session_year']." / ".$classFrom[0]['Class_Name']." / ".$sectionFrom[0]['section_name'];?></td>

                  <td style="color: black;text-align: left;padding: 1%;"><?php echo $sessionTo[0]['session_year']." / ".$classTo[0]['Class_Name']." / ".$sectionTo[0]['section_name'];?></td>

                  <td style="color: black;text-align: left;padding: 1%;"><?php echo $std_track['remarks'];?></td>

                </tr>



              <?php } ?>



                                        

           

            

             </table>



             



        </div> 

                   

              

                  

                                     

      

            <div class="modal-footer">



           

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

              





            </div>









          </div>



          </div>



        </div>

      </div>



      <!-- Student Track popup ending -->

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

                  </div>

                  <div class="x_content">

                   

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



                     

                  

                       <div class="" role="tabpanel" data-example-id="togglable-tabs">

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

                          <li role="presentation" class="active"><a href="#tab_content4" role="tab" id="profile-tab4" data-toggle="tab" aria-expanded="false">Profile</a>

                          </li>



                          <li role="presentation" onclick="StudentResultData()"><a href="#tab_content2" role="tab" id="profile-tab" data-toggle="tab" aria-expanded="false">Result</a>

                          </li>



                          <li><a href="print_students_attendance_history.php?a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156&amp;student=<?php echo $WorkAssignListVal[0]['student_id'];?>&class_id=<?php echo $WorkAssignListVal[0]['class_id'];?>&section_id=<?php echo $WorkAssignListVal[0]['section_id'];?>&session=<?php echo $_SESSION['current_session'];?>" target="_blank">Attendance</a>

                          </li>



                          <li><a href="print_monthly_fee_report.php?a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156&amp;std=<?php echo $WorkAssignListVal[0]['student_id'];?>&year=<?php echo $year;?>&months=1,2,3,4,5,6,7,8,9,10,11,12" target="_blank"> Fee History </a></li>



                          <li role="presentation" class=""><a href="#tab_content5" role="tab" id="profile-tab5" data-toggle="tab" aria-expanded="false">Parents Login</a>

                          </li>



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



                        </ul>







                          

                        <div id="myTabContent" class="tab-content" style="padding:1%;">



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



 





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

                <div class="form-group ">

                      <label class="required" style="color:white; "> . </label> <br>

                      <a onclick="FamilyData(<?php echo $WorkAssignListVal[0]['student_id'];?>,'<?php echo $WorkAssignListVal[0]['cell_no'];?>')" class="btn btn-success"> Show Family Data With Cell No </a>      

                  </div>

                </div>



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

                <div class="form-group ">

                      <label class="required" style="color:white; "> . </label> <br>

                      <a onclick="FamilyDataWithCodeNo(<?php echo $WorkAssignListVal[0]['student_id'];?>,'<?php echo $WorkAssignListVal[0]['family_code'];?>')" class="btn btn-success"> Show Family Data With Code </a>      

                  </div>

                </div>





            <div id="myID<?php echo $WorkAssignListVal[0]['student_id'];?>" style="display:none">

   



            </div> 



            </div>



                        <div role="tabpanel" class="tab-pane fade active in" id="tab_content4" aria-labelledby=" home-tab">

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

                        </div>

                        <div role="tabpanel" class="tab-pane fade" id="tab_content1" aria-labelledby="profile-tab">



                          <!-- start Fee History -->

      

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

                          <!-- end Fee History -->



                        </div>



                          <div role="tabpanel" class="tab-pane fade" id="tab_content2" aria-labelledby="profile-tab">



                            <p style="text-align:center;" id="hideMe">Results is retreiving please patience.</p>

                            <div id="myIDmyID">

   



                            </div>



                            <!-- start Student Result -->

             

                            <?php //include('student_result_history.php');?>

                            

                            <!-- end Student Result -->



                          </div>



                          <div role="tabpanel" class="tab-pane fade" id="tab_content3" aria-labelledby="profile-tab">

                            <!-- Attendance Search -->

                            <?php //include('student_attendance_history.php');?>

                            <!-- Attendance Search -->

  

   

                          </div>



                          <div role="tabpanel" class="tab-pane fade" id="tab_content5" aria-labelledby="profile-tab">

                            

            <div>

               <div class="" width="30%" style="float: left;font-weight: bold;font-size: 12px;"> Parent Id: </div>

               <div class="" width="70%" style="float: left; margin-left: 61px;font-size: 12px;"> <?php  if($parentsIdPaswrd1[0]['parents_cellno']!=NULL){echo $parentsIdPaswrd1[0]['parents_cellno'];}else {echo "--";};?> </div>

            </div>

            <br>

            <div>

               <div class="" width="30%" style="float: left;font-weight: bold;font-size: 12px;"> Parent Password: </div>

               <div class="" width="70%" style="float: left; margin-left: 15px;font-size: 12px;"> <?php  if($parentsIdPaswrd1[0]['password']!=NULL){echo $parentsIdPaswrd1[0]['password'];}else {echo "--";};?> </div>

            </div>

            <br>



            <h3 style="text-align: center;">Sibling Names</h3>

<?php 

$branch_id=$_SESSION['branch'];

$cell_no=$parentsIdPaswrd[0]['parents_cellno'];

              $sql="SELECT * FROM edu_student_details as std WHERE std.cell_no='$cell_no' and std.branch_id='$branch_id' and std.status='0'";

//print_r($sql);

$studentsName = $m->query($sql);





foreach($studentsName as $students)

      {



        echo $students['first_name']." ".$students['last_name']."<br>";



      }

  ?>



  <table id="listofstudents" class="table table-striped table-bordered" style="width:50%;float: right;">

 

        <thead>

            <tr>



              

             

                <th width="15%">Parents Portal</th>

                <th width="15%">Mobile App</th>

                <th width="10%">Action</th>

                            

                             

                                

            </tr>

        </thead>

        <tbody>





   

     

     <?php 





       $m->where("cell_no", $parentsIdPaswrd[0]['parents_cellno']);

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



        

      ?>



        <tr>

          <input type="hidden" name="last_name<?php echo $WorkAssignListVal['parents_id'];?>" value="<?php echo  $WorkAssignListVal['parents_name'];?>">

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

          <input type="hidden" name="parent_password<?php echo $WorkAssignListVal['parents_id'];?>" value="<?php echo  $WorkAssignListVal['password'];?>">



                      

          

          <td style="text-align:center;"> 





       



       <a style="padding: 0px 5px;" href="profile_portal_link_popup.php?parentId=<?php echo $parentsIdPaswrd[0]['parents_id'];?>&profile='profile'&portallink=<?php echo $soft_link;?>" class="iframePupop btn btn-success" >

          Send Portal Link

        </a>

        </td>  

       



   <td style="text-align:center;"> 





      



       <a style="padding: 0px 5px;" href="profile_app_link_popup.php?parentId=<?php echo $parentsIdPaswrd[0]['parents_id'];?>&profile='profile'&portallink=<?php echo $soft_link;?>" class="iframePupop btn btn-success" >

          Mobile App Link

        </a>



       </td>



       <td>



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



            <i class="fa fa-pencil" aria-hidden="true"></i>



        </a>



         <a href="<?php echo DOMAIN.AgentDirectory;?>parent/InsertMe.php?id=<?php echo $parentsIdPaswrd[0]['parents_id'];?>&profile='profile'&action=DeleteParentId" style="padding: 0px 5px; font-size:14px;" onClick="return confirm('Are you sure you want to delete this record');"  class="btn btn-danger"><i class="fa fa-remove"></i> </a>

       </td>



        <!-- Student Result popup start -->





      <div id="EditParentAccess<?php echo $parentsIdPaswrd[0]['parents_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;"> Edit Password (<?php echo $parentsIdPaswrd[0]['parents_name']." - ".$WorkAssignListVal[0]['user_lname']; ?>)  </h4>

            </div>



            <div class="modal-body">



</form>





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



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

           <input type="hidden" name="parents_id" value="<?php echo $parentsIdPaswrd[0]['parents_id']; ?>">

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

           

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



                       <div class="form-group ">



                          <label class="required"> Parents Name</label>

                              <input name="parents_name"  id="" value="<?php echo $parentsIdPaswrd[0]['parents_name'];?>" autocomplete="off" type="text" class="form-control"/>

                       

                          </div>

                  </div> 





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



                       <div class="form-group ">



                          <label class="required"> Cell No</label>

                              <input name="parents_cellno"  id="" value="<?php echo $parentsIdPaswrd[0]['parents_cellno'];?>" autocomplete="off"  type="text" class="form-control"/>

                       

                          </div>

                  </div>                         

                  



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



                       <div class="form-group ">



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

                              <input name="password"  id="" value="<?php echo $parentsIdPaswrd[0]['password'];?>" autocomplete="off" type="text" class="form-control"/>

                       

                          </div>

                  </div>                     

      

            <div class="modal-footer">



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

              





            </div>







                 </form>



          </div>



          </div>



        </div>

      </div>



      <!-- Student result popup ending -->



               

        



              </tr>



       

 

        </tbody>

        

    </table>

                          </div>





                        </div>

                      </div>

                    </div>

                  </div>

                </div>

              </div>

            </div>

          </div>

        </div>



            </div>

          </div>

        </div>

        <!-- /page content -->

  

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



  <script type="text/javascript">

$(document).ready(function() {



        

        document.getElementById("text").value = '';

        $("#text").removeAttr('dir');

        $('.unicode-show').hide();

        $("#text").attr('maxlength', '612');

        document.getElementById('char').innerHTML = "0";

        document.getElementById('leavechar').innerHTML = "160";

        document.getElementById('maxcount').innerHTML = "612";

        document.getElementById('msgcount').innerHTML = "0";

        





    function show(ch, leave, messagecount, total, maxLen) {

        $('#char').html(ch);

        $('#leavechar').html(leave);

        $('#maxcount').html(maxLen);

        $('#msgcount').html(messagecount);

        $("#message").attr('maxlength', maxhtml);

    };









$("[name='message']").keyup(function() {

        var len = this.value.length;

        

        

        if (len!= "") {

           

            var chars = 1;

            var msgs = 1;

            var maxLen = 612;

            var level1 = 160;

            var level2 = 146;

            var level3 = 153;

            var level4 = 153;



            maxhtml = 612;

          



            if (len == 0) {

                show(0, level1, 0, 0, maxLen);

            } else if (len > 0 && len <= level1) {

                var tot;

                tot = "";

                show(len, level1 - len, 1, len, maxLen - len);

                document.getElementById("msgcount1").value=1;

            } else if (len > level1 && len <= (level2 + level1)) {

                var tot;

                tot = len - level1;

                show(tot, level2 - tot, 2, len, maxLen - len);

                document.getElementById("msgcount1").value=2;

            } else if (len > (level2 + level1) && len <= (level3 + level1 + level2)) {

                var tot;

                tot = len - (level1 + level2);

                show(tot, level3 - tot, 3, len, maxLen - len);

                document.getElementById("msgcount1").value=3;

            } else if (len > (level3 + level1 + level2) < len <= maxLen) {

                var tot;

                tot = len - (level1 + level2 + level3);

                show(tot, level4 - tot, 4, len, maxLen - len);

                document.getElementById("msgcount1").value=4;

                

                 if (maxLen - len<0){

                    msg = $('#message').val(); 

                    str = msg.slice(0, maxLen - len);

                    document.getElementById("message").value = str;

                    return;   

                    }

                 

                 

           

                

                

            } else {





            }

        }

    });



});

</script>



  <link rel="stylesheet" href="colorbox.css" />



<script src="jquery.colorbox.js"></script>



 <script>



$(document).ready(function(){



$(".iframePupop").colorbox({iframe:true, width:"80%", height:"85%"});



});



</script>



  </body>

</html>

