<!--<!DOCTYPE html>-->
<!--<html lang="en" ng-app="myApp" ng-controller="timesheetController">-->
<!--<head>-->
<!--    <meta charset="UTF-8">-->
<!--    <title>Time Sheet</title>-->
<!--    <meta name="viewport" content="width=device-width, initial-scale=1">-->
<!--    <script src="//unpkg.com/@uirouter/angularjs/release/angular-ui-router.min.js"></script>-->
<!--    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"-->
<!--            integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"-->
<!--            crossorigin="anonymous"></script>-->
<!--    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"-->
<!--          integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">-->
<!--    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>-->
<!--    <script src="timeSheetController.js"></script>-->

<!--</head>-->
<!--<body>-->

<!--</body>-->
<!--</html>-->
<div class="container">
    <div class="row">
        <div class="col-sm-12">
            <br><br>
            <input id="addLeaveForm" type="submit" name="addTS" value="Add" onclick="showAddLeaveFormFunction()"/>
            <div id="addDivLF" style="display: none">
                <legend>Leave Form</legend>
                <table>

                    <tr>
                        <td><label>Title</label></td>
                        <td>
                            <input type="text" maxlength="300" ng-model="lfdto.title"/>
                        </td>
                    </tr>
                    <tr>
                        <td><label>Content</label></td>
                        <td>
                            <input type="text" maxlength="10000" ng-model="lfdto.content"/>
                        </td>
                    </tr>
                    <tr>
                        <td><label>Employee Id</label></td>
                        <td>
                            <input type="text" maxlength="10" value="" ng-model="lfdto.employeeId"/>
                        </td>
                    </tr>

                    <tr>
                        <td><label>Leave Type Id</label></td>
                        <td>
                            <input type="text" maxlength="10" value="" ng-model="lfdto.leaveTypeId"/>
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td >

                            <input type="submit" name="submit" value="Confirm" ng-click="save();"/>
                            <input type="submit" name="clear" value="Clear" ng-click="lfdto = null"/>
                        </td>
                    </tr>
                </table>
            </div>
            <br><br>
            <div id="updateDivLF" style="display: none">
<!--                <legend>Leave Form</legend>-->
                <table>

                    <tr>
                        <td><label>Title</label></td>
                        <td>
                            <input type="text" maxlength="300" ng-model="lfdto.title"/>
                        </td>
                    </tr>
                    <tr>
                        <td><label>Content</label></td>
                        <td>
                            <input type="text" maxlength="10000" ng-model="lfdto.content"/>
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td >

                            <input type="submit" name="submit" value="Confirm" ng-click="update();"/>
                            <input type="submit" name="clear" value="Clear" ng-click="lfdto = null"/>
                            <input type="submit" name="close" value="Close" onclick="document.getElementById('updateDivLF').style.display = 'none'"/>
                        </td>
                    </tr>
                </table>
            </div>
            <br><br>
            <div>
                <table class="table">
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th>Title</th>
                        <th>Content</th>
                        <th>Employee</th>
                        <th>Leave Type</th>
                        <th>Create At</th>
                        <th>Status</th>
                        <th colspan="4"></th>
                    </tr>
                    </thead>
                    <tbody>
                        <tr class="lff" ng-repeat="lf in leaveForms">
                            <td>{{$index + 1}}</td>
                            <td>{{lf.title}}</td>
                            <td>{{lf.content}}</td>
                            <td>{{lf.employee.lastName}}</td>
                            <td>{{lf.leaveType.name}}</td>
                            <td>{{lf.createdAt}}</td>
                            <td>{{lf.status}}</td>

                            <td><a ui-sref="leaveFormDetail({id: lf.id})">Xem</a></td>
                            <td><a href="/#/leaveform" ng-click="getLf(lf);" onclick="document.getElementById('updateDivLF').style.display = 'block'">Sửa</a></td>
                            <td><a href="/#/leaveform" ng-click="delete(lf);">Xoá</a></td>
                            <td><a href="/#/leaveform" ng-click="updateStatus(lf)">Duyệt</a></td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>