<?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>Daily Performance 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>

<script>

    function select_staff(branch) {

        var branch_data = "action=reportstaff&branch_names=" + branch;

        // alert(branch);

        $.ajax({

            url: "tk_staff_ajax.php", type: "post", data: branch_data, cache: false,

            success: function (retadmin) {

                // alert(retadmin);

                document.getElementById("staff_name").innerHTML = retadmin;



            }

        });

    }

</script>

<?php

 function convertToHoursMins($time, $format = '%02d:%02d') {

    if ($time < 1) {

        return;

    }

    $hours = floor($time / 60);

    $minutes = ($time % 60);

    return sprintf($format, $hours, $minutes);

}

?>



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

                    Daily Performance 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="table-responsive">

                            <table class="table no-margin" >

                                <form method="get" name="search">

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

                                        <td width="5px"></td>

                                        <td>

                                            <div>

                                                <?php

                                                if($_REQUEST['staff_name']!='')

                                                  {

                                                    $sel_staffs="select admin_id,name from site_setting where branch_name='".$_GET['branch_name']."'  and system_status='Enabled' ";

                                                    $ptr_que=mysql_query($sel_staffs);

                                                      ?>

                                                      <select class="form-control select2" style="width:200px" id="staff_names1" name="staff_name">

                                                          <option value="">Select Staff</option>

                                                            <?php

                                                        while($data_query=mysql_fetch_array($ptr_que))

                                                        {

                                                          $sel='';

                                                          if($data_query['admin_id']==$_GET['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_name" name="staff_name">

                                                      <option value="">Select Staff</option>

                                                    </select>

                                                    <?php

                                                  }

                                                  ?>

                                            </div>

                                        </td>

                                        <?php

                                      }else if($manager_access=='manager')

                                      {

                                        $sel_staffs="select admin_id,name from site_setting where branch_name='".$_SESSION['branch_name']."'  and system_status='Enabled' and (".$admins.") ";

                                        $ptr_que=mysql_query($sel_staffs);

                                          ?>

                                          <td>

                                            <select class="form-control select2" style="width:200px" id="staff_names1" name="staff_name">

                                                <option value="">Select Staff</option>

                                                  <?php

                                              while($data_query=mysql_fetch_array($ptr_que))

                                              {

                                                $sel='';

                                                if($data_query['admin_id']==$_GET['staff_name'])

                                                  {

                                                    $sel='selected="selected"';

                                                  }

                                                ?>

                                                <option <?php echo $sel;?> value="<?php echo $data_query['admin_id'] ;?>"><?php echo $data_query['name'] ;?>

                                                </option>

                                                <?php

                                              }

                                              ?>

                                            </select>

                                          </td>

                                        <?php

                                      }

                                      else

                                      {

                                        ?>

                                        <input type="hidden" name="branch_name" id="branch_name"

                                            value="<?php echo $_SESSION['branch_name']; ?>" />

                                        <?php

                                      }

                                      ?>

                                        <td width="5px"></td>

                                        <td>

                                            <div>

                                                <input type="text" name="start_date" class="input_text datepicker"

                                                    placeholder="From Date" id="datepicker" title="From Date"

                                                    value="<?php if($_REQUEST['start_date']) echo $_REQUEST['start_date']; else if($_REQUEST['id']!='') echo date('d/m/Y',strtotime($_REQUEST['date'])); else echo date('d/m/Y',strtotime('-1 days')) ?>">

                                            </div>

                                        </td>

                                        <td width="5px"></td>

                                        <td>

                                            <input type="image" src="images/search.jpg" name="search" value="search"

                                                style="height:32px;">

                                        </td>

                                    </tr>

                                </form>

                            <tr>

                              <div class="box-body">

                                <!-- <div class="table-responsive"> -->

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

                                      $date1=" and attendance_date ='".date('Y-m-d',strtotime($frm_dates))."'";

                                      $dates=" and DATE(date) ='".date('Y-m-d',strtotime($frm_dates))."'";

                                      $date=" and DATE(attendance_date )='".date('Y-m-d',strtotime($frm_dates))."'";

                                      $add_date=" and DATE(added_date) ='".date('Y-m-d',strtotime($frm_dates))."'";

                                      $attd_dates=" and attendence_date ='".date('Y-m-d',strtotime($frm_dates))."'";
                                      $att_date=" and s.attendence_date ='".date('Y-m-d',strtotime($frm_dates))."'";

                                    //   $staff_id=$_SESSION['admin_id'];

                                  }

                                  else if($_REQUEST['id']!='')

                                  {

                                      // $staff_id=$_REQUEST['id'];

                                      $start_date=date('Y-m-d',strtotime($_REQUEST['date']));

                                      $date1=" and attendance_date ='".date('Y-m-d',strtotime($_REQUEST['date']))."'";

                                      $add_date=" and DATE(added_date) ='".date('Y-m-d',strtotime($_REQUEST['date']))."'";

                                      $dates="and date ='".date('Y-m-d',strtotime($_REQUEST['date']))."'";

                                      $attd_dates=" and attendence_date ='".date('Y-m-d',strtotime($_REQUEST['date']))."'";
                                      $att_date=" and s.attendence_date ='".date('Y-m-d',strtotime($_REQUEST['date']))."'";

                                  }

                                  else

                                  {

                                      $date1=" and attendance_date ='".date('Y-m-d',strtotime('-1 days'))."'";

                                      $add_date=" and DATE(added_date) ='".date('Y-m-d',strtotime('-1 days'))."'";

                                      $dates=" and date ='".date('Y-m-d',strtotime('-1 days'))."'";

                                      $attd_dates=" and attendence_date ='".date('Y-m-d',strtotime('-1 days'))."'";
                                      $att_date=" and s.attendence_date ='".date('Y-m-d',strtotime('-1 days'))."'";

                                    //   $staff_id=$_SESSION['admin_id'];

                                  }

                                  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 if($_REQUEST['id']!='')

                                  {

                                    $cm_ids=$_REQUEST['branch'];

                                    $search_cm_id="and cm_id='".$cm_ids."'";

                                  }

                                  else

                                  {

                                    $search_cm_id="and cm_id='".$_SESSION['cm_id']."'";

                                  }



                                  if($_REQUEST['staff_name']!='')

                                  {

                                    $staff_id=$_REQUEST['staff_name'];

                                    // $sel_type="select type from site_setting where admin_id='".$staff_id."'";

                                    // $ptr_type=mysql_query( $sel_type);

                                    // $data_type=mysql_fetch_array($ptr_type);

                                    $search_staff_id="and staff_id='".$staff_id."'";

                                    $search_staff_ids="and admin_id='".$staff_id."'";

                                  }

                                  else if($_REQUEST['id']!='')

                                  {

                                    $staff_id=$_REQUEST['id'];

                                    $search_staff_id="and staff_id='".$staff_id."'";

                                    $search_staff_ids="and admin_id='".$staff_id."'";

                                  }

                                  else

                                  {

                                      $staff_id=$_SESSION['admin_id'];

                                      $search_staff_id="and staff_id='".$_SESSION['admin_id']."'";

                                      $search_staff_ids="and admin_id='".$_SESSION['admin_id']."'";

                                  }

                                  $i=1;

                                  ?>

                                    <table class="table no-margin" style="text-align:center">

                                      <?php

                                      $sel_names="select name  from site_setting where admin_id='".$staff_id."'";

                                      $ptr_names=mysql_query($sel_names);

                                      $data_names=mysql_fetch_array($ptr_names);

                                      $sel_daily_per="select final_percentage,hour_not_worked,status,staff_type,feedback_management_approach,lead_point from pm_daily_emp_performance where 1 and staff_id='".$staff_id."' ".$search_cm_id." ".$dates." "; 

                                      $ptr_daily_per=mysql_query($sel_daily_per);

                                      $records=mysql_num_rows($ptr_daily_per);

                                      // if($records){

                                      $data_daily_per=mysql_fetch_array($ptr_daily_per);

                                      ?>

                                        <tr>

                                            <td style="text-align:left;"><b>Name : </b><span style="color:blue">

                                                    <?php echo $data_names['name']; ?>

                                                </span></td>

                                            <td><b>Date : </b><span style="color:blue">

                                                    <?php if($_REQUEST['start_date']!='') echo $frm_dates; else if($_REQUEST['id']!='') echo date('d-m-Y',strtotime($_REQUEST['date'])); else echo date('d-m-Y',strtotime('-1 days')); ?>

                                                </span></td>

                                            <td <strong> <?php if($data_daily_per['final_percentage']!='') echo '<span style="font-size:22px">Total Performance : <span style="color:red; width:100px;font-size:22px">'.$data_daily_per['final_percentage'].'%</span></span>';else echo '<span style="color:red; width:100px;">[Final Performance Not Yet Generated]</span>';  ?> </strong></td>

                                            <td style="font-size:14px">

                                              <?php

                                              if($data_daily_per['hour_not_worked']!='0')

                                              {

                                                ?>

                                                <strong> Not Working Hour : </strong><span style="font-size:14px;color:red; width:100px;">

                                                  <?php 

                                                    $not_working= $data_daily_per['hour_not_worked'];

                                                    $tot_hour= convertToHoursMins($not_working, '%02d hour %02d min');

                                                    echo $tot_hour; 

                                                  ?>

                                                </span>

                                                <?php

                                              }

                                              else if($data_daily_per['hour_not_worked']=='0' && $data_daily_per['status']=='present')

                                              {

                                                ?>

                                                <strong><span style="font-size:14px;color:Green; width:100px;">Welcome

                                                        You Utilize Total Time</strong></span>

                                                <?php

                                              }

                                              else

                                              {

                                                ?>

                                                <strong><span style="font-size:14px;color:red; width:100px;">

                                                        <?php echo ucfirst($data_daily_per['status']);  ?></strong></span>

                                                <?php

                                              }

                                              ?>

                                            </td>

                                        </tr>

                                    </table>

                                    <?php

                                    $sel_key_point_per= "select key_point_id,points from pm_daily_keypoint_performance where 1 and employee_id='".$staff_id."' ".$dates." ".$search_cm_id." order by key_point_id ASC";

                                    $ptr_key_point_per=mysql_query($sel_key_point_per);

                                    $tot_record=mysql_num_rows($ptr_key_point_per);

                                    $tot_pecentage='';

                                    $out_of_point='';

                                    if($tot_record)

                                    {

                                      ?>

                                      <div style="font-size:17px;color:blue;text-align:center">

                                          <strong>Performance Key Index</strong>

                                      </div>

                                      <table class="table no-margin" style="text-align:center">

                                          <thead>

                                              <tr>

                                                  <th style="text-align:center">Sr.No.</th>

                                                  <th style="text-align:center">Key Title</th>

                                                  <th style="text-align:center">Total point</th>

                                                  <th style="text-align:center">Got point</th>

                                              </tr>

                                          </thead>

                                          <tbody>

                                            <?php

                                            $sel_key_point_per1="select total_percentage,total_point,status from pm_total_keypoint_performancee where 1 and employee_id='". $staff_id."' ".$dates." ".$search_cm_id."";

                                            $ptr_key_point_per1=mysql_query($sel_key_point_per1);

                                            $data_key_point_per1=mysql_fetch_array($ptr_key_point_per1);

                                            if($data_key_point_per1['total_percentage']!=''){

                                            $kpi=$data_key_point_per1['total_percentage'];

                                            }

                                            else{

                                                $kpi='0';

                                            }

                                            while($data_key_point_per=mysql_fetch_array($ptr_key_point_per))

                                            {

                                              $select_per="select * from pm_key_performance_point where key_id='".$data_key_point_per['key_point_id']."' ";

                                              $ptr_per=mysql_query($select_per);

                                              $data_per=mysql_fetch_array($ptr_per);

                                              ?>

                                              <tr>

                                                  <td>

                                                      <?php echo $i++ ?>

                                                  </td>

                                                  <?php

                                                  if($data_key_point_per['key_point_id']=='0')

                                                  {

                                                    ?>

                                                    <td>

                                                        <?php echo ucfirst($data_key_point_per1['status']);?>

                                                    </td>

                                                    <td>100</td>

                                                    <td>

                                                        <?php echo $data_key_point_per['points'];?>

                                                    </td>

                                                    <?php

                                                  }

                                                  else

                                                  {

                                                    ?>

                                                    <td>

                                                        <?php echo $data_per['key_title'];?>

                                                    </td>

                                                    <td>

                                                      <?php echo $data_per['point'];

                                                      $out_of_point+=$data_per['point'];

                                                      ?>

                                                    </td>

                                                    <td>

                                                      <?php echo $data_key_point_per['points'];?>

                                                    </td>

                                                    <?php

                                                  }

                                                  ?>

                                              </tr>

                                              <?php

                                            }    

                                            ?>

                                              <tr style="background-color:#f4f0ec;">

                                                  <td style="text-align:left;font-size:15px;"><b> Key Point

                                                  Index<b></td>

                                                  <td><span style="font-size:20px;color:red"><b>

                                                              <?php echo $kpi; ?>

                                                          </b>%</span></td>

                                                  <td><b>

                                                          <?php echo $out_of_point;?>

                                                      </b></td>

                                                  <td><b>

                                                          <?php echo $data_key_point_per1['total_point'];?>

                                                      </b></td>

                                              </tr>

                                          </tbody>

                                      </table>

                                      <?php

                                    }

                                    ?>

                                    <!-- ============================= Task Points ======================================== -->

                                    <?php

                                    $sql_query1= "select * from tk_employee_performance where 1 and staff_id='". $staff_id."' ".$dates." "; 

                                    $ptr_query=mysql_query($sql_query1);

                                    $no_of_record=mysql_num_rows($ptr_query);

                                    $task_point1='0';

                                    $k='1';

                                    if($no_of_record)

                                    {

                                      ?>

                                      <div style="font-size:17px;color:blue;text-align:center"><strong>Task

                                              Point</strong></div>

                                      <table class="table no-margin" style="text-align:center">

                                          <thead>

                                              <tr>

                                                  <th style="text-align:center">Sr.No.</th>

                                                  <th style="text-align:center">Task Name</th>

                                                  <th style="text-align:center">Task Points</th>

                                                  <th style="text-align:center">Got Task Point</th>

                                                  <th style="text-align:center">Got Task Quality Point</th>

                                                  <th style="text-align:center">Added Date</th>

                                                  <th style="text-align:center">Completed/In-Complete Date</th>

                                                  <th style="text-align:center">Working Time</th>

                                              </tr>

                                          </thead>

                                          <tbody>

                                            <?php

                                            while($val_query1=mysql_fetch_array($ptr_query))

                                            {

                                                $select_per="select * from pm_key_performance_point where key_id='".$data_key_point_per['key_point_id']."' ";

                                                $ptr_per=mysql_query($select_per);

                                                $data_per=mysql_fetch_array($ptr_per);

                                                ?>

                                              <tr>

                                                  <td>

                                                      <?php echo $k++ ?>

                                                  </td>

                                                  <?php

                                                    $select_per="select points,task_name,hours,added_date,sta_complete_date from tk_individual_task where staff_task_id='".$val_query1['staff_task_id']."' ";

                                                    $ptr_per=mysql_query($select_per);

                                                    $data_per1=mysql_fetch_array($ptr_per);

                                                  ?>

                                                  <td>

                                                      <?php echo ucwords($data_per1['task_name']);?>

                                                  </td>

                                                  <td>

                                                      <?php echo $data_per1['points'];

                                                      ?>

                                                  </td>

                                                  <td>

                                                      <?php echo $val_query1['earn_points'];?>

                                                  </td>

                                                  <td>

                                                      <?php echo $val_query1['rating_point'];?>

                                                  </td>

                                                  <td>

                                                      <?php echo date('d-m-Y',strtotime($data_per1['added_date']));?>

                                                  </td>

                                                  <td>

                                                      <?php echo date('d-m-Y',strtotime($data_per1['sta_complete_date']));?>

                                                  </td> 

                                                  <td>

                                                      <?php  $hours=$data_per1['hours'];

                                                        $time1= convertToHoursMins($hours, '%02d hour %02d min');

                                                        echo $time1;

                                                      ?>

                                                  </td>

                                              </tr>

                                              <?php

                                              $task_point1+=round($val_query1['earn_points']);

                                              $qualty_point=$val_query1['rating_point'];

                                              $task_quality_point+=$qualty_point;

                                            }

                                            $task_point=$task_point1;

                                            $tot_cont=$no_of_record*100;

                                            $tot_quality_point= ($task_quality_point/$tot_cont)*100;

                                            ?>

                                              <tr style="background-color:#f4f0ec;">

                                                  <td colspan="3" style="font-size:15px;text-align:left"><b>

                                                  Total Task Performance<b></td>

                                                  <td><span style="font-size:20px;color:red"><b>

                                                              <?php echo round($task_point); ?>

                                                          </b>%</span></td>

                                                  <td><span style="font-size:20px;color:red"><b>

                                                              <?php echo round($tot_quality_point);?>

                                                          </b>%</span></td>

                                                  <td colspan="3" style="text-align:right;"> Today's Task Hours :

                                                      <?php 

                                                     '<br>'. $select_time="select sum(hours)as tot_hour from tk_individual_task where 1 and staff_id='".$staff_id."' ".$add_date." and Validation='valid' "; //and status='complete'

                                                      $ptr_time=mysql_query($select_time);

                                                      $data_time=mysql_fetch_array($ptr_time);

                                                      $hour=$data_time['tot_hour'];

                                                      $tot_time= convertToHoursMins($hour, '%02d hour %02d min');

                                                        echo $tot_time;

                                                      ?>

                                                  </td>

                                              </tr>

                                          </tbody>

                                      </table>

                                      <?php

                                    }

                                    '<br>'.$sel_minute="select minutes from pm_sales_kpi where action_name='add_lead'";

                                    $ptr_mintute=mysql_query($sel_minute);

                                    $data_minute=mysql_fetch_array($ptr_mintute);

                                    $lead_min=$data_minute['minutes'];

                                     $sel_lead="select count(inquiry_id) as tot_lead from inquiry where 1 ".$add_date." and admin_id='".$staff_id."'";

                                    $ptr_lead=mysql_query($sel_lead);

                                    $data_lead=mysql_fetch_array($ptr_lead);

                                    '<br>Lead Count- '.$tot_lead=$data_lead['tot_lead'];

                                    '<br>Lead Time- '.$lead_time=$tot_lead*$lead_min;

                                    // $nos_of_records=mysql_num_rows($ptr_lead);

                                    if($data_daily_per['lead_point']!=''  && $data_daily_per['lead_point']!='0')

                                    {

                                      ?>

                                      <div style="font-size:17px;color:blue;text-align:center"><strong>Lead

                                              Point</strong></div>

                                      <table class="table no-margin" style="text-align:center">

                                          <tbody>

                                              <tr style="background-color:#f4f0ec;">

                                                  <td style="text-align:left;font-size:15px;"><b> Lead Point

                                                          Performance<b></td>

                                                        <?php

                                                            // $data_conc_pnt=mysql_fetch_array($ptr_conc_pnt);

                                                            // $tot_conc_time=$data_conc_pnt['total_minute'];

                                                            // '<br>Tot Councillor point '.$tot_conc_pnt=round($tot_conc_time*0.208);

                                                            $tot_lead_time= convertToHoursMins($lead_time, '%02d hour %02d min');

                                                        ?>

                                                  <td colspan="0"><span style="font-size:20px;color:red;"><b>

                                                              <?php echo round($data_daily_per['lead_point']); ?>

                                                          </b>%</span></td>

                                                  <td colspan="3" style="text-align:right;"> ToTal Lead Hour :

                                                      <?php echo $tot_lead_time;?>

                                                  </td>

                                              </tr>

                                          </tbody>

                                      </table>

                                      <?php

                                    }

                                    ?>

                                    <!-- =============================Student Batch FeedBack ======================================== -->

                                    <?php

                                  if($_SESSION['type']=='F' || $data_daily_per['staff_type']=='F')

                                  {

                                    $point_aplied="";

                                  }

                                  else if($data_daily_per['status']=='present'){

                                    $point_aplied="( This Score Is Not Consider In Daily Performance Report )";

                                  }

                                    // $sql_query1="select DISTINCT(s.course_batch_id) as batch_id from student_attendence s, course_batch_mapping b where s.course_batch_id=b.c_b_id and b.staff_id='".$staff_id."' ".$attd_dates."";

                                    // $sql_query1= "select distinct(batch_id) from student_batch_feedback where 1 and staff_id='".$_SESSION['admin_id']."' ".$date1." order by id Asc";

                                     '<br>'. $sql_tot_today_batch="select distinct(course_batch_id) from student_attendence where 1 ".$attd_dates." and admin_id='".$staff_id."'"; 
                                    $ptr_tot_today_batch=mysql_query($sql_tot_today_batch);
                                    $tot_today_batch=mysql_num_rows($ptr_tot_today_batch);
                                    if($tot_today_batch)

                                    {

                                      ?>

                                      <div style="font-size:17px;color:blue;text-align:center"><strong>Student

                                              FeedBack</strong>

                                      </div>

                                      <table class="table no-margin" style="text-align:center">
                                      <?php
                                      '<br>'. $sql_querys1="SELECT DISTINCT(s.course_batch_id) FROM student_attendence s, batch_timetable b WHERE 1 ".$att_date." AND s.admin_id = '" . $staff_id. "' AND s.course_batch_id = b.c_b_id AND s.attendence_date = b.date AND b.review_status = 'yes'"; 

                                       $ptr_query_b=mysql_query($sql_querys1);
   
                                       $no_of_records=mysql_num_rows($ptr_query_b);
   
                                       $batch_cnt=$no_of_records*100;
   
                                       $d=1;
   
                                       if($no_of_records)
   
                                       {
   
                                         ?>
                                          <thead>

                                              <tr>

                                                  <th style="text-align:center">Sr.No.</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">Total percentage</th>

                                                  <th style="text-align:center">Student Not Giving Review</th>

                                              </tr>

                                          </thead>

                                          <!-- <tbody> -->

                                            <?php

                                            //$ptr1_querys=mysql_query($sql1_querys);

                                            $total_feedback_percentage=0;

                                            $total_feedback_percentage1=0;

                                            while($val_querys1=mysql_fetch_array($ptr_query_b))

                                            {

                                              '<br>'.  $sel_tot_batch_std="select count(enroll_id) as student_count from student_attendence where attendence='present' and course_batch_id='".$val_querys1['course_batch_id']."' ".$attd_dates." ";  

                                              $ptr_count=mysql_query($sel_tot_batch_std);

                                              $data_count=mysql_fetch_array( $ptr_count);

                                              $tot_std_fed=$data_count['student_count'];

                                              $point_cnt=$tot_std_fed*100;

          

                                              $sel_batch_names="select batch_name from course_batch_mapping where 1 and c_b_id ='".$val_querys1['course_batch_id']."'";

                                              $ptr_batch_names=mysql_query( $sel_batch_names);

                                              $data_batch_names=mysql_fetch_array($ptr_batch_names);

                                                        

                                              echo '<tr><td colspan="7" align="center" style="font-size:14px;color:green"><strong> Batch - '.$data_batch_names['batch_name'].' [ Present Student - '.$tot_std_fed.' ]</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:red">'.$point_aplied.'</span></td></tr>';



                                              '<br>'.  $sql_querys="select batch_id, enroll_id, teaching_method,monitoring_class,faculty_behaviour,class_attention,phone_submission from student_batch_feedback where 1 ".$_SESSION['where']." and staff_id='". $staff_id."' and batch_id='".$val_querys1['course_batch_id']."'".$date1." ".$search_cm_id."";

                                              // $sql_querys= "select * from student_batch_feedback where 1 ".$_SESSION['where']." and staff_id='".$_SESSION['admin_id']."' ".$date1." and batch_id='".$val_querys1['batch_id']."'"; 

                                              $ptr_querys=mysql_query($sql_querys);

                                              $no_of_record1=mysql_num_rows($ptr_querys);

                                              // $point_cnt=$no_of_record1*100;

                                              $p=1;

                                              $teaching_method='0';

                                              $monitoring_class='0';

                                              $faculty_behaviour='0';

                                              $class_attention='0';

                                              $phone_submission='0';

                                              while($val_querys=mysql_fetch_array($ptr_querys))

                                              {

                                                $teaching_method+=$val_querys['teaching_method'];

                                                $monitoring_class+=$val_querys['monitoring_class'];

                                                $faculty_behaviour+=$val_querys['faculty_behaviour'];

                                                $class_attention+=$val_querys['class_attention'];

                                                $phone_submission+=$val_querys['phone_submission'];

                                              }

                                                $teaching_method_point=round(($teaching_method/$point_cnt)*100);

                                                $monitoring_class_point=round(($monitoring_class/$point_cnt)*100);

                                                $faculty_behaviour_point=round(($faculty_behaviour/$point_cnt)*100);

                                                $class_attention_point=round(($class_attention/$point_cnt)*100);

                                                $phone_submission_point=round(($phone_submission/$point_cnt)*100);

                                                $total_feedback_point=$teaching_method_point+$monitoring_class_point+$faculty_behaviour_point+$class_attention_point+$phone_submission_point;

                                                $total_feedback_percentage=($total_feedback_point/500)*100;

                                                $total_feedback_percentage1+=($total_feedback_point/500)*100;

                                              ?>

                                              <tr>

                                                  <td>

                                                      <?php echo $d++ ?>

                                                  </td>

                                                  <td align="center">

                                                      <?php echo $teaching_method ?>/<b>

                                                          <?php echo $point_cnt ?>

                                                      </b>

                                                  </td>

                                                  <td align="center">

                                                      <?php echo $monitoring_class ?>/<b>

                                                          <?php echo $point_cnt ?>

                                                      </b>

                                                  </td>

                                                  <td align="center">

                                                      <?php echo $faculty_behaviour ?>/<b>

                                                          <?php echo $point_cnt ?>

                                                      </b>

                                                  </td>

                                                  <td align="center">

                                                      <?php echo $class_attention ?>/<b>

                                                          <?php echo $point_cnt ?>

                                                      </b>

                                                  </td>

                                                  <td align="center">

                                                      <?php echo $phone_submission ?>/<b>

                                                          <?php echo $point_cnt ?>

                                                      </b>

                                                  </td>

                                                  <td align="center"><b>

                                                          <?php echo round($total_feedback_percentage)?>%

                                                      </b>

                                                    </td>

                                                    <td>

                                                      <?php

                                                      $remain_std=0;

                                                      // $sel_staff="select * from student_batch_feedback where 1 ".$date." ". $search_staff_id."  ".$search_cm_id." and batch_id='".$val_querys1['course_batch_id']."' order by batch_id ASC";

                                                      // $no_of_records=mysql_num_rows($db->query($sel_staff));

                                                      $i=1;

                                                    

                                                      // '<br>' .$sel_tot_batch_std="select enroll_id from student_attendence where 1 and attendence='present' ".$attd_dates."  ".$search_staff_ids." and course_batch_id='".$val_querys1['course_batch_id']."'";  //".$search_cm_id."

                                                      // $ptr_count=mysql_query($sel_tot_batch_std);

                                                      // $data_count=mysql_num_rows( $ptr_count); 

                                                      $remain_std=$tot_std_fed-$no_of_record1;

                                                      if($remain_std!=0){

                                                      ?>

                                                    <button type="button" class="btn btn-default" data-toggle="modal" data-target="#<?=$val_querys1['course_batch_id'];?>">

                                                            <?php echo '<strong>'.abs($remain_std).'</strong>';?>

                                                    </button>

                                                      <?php

                                                      }

                                                      else{

                                                        echo '0';

                                                      }

                                                      ?>

                                                    <div class="modal fade" id="<?=$val_querys1['course_batch_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">

                                                                                    <span>

                                                                                      <?php

                                                                                      $sel_faculty="select name from site_setting where admin_id='". $staff_id."'";

                                                                                      $ptr_faculty=mysql_query($sel_faculty);

                                                                                      $data_faculty=mysql_fetch_array($ptr_faculty);

                                                                                      ?>

                                                                                        <h4><strong>Faculty Name : <span

                                                                                                    style="color:blue;">

                                                                                                    <?php   echo $data_faculty['name'];?></strong>

                                                                                    </span>

                                                                                    &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></b>

                                                                                </h4></span>

                                                                                <?php

                                                                                

                                                                                ?>

                                                                                <span> Batch Name : <?php echo $data_batch_names['batch_name'] ?></span>

                                                                                </h4>

                                                                            </div>

                                                                            <div class="direct-chat-messages">

                                                                                <div class="modal-body">

                                                                                    <?php

                                                                                    '<br>'.$sel_std="select distinct(enroll_id) from student_batch_feedback where 1 ".$date." ". $search_staff_id." ".$search_cm_id." ".$date1."  and batch_id='".$val_querys1['course_batch_id']."'";

                                                                                    $ptr_std=mysql_query( $sel_std);

                                                                                    $tot_stds=mysql_num_rows( $ptr_std);

                                                                                    $it=1;

                                                                                    $std_id='';

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

                                                                                           '<br>'.  $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' ".$attd_dates." ".$search_staff_ids." and course_batch_id='".$val_querys1['course_batch_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 No</th> -->

                                                                                                <!-- <th

                                                                                                    style="text-align:center">

                                                                                                    Faculty Name</th> -->

                                                                                            </tr>

                                                                                        </thead>

                                                                                        <tbody>

                                                                                          <?php

                                                                                          $p=1;

                                                                                          while($data_std=mysql_fetch_array($ptr_student))

                                                                                          {

                                                                                            '<br>'.$sel_name="select name,enroll_id from enrollment where 1 and enroll_id='".$data_std['enroll_id']."'";

                                                                                            $ptr_names=mysql_query($sel_name);

                                                                                            $data_names=mysql_fetch_array($ptr_names);

                                                                                              ?>

                                                                                            <tr>

                                                                                                <td>

                                                                                                    <?php echo $p++ ?>

                                                                                                </td>

                                                                                                <td>

                                                                                                    <?php echo $data_names['name'] ?>

                                                                                                </td>

                                                                                                <!-- <td> -->

                                                                                                    <?php  //echo $data_names['enroll_id'] ?>

                                                                                                <!-- </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>

                                              </tr>

                                              <?php
                                            }

                                            
                                            $tot_daily_feedback=($total_feedback_percentage1/$batch_cnt)*100;
                                            $tot_daily_feedback_percentage=round($tot_daily_feedback).'%';
                                            
                                          }
                                          else{
                                            $tot_daily_feedback_percentage='Todays Not Review Day';
                                          }
                                            $tot_batch=2.5*$tot_today_batch;
                                            
                                            $tot_minute= $tot_batch*60;
                                            
                                            $tot_batch_time= convertToHoursMins($tot_minute, '%02d hour %02d min');

                                            ?>

                                            <tr style="background-color:#f4f0ec;">

                                                  <td colspan="2" style="text-align:left;font-size:15px;">

                                                      <strong> Total Batch Performance </strong>

                                                  </td>

                                                  <td colspan="4" style="font-size:20px;color:red;text-align:left"> <b>

                                                          <?php echo $tot_daily_feedback_percentage?>

                                                      </b></td>

                                                  <td colspan="2" style="font-size:14px;color:;text-align:left"> ToTal

                                                      Batch Hour : <b>

                                                          <?php echo $tot_batch_time?>

                                                      </b></td>

                                            </tr>

                                          <!-- </tbody> -->

                                      </table>

                                      <?php

                                    }

                                    // if($records){

                                    if($_SESSION['type']=='A' || $data_daily_per['staff_type']=='A' )

                                    {

                                      //  $sel_tot_batch_std="select count(enroll_id) as student_count from student_attendence where attendence='present' and cm_id='".$_SESSION['cm_id']."'".$attd_dates." ";

                                      //   $ptr_tot_batch_std=mysql_query( $sel_tot_batch_std);

                                      //   $tot_std=mysql_num_rows( $ptr_tot_batch_std);

                                      //   // $tot_rec= $tot_std*100;

                                      //   $tot_rec= 1500;



                                      //   '<br>'.$sql1_querys="select management_approach from student_batch_feedback where 1 ".$_SESSION['where']." ".$date1."";

                                      //   $ptr1_querys=mysql_query($sql1_querys);

                                      //   $management_approach='';

                                      //   while($val1_querys=mysql_fetch_array($ptr1_querys))

                                      //   {

                                      //     $management_approach+=$val1_querys['management_approach'];

                                      //   }

                                      //   $tot_management_approach=round(($management_approach/$tot_rec)*100);

                                      ?>

                                      <div style="font-size:17px;color:blue;text-align:center"><strong>Student

                                              FeedBack </strong> ( Management Approach )

                                      </div>

                                      <table class="table no-margin" style="text-align:">

                                          <tbody>

                                              <tr style="background-color:#f4f0ec;">

                                                  <td style="text-align:left;font-size:15px;width:520px"><b>Management

                                                  Approach Performance <b></td>

                                                  <td style="text-align:left;"> <span style="font-size:20px;color:red"><b>

                                                              <?php echo round($data_daily_per['feedback_management_approach']); ?>

                                                          </b>%</span></td>

                                              </tr>

                                          </tbody>

                                      </table>

                                      <?php

                                    }

                                    '<br>' .$sel_conc_pnt="select * from tk_sales_point where 1 and DATE(added_date)='".$start_date."' and staff_id='". $staff_id."' ".$search_cm_id." and total_minute >0";

                                    $ptr_conc_pnt=mysql_query($sel_conc_pnt);

                                    $nos_of_record=mysql_num_rows($ptr_conc_pnt);

                                    if($nos_of_record)

                                    {

                                      ?>

                                      <div style="font-size:17px;color:blue;text-align:center"><strong>Sale

                                              Performance</strong></div>

                                      <table class="table no-margin" style="text-align:center">

                                          <thead>

                                              <tr>

                                                  <th style="text-align:center">Sr.No.</th>

                                                  <th style="text-align:center">Follow Up Call</th>

                                                  <th style="text-align:center">Walk-in</th>

                                                  <th style="text-align:center">Installment followUp call</th>

                                                  <th style="text-align:center">Agent Call</th>

                                                  <th style="text-align:center">Enrollment</th>

                                                  <th style="text-align:center">Upgrade</th>

                                                  <th style="text-align:center">Recovery</th>

                                                  <th style="text-align:center">Entry Changes</th>

                                                  <th style="text-align:center">Upgrade FollowUp</th>

                                              </tr>

                                          </thead>

                                          <tbody>

                                            <?php

                                            $tot_conc_time='';

                                            while($data_sales=mysql_fetch_array($ptr_conc_pnt)){

                                                ?>

                                                <tr>

                                                    <td>

                                                        <?php echo $d++ ?>

                                                    </td>

                                                    <td align="center">

                                                        <?php 

                                                        if($data_sales['followup_call']!='' && $data_sales['followup_call']!='0')

                                                        {

                                                          echo $followup_call= convertToHoursMins($data_sales['followup_call'], '%02d hour %02d min');

                                                        }

                                                        else{

                                                          echo '0';

                                                        }

                                                         ?>

                                                    </td>

                                                    <td align="center">

                                                        <?php 

                                                        if($data_sales['walkin']!='' && $data_sales['walkin']!='0'){

                                                            echo $walkin= convertToHoursMins($data_sales['walkin'], '%02d hour %02d min');

                                                        }

                                                            else{

                                                              echo '0';

                                                            }

                                                         ?>

                                                    </td>

                                                    <td align="center">

                                                        <?php 

                                                        if($data_sales['installment_foll_call']!='' && $data_sales['installment_foll_call']!='0'){

                                                        echo $installment_foll_call= convertToHoursMins($data_sales['installment_foll_call'], '%02d hour %02d min');

                                                        }

                                                        else{

                                                          echo '0';

                                                        }

                                                         ?>

                                                    </td>

                                                    <td align="center">

                                                        <?php

                                                        if($data_sales['agent_call']!='' && $data_sales['agent_call']!='0'){

                                                          echo $agent_call= convertToHoursMins($data_sales['agent_call'], '%02d hour %02d min');

                                                        }

                                                        else{

                                                          echo '0';

                                                        }

                                                        ?>

                                                    </td>

                                                    <td align="center">

                                                        <?php

                                                        if($data_sales['enrollment']!='' && $data_sales['enrollment']!='0'){

                                                            echo $enrollment= convertToHoursMins($data_sales['enrollment'], '%02d hour %02d min');

                                                        }

                                                            else{

                                                              echo '0';

                                                            }

                                                         ?>

                                                    </td>

                                                    <td align="center">

                                                        <?php

                                                        if($data_sales['upgrade']!='' && $data_sales['upgrade']!='0'){

                                                            echo $upgrade= convertToHoursMins($data_sales['upgrade'], '%02d hour %02d min'); 

                                                        }

                                                        else{

                                                          echo '0';

                                                        }

                                                        ?>

                                                    </td>

                                                    <td align="center">

                                                        <?php 

                                                        if($data_sales['recovery']!='' && $data_sales['recovery']!='0'){

                                                            echo $recovery= convertToHoursMins($data_sales['recovery'], '%02d hour %02d min'); 

                                                        }

                                                        else{

                                                          echo '0';

                                                        }

                                                        ?>

                                                    </td>

                                                    <td align="center">

                                                        <?php 

                                                        if($data_sales['entry_changes']!='' && $data_sales['entry_changes']!='0'){

                                                            echo $entry_changes= convertToHoursMins($data_sales['entry_changes'], '%02d hour %02d min');

                                                        }

                                                        else{

                                                          echo '0';

                                                        }

                                                         ?>

                                                    </td>

                                                    <td align="center">

                                                        <?php

                                                        if($data_sales['upgrade_followup']!='' && $data_sales['upgrade_followup']!='0'){

                                                             echo $upgrade_followup= convertToHoursMins($data_sales['upgrade_followup'], '%02d hour %02d min'); 

                                                        }

                                                          else{

                                                          echo '0';

                                                        }

                                                             ?>

                                                    </td>

                                                </tr>

                                                <?php

                                                 $tot_conc_time=$data_sales['total_minute'];

                                              }

                                              ?>

                                              <tr style="background-color:#f4f0ec;">

                                                  <td  colspan="3" style="text-align:left;font-size:15px;"><b> Sale

                                                          Performance<b></td>

                                                        <?php

                                                            // $data_conc_pnt=mysql_fetch_array( $ptr_conc_pnt);

                                                            // $tot_conc_time=$data_conc_pnt['total_minute'];

                                                            '<br>Tot Councillor point '.$tot_conc_pnt=round($tot_conc_time*0.208);

                                                            $tot_sale_time= convertToHoursMins($tot_conc_time, '%02d hour %02d min');

                                                        ?>

                                                  <td colspan="3"><span style="font-size:20px;color:red"><b>

                                                              <?php echo round($tot_conc_pnt); ?>

                                                          </b>%</span></td>

                                                  <td colspan="4" style="text-align:right;"> ToTal Sale Hour :

                                                      <b><?php echo $tot_sale_time;?></b>

                                                  </td>

                                              </tr>

                                          </tbody>

                                      </table>

                                      <?php

                                    }

                                    // }

                                    // else {

                                    //   echo '<div><h3>No records found related to your search criteria, please try again</h3></div>';

                                    // }

                                    ?>

                                    <!-- /.table-responsive -->

                                    <!-- </div> -->



                                    <!-- /.box -->

                                </div>

                                <!-- /.col -->

                              <!-- </div> -->

                          </tr>

                        </table>

                    </div>

                  </div>

              </div>

                        <!-- /.box -->

            </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>