Commit c4988102 by Azhan Hannan

validation untuk HR check timesheet staff

parent 711525f0
......@@ -38,7 +38,11 @@
@else
<div class="field">
<label>Year</label>
<input type="text" name="year" class="ui fluid dropdown" value="{{ $curryear }}" readonly="readonly">
<select name="year" class="ui fluid dropdown" required="required">
@foreach($years as $key => $year)
<option value="{{ data_get($year,'tm_year') }}">{{ data_get($year,'tm_year') }}</option>
@endforeach
</select>
</div>
@endif
......@@ -72,12 +76,41 @@
</div>
</div>
<button class="ui green button" type="submit">View Timesheet</button>
<div class="ui error message"></div>
</form>
</div>
@endsection
@push('script')
<script type="text/javascript">
$('.ui.form')
.form({
fields: {
department: {
identifier: 'department',
rules: [
{
type : 'empty',
prompt : 'Please select a department'
}
]
},
staffname: {
identifier: 'staffId',
rules: [
{
type : 'empty',
prompt : 'Please select a staff'
}
]
},
}
})
;
</script>
<script>
function selectDepartment(i) {
// alert(i);
......
......@@ -2222,7 +2222,10 @@ class DashboardController extends Controller
->get();
}
return view('timesheet::dashboard.filterHrStaffsTimesheet', compact('month', 'curryear', 'currmonth', 'departments', 'staffs'));
$years = Ts_master::select('tm_year')->distinct()->get();
// dd($years);
return view('timesheet::dashboard.filterHrStaffsTimesheet', compact('month', 'curryear', 'currmonth', 'departments', 'staffs', 'years'));
}
public function hrstaffstimesheet(Request $request){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment