<?php include 'inc_classes.php'; 
include "admin_authentication.php";
// $edit_access='';
// $sel_acc="select * from edit_previleges where admin_id='".$_SESSION['admin_id']."' and privilege_id='392'";
// $ptr_access=mysql_query($sel_acc);
// if(mysql_num_rows($ptr_access))
// {
// 	$edit_access='yes';
// }
?>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Student FeedBack Report</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="bower_components/Ionicons/css/ionicons.min.css">
    <!-- daterange picker -->
    <link rel="stylesheet" href="bower_components/bootstrap-daterangepicker/daterangepicker.css">
    <!-- bootstrap datepicker -->
    <link rel="stylesheet" href="bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
    <!-- iCheck for checkboxes and radio inputs -->
    <link rel="stylesheet" href="plugins/iCheck/all.css">
    <!-- Bootstrap Color Picker -->
    <link rel="stylesheet" href="bower_components/bootstrap-colorpicker/dist/css/bootstrap-colorpicker.min.css">
    <!-- Bootstrap time Picker -->
    <link rel="stylesheet" href="plugins/timepicker/bootstrap-timepicker.min.css">
    <!-- Select2 -->
    <link rel="stylesheet" href="bower_components/select2/dist/css/select2.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="dist/css/AdminLTE.min.css">
    <!-- paginate style -->
    <link rel="stylesheet" href="dist/css/paginate.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="dist/css/skins/_all-skins.min.css">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->
    <!-- Google Font -->
    <link rel="stylesheet"
        href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<?php
 include "include/ps_pagination.php";
 function convertToHoursMins($time, $format = '%02d:%02d') {
    if ($time < 1) {
        return;
    }
    $hours = floor($time / 60);
    $minutes = ($time % 60);
    return sprintf($format, $hours, $minutes);
}
?>

<script>
    function select_staff(branch1) {
        var branch_data1 = "action=faculty&branch_name1=" + branch1;
        // alert(branch1);
        $.ajax({
            url: "tk_staff_ajax.php", type: "post", data: branch_data1, cache: false,
            success: function (retfaculty) {
                // alert(retstaff);
                document.getElementById("staff_name1").innerHTML = retfaculty;

            }
        });
    }
</script>
<?php
$sep_url_string='';
$sep_url= explode("?",$_SERVER['REQUEST_URI']);
if($sep_url[1] !='')
{
	$sep_url_string="?".$sep_url[1];
}
?>
<body class="hold-transition skin-blue sidebar-mini">
    <div class="wrapper">
        <?php include "include/header-main.php"; ?>
        <!-- Left side column. contains the logo and sidebar -->
        <?php include "include/menu_left.php"; ?>
        <!-- Content Wrapper. Contains page content -->
        <!-- Left side column. contains the logo and sidebar -->
        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>
                    Student FeedBack Report
                    <!--<small>Version 2.0</small>-->
                </h1>
                <ol class="breadcrumb">
                    <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
                    <li class="active">Dashboard</li>
                </ol>
            </section>
            <!-- Main content -->
            <section class="content">
                <div class="row">
                    <!-- Left col -->
                    <div class="col-md-12">
                        <!-- TABLE: LATEST ORDERS -->
                        <div class="box box-info">
                            <!-- <div class="nav-tabs-custom">
                                <div class="tab-content"> -->
                                    <!-- ==================================================== student feedback report ============================================================================ -->
                                    <!-- <div class="tab-pane active" id="tab_1"> -->
                                    <div class="table-responsive">
                                        <table class="table no-margin">
                                            <form method="get" name="search_staff">
                                                <tr>
                                                    <?php 
                                                    if($_SESSION['type']=='S' || $_SESSION['branch_access']=='yes')
                                                    {
                                                        ?>
                                                        <td>
                                                            <select class="form-control select2" id="branch_name"
                                                                style="width:200px" name="branch_name"
                                                                onchange="select_staff(this.value)" ;>
                                                                <option value="">Select Branch</option>
                                                                <?php 
                                                                $sel_branch="select branch_id,branch_name from branch";
                                                                $ptr_sel=mysql_query($sel_branch);
                                                                while($data_branch=mysql_fetch_array($ptr_sel))
                                                                {
                                                                    $sel='';
                                                                    if($data_branch['branch_name']==$_GET['branch_name'])
                                                                    {
                                                                    $sel='selected="selected"';
                                                                    }
                                                                    echo '<option '.$sel.' value="'.$data_branch['branch_name'].'" >'.$data_branch['branch_name'].'</option>';
                                                                }
                                                                ?>
                                                            </select>
                                                        </td>
                                                        <?php
                                                    }
                                                    else
                                                    {
                                                        ?>
                                                            <input type="hidden" name="branch_name" id="branch_name" value="<?php echo $_SESSION['branch_name']; ?>" />
                                                            <!-- <input type="hidden" name="staff_name1" id="staff_name1" value="<?php echo $_SESSION['admin_id']; ?>"  /> -->
                                                        <?php
                                                    }
                                                    ?>
                                                    <!-- <td width="5px"></td> -->
                                                    <td>
                                                        <div>
                                                            <?php
                                                            // echo  $_GET['staff_name'];
                                                            if($_REQUEST['staff_name']!='')
                                                            {
                                                                $sel_staffs="select admin_id,name from site_setting where branch_name='".$_REQUEST['branch_name']."'  and system_status='Enabled' and type='F' order by name Asc";
                                                                $ptr_que=mysql_query($sel_staffs);
                                                              ?>
                                                                <select class="form-control select2" style="width:200px"
                                                                    id="staff_name1" name="staff_name">
                                                                    <option value="">Select Faculty</option>
                                                                    <?php
                                                                    while($data_query=mysql_fetch_array($ptr_que))
                                                                    {
                                                                    $sel='';
                                                                    if($data_query['admin_id']==$_REQUEST['staff_name'])
                                                                        {
                                                                        $sel='selected="selected"';
                                                                        }
                                                                    ?>
                                                                    <option <?php echo $sel;?> value="
                                                                        <?php echo $data_query['admin_id'] ;?>">
                                                                        <?php echo $data_query['name'] ;?>
                                                                    </option>
                                                                    <?php
                                                                    }
                                                                ?>
                                                                </select>
                                                                <?php
                                                            }
                                                            else
                                                            {
                                                                ?>
                                                                <select class="form-control select2" style="width:200px"
                                                                    id="staff_name1" name="staff_name">
                                                                    <option value="">Select Faculty</option>
                                                                </select>
                                                                <?php
                                                            }
                                                            ?>
                                                        </div>
                                                    </td>
                                                    <!-- <td width="5px"></td> -->
                                                    <td width="">
                                                        <input type="text" name="start_date"
                                                            class="input_text datepicker" placeholder="Select Date"
                                                            id="datepicker" title="Task Date"
                                                            value="<?php echo $_GET['start_date'] ;?>">
                                                    </td>
                                                    <!-- <td width="5px"></td> -->
                                                    <td>
                                                        <input type="image" src="images/search.jpg" name="search"
                                                            value="search" style="height:32px;">
                                                    </td>
                                                </tr>
                                            </form>
                                        <tr>
                                        <?php
                                        if($_REQUEST['start_date'] && $_REQUEST['start_date']!=="0000-00-00" && $_REQUEST['start_date']!="From Date")
                                        {
                                            $frm_date=explode("/",$_REQUEST['start_date']);
                                            $frm_dates=$frm_date[2]."-".$frm_date[1]."-".$frm_date[0];
                                            $start_date=$frm_dates;
                                            $date=" and DATE(attendance_date )='".date('Y-m-d',strtotime($frm_dates))."'";
                                            $dates=" and DATE(attendence_date )='".date('Y-m-d',strtotime($frm_dates))."'";
                                        }
                                        else{
                                            $date=" and DATE(attendance_date)='".date('Y-m-d',strtotime('-1 days'))."'";
                                            $dates=" and DATE(attendence_date)='".date('Y-m-d',strtotime('-1 days'))."'";
                                        }
                                        if($_REQUEST['branch_name']!='')
                                        {
                                          $branch_name=$_REQUEST['branch_name'];
                                          $select_cm_id="select cm_id from site_setting where branch_name='".$branch_name."' and type='A'";
                                          $ptr_cm_id=mysql_query($select_cm_id);
                                          $data_cm_id=mysql_fetch_array($ptr_cm_id);
                                          $search_cm_id="and cm_id='".$data_cm_id['cm_id']."'";
                                        }
                                        else
                                        {
                                          $search_cm_id="and cm_id='2'";
                                        }
                                        // $search=$_REQUEST['staff_name'];
                                        if($_REQUEST['staff_name']!='')
                                        {
                                          $staff_id=$_REQUEST['staff_name'];
                                          $search_staff_id="and staff_id='".$staff_id."'";
                                          $search_staff_ids="and admin_id='".$staff_id."'";
                                        }
                                        else
                                        {
                                          $search_staff_id='';
                                          $search_staff_ids='';
                                        }
                                      

                                        $i=1;
                                        if($_REQUEST['keyword121']!="keyword121")
                                        $search=trim($_REQUEST['keyword121']);
                                        if($search)
                                        {
                                          $task_search=" and (task_name like '%".$search."%' || priority like '%".$search."%' || status like '%".$search."%')";
                                        }
                                        else
                                        {
                                          $task_search="";
                                        }
                                        // $my_task='';
                                        // $date=date("Y-m-d");
                                        // $date='2023-05-02';
                                        $sel_staff="select * from student_batch_feedback where 1 ".$date." ". $search_staff_id."  ".$search_cm_id." order by batch_id ASC ";
                                        $ptr_staff=mysql_query( $sel_staff);
                                        $no_of_records=mysql_num_rows($ptr_staff);
                                        // $no_of_records=mysql_num_rows($db->query($sel_staff));
                                        $tot_std= $no_of_records*100;
                                        // if($tot_count){
                                        $i=1;
                                      
                                        '<br>' .$sel_tot_batch_std="select enroll_id from student_attendence where 1 and attendence='present' ".$dates."  ".    $search_staff_ids." ".$search_cm_id."";
                                        $ptr_count=mysql_query($sel_tot_batch_std);
                                        $data_count=mysql_num_rows( $ptr_count); 
                                        $remain_std=$data_count-$no_of_records;
                                        ?>
                                        <div class="box-body">
                                            <!-- <div class="table-responsive"> -->
                                                <table class="table no-margin" style="text-align:center">
                                                    <thead>
                                                        <tr>
                                                            <td colspan="2">
                                                                <strong>Branch :
                                                                    <span style="color:blue;">
                                                                        <?php  if($_REQUEST['branch_name']!='')echo ucfirst($_GET['branch_name']); else echo 'Pune';?>
                                                                    </span>
                                                                </strong>
                                                            </td>
                                                            <td>
                                                                <b>Date : 
                                                                    <span style="color:blue;">
                                                                            <?php if($_REQUEST['start_date']!='') echo  date("d-m-Y",strtotime($start_date)); else echo date('d-m-Y',strtotime('-1 days'));  ?>
                                                                    </span>
                                                                </b>
                                                            </td>
                                                            <td>
                                                                <strong>Present Student: </strong>
                                                            </td>
                                                            <td>
                                                                <strong style="color:blue;">
                                                                        <?php echo $data_count ?>
                                                                </strong>
                                                            </td>
                                                            <td>
                                                                <strong>Review Giving Student: </strong>
                                                            </td> 
                                                            <td>
                                                                <strong style="color:blue;">
                                                                        <?php echo $no_of_records ?>
                                                                </strong>
                                                            </td>
                                                            <td>
                                                                <strong>Remaining Student: </strong>
                                                            </td>
                                                            <td>
                                                                <?php
                                                                    if($remain_std!=0)
                                                                    {
                                                                        ?>
                                                                        <button type="button" class="btn btn-danger"
                                                                            data-toggle="modal" data-target="#absent_std">
                                                                            <?php echo '<strong>'.abs($remain_std).'</strong>';?>
                                                                        </button>
                                                                        <?php
                                                                    }
                                                                    else{
                                                                      echo '0';
                                                                    }
                                                                ?>
                                                                <div class="modal fade" id="absent_std">
                                                                    <div class="modal-dialog">
                                                                        <div class="modal-content">
                                                                            <div class="modal-header">
                                                                                <button type="button" class="close"
                                                                                    data-dismiss="modal"
                                                                                    aria-label="Close"> 
                                                                                    <span aria-hidden="true">&times;</span>
                                                                                </button>
                                                                                <h4 class="modal-title">
                                                                                    <span>
                                                                                        <h4>
                                                                                            <strong>Branch : 
                                                                                                <span style="color:blue;">
                                                                                                    <?php  if($_REQUEST['branch_name']!='')echo ucfirst($_GET['branch_name']); else echo 'Pune';?>
                                                                                                </span>
                                                                                            </strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                                            <b>Date: 
                                                                                                <span style="color:blue;">
                                                                                                    <?php if($_REQUEST['start_date']!='') echo  date("d-m-Y",strtotime($start_date)); else echo date('d-m-Y',strtotime('-1 days'));  ?>
                                                                                                </span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                                                <span>
                                                                                                    <a href="excel_std.php<?php echo $sep_url_string; ?>"><img src="images/excel.png" height="30px" width="30px"/></a>
                                                                                                </span>
                                                                                            </b>
                                                                                        </h4>
                                                                                    </span>
                                                                                </h4>
                                                                            </div>
                                                                            <div class="direct-chat-messages">
                                                                                <div class="modal-body">
                                                                                    <?php
                                                                                    $sel_std="select enroll_id from student_batch_feedback where 1 ".$date." ". $search_staff_id." ".$search_cm_id."";
                                                                                    $ptr_std=mysql_query( $sel_std);
                                                                                    $tot_stds=mysql_num_rows( $ptr_std);
                                                                                    $it=1;
                                                                                    while($fetch_std_id=mysql_fetch_array($ptr_std))
                                                                                    {
                                                                                        if( $tot_stds)
                                                                                        { 
                                                                                            $where_data = $fetch_std_id['enroll_id'];
                                                                                            $sel_enroll="select enroll_id from enrollment where 1 and ref_id='".$fetch_std_id['enroll_id']."' ";
                                                                                            $ptr_enroll=mysql_query($sel_enroll);
                                                                                            if(mysql_num_rows($ptr_enroll))
                                                                                            {
                                                                                                while($data_enroll=mysql_fetch_array($ptr_enroll))
                                                                                                {
                                                                                                    $where_data .=','.$data_enroll['enroll_id'];
                                                                                                }
                                                                                            }
                                                                                            if($it==$tot_stds)
                                                                                            {
                                                                                                $std_id .= $where_data;
                                                                                            }
                                                                                            else{            
                                                                                                $std_id .=$where_data.',';
                                                                                            }
                                                                                            $it++;
                                                                                            $search_std_id='and enroll_id NOT IN('.$std_id.')';   
                                                                                        }
                                                                                        else{
                                                                                            $search_std_id='';
                                                                                        }
                                                                                    }
                                                                                    // $search_std_id='and enroll_id NOT IN('.$std_id.')';  
                                                                                    '<br>'. $sel_student="select enroll_id,course_batch_id from student_attendence where 1 ".$search_std_id." and attendence='present' ".$dates." ".$search_staff_ids." ".$search_cm_id." order by course_batch_id ASC";
                                                                                    $ptr_student=mysql_query($sel_student);
                                                                                    $tota=mysql_num_rows($ptr_student); 
                                                                                    //  echo $tota;
                                                                                    if($tota)
                                                                                    {
                                                                                        ?>
                                                                                        <table class="table no-margin"
                                                                                            style="text-align:center">
                                                                                            <thead>
                                                                                                <tr>
                                                                                                    <th
                                                                                                        style="text-align:center">
                                                                                                        Sr.No.</th>
                                                                                                    <th
                                                                                                        style="text-align:center">
                                                                                                        Student Name</th>
                                                                                                    <th
                                                                                                        style="text-align:center">
                                                                                                        Batch Name</th>
                                                                                                    <th
                                                                                                        style="text-align:center">
                                                                                                        Faculty Name</th>
                                                                                                </tr>
                                                                                            </thead>
                                                                                            <tbody>
                                                                                            <?php
                                                                                            $p=1;
                                                                                            while($data_std=mysql_fetch_array($ptr_student))
                                                                                            {
                                                                                                $sel_name="select name from enrollment where 1 and enroll_id='".$data_std['enroll_id']."'";
                                                                                                $ptr_names=mysql_query($sel_name);
                                                                                                $data_names=mysql_fetch_array($ptr_names);
                                                                                                $sel_batch_names="select batch_name from course_batch_mapping where 1 and c_b_id ='".$data_std['course_batch_id']."'";
                                                                                                $ptr_batch_names=mysql_query( $sel_batch_names);
                                                                                                $data_batch_names=mysql_fetch_array($ptr_batch_names);
                                                                                                ?>
                                                                                                <tr>
                                                                                                    <td>
                                                                                                        <?php echo $p++ ?>
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <?php echo $data_names['name'] ?>
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <?php  echo $data_batch_names['batch_name'] ?>
                                                                                                    </td>
                                                                                                    <td>
                                                                                                    <?php
                                                                                                        $sel_batch="select staff_id from course_batch_mapping where 1 and c_b_id ='".$data_std['course_batch_id']."'";
                                                                                                        $ptr_batch=mysql_query( $sel_batch);
                                                                                                        $data_batch=mysql_fetch_array($ptr_batch);
                                                                                                        $name_sel="select name from site_setting where admin_id='".$data_batch['staff_id']."'";
                                                                                                        $name_ptr=mysql_query($name_sel);
                                                                                                        $data_name=mysql_fetch_array($name_ptr);
                                                                                                        echo  $data_name['name'];
                                                                                                    ?>
                                                                                                    </td>
                                                                                                </tr>
                                                                                                <?php
                                                                                            }
                                                                                            ?>
                                                                                            </tbody>
                                                                                        </table>
                                                                                        <?php
                                                                                    }
                                                                                    ?>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <strong>Feedback: </strong>
                                                            </td>
                                                            <td>
                                                                <?php
                                                                    $sel_cmt="select * from student_batch_feedback where 1 ".$date." ". $search_staff_id."  ".      $search_cm_id." and comment!='' order by batch_id ASC ";
                                                                    $ptr_cmt=mysql_query($sel_cmt);
                                                                    $tot_cmt=mysql_num_rows($ptr_cmt);
                                                                if($tot_cmt!=0)
                                                                {
                                                                    ?>
                                                                    <button type="button" class="btn btn-warning"
                                                                        data-toggle="modal" data-target="#feedback">
                                                                        <?php echo '<strong>'.abs($tot_cmt).'</strong>';?>
                                                                    </button>
                                                                    <?php
                                                                }
                                                                else{
                                                                    echo '0';
                                                                }
                                                                ?>
                                                                <div class="modal fade bd-example-modal-lg" id="feedback" tabindex="-1" role="dialog"           aria-labelledby="exampleModalLongTitle" aria-hidden="true">
                                                                    <div class="modal-dialog modal-lg" role="document">
                                                                        <div class="modal-content">
                                                                            <div class="modal-header">
                                                                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                                                    <span aria-hidden="true">&times;</span>
                                                                                </button>
                                                                                <h5 class="modal-title" id="exampleModalLongTitle">
                                                                                    <span>
                                                                                        <h4><strong>Branch :
                                                                                                <span style="color:blue;">
                                                                                                    <?php  if($_REQUEST['branch_name']!='')echo ucfirst($_GET['branch_name']); else echo 'Pune';?>
                                                                                                </span>
                                                                                            </strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                                                                                            <b>Date : 
                                                                                                <span style="color:blue;">
                                                                                                    <?php if($_REQUEST['start_date']!='') echo  date("d-m-Y",strtotime($start_date)); else echo date('d-m-Y',strtotime('-1 days'));  ?>
                                                                                                </span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                                                <span>
                                                                                                    <a href="tk_cmt_exel.php<?php echo $sep_url_string; ?>"><img src="images/excel.png" height="30px" width="30px"/></a>
                                                                                                </span>
                                                                                            </b>
                                                                                        </h4>
                                                                                    </span>
                                                                                </h5>
                                                                            </div>
                                                                            <!-- <div class="direct-chat-messages"> -->
                                                                            <div class="modal-body">
                                                                                <table class="table no-margin"
                                                                                    style="text-align:center">
                                                                                    <thead>
                                                                                        <tr>
                                                                                            <th
                                                                                                style="text-align:center">
                                                                                                Sr.No.</th>
                                                                                            <th
                                                                                                style="text-align:center">
                                                                                                Student Name</th>
                                                                                            <th
                                                                                                style="text-align:center">
                                                                                                Batch Name</th>
                                                                                            <th
                                                                                                style="text-align:center">
                                                                                                Comment</th>    
                                                                                            <th
                                                                                                style="text-align:center">
                                                                                                Faculty Name</th>
                                                                                        </tr>
                                                                                    </thead>
                                                                                    <tbody>
                                                                                    <?php
                                                                                    $p=1;
                                                                                    while($data_cmt=mysql_fetch_array($ptr_cmt))
                                                                                    {
                                                                                        $sel_name="select name from enrollment where 1 and enroll_id='".$data_cmt['enroll_id']."'";
                                                                                        $ptr_names=mysql_query($sel_name);
                                                                                        $data_names=mysql_fetch_array($ptr_names);
                                                                                        $sel_batch_names="select batch_name from course_batch_mapping where 1 and c_b_id ='".$data_cmt['batch_id']."'";
                                                                                        $ptr_batch_names=mysql_query( $sel_batch_names);
                                                                                        $data_batch_names=mysql_fetch_array($ptr_batch_names);
                                                                                        ?>
                                                                                        <tr>
                                                                                            <td>
                                                                                                <?php echo $p++ ?>
                                                                                            </td>
                                                                                            <td>
                                                                                                <?php echo $data_names['name'] ?>
                                                                                            </td>
                                                                                            <td>
                                                                                                <?php  echo $data_batch_names['batch_name'] ?>
                                                                                            </td>
                                                                                            <td>
                                                                                                <?php  echo $data_cmt['comment'] ?>
                                                                                            </td>
                                                                                            <td>
                                                                                            <?php
                                                                                                $name_sels="select name from site_setting where admin_id='".$data_cmt['staff_id']."'";
                                                                                                $name_ptrs=mysql_query($name_sels);
                                                                                                $data_name_fac=mysql_fetch_array($name_ptrs);
                                                                                                echo  $data_name_fac['name'];
                                                                                            ?>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <?php
                                                                                    }
                                                                                    ?>
                                                                                    </tbody>
                                                                                </table>
                                                                            </div>
                                                                            <!-- </div> -->
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </td>
                                                        </tr>
                                                        <tr style="background-color:rgb(192,192,192)">
                                                            <th style="text-align:center">Sr.No.</th>
                                                            <th style="text-align:center">Student Name</th>
                                                            <th style="text-align:center">Batch Name</th>
                                                            <th style="text-align:center">Teaching Method</th>
                                                            <th style="text-align:center">Monitoring Class</th>
                                                            <th style="text-align:center">Faculty Behaviour</th>
                                                            <th style="text-align:center">Class Attention</th>
                                                            <th style="text-align:center">Phone Submission</th>
                                                            <th style="text-align:center">Management Approch</th>
                                                            <th style="text-align:center">Comment</th>
                                                            <th style="text-align:center">Faculty Name</th>
                                                        </tr>
                                                    </thead>
                                                    <tbody>
                                                        <?php
                                                        if($no_of_records)
                                                        {
                                                            $bgColorCounter=1;
                                                            $query_string='&branch_name='.$branch_name.'&staff_name='.$staff_id.'&start_date='.$_REQUEST['start_date'];
                                                            $query_string1=$query_string;
                                                            $pager = new PS_Pagination($sel_staff,$_SESSION['show_records'],5,$query_string1);
                                                            $all_records= $pager->paginate();
                                                            $bgColorCounter_color=1;
                                                            $teaching_method=0;
                                                            $monitoring_class=0;
                                                            $faculty_behaviour=0;
                                                            $class_attention=0;
                                                            $phone_submission=0;
                                                            $management_approach=0;
                                                            $i=1;
                                                            while($data_staff=mysql_fetch_array($ptr_staff))
                                                            {
                                                                if($bgColorCounter%2==0)
                                                                $bgcolor='class="grey_td"';
                                                                else
                                                                $bgcolor=""; 
                                                                include "include/paging_script.php";
                                                                if($bgColorCounter_color%2==0){
                                                                    $bgcolor_color='style="background-color:rgb(220,220,220)"';
                                                                }
                                                                else{
                                                                    $bgcolor_color="";    
                                                                }    
                                                                '<br/>' . $staff_name="select name from site_setting where 1 and admin_id='".$data_staff['staff_id']."'";
                                                                $ptr_name=mysql_query($staff_name);
                                                                $data_staff_name=mysql_fetch_array($ptr_name);
                                                                $sel_batch_name="select batch_name from course_batch_mapping where 1 and c_b_id ='".$data_staff['batch_id']."'";
                                                                $ptr_batch_name=mysql_query( $sel_batch_name);
                                                                $data_batch_name=mysql_fetch_array($ptr_batch_name);
                                                                ?>
                                                                <tr <?php echo $bgcolor_color ?> >
                                                                    <td>
                                                                        <?php echo $i++ ?>
                                                                    </td>
                                                                    <td>
                                                                        <strong>
                                                                            <?php 
                                                                            echo strip_tags(ucwords($data_staff['name']));
                                                                            ?>
                                                                        </strong>
                                                                    </td>
                                                                    <td>
                                                                        <strong>
                                                                            <?php 
                                                                            echo strip_tags(ucwords($data_batch_name['batch_name']));
                                                                            ?>
                                                                        </strong>
                                                                    </td>
                                                                    <td>
                                                                        <strong>
                                                                            <?php 
                                                                            echo ucfirst($data_staff['teaching_method']);
                                                                            $teaching_method+=$data_staff['teaching_method'];
                                                                            ?>
                                                                        </strong>
                                                                    </td>
                                                                    <td>
                                                                        <strong>
                                                                            <?php 
                                                                            echo ucfirst($data_staff['monitoring_class']);
                                                                            $monitoring_class+=$data_staff['monitoring_class'];
                                                                            ?>
                                                                        </strong>
                                                                    </td>
                                                                    <td>
                                                                        <strong>
                                                                            <?php 
                                                                            echo $data_staff['faculty_behaviour'];
                                                                            $faculty_behaviour+=$data_staff['faculty_behaviour'];
                                                                            ?>
                                                                        </strong>
                                                                    </td>
                                                                    <td>
                                                                        <strong>
                                                                            <?php
                                                                            echo $data_staff['class_attention'];
                                                                            $class_attention+=$data_staff['class_attention'];
                                                                            ?>
                                                                        </strong>
                                                                    </td>
                                                                    <td>
                                                                        <strong>
                                                                            <?php 
                                                                            echo $data_staff['phone_submission'];
                                                                            $phone_submission+=$data_staff['phone_submission'];
                                                                            ?>
                                                                        </strong>
                                                                    </td>
                                                                    <td>
                                                                        <strong>
                                                                            <?php 
                                                                            echo $data_staff['management_approach'];
                                                                            $management_approach+=$data_staff['management_approach'];
                                                                            ?>
                                                                        </strong>
                                                                    </td>
                                                                    <td>
                                                                        <strong>
                                                                            <?php
                                                                            if($data_staff['comment']!=''){
                                                                            ?>
                                                                            <button type="button" class="btn btn-primary"
                                                                                data-toggle="modal" data-target="#<?php echo $data_staff['id']; ?>">
                                                                                <?php echo 'Feedback';?>
                                                                            </button>
                                                                            <?php
                                                                            }
                                                                            else{
                                                                                echo '<span style="color:Blue">Null</span>';
                                                                            }
                                                                            ?>
                                                                            <div class="modal fade" id="<?php echo $data_staff['id']; ?>">
                                                                            <div class="modal-dialog">
                                                                                <div class="modal-content">
                                                                                    <div class="modal-header">
                                                                                        <button type="button" class="close"
                                                                                            data-dismiss="modal"
                                                                                            aria-label="Close"> <span
                                                                                                aria-hidden="true">&times;</span></button>
                                                                                        <h4 class="modal-title">
                                                                                           <b><?php echo strip_tags(ucwords($data_staff['name']))?></b> Feedback
                                                                                        </h4></span>
                                                                                        </h4>
                                                                                    </div>
                                                                                    <!-- <div class="direct-chat-messages"> -->
                                                                                        <div class="modal-body">
                                                                                       <div style="text-align:center;color:blue">
                                                                                            <!-- <ul>
                                                                                                <li> -->
                                                                                                    <?php
                                                                                                        echo $data_staff['comment'];
                                                                                                    ?>
                                                                                                <!-- </li>
                                                                                            </ul> -->
                                                                                            </div>
                                                                                        </div>
                                                                                    <!-- </div> -->
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                        </strong>
                                                                    </td>
                                                                    <td>
                                                                        <strong>
                                                                            <?php echo $data_staff_name['name']?>
                                                                        </strong>
                                                                    </td>
                                                                </tr>
                                                                <?php
                                                                $bgColorCounter++;
                                                                $bgColorCounter_color++;
                                                            }
                                                                $tot_teaching_method=($teaching_method/$tot_std)*100;
                                                                $tot_monitoring_class=($monitoring_class/$tot_std)*100;
                                                                $tot_faculty_behaviour=($faculty_behaviour/$tot_std)*100;
                                                                $tot_class_attention=($class_attention/$tot_std)*100;
                                                                $tot_phone_submission=($phone_submission/$tot_std)*100;
                                                                $tot_management_approach=($management_approach/$tot_std)*100;
                                                                $tot_day_feddback=$tot_teaching_method+$tot_monitoring_class+$tot_faculty_behaviour+$tot_class_attention+$tot_phone_submission+$tot_management_approach;
                                                                $final_per=($tot_day_feddback/600)*100;
                                                                //if($_SESSION['show_records']==$no_of_records){
                                                            if($no_of_records)
                                                            {
                                                                ?>
                                                                <tr style="background-color:rgb(0, 0, 0);color: white;">
                                                                    <?php
                                                                    //   if($tot_count)
                                                                    //   {
                                                                    ?>
                                                                    <td colspan="3">
                                                                        <strong> Total Percentage</strong>
                                                                    </td>
                                                                    <td>
                                                                        <strong>
                                                                            <?php echo  round($tot_teaching_method)?>
                                                                        </strong>
                                                                    </td>
                                                                    <td>
                                                                        <strong>
                                                                            <?php echo round($tot_monitoring_class)?>
                                                                        </strong>
                                                                    </td>
                                                                    <td>
                                                                        <strong>
                                                                            <?php echo round($tot_faculty_behaviour)?>
                                                                        </strong>
                                                                    </td>
                                                                    <td>
                                                                        <strong>
                                                                            <?php echo round($tot_class_attention)?>
                                                                        </strong>
                                                                    </td>
                                                                    <td>
                                                                        <strong>
                                                                            <?php echo round($tot_phone_submission)?>
                                                                        </strong>
                                                                    </td>
                                                                    <td>
                                                                        <strong>
                                                                            <?php echo round($tot_management_approach)?>
                                                                        </strong>
                                                                    </td>
                                                                    <td colspan="2">
                                                                        <h4><strong style="color:red">
                                                                                <?php echo  round($final_per)?>%
                                                                            </strong></h4>
                                                                    </td>
                                                                </tr>
                                                                <?php
                                                            }
                                                            ?>
                                                            <!-- <tr class="head_td">
                                                                <td colspan="17">
                                                                    <table cellspacing="0" cellpadding="0" width="100%">
                                                                        <tr>
                                                                            <?php
                                                                    // if($no_of_records>10)
                                                                    // {
                                                                    //     echo '<td width="5%" align="left"> Show &nbsp;&nbsp;</td>
                                                                    //     <td width="20%" align="left"><select class="form-control" name="show_records" onchange="redirect(this.value)">';
                                                                    //     $show_records=array(0=>'10',1=>'20','50','100','200');
                                                                    //     for($s=0;$s<count($show_records);$s++)
                                                                    //     {
                                                                    //         if($_SESSION['show_records']==$show_records[$s])
                                                                    //             echo '<option selected="selected" value="'.$show_records[$s].'">'.$show_records[$s].' Records</option>';
                                                                    //         else
                                                                    //             echo '<option value="'.$show_records[$s].'">'.$show_records[$s].' Records</option>';
                                                                    //     }
                                                                    //     echo'</td></select>';
                                                                    // }
                                                                    // echo '<td width="75%" align="right">'.$pager->renderFullNav().'</td>';
                                                                    ?>
                                                                        </tr>
                                                                    </table>
                                                                </td>
                                                            </tr> -->
                                                            <?php
                                                        }
                                                        else
                                                        {
                                                            ?> 
                                                            <tr ><td colspan="11"><h4 style="background-color:;text-align:center"> No Record Avialable According To Your Creteria</h4></td></tr>
                                                            <?php
                                                        }
                                                        ?>    
                                                    </tbody>
                                                </table>
                                            </div>
                                        <!-- </div> -->
                                        <!-- /.box-body -->
                                    </tr>
                                </table>
                                <!-- /.col -->
                            </div>
                        </div>
                        <!-- /.box -->
                    </div>
                </div>    
            </section>
            <!-- /.content -->
        </div>
        <!-- /.content-wrapper -->
        <?php include "include/footer-main.php"; ?>
    </div>
    <!-- jQuery 3 -->
    <script src="bower_components/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap 3.3.7 -->
    <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- Select2 -->
    <script src="bower_components/select2/dist/js/select2.full.min.js"></script>
    <!-- InputMask -->
    <script src="plugins/input-mask/jquery.inputmask.js"></script>
    <script src="plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
    <script src="plugins/input-mask/jquery.inputmask.extensions.js"></script>
    <!-- date-range-picker -->
    <script src="bower_components/moment/min/moment.min.js"></script>
    <script src="bower_components/bootstrap-daterangepicker/daterangepicker.js"></script>
    <!-- bootstrap datepicker -->
    <script src="bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
    <!-- bootstrap color picker -->
    <script src="bower_components/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js"></script>
    <!-- bootstrap time picker -->
    <script src="plugins/timepicker/bootstrap-timepicker.min.js"></script>
    <!-- SlimScroll -->
    <script src="bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
    <!-- iCheck 1.0.1 -->
    <script src="plugins/iCheck/icheck.min.js"></script>
    <!-- FastClick -->
    <script src="bower_components/fastclick/lib/fastclick.js"></script>
    <!-- AdminLTE App -->
    <script src="dist/js/adminlte.min.js"></script>
    <!-- AdminLTE for demo purposes -->
    <script src="dist/js/demo.js"></script>
    <!-- Page script -->
    <script>
        $(function () {
            //Initialize Select2 Elements
            $('.select2').select2()
            //Date picker
            $('#datepicker').datepicker({
                autoclose: true,
                format: 'dd/mm/yyyy',
                // startDate: '-0d',
                Default: true,
                todayHighlight: true
            })


            //Colorpicker
            $('.my-colorpicker1').colorpicker()
            //color picker with addon
            $('.my-colorpicker2').colorpicker()

            //Timepicker
            $('.timepicker').timepicker({
                showInputs: false
            })
        })
    </script>
    <?php
	if($_SESSION['type']!='S' || $_SESSION['branch_access']!='yes'){
		?>
    <script>
        branch = document.getElementById("branch_name").value;
        select_staff(branch);
    </script>
    <?php
	}
	?>
</body>

</html>