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

$pageName=basename($_SERVER['PHP_SELF']);

    
     $m->where("page_name", $pageName);
     $video = $m->get("eduportal_modules_pages_detail");


   $sessionIDs;
 
  if($_GET["session"]!=NULL ){

      $sessionIDs= $_GET["session"];
    }
    else{
      $sessionIDs= $_SESSION['current_session'];
    }

$section=$_REQUEST['section'];
$class=$_REQUEST['class_id'];
$branchId=$_SESSION['branch'];

/*$orderBy;

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

	$orderBy='asc';

} else {

$orderBy=$_REQUEST['orderBy'];

}*/

$query="SELECT * FROM eduportal_subject_config as sub, eduportal_class_subjects as cls where cls.subject_id=sub.subject_id and cls.class_id='$class' and cls.section_id='$section' and cls.session_id='$sessionIDs' and cls.branch_id='$branchId' ";
//print_r($query);
$WorkAssignListings = $m->query($query);

 
     ?>

<input type="hidden" name="" value="<?php print_r($query);?>">
<!DOCTYPE html>
<html lang="en">
  <head>
    
    <title>MarkSheet | EduPortal</title>
    <?php include('RootMe/css_links.php');?>


<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.1/css/bootstrap-select.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.1/js/bootstrap-select.min.js"></script>
   
  </head>
<script type="text/javascript">
  
function getterm(id){
//alert(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("term_id").innerHTML=xmlhttp.responseText;
               //  alert(xmlhttp.responseText);

              }

            }

            xmlhttp.open("GET","get_term.php?session_id="+id,true);

            xmlhttp.send();

          }

</script>

<style type="text/css">
    .center {
  margin-left: auto;
  margin-right: auto;
}
  </style>

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

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

        

           <a href="academic_setting.php" class="btn btn-round btn-info quiklink pull-right">Academic Settings </a>

           <a href="examination.php" class="btn btn-round btn-danger quiklink pull-right" >View Mark Sheets </a>

    <?php if ($video[0]['video_url']!=NULL) { ?>
  
  <a href="watch_video.php?videourl=<?php echo $video[0]['video_url'];?>" target="_blank" class="btn btn-success pull-right btn btn-round" style="padding: 10px 10px;color:white;float: right;"><i class="fa fa-play"></i>&nbsp;&nbsp;Watch Demo</a>

<?php } ?>

<br><br><br>

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


 <div >
      <form  action="print_subjectwise_multi_test_report.php" enctype="multipart/form-data" method="get">
        <div class="panel panel-default">
          <div class="panel-heading"><?php echo count($WorkAssignListings);?> Records <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">
          
            <div class="col-md-12" id="" >


                <div class="col-md-2 col-xs-12" style="padding: 8px;">
                <div class="form-group ">
                  <label class="required">Session</label>
                    <select name="session" id="session" class="form-control" onChange="getterm(this.value)" >

                              <option value="">Select Session</option>
                       
                        <?php
  
                      $match;
                      if(!isset($_REQUEST['session'])){
                        $match=$_SESSION['current_session'];
                      }else { $match=$_REQUEST['session']; }
                     
   
                        $WorkAssignList = $m->get("edu_session_config");
                        foreach($WorkAssignList as $WorkAssignListVal)
                        { ?>

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


                                <?php
                        } ?>

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


               <div class="col-md-2 col-xs-12" style="padding: 8px;">
                <div class="form-group ">
                  <label class="required">Class</label>
 

                  <select name="class_id" id="class_id"  name="term_id"   data-placeholder="Select" class="chosen-multi-select inputfield form-control" onChange="getsec(this.value)"  >
                    <option value="">Select Class</option>

                    <?php
                    $m->where("branch_id", $_SESSION['branch']);
                    $WorkAssignList = $m->get("edu_class_config");
                    foreach($WorkAssignList as $WorkAssignListVal)
                    { ?>

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


                            <?php
                    } ?>

                </select> 
                </div>
              </div>
              
              
              <div class="col-md-2 col-xs-12" style="padding: 8px;">
                <div class="form-group ">
                  <label class="required">Section</label>
                    <select name="section" id="txt_section" class="form-control" onChange="getSubjects(this.value)">
                      
                   <?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="col-md-4 col-xs-12" style="padding: 8px;">
                <div class="form-group ">
                  <label class="required">Select Multi Term</label>
                  
                  <select name="term_id[]" id="term_id"  data-placeholder="Select" class="selectpicker inputfield form-control" multiple data-live-search="true">
                    <option value="">Select Term</option>

                    <?php
                    $m->where("session_id", $sessionIDs);
                    $m->where("branch_id", $_SESSION['branch']);
                    $m->orderBy("term_title","asc");
                    
                    $WorkAssignList = $m->get("eduportal_exam_terms");
                    foreach($WorkAssignList as $WorkAssignListVal)
                    { ?>

                       <option <?php if($_REQUEST['term_id']==$WorkAssignListVal['term_id']){echo 'selected';}?> value="<?php echo $WorkAssignListVal['term_id']; ?>"><?php echo $WorkAssignListVal['term_title']; ?></option>

                            <?php
                    } ?>

                </select> 

                  
                </div>
              </div> 

            

          
           

        

           <div class="col-md-1 pull-right" style="padding:2px;" >
                <div class="form-group ">
                   <input type="hidden" name="addaccountAdmin" value="1">
                <button type="submit" class="btn btn-primary" style="margin-top: 28px;">Search</button>
                </div>
          </div>

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


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

           
          </div>
        </div>

            </div>
          </div>
        </div>
        <!-- /page content -->
  
   <!-- jQuery -->
    <script src="js/ajax_functions.js"></script>  
    
  <?php include('RootMe/js_linksscript.php');?>


       <!-- searchable dropdown -->
    
    <link href="autosearch_select/select2.css" rel="stylesheet">
    <link href="autosearch_select/select2-default.css" rel="stylesheet">
    <script src="autosearch_select/select2.min.js"></script>
    
    <script>
    $(function() {
    $('.chosen-select').select2( { width:'100%', maximumSelectionSize: 1 } );
    $(document).ready(function() {
    $(".chosen-multi-select").select2( { width:'100%', } ); }); }); function slideout(){ setTimeout(function(){
    $(".alert-success").fadeOut("slow", function () { });
    $(".alert-danger").fadeOut("slow", function () { }); }, 4000);}

    $('select').selectpicker();
    </script>

  </body>
</html>
