<?php include 'inc_classes.php'; 
include "admin_authentication.php";
?>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Add Team</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_me(ids) {
        var table1 = document.getElementById("table1");
        var table2 = document.getElementById("table2");
        checkboxes = document.getElementsByName("check_tab1");
        var i;
        for (i = 0; i < checkboxes.length; i++)
        {
            if (checkboxes[i].checked) {
                var newRow = table2.insertRow(table2.length);
                cell1 = newRow.insertCell(0);
                cell2 = newRow.insertCell(1);
                cell3 = newRow.insertCell(2);
                cell1.innerHTML = '<input type="hidden" name="team_staff[]" value="' + ids + '">';
                cell2.innerHTML = table1.rows[i + 1].cells[1].innerHTML;
                cell3.innerHTML = table1.rows[i + 1].cells[2].innerHTML;

                var index = table1.rows[i + 1].rowIndex;
                table1.deleteRow(index);
                i--;
            }
        }
    }
    function selects() {
        var ele = document.getElementsByName('check_tab1');
        for (var i = 0; i < ele.length; i++) {
            if (ele[i].type == 'checkbox')
                ele[i].checked = true;
        }
    }
    function deSelect() {
        var ele = document.getElementsByName('check_tab1');
        for (var i = 0; i < ele.length; i++) {
            if (ele[i].type == 'checkbox')
                ele[i].checked = false;

        }
    }            
</script>

<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>
                    Add Team
                    <!--<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>
            <?php
                if($_REQUEST['id']!='')
                {
                    $record_id=$_REQUEST['id'];
                    $query="select * from tk_team where team_id='$record_id'";
                    $ptr_data_3=mysql_query($query);
                    $data=mysql_fetch_array($ptr_data_3);
                }
                else
                {
                    $record_id='';
                    
                }
              if(isset($_REQUEST['submit']))
               {
                    if (empty($_POST['team_name'])){
                        $team_Err = "Field is required";
                        }
                    else{
                        $team_name=addslashes($_POST['team_name']);
                       }
                    if (empty($_POST['team_staff'])){
                        $staff_Err = "Field is required";
                        }
                    else{
                         $staff_id=$_POST['team_staff'];
                       }
                    
                    $admin_id =$_SESSION['admin_id'];
                    
                       if($record_id)
                       {
                            if($team_name !="" &&  $staff_id !="" )
                            {
                                $upd_team="update tk_team set `team_name`='".$team_name."',`updated_admin_id`='".$admin_id."',`cm_id`='".$_SESSION['cm_id']."',`updated_date`='".date('Y-m-d : H:i:s')."' where team_id='".$record_id."' ";
                                $ptr_upd_team=mysql_query($upd_team); 

                                $staff_count=count($staff_id);
                                if($staff_count > 0)
                                {   

                                    $delete_colla="delete from tk_team_collabraters where team_id='".$record_id."'";
                                    $ptr_delete_colla=mysql_query($delete_colla);
    
                                    // inserting into team_collabrates after updating the team members
                                    for($i=0;$i<$staff_count;$i++)
                                    {
                                        $insert_team_collabraters="insert into tk_team_collabraters(`team_id`,`staff_id`,`updated_admin_id`,`cm_id`,`updated_date`) values('".$record_id."','".$staff_id[$i]."','".$admin_id."','".$_SESSION['cm_id']."','".date('Y-m-d : H:i:s')."')";
                                        $ptr_ins_collabraters=mysql_query($insert_team_collabraters);
                                    }
                                   //updating altert box
                                }
                                    if($ptr_upd_team)
                                    {
                                    ?>
                                    <div class="alert alert-success alert-dismissible">
                                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                                        <h4><i class="icon fa fa-ban"></i> Alert!</h4>
                                        <p> Record Updated Successfully.</p>
                                    </div>
                                        <script>setTimeout('document.location.href="tk_add_team.php";', 1000);</script>
                                        <?php
                                    }  
                            }
                        }
                        else
                        {
                            if($team_name !="" &&  $staff_id !="" )
                            {
                                $insert_team="insert into tk_team(`team_name`,`admin_id`,`cm_id`,`added_date`) values('".$team_name."','".$admin_id."','".$_SESSION['cm_id']."','".date('Y-m-d : H:i:s')."')";
                                $ptr_ins=mysql_query($insert_team);
                                $team_id=mysql_insert_id();

                                $staff_count=count($staff_id);
                                for($i=0;$i<$staff_count;$i++)
                                {
                                    $insert_team_collabraters="insert into tk_team_collabraters(`team_id`,`staff_id`,`admin_id`,`cm_id`,`added_date`) values('".$team_id."','".  $staff_id[$i]."','".$admin_id."','".$_SESSION['cm_id']."','".date('Y-m-d : H:i:s')."')";
                                    $ptr_ins_collabraters=mysql_query($insert_team_collabraters);       
                                }
                                if($ptr_ins)
                                {
                                ?>
                                <div class="alert alert-success alert-dismissible">
                                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                                    <h4><i class="icon fa fa-ban"></i> Alert!</h4>
                                    <p> Record Inserted Successfully.</p>
                                </div>
                                    <script>setTimeout('document.location.href="tk_add_team.php";', 1000);</script>
                                    <?php
                                }
                            }   
                        }   
                }

                //  deleting team and team collabraters 
                    if($_REQUEST['deleteRecord']!='' && $_REQUEST['id']!='')
                      {
                        $id=$_REQUEST['id'];
                        $delete_team="delete from tk_team where team_id='".$id."'";                    //  deleting team
                        $ptr_delete_team=mysql_query($delete_team);
                        $delete_team_colla="delete from tk_team_collabraters where team_id='".$id."'";    //  deleting team collabraters
                        $ptr_delete_team_colla=mysql_query($delete_team_colla);
                        $del_query="delete from tk_team_project where proj_id='".$id."'";
                        $ptr_del=mysql_query($del_query);
                        if ($ptr_delete_team)
                            {
                                ?>
                                <!-- delete record alert box -->
                                <div class="alert alert-danger alert-dismissible">
                                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                                    <h4><i class="icon fa fa-ban"></i> Alert!</h4>
                                    <p> Record Deleted Successfully.</p>
                                </div>
                                <script>
                                    //  if(confirm("Are you sure, you want to delete selected record(s)?"))
                                    setTimeout('document.location.href="tk_add_team.php";', 1000);
                                </script>
                                <?php
                            }
                      } 
                     //  deleting perticular collabraters from tk team collabraters
                    if($_REQUEST['deleteStaff']!='' && $_REQUEST['ids']!='')
                    {
                      $id_staff=$_REQUEST['ids'];
                     $staff_delete="delete from tk_team_collabraters where staff_id='".$id_staff."'and team_id='".$record_id."' " ;
                      $ptr_staff_delete=mysql_query($staff_delete);
                    }     
            ?>
            <!-- Main content -->
            <section class="content">
                <div class="box box-default">
                    <form name="task_form" method="post">
                        <div class="box-body">
                            <div class="row">
                                <div class="col-md-6">
                                    <p style="color:red"> * Required Field</p>
                                    <div class="form-group">
                                        <label><span style="color:red">*</span> Team Name &nbsp;&nbsp;<span style="color:red"><?php echo $team_Err ;?></span></label>
                                        <input type="text" class="form-control" name="team_name" id="team_name"
                                            value="<?=$data['team_name']?>" placeholder="">
                                    </div>
                                    <div class="form-group">
                                        <div class="box-body">
                                            <div class="direct-chat-messages">
                                                <label><span style="color:red">*</span>Assigned Collabraters
                                                    &nbsp;&nbsp;<span style="color:red">
                                                        <?php echo $staff_Err ;?>
                                                    </span></label>
                                                    <!-- <div class="" style="padding-left:60%">
                                                <form method="post" name="search">
                                                    <div class="input-group" >
                                                        <input type="text" class="form-control" name="keywords" 
                                                            value="<?php if($_REQUEST['search']!=" search") echo $_REQUEST['search'];?>"
                                                        placeholder="Search Staff">
                                                        <div class="input-group-btn" >
                                                            <input type="image" src="images/search.jpg" name="search" value="search" style="height:33px;">
                                                        </div>
                                                    </div>
                                                </form>
                                            </div> -->
                                                <!-- table 2nd for assigned collabraters  -->
                                                <div class="table-responsive">
                                                    <table class="table no-margin" id="table2">
                                                        <thead>
                                                            <tr>
                                                                <th></th>
                                                                <th>Staff_name</th>
                                                                <th>Photo</th>
                                                                <th></th>
                                                            </tr>
                                                            <?php 
                                                                // updating collabraters selection
                                                        //         if($_REQUEST['keywords']!="keywords")
                                                        // $search_staffs=trim($_REQUEST['keywords']);
                                                        // if($search_staffs)
                                                        // {
                                                        //    $staff_searchs=" and name like '%".$search_staffs."%'";
                                                        // }
                                                        // else{
                                                        //    $staff_searchs="";
                                                        // }
                                                                $team_update="select staff_id,team_id from tk_team_collabraters where team_id='".$record_id."'";
                                                                $ptr_team_update=mysql_query($team_update);
                                                               while($fetch_team_update=mysql_fetch_array($ptr_team_update))
                                                               {
                                                                    $sel_staff= $fetch_team_update['staff_id'];
                                                                
                                                                    $team_name_update="select name,photo,admin_id from site_setting where 1 and admin_id='".$sel_staff."'";
                                                                    $ptr_team_name_update=mysql_query($team_name_update);
                                                                    $update_data=mysql_fetch_array($ptr_team_name_update);
                                                                        ?>
                                                                        <tr>
                                                                            <td><input type="hidden" name="team_staff[]" value=<?php
                                                                                    echo $fetch_team_update['staff_id']; ?>></td>
                                                                            <td>
                                                                                <?php echo ucfirst($update_data['name']); ?>
                                                                            </td>
                                                                            <td><img src="../faculty_login/staff_photo/<?php echo $update_data['photo'];?>" width="20px"; height="20px";></td>
                                                                            <td>
                                                                                <a href="tk_add_team.php?deleteStaff=1&ids=<?php echo $fetch_team_update['staff_id'];?>&id=<?php echo $fetch_team_update['team_id'];?>" value="delete" style="color:red">
                                                                                <i class="fa fa-times-circle"></i>
                                                                                </a>
                                                                            </td>
                                                                        </tr>
                                                                        <?php
                                                                }  
                                                            ?>
                                                        </thead>
                                                    </table>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div>.</div>
                                    <div class="form-group">
                                    </div>
                                    <div class="box-body">
                                        <!-- table 1st - all collabraters for selecting -->
                                        <div class="direct-chat-messages">
                                            <label class="box-title"> Collabraters</label>
                                            <div class="" style="padding-left:60%">
                                                <form method="post" name="search">
                                                    <div class="input-group" >
                                                        <input type="text" class="form-control" name="keyword1" 
                                                            value="<?php if($_REQUEST['search']!=" search") echo $_REQUEST['search'];?>"
                                                        placeholder="Search Staff">
                                                        <div class="input-group-btn" >
                                                            <input type="image" src="images/search.jpg" name="search" value="search" style="height:33px;">
>
                                                        </div>
                                                    </div>
                                                </form>
                                            </div>
                                            <div class="table-responsive">
                                                <table class="table no-margin" id="table1" ;>
                                                    <!-- <input type="button" onclick='selects()' value="Select All"/>&nbsp;&nbsp;
                                                <input type="button" onclick='deSelect()' value="Unselect All"/> &nbsp;&nbsp; -->
                                                    <!-- <input type="checkbox" name="check_tab1" value="<?=$fetch_staff_data['admin_id'];?>" onclick=" select_me(<?=$fetch_staff_data['admin_id'];?>)"> -->

                                                    <thead>
                                                        <tr>
                                                            <th></th>
                                                            <th>Staff_name</th>
                                                            <th>Photo</th>
                                                            <th>User_Type</th>
                                                        </tr>
                                                    </thead>
                                                    <tbody>
                                                        <?php
                                                        // team collabraters updating time remain collabraters display on screen
                                                    
                                                        $i=1;
                                                        if($_REQUEST['keyword1']!="keyword1")
                                                        $search_staff=trim($_REQUEST['keyword1']);
                                                        if($search_staff)
                                                        {
                                                           $staff_search=" and name like '%".$search_staff."%'";
                                                        }
                                                        else{
                                                           $staff_search="";
                                                        }
                                                                if($record_id)
                                                                {
                                                                    $staff_id_coll='';
                                                        
                                                                   $sel_team_id="select team_id from tk_team where team_id='".$record_id."'";
                                                                   $ptr_team_id=mysql_query($sel_team_id);
                                                                    while($fetch_team_id=mysql_fetch_array($ptr_team_id))
                                                                    { 
                                                                        $sel_staff_id="select staff_id from tk_team_collabraters where team_id='".$fetch_team_id['team_id']."'";
                                                                        $ptr_staff_id=mysql_query($sel_staff_id);
                                                                        $tot=mysql_num_rows($ptr_staff_id); 
                                                                        $it=1;
                                                                        while($fetch_staff_id=mysql_fetch_array($ptr_staff_id))
                                                                        {
                                                                            if($it==$tot){
                                                                                $staff_id_coll .= $fetch_staff_id['staff_id'];
                                                                                 $staff_id_coll;
                                                                            }
                                                                            else{
                                                                                
                                                                                $staff_id_coll .=$fetch_staff_id['staff_id'].',';
                                                                            }
                                                                            $it++;
                                                                            $sel_staff="select name,photo,admin_id,type from site_setting where admin_id NOT IN(".$staff_id_coll.") order by name asc";
                                                                            $ptr_staff_data=mysql_query($sel_staff);
                                                                            while($fetch_staff_data=mysql_fetch_array($ptr_staff_data)){
                                                                                ?>
                                                                                <tr><td><input type="checkbox" name="check_tab1" value="<?php echo $fetch_staff_data['admin_id'] ;?>" onclick="select_me(<?php echo $fetch_staff_data['admin_id']; ?>);" ></td><td><?php echo ucfirst($fetch_staff_data['name']);?></td><td><img src="../faculty_login/staff_photo/<?php echo $fetch_staff_data['photo'];?>" width="20px"; height="20px";></td><td><?php echo $fetch_staff_data['type'];?> </td></tr>    
                                                                                <?php               
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            else
                                                            {
                                                                $sel_collabraters="select name,photo,type,admin_id from site_setting where 1 ".$staff_search." order by name asc";
                                                                    $ptr_sel_colla=mysql_query($sel_collabraters);
                                                                    while( $fetch_data=mysql_fetch_array($ptr_sel_colla))
                                                                      {
                                                                        ?>
                                                                        <tr><td><input type="checkbox" name="check_tab1" value="<?php echo $fetch_data['admin_id'] ;?>" onclick="select_me(<?php echo $fetch_data['admin_id']; ?>);" ></td><td><?php echo ucfirst($fetch_data['name']);?></td><td><img src="../faculty_login/staff_photo/<?php echo $fetch_data['photo'];?>" width="20px"; height="20px";></td><td><?php echo $fetch_data['type'];?> </td></tr>    
                                                                        <?php 
                                                                    }
                                                            } 
                                                                  ?>
                                                    </tbody>
                                                </table>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="">
                                    <input type="submit" name="submit" data-toggle="modal" data-target="#updated" ;
                                        value="<?php if($record_id) echo 'Update '; else echo 'Submit'; ?>"
                                        class="btn btn-block btn-success">
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <!-- team manage and team table  -->
                <div class="row">
                    <div class="col-md-12">
                        <div class="box box-info">
                            <div class="box-header with-border">
                                <h3 class="box-title"> Manage Team</h3>
                                <!-- <div class="box-tools pull-right">
                                    <button type="button" class="btn btn-box-tool" data-widget="collapse"><i
                                            class="fa fa-minus"></i>
                                    </button>
                                </div> -->
                            </div>
                            <!-- filter serching team -->
                            <div class="">
                                <form method="post" name="search">
                                    <div class="input-group" style="padding:0% 2% 0% 82%; ">
                                        <input type="text" class="form-control" name="keyword" id="search_project"
                                            value="<?php if($_REQUEST['search']!=" search") echo $_REQUEST['search'];?>"
                                        placeholder="Search Team">
                                        <div class="input-group-btn">
                                            <input type="image" src="images/search.jpg" name="search" value="search" style="height:34px;">
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="box-body">
                                <div class="table-responsive">
                                    <table class="table no-margin">
                                        <thead>
                                            <tr>
                                                <th>Sr. No.</th>
                                                <th>Team Name</th>
                                                <th>Team Collabtraters</th>
                                                <th>Added Date</th>
                                                <th>Added By</th>
                                                <th>Action</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php
                                                  $i=1;
                                                  if($_REQUEST['keyword']!="keyword")
                                                  $search=trim($_REQUEST['keyword']);
                                                  if($search)
                                                  {
                                                     $team_search=" and team_name like '%".$search."%'";
                                                  }
                                                  else{
                                                     $team_search="";
                                                  }
                                                  $sel_team="select * from tk_team where 1 ".$team_search." order by added_date desc";
                                                  $ptr_sel_team=mysql_query($sel_team);
                                                  while($team_data=mysql_fetch_array($ptr_sel_team))
                                                  {
                                                      $p_data="select name from site_setting where 1 and admin_id='".$team_data['admin_id']."'";
                                                      $ptr_data=mysql_query($p_data);
                                                      $team_admin=mysql_fetch_array($ptr_data);

                                                      $staff_no="select team_id, count(staff_id) as tot_staff from tk_team_collabraters where 1 and team_id='".$team_data['team_id']."'";
                                                      $ptr_query1=mysql_query($staff_no);
                                                      $staff_data=mysql_fetch_array($ptr_query1);
                                              ?>
                                            <tr>
                                                <td>
                                                    <?php echo $i++ ?>
                                                </td>
                                                <td>
                                                    <?php echo strip_tags(ucfirst($team_data['team_name'])); ?>
                                                </td>
                                                <!-- popup window for collabraters name showing -->
                                                <td>
                                                    <button type="button" class="btn btn-default" data-toggle="modal"
                                                        data-target="#<?php echo $staff_data['team_id'];?>">
                                                        <?php echo $staff_data['tot_staff'];?>
                                                    </button>
                                                    <div class="modal fade" id="<?php echo $staff_data['team_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 style="color:blue">
                                                                            <?php echo ucwords($team_data['team_name']) ?>
                                                                        </span>- Team Collabraters
                                                                    </h4>
                                                                </div>
                                                                <div class="direct-chat-messages">
                                                                    <div class="modal-body">
                                                                        <?php
                                                                        $sel_task_staff="select staff_id from tk_team_collabraters where 1 and team_id='".$team_data['team_id']."'";
                                                                        $ptr_sel_staff=mysql_query($sel_task_staff);
                                                                        $k=1;
                                                                        $p=1;
                                                                        while( $fetch_staff=mysql_fetch_array($ptr_sel_staff))
                                                                        {
                                                                        $staff_name="select name,photo from site_setting where 1 and admin_id='".$fetch_staff['staff_id']."' ";
                                                                        $ptr_data_staff=mysql_query($staff_name);
                                                                        $fetch_staff_name=mysql_fetch_array($ptr_data_staff);   
                                                                ?>
                                                                        <p><span>
                                                                                <?php echo $p++ ?>
                                                                            </span>
                                                                            .<strong style="color:maroon">
                                                                                <?php echo ucfirst($fetch_staff_name['name']);?>
                                                                            </strong>
                                                                        </p>
                                                                        <?php
                                                                    }
                                                                    ?>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </td>
                                               <!-- end popup window td -->
                                                <td>
                                                    <?php 
                                                     $add_Date = date("d-m-Y", strtotime($team_data['added_date']));
                                                     echo $add_Date ;
                                                    ?>
                                                </td>
                                                <td>
                                                    <?php echo ucfirst($team_admin['name']); ?>
                                                </td>
                                                <td>
                                                     <a href="tk_add_team.php?id=<?php echo $team_data['team_id']?>"><i class="fa fa-edit"></i>       <!-- edit -->
                                                    </a>&nbsp;&nbsp;&nbsp;&nbsp;
                                                    <a href="tk_add_team.php?deleteRecord=1&id=<?php echo $team_data['team_id'] ?>"><i class="fa fa-trash"></i>
                                                </a>                             <!-- delete -->
                                                </td>
                                            </tr>
                                            <?php 
                                              }
                                            ?>
                                        </tbody>
                                    </table>
                                    <!-- table pagination code -->
                                    <div class="pagination">
                                        <a href="#">&laquo;</a>
                                        <a href="" class="active">1</a>
                                        <a href="" >2</a>
                                        <a href="">3</a>
                                        <a href="">&raquo;</a>
                                  </div>
                                </div>
                                <!-- /.table-responsive -->
                            </div>
                            <!-- /.box-body -->
                        </div>
                        <!-- /.box -->
                    </div>
                    <!-- /.col -->
                </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: '-1d',
                Default: true,
                todayHighlight: true
            })
            $('#datepicker1').datepicker({
                autoclose: true,
                format: 'dd/mm/yyyy',
                Default: true,
                todayHighlight: true
            })

            //iCheck for checkbox and radio inputs
            $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
                checkboxClass: 'icheckbox_minimal-blue',
                radioClass: 'iradio_minimal-blue'
            })
            //Red color scheme for iCheck
            $('input[type="checkbox"].minimal-red, input[type="radio"].minimal-red').iCheck({
                checkboxClass: 'icheckbox_minimal-red',
                radioClass: 'iradio_minimal-red'
            })
            //Flat red color scheme for iCheck
            $('input[type="checkbox"].flat-red, input[type="radio"].flat-red').iCheck({
                checkboxClass: 'icheckbox_flat-green',
                radioClass: 'iradio_flat-green'
            })

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

            //Timepicker
            $('.timepicker').timepicker({
                showInputs: false
            })
        })
    </script>
</body>

</html>