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

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

 $m->where("page_name", $pageName);

 $param = array('page_id');
 $pageNameAccess = $m->get("eduportal_modules_pages_detail",null,$param);


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

$param1 = array('delete_access');
 $access = $m->get("users_privilege_detail",null,$param1);


       $m->where("status", '0');
       $m->where("branch_id", $_SESSION['branch']);
  
       $param2 = array('template_title', 'template_detail', 'template_date', 'template_id');
       $WorkAssignListings = $m->get("eduportal_templates_details",null,$param2);
 
     ?>


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

  </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="">
             
                <h3>View Templates</h3>
            <a href="add_template.php" class="btn btn-primary pull-right"> Add Template</a>
            <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_content">
      
      <table id="listofstudents" class="table table-striped table-bordered" style="width:100%">
        <thead>
            <tr>
                <th width="5%">S.No</th>
                <th width="20%"> Title </th>
                <th width="40%">Template</th>
                <th width="20%"> Date </th>
                <th width="10%"> Status </th>
                
            </tr>
        </thead>
        <tbody>

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

      ?>

        <tr >
                  

                  <td> <?php echo $count; $count++;?> </td>
                  <td> <?php echo $WorkAssignListVal['template_title'];?> </td>
                  <td> <?php echo $WorkAssignListVal['template_detail']; // session_id().session_id().session_id().session_id().session_id()?> </td>

                  <td style="text-align:center;"> <?php echo time_elapsed_string($WorkAssignListVal['template_date']);?> </td>

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

                <a href="parent/InsertMe.php?action=DeleteTemplate&id=<?php echo $WorkAssignListVal['template_id'];?>" onClick="return confirm('Are you sure you want to delete this record ?')"  class="btn btn-danger"><i class="fa fa-remove"></i> </a>

              <?php } ?>
              
              
               </td>
                    

              </tr>

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

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


     </div>   <!--  main row -->

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

            </div>
          </div>
        </div>
        <!-- /page content -->
  
 <?php include('RootMe/js_linksscript.php');?>
 
  </body>
</html>
