128 lines
6.3 KiB
PHP
128 lines
6.3 KiB
PHP
<div class="row">
|
|
<div class="col-md-2">
|
|
<select class="form-control form-control-sm"
|
|
data-bind="options:years,
|
|
optionsText:'year',
|
|
optionsValue:'year',
|
|
value:selectedYear,
|
|
event:{change:refreshEmployeehours}"></select>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<select class="form-control form-control-sm"
|
|
data-bind="options:months,
|
|
optionsText:'month',
|
|
optionsValue:'monthID',
|
|
value:selectedMonth,
|
|
event:{change:refreshEmployeehours}"></select>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<select class="form-control form-control-sm"
|
|
data-bind="options:employees,
|
|
optionsText:'fullname',
|
|
optionsValue:'id',
|
|
value:$root.selectedEmployeeID,
|
|
event:{change:refreshEmployeehours}"></select>
|
|
</div>
|
|
</div>
|
|
<br/>
|
|
<table class="table table-sm">
|
|
<thead>
|
|
<tr>
|
|
<th class="table-tealish-header">medewerker</th>
|
|
<th class="table-tealish-header">datum</th>
|
|
<th class="table-tealish-header">soort uren</th>
|
|
<th class="table-tealish-header">project</th>
|
|
<th class="table-tealish-header" style="min-width:100px;">uren</th>
|
|
<th class="table-tealish-header"> </th>
|
|
</tr>
|
|
</thead>
|
|
<tbody data-bind="foreach:employeehours">
|
|
<tr>
|
|
<td data-bind="css:{'red-line': id() == 0}">
|
|
<span data-bind="text:dbo.helpers.findArrayElement('id', 'fullname', employee_id(), $root.employees()),
|
|
visible: ! inEdit()"></span>
|
|
<select class="form-control form-control-sm"
|
|
data-bind="options:$root.employees,
|
|
optionsText:'fullname',
|
|
optionsValue:'id',
|
|
value:employee_id,
|
|
optionsCaption: 'selecteer...',
|
|
visible:inEdit(),
|
|
enable: ! $root.selectedEmployeeID,
|
|
event:{change:$root.changeEmployee}"></select>
|
|
</td>
|
|
<td data-bind="css:{'red-line': id() == 0}">
|
|
<span data-bind="text:hourdate, visible:! inEdit()"></span>
|
|
<input class="form-control form-control-sm"
|
|
data-bind="datepicker:{dateFormat: 'dd-mm-yy' },
|
|
value:hourdate, visible:inEdit(),
|
|
event:{change:$root.saveEmployeehour}"
|
|
</td>
|
|
<td data-bind="css:{'red-line': id() == 0}">
|
|
<span data-bind="text:dbo.helpers.findArrayElement('id', 'description', hourtype_id(), $root.hourtypes()),
|
|
visible: ! inEdit()"></span>
|
|
<select class="form-control form-control-sm"
|
|
data-bind="options:$root.hourtypes,
|
|
optionsText:'description',
|
|
optionsValue:'id',
|
|
value:hourtype_id,
|
|
optionsCaptiuon:'selecteer...',
|
|
visible:inEdit(),
|
|
event:{change:$root.saveEmployeehours}"></select>
|
|
</td>
|
|
<td data-bind="css:{'red-line': id() == 0}">
|
|
<!-- ko if: hourType() == 'PROJECTS' -->
|
|
<span data-bind="text:dbo.helpers.findArrayElement('projectID', 'projectname', projectID(), projects()),
|
|
visible: ! inEdit()"></span>
|
|
<select class="form-control form-control-sm"
|
|
data-bind="options:projects,
|
|
optionsText:'projectname',
|
|
optionsValue:'projectID',
|
|
value:projectID,
|
|
optionsCaption:'selecteer...',
|
|
visible:inEdit(),
|
|
event:{change:$root.saveEmployeehours}"></select>
|
|
<!-- /ko -->
|
|
<!-- ko if: hourType() == 'OFFERS' -->
|
|
<span data-bind="text:dbo.helpers.findArrayElement('id', 'offername', projectID(), $root.offersWithoutProject()),
|
|
visible: ! inEdit()"></span>
|
|
<select class="form-control form-control-sm"
|
|
data-bind="options:$root.offersWithoutProject,
|
|
optionsText:'offername',
|
|
optionsValue:'id',
|
|
value:projectID,
|
|
optionsCaption:'selecteer...',
|
|
visible:inEdit(),
|
|
event:{change:$root.saveEmployeehours}"></select>
|
|
<!-- /ko -->
|
|
</td>
|
|
<td class="align-right" data-bind="css:{'red-line': id() == 0}">
|
|
<span data-bind=" visible: ! inEdit()">
|
|
<span data-bind="text:hours"></span>
|
|
uur
|
|
</span>
|
|
<input type="text"
|
|
class="form-control form-control-sm align-right"
|
|
paceholder="uren"
|
|
data-bind="textInput:hours, visible:inEdit,
|
|
event:{change:$root.saveEmployeehours,keyup:$root.validateNumber.bind($data, 'hours')}"/>
|
|
</td>
|
|
<td data-bind="css:{'red-line': id() == 0}">
|
|
<i class="icon fa-edit pointer" title="wijzig" data-bind="click:$root.editEmployeehour"></i>
|
|
<i class="icon fa-trash redish pointer" title="verwijder"
|
|
data-bind="click:$root.removeEmployeehour"></i>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
<tfoot>
|
|
<tr>
|
|
<td colspan="3">
|
|
<button class="btn btn-primary btn-round btn-sm" data-bind="click:newEmployeehour">
|
|
nieuwe uren
|
|
</button>
|
|
</td>
|
|
</td>
|
|
</tr>
|
|
</tfoot>
|
|
|
|
</table> |