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


 ?>
<!DOCTYPE html>
<html lang="en">
  <head>
    
    <title>Study Material | EduPortal</title>
    <?php include('RootMe/css_links.php');?>
  
     <!-- ################### -->
     <!-- CSS files for table -->
   <!-- x-editor CSS
		============================================ -->
    <link rel="stylesheet" href="css/editor/select2.css">
    <link rel="stylesheet" href="css/editor/datetimepicker.css">
    <link rel="stylesheet" href="css/editor/bootstrap-editable.css">
    <link rel="stylesheet" href="css/editor/x-editor-style.css">

    <!-- normalize CSS
		============================================ -->
    <link rel="stylesheet" href="css/data-table/bootstrap-table.css">
    <link rel="stylesheet" href="css/data-table/bootstrap-editable.css">

     <!-- responsive CSS
		============================================ -->
        <link rel="stylesheet" href="css/responsive.css">
    <!-- main CSS
		============================================ -->
        <link rel="stylesheet" href="css/main.css">
    <!--###################  -->


<script type="text/javascript">

function getSubCat(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("subcatgory").innerHTML=xmlhttp.responseText;
       //alert(xmlhttp.responseText);

      }

    }
    xmlhttp.open("GET","get_exp_subcategory.php?id="+id,true);
    xmlhttp.send();
  }
</script> 
  </head>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- <script>
$(document).ready(function(){
  
    $("#div1").fadeOut();
    $("#div2").fadeOut("slow");
    $("#div3").fadeOut(3000);
 
});
</script> -->
  <style>
#snackbar {
  visibility: hidden;
  min-width: 250px;
  margin-left: -125px;
  background-color: #1E90FF;
  color: #fff;
  text-align: right;
  border-radius: 2px;
  padding: 16px;
  position: fixed;
  z-index: 1;
  left: 80%;
  bottom: 30px;
  font-size: 17px;
}

#snackbar.show {
  visibility: visible;
  -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
  animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@-webkit-keyframes fadein {
  from {bottom: 0; opacity: 0;} 
  to {bottom: 30px; opacity: 1;}
}

@keyframes fadein {
  from {bottom: 0; opacity: 0;}
  to {bottom: 30px; opacity: 1;}
}

@-webkit-keyframes fadeout {
  from {bottom: 30px; opacity: 1;} 
  to {bottom: 0; opacity: 0;}
}

@keyframes fadeout {
  from {bottom: 30px; opacity: 1;}
  to {bottom: 0; opacity: 0;}
}

.active{
        color:aqua;
    }
</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">

          <a href="dashboard.php">Dashboard </a> &nbsp; <i style="" class="fa fa-angle-double-right"></i> &nbsp;
                  Download Center <i style="" class="fa fa-angle-double-right"></i> &nbsp; <span class="active"> Study Material </span> 
                    <br><br>
          <div class="row" style="background-color: white;">
  <section class="add_sub_agent" id="table_sub_agent">
  <div class="container">
 <div class="" style="margin-top:10px;">
                                    <!-- page content -->
        
  <div class="">
    
      <h3 style="margin-left: 15px;">Study Material</h3>
            <div class="row">
          
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
            
                  <div class="x_content">
          <br>
     
                    <form action="<?php echo DOMAIN.AgentDirectory;?>parent/InsertMe.php" method="post" enctype="multipart/form-data" class="form-horizontal form-label-left" >
                  
                     
 <!-- Main content  id="listofstudents1"-->
 <div style="overflow-x:auto;">
 <table id="table" data-toggle="table" class="table-bordered" data-pagination="true" data-search="true" data-show-columns="true" data-show-pagination-switch="true" data-show-refresh="true" data-key-events="true" data-show-toggle="true" data-resizable="true" data-cookie="true"
      data-show-export="true" data-click-to-select="true" data-toolbar="#toolbar">
                           

                            <thead>
                                <tr>
                                    <th width="5%"> Serial No.</th>
                                    <th width="25%"> Content Title</th>
                                    <th width="10%">Type</th>
                                    <th width="10%">Available For </th>
                                    <th width="10%">Class</th>
                                    <th width="10%">Date</th>
                                    <th width="10%">Action</th>
                                </tr>
                            </thead>
                            <tbody>

                                <?php $count = 1;

                                $m->where("branch_id", $_SESSION['branch']);
                                $m->orderBy("contentID", "desc");
                                $m->where("content_type", "Study Material");
                                $WorkAssignListings = $m->get("eduportal_download_center");

                                foreach ($WorkAssignListings as $WorkAssignListVal) {

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

                                    $m->where("section_id", $WorkAssignListVal['section_id']);
                                    $section = $m->get("edu_adm_section_detail");

                                ?>

                                    <tr>
                                        <td style="text-align:center;"> <?php echo $count; $count += 1; ?> </td>
                                        <td style=""> <?php echo $WorkAssignListVal['content_title']; ?> </td>
                                        <td style=""> <?php echo $WorkAssignListVal['content_type']; ?> </td>
                                        <td style=""> <?php echo $WorkAssignListVal['content_available']; ?> </td>
                                        <td> <?php echo $class[0]['Class_Name']; ?> - <?php echo $section[0]['section_name']; ?> </td>
                                        <td style=""> <?php echo $WorkAssignListVal['upload_date']; ?> </td>

                                        <td>
                                         
                                            <a href="<?php echo DOMAIN . AgentDirectory; ?>parent/InsertMe.php?content_id=<?php echo $WorkAssignListVal['contentID']; ?>&action=DeleteContent" 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>

                                           <a class="btn btn-success" style="padding: 0px 5px; font-size:14px;" href="<?php echo DOMAIN.AgentDirectory;?>upload_img/<?php echo $WorkAssignListVal['file'];?>" download><i class="fa fa-download"></i></a>



                                        </td> 

                                    </tr>
                                <?php
                                } ?>
                            </tbody>
                        </table>
                    </div>


                        </div>
                      </div>

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

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


 <!-- ################## -->

   <!-- JS files for table -->
      <!-- bootstrap JS
		============================================ -->
  <!-- data table JS
		============================================ -->
    <script src="js/data-table/bootstrap-table.js"></script>
    <script src="js/data-table/tableExport.js"></script>
    <script src="js/data-table/data-table-active.js"></script>
    <script src="js/data-table/bootstrap-table-editable.js"></script>
    <script src="js/data-table/bootstrap-editable.js"></script>
    <script src="js/data-table/bootstrap-table-resizable.js"></script>
    <script src="js/data-table/colResizable-1.5.source.js"></script>
    <script src="js/data-table/bootstrap-table-export.js"></script>
    <!--  editable JS
		============================================ -->
    <script src="js/editable/jquery.mockjax.js"></script>
    <script src="js/editable/mock-active.js"></script>
    <script src="js/editable/select2.js"></script>
    <script src="js/editable/moment.min.js"></script>
    <script src="js/editable/bootstrap-datetimepicker.js"></script>
    <script src="js/editable/bootstrap-editable.js"></script>
    <script src="js/editable/xediable-active.js"></script>

    <!--###############  -->

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