<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <title>SIMS - Admin</title>

  <?php include 'header.php' ?>
 </head> 
 
 
<body class="grey lighten-3"> 

<?php 
$fname = $this->db->query("SELECT concat(lastname,' ',name_pref,', ',firstname) as name from faculty_list where id = $fid ")->row()->name;
$sy = $this->db->query('SELECT * FROM evaluation_list where status = 1 and is_default = 1 ')->row();
foreach($sy as $k => $v){
    $e_arr[$k] = $v;
}
$class = $this->db->query("SELECT r.*,concat(co.course,' ',cl.year,'-',cl.section,' - ',s.subject) as class,cl.id as cl_id,s.subject,cl.department_id FROM restriction_list r  inner join curriculum_level_list cl on cl.id = r.curriculum_id inner join subjects s on s.id = r.subject_id inner join courses co on co.id = cl.course_id where cl.status = 1 and r.evaluation_id = '{$e_arr['id']}' and r.faculty_id = $fid ".($_SESSION['login_user_type'] != 1 ? " and cl.department_id = '{$_SESSION['login_department_id']}' ":""));
// var_dump($class)
$rid = isset($_GET['rid']) ? $_GET['rid']: '';
$cl_id = isset($_GET['cl_id']) ? $_GET['cl_id']: '';
$sid = isset($_GET['sid']) ? $_GET['sid']: '';
?>

<header>

     <?php include 'top_bar.php' ?>
     <?php include 'nav_bar.php' ?>

    

  </header>
  <!--Main Navigation-->



 
   

      <!--Grid row-->
    <div class="row wow fadeIn">

        <!--Grid column-->
        <div class="col-md-9 mb-4">

          <!--Card-->
          <div class="card">

            <!--Card content-->
            <div class="card-body">

              <canvas id="myChart"></canvas>

            </div>

          </div>
          <!--/.Card-->

        </div>
        <!--Grid column-->

        <!--Grid column-->
        <div class="col-md-3 mb-4">

          <!--Card-->
          <div class="card mb-4">

            <!-- Card header -->
            <div class="card-header text-center">
              Pie chart
            </div>

            <!--Card content-->
            <div class="card-body">

              <canvas id="pieChart"></canvas>

            </div>

          </div>
          
        </div>
        <!--Grid column--> 
        
    </div>    
     <!--Grid row-->    
     
     
     
     
     
     
     
    <!-- SCRIPTS -->
  <!-- JQuery -->
  <script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
  <!-- Bootstrap tooltips -->
  <script type="text/javascript" src="js/popper.min.js"></script>
  <!-- Bootstrap core JavaScript -->
  <script type="text/javascript" src="js/bootstrap.min.js"></script>
  <!-- MDB core JavaScript -->
  <script type="text/javascript" src="js/mdb.min.js"></script>
  <!-- Initializations -->
  <script type="text/javascript">
    // Animations initialization
    new WOW().init();

  </script>

  <!-- Charts -->
  <script>
    // Line
    var ctx = document.getElementById("myChart").getContext('2d');
    var myChart = new Chart(ctx, {
      type: 'bar',
      data: {
        labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
        datasets: [{
          label: '# of Votes',
          data: [12, 19, 3, 5, 2, 3],
          backgroundColor: [
            'rgba(255, 99, 132, 0.2)',
            'rgba(54, 162, 235, 0.2)',
            'rgba(255, 206, 86, 0.2)',
            'rgba(75, 192, 192, 0.2)',
            'rgba(153, 102, 255, 0.2)',
            'rgba(255, 159, 64, 0.2)'
          ],
          borderColor: [
            'rgba(255,99,132,1)',
            'rgba(54, 162, 235, 1)',
            'rgba(255, 206, 86, 1)',
            'rgba(75, 192, 192, 1)',
            'rgba(153, 102, 255, 1)',
            'rgba(255, 159, 64, 1)'
          ],
          borderWidth: 1
        }]
      },
      options: {
        scales: {
          yAxes: [{
            ticks: {
              beginAtZero: true
            }
          }]
        }
      }
    });

    //pie
    var ctxP = document.getElementById("pieChart").getContext('2d');
    var myPieChart = new Chart(ctxP, {
      type: 'pie',
      data: {
        labels: ["Red", "Green", "Yellow", "Grey", "Dark Grey"],
        datasets: [{
          data: [300, 50, 100, 40, 120],
          backgroundColor: ["#F7464A", "#46BFBD", "#FDB45C", "#949FB1", "#4D5360"],
          hoverBackgroundColor: ["#FF5A5E", "#5AD3D1", "#FFC870", "#A8B3C5", "#616774"]
        }]
      },
      options: {
        responsive: true,
        legend: false
      }
    }); 
    
  </script>
</body>

</html>    