<form class="form-horizontal" role=form>
    <h2>Attendance</h2>

    <div class="form-group">
        <label for="txtDate" class="col-md-2 control-label">Date</label>

        <div class="col-md-8">
            <div class="input-group">
                <input class="form-control" id="txtDate" type="text" datepicker-popup="dd-MMM-yyyy"
                       ng-model="info.Date"/>
                <span class="input-group-btn">
                    <button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
                </span>
            </div>
        </div>

        <div class="col-md-2">
            <button class="btn btn-info" ng-click="show()">Show <i class="glyphicon glyphicon-eye-open"></i></button>
        </div>
    </div>
    <table id="gvGrid" class="table table-condensed table-bordered table-striped">
        <thead>
        <tr>
            <th class="text-right">Code</th>
            <th>Name</th>
            <th>Designation</th>
            <th>Department</th>
            <th>Status</th>
            <th>Prints</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="item in info.Body"
            ng-class="{0:'', 1:'Present', 2:'Off', 3:'Leave', 4:'Absent', 5:'HalfDay', 6:'Double', 7:'PaidLeaveAvailed', 8:'CasualLeaveAvailed', 9:'Overtime', 10:'OffWorked', 11:'COff', 12:'HalfPL', 13:'HalfCL'}[item.AttendanceTypeID]"
            ng-controller="AttendanceSubCtrl">
            <td class="text-right">{{item.Code}}</td>
            <td><i class="glyphicon glyphicon-leaf" ng-show="isDirty()"></i> {{item.Name}}</td>
            <td>{{item.Designation}}</td>
            <td>{{item.Department}}</td>
            <td>
                <select class="form-control" ng-model="item.AttendanceTypeID"
                        ng-options="i.AttendanceTypeID as i.Name for i in attendance_types"></select>
            </td>
            <td class="no-bg">{{item.Prints}}
                <span ng-show="item.Hours.length > 0"
                      ng-class="{'label': isLabel(), 'label-success': isGood(), 'label-warning': isBad(), 'label-important': isError()}">{{item.Hours}}</span>
            </td>
        </tr>
        </tbody>
    </table>
    <div class="form-group">
        <div class="col-md-offset-2 col-md-10">
            <button tan-click="save()" ng-disabled="isClean() || frmForm.$invalid" class="btn btn-primary">Save</button>
        </div>
    </div>
</form>
