Commit c4988102 by Azhan Hannan

validation untuk HR check timesheet staff

parent 711525f0
...@@ -38,7 +38,11 @@ ...@@ -38,7 +38,11 @@
@else @else
<div class="field"> <div class="field">
<label>Year</label> <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> </div>
@endif @endif
...@@ -72,12 +76,41 @@ ...@@ -72,12 +76,41 @@
</div> </div>
</div> </div>
<button class="ui green button" type="submit">View Timesheet</button> <button class="ui green button" type="submit">View Timesheet</button>
<div class="ui error message"></div>
</form> </form>
</div> </div>
@endsection @endsection
@push('script') @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> <script>
function selectDepartment(i) { function selectDepartment(i) {
// alert(i); // alert(i);
......
...@@ -2222,7 +2222,10 @@ class DashboardController extends Controller ...@@ -2222,7 +2222,10 @@ class DashboardController extends Controller
->get(); ->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){ 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