<?php include 'inc_classes.php'; 
include "admin_authentication.php";
// include "include/headHeader.php";
// include "include/functions.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>Task 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(branch1) {
        var branch_data1 = "action=admin&branch_name1=" + branch1;
        // alert(branch);
        $.ajax({
            url: "tk_staff_ajax.php", type: "post", data: branch_data1, cache: false,
            success: function (retadmin) {
                // alert(retstaff);
                document.getElementById("staff_name1").innerHTML = retadmin;

            }
        });
    }
</script>
<?php include "include/ps_pagination.php"; ?>
<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>
                    Task 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>
                                        <td>
                                          <?php if($_SESSION['type']=='S' || $_SESSION['branch_access']=='yes')
                                          {
                                            ?>
                                            <select class="form-control select2" id="branch_name" style="width:150px"
                                                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>
                                            <?php
                                          }
                                          else
                                          {
                                            ?>
                                            <input type="hidden" name="branch_name" id="branch_name"
                                                value="<?php echo $_SESSION['branch_name']; ?>" />
                                            <?php
                                          }
                                          ?>
                                        </td>
                                        <?php if($_SESSION['type']=='S' || $edit_access=='yes')
                                          {
                                              ?>
                                              <td>
                                                  <select class="form-control select2" id="dept" style="width:200px"
                                                      name="dept" ;>
                                                      <option value="">Select Department</option>
                                                      <?php 
                                                      $sel_dept="select dept_id,dept_name from emp_dept";
                                                      $ptr_dept=mysql_query($sel_dept);
                                                      while($data_dept=mysql_fetch_array($ptr_dept))
                                                      {
                                                          $sel='';
                                                          if($data_dept['dept_id']==$_GET['dept'])
                                                          {
                                                          $sel='selected="selected"';
                                                          }
                                                          echo '<option '.$sel.' value="'.$data_dept['dept_id'].'" >'.$data_dept['dept_name'].'</option>';
                                                      }
                                                      ?>
                                                  </select>
                                              </td>
                                              <?php
                                          }
                                           else if($manager_access=='manager')
                                          {
                                              ?>
                                              <td>
                                                  <select class="form-control select2" id="dept" style="width:200px"
                                                      name="dept" ;>
                                                      <option value="">Select Department</option>
                                                      <?php 
                                                        $sel_dept="select dept_id,dept_name from emp_dept where ".$dept_string.""; 
                                                      $ptr_dept=mysql_query($sel_dept);
                                                      while($data_dept=mysql_fetch_array($ptr_dept))
                                                      {
                                                          $sel='';
                                                          if($data_dept['dept_id']==$_GET['dept'])
                                                          {
                                                          $sel='selected="selected"';
                                                          }
                                                          echo '<option '.$sel.' value="'.$data_dept['dept_id'].'" >'.$data_dept['dept_name'].'</option>';
                                                      }
                                                      ?>
                                                  </select>
                                              </td>
                                              <?php
                                          }
                                          ?>
                                        <td>
                                            <div>
                                                <?php
                                                if($_REQUEST['staff_name1']!='')
                                                  {
                                                    $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_name1">
                                                          <option value="">Select Staff</option>
                                                            <?php
                                                        while($data_query=mysql_fetch_array($ptr_que))
                                                        {
                                                          $sel='';
                                                          if($data_query['admin_id']==$_GET['staff_name1'])
                                                            {
                                                              $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_name1">
                                                      <option value="">Select Staff</option>
                                                    </select>
                                                    <?php
                                                  }
                                                  ?>
                                            </div>
                                        </td>
                                        <td>
                                            <div>
                                                <select class="form-control select2" style="width:150px"
                                                    id="staff_names" name="staff_names">
                                                    <option value="">Assinged By</option>
                                                    <?php
                                                      $categary="select admin_id,name from site_setting where 1 and system_status='Enabled'
                                                        order by name ASC"; 
                                                      $c_query=mysql_query($categary);
                                                      while($data_c=mysql_fetch_array($c_query))
                                                      {
                                                        $sel='';
                                                        if($data_c['admin_id']==$_GET['staff_names'])
                                                          {
                                                            $sel='selected="selected"';
                                                          }
                                                          echo  '<option '. $sel.'  value="'.$data_c['admin_id'].'">'.ucfirst($data_c['name']). '</option>';
                                                      }
                                                    ?>
                                                </select>
                                            </div>
                                        </td>
                                        <!-- <td width="5px"></td> -->
                                        <td>
                                            <div>
                                                <select class="form-control select2" style="width:100px" id="task_type"
                                                    name="task_type">
                                                    <option value="">Task Type</option>
                                                    <option value="system" <?php if ($_GET['task_type']=="system" )
                                                        echo "selected='selected'" ;?>>System Task</option>
                                                    <option value="adhoc_task" <?php if
                                                        ($_GET['task_type']=="adhoc_task" ) echo "selected='selected'"
                                                        ;?>>Ad hoc Task</option>
                                                </select>
                                            </div>
                                        </td>
                                        <!-- </td> -->
                                        <!-- <td width="5px"></td> -->
                                        <td>
                                            <div>
                                                <select class="form-control select2" style="width:100px" id="status"
                                                    name="status">
                                                    <option value="">Status</option>
                                                    <option value="complete" <?php if ($_GET['status']=="complete" )
                                                        echo "selected='selected'" ;?>>Complete</option>
                                                    <option value="in_progress" <?php if ($_GET['status']=="in_progress"
                                                        ) echo "selected='selected'" ;?>>In_Progress</option>
                                                    <option value="in_complete" <?php if ($_GET['status']=="in_complete"
                                                        ) echo "selected='selected'" ;?>>In_Complete</option>
                                                    <option value="cancel" <?php if ($_GET['status']=="cancel" )
                                                        echo "selected='selected'" ;?>>Cancel</option>
                                                    <option value="halt" <?php if ($_GET['status']=="halt" )
                                                        echo "selected='selected'" ;?>>Halt</option>
                                                </select>
                                            </div>
                                        </td>
                                        <!-- <td width="5px"></td> -->
                                        <td width="">
                                            <input type="text" name="start_date" class="input_text datepicker"
                                                placeholder="Task Added Date" id="datepicker" title="Task Date"
                                                value="<?php echo $_GET['start_date'] ;?>" style="width:110px">
                                        </td>
                                        <!-- <td width="5px"></td> -->
                                        <td>
                                            <input type="text" class="form-control" style="width:100px" name="keyword121"
                                                id="search_project" value="<?php if($_REQUEST['search']!=" search") echo
                                                $_REQUEST['keyword121'];?>" placeholder="search">
                                        </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"> -->
                                        <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 Assignee</th>
                                                    <th style="text-align:center">Task Type</th>
                                                    <th style="text-align:center">Priority</th>
                                                    <th style="text-align:center">Status</th>
                                                    <th style="text-align:center">Added Date</th>
                                                    <th style="text-align:center">Dead Line</th>
                                                    <th style="text-align:center">Completed/In-Complete Date</th>
                                                    <th style="text-align:center">Assinged By</th>
                                                    <th style="text-align:center">Details</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                            <?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(added_date )='".date('Y-m-d',strtotime($frm_dates))."'";
                                            }
                                            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='';
                                            }
                                            // $search=$_REQUEST['staff_name'];
                                            if($_REQUEST['staff_name1']!='')
                                            {
                                              $staff_id=$_REQUEST['staff_name1'];
                                              $search_staff_id="and staff_id='".$staff_id."'";
                                            }
                                            else
                                            {
                                              $search_staff_id='';
                                            }
                                            if($_REQUEST['staff_names']!='')
                                            {
                                              $admin_ids=$_REQUEST['staff_names'];
                                              $search_admin_id="and assign_by='".$admin_ids."'";
                                            }
                                            else
                                            {
                                              $search_admin_id='';
                                            }
                                            if($_REQUEST['task_type']!='')
                                            {
                                              $task_type=$_REQUEST['task_type'];
                                              $search_task_type="and task_type='".$task_type."'";
                                            }
                                            else if( $staff_id!='')
                                            {
                                              $search_task_type='';
                                            }
                                            else
                                            {
                                              $search_task_type='and task_type="adhoc_task"';
                                            }
                                            if($_REQUEST['status']!='')
                                            {
                                              $status=$_REQUEST['status'];
                                              $search_status="and status='".$status."'";
                                            }
                                            else
                                            {
                                              $search_status='';
                                            }
                                            if($_REQUEST['dept']!='')
                                        {
                                          $dept_idss=$_REQUEST['dept'];
                                          $depa_array=array();
                                          $p=0;
                                          $tot_staff='';
                                          $sel_depa="SELECT * FROM emp_dept where 1 and dept_id='".$_REQUEST['dept']."' ";
                                          $ptr_depa=mysql_query($sel_depa);
                                          while($data_depat=mysql_fetch_array($ptr_depa))
                                          {
                                            '<br>'.$sel_sept_staff="SELECT * FROM dept_employee where 1 and dept_id='".$data_depat['dept_id']."' ";
                                              $ptr_sept_staff=mysql_query($sel_sept_staff);
                                              $l=0;
                                              $tot_staff=mysql_num_rows($ptr_sept_staff);
                                              while($data_sept_staff=mysql_fetch_array($ptr_sept_staff))
                                              {
                                                  $depa_array[$l][$p]= $data_sept_staff['staff_id'];
                                                  $l++;
                                              }
                                              $p++;
                                          }
                                          // array_multisort($staff_array, SORT_ASC,SORT_NUMERIC);
                                          $array_result = [];
                                          foreach ($depa_array as $sub_Array) {
                                              foreach ($sub_Array as $values) {
                                                  $array_result[] = $values;
                                              }
                                          }
                                          // '<br><pre>'; print_r($array_result); echo '</pre> <br> <br>'; 
                                          $deptatment = "staff_id=" . implode(" or staff_id=", $array_result);
                                          $deptatments = "admin_id=" . implode(" or admin_id=", $array_result);
                                          if($tot_staff){
                                            $search_dept="and(". $deptatment.")";
                                            $search_depts="and(". $deptatment.")";
                                          }
                                          else{
                                            $search_dept="and staff_id='0'";
                                            $search_depts="and staff_id='0'";
                                          }
                                        }
                                        else{
                                          $search_dept="";
                                          $search_depts="and (".$string.")";
                                        }
                                            $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='';
                                            if($_SESSION['type']=='S' || $edit_access=='yes')
                                            {
                                              $my_task="select * from tk_individual_task where 1 ".$search_cm_id." ".$search_staff_id." ".$search_admin_id." ".$search_task_type." ".$search_status." ".$task_search."  ".$dates." ".$search_dept." and Validation='valid' order by added_date DESC ";
                                              // $ptr_data=mysql_query($my_task);
                                            }
                                            else if($manager_access=='manager')
                                            {
                                              $my_task="select * from tk_individual_task where 1 ".$search_cm_id." ".$search_staff_id." ".$search_admin_id." ".$search_task_type." ".$search_status." ".$task_search."  ".$dates."  and Validation='valid' ".$search_depts." order by added_date DESC ";
                                            }
                                            else{
                                              $my_task="select * from tk_individual_task where 1 and staff_id='".$_SESSION['admin_id']."'  and Validation='valid' order by added_date DESC ";
                                            }
                                            $no_of_records=mysql_num_rows($db->query($my_task));
                                            if($no_of_records)
                                            {
                                                $bgColorCounter=1;
                                                $query_string='&keyword121='.$search.'&branch_name='.$branch_name.'&dept='.$dept_idss.'&status='.$status.'&staff_names='.$admin_ids.'&staff_name1='.$staff_id.'&task_type='.$task_type.'&start_date='.$frm_dates;
                                                $query_string1=$query_string;
                                                $pager = new PS_Pagination($my_task,$_SESSION['show_records'],5,$query_string1);
                                                $all_records= $pager->paginate();
                                                while($my_data=mysql_fetch_array($all_records))
                                                {  
                                                    if($bgColorCounter%2==0)
                                                      $bgcolor='class="grey_td"';
                                                    else
                                                      $bgcolor=""; 
                                                    include "include/paging_script.php";
                                                    $add="select name from site_setting where 1 and admin_id='".$my_data['staff_id']."' and system_status='Enabled'";
                                                    $ptr=mysql_query($add);
                                                    $data_name=mysql_fetch_array($ptr);
                                                    ?>
                                                  <tr>
                                                      <td>
                                                          <?php echo $sr_no ?>
                                                      </td>

                                                      <td>
                                                          <?php echo strip_tags(ucwords($my_data['task_name']))?>
                                                      </td>
                                                      <td>
                                                          <?php echo strip_tags(ucwords($data_name['name']))?>
                                                      </td>
                                                      <td>
                                                          <?php echo ucfirst($my_data['assign_type'])?>
                                                      </td>
                                                      <td>
                                                          <?php echo ucfirst($my_data['priority'])?>
                                                      </td>
                                                      <td>
                                                          <?php if($my_data['status']=='complete') 
                                                          { 
                                                            ?>
                                                            <p class="label label-success">
                                                              <?php echo ucfirst($my_data['status']);?>
                                                            </p>
                                                            <?php
                                                          } 
                                                          if($my_data['status']=='in_progress') 
                                                          { 
                                                            ?>
                                                            <p class="label label-warning">
                                                                <?php echo ucfirst($my_data['status']);?>
                                                            </p>
                                                            <?php
                                                          } 
                                                          if($my_data['status']=='in_complete') 
                                                          { 
                                                            ?>
                                                            <p class="label label-danger">
                                                                <?php echo ucfirst($my_data['status']);?>
                                                            </p>
                                                            <?php
                                                          } 
                                                          if($my_data['status']=='cancel') 
                                                          { 
                                                            ?>
                                                            <p class="label label-default">
                                                              <?php echo ucfirst($my_data['status']);?>
                                                            </p>
                                                            <?php
                                                          }
                                                          if($my_data['status']=='halt') 
                                                          { 
                                                            ?>
                                                            <p class="label label-primary">
                                                                <?php echo ucfirst($my_data['status']);?>
                                                            </p>
                                                            <?php
                                                          }
                                                          ?>
                                                        </td>
                                                        <td>
                                                          <?php
                                                            $new_addDate = date("d-m-Y", strtotime( $my_data['added_date']));  
                                                            echo $new_addDate;  
                                                          ?>
                                                        </td>
                                                        <td>
                                                          <?php 
                                                            $new_dueDate = date("d-m-Y", strtotime( $my_data['due_date']));
                                                            echo $new_dueDate 
                                                          ?>
                                                      </td>
                                                      <td>
                                                        <?php 
                                                          $complete_Date='';
                                                          if($my_data['status']=='complete')
                                                          {
                                                            $complete_Date = date("d-m-Y", strtotime( $my_data['sta_complete_date']));
                                                            echo $complete_Date;
                                                          }
                                                          else{
                                                            // $complete_Date='';
                                                            echo '-';
                                                          }
                                                        ?>
                                                      </td>
                                                      <td>
                                                        <?php 
                                                          $add1="select name from site_setting where 1 and admin_id='".$my_data['assign_by']."' and system_status='Enabled'";
                                                          $ptr1=mysql_query($add1);
                                                          $data1=mysql_fetch_array($ptr1);
                                                          echo ucfirst($data1['name']);?>
                                                      </td>
                                                      <td>
                                                          <a target=_blank
                                                              href="tk_individual_task_detail.php?id=<?= $my_data['staff_task_id'] ?>"
                                                              target=""><i class="fa fa-file"></i></a>
                                                      </td>
                                                      <!-- <td>
                                                        <a href="tk_add_task.php?deleteRecord=1&id=<?= $data['tm_id']?>"><i class="fa fa-trash"></i></a>
                                                      </td> -->
                                                  </tr>
                                                  <?php
                                                  $bgColorCounter++;
                                                }
                                              ?>
                                              <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>
                              </tr>
                              </table>
                            </div>
                            <!-- /.box -->
                        </div>
                        <!-- /.col -->
                    </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>