Commit c9dba014 by Azhan Hannan

Edit Team -> set department to selected user department.

Boleh reselect orang under the same department shj
Remove project director drpd role option
parent 4dcd2aaf
......@@ -12,6 +12,7 @@
<div class="ui styled fluid accordion">
@foreach($profile as $key => $staff)
<?php
// dd($staff);
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID));
$checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID)->where('tp_timesheet_sts', 3));
?>
......@@ -22,7 +23,8 @@
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 60%;"><i class="dropdown icon"></i>{{ data_get($staff,'fullname') }}</th>
<th style="width: 40%;"><i class="dropdown icon"></i>{{ data_get($staff,'fullname') }}</th>
<th style="width: 20%" class="text-center">{{ data_get($staff,'year') }}-{{ date("F", mktime(0, 0, 0, data_get($staff,'month'), 10)) }}-Phase {{ data_get($staff,'phase') }}</th>
<th style="width: 15%;" class="center aligned">
<?php
// dd($profile);
......@@ -61,7 +63,7 @@
</tr>
</thead>
@foreach($details as $key => $detail)
@if(data_get($detail,'staffid') == data_get($staff, 'staff_id'))
@if(data_get($detail,'fk_tm_id') == data_get($staff, 'tmid'))
<tr>
<td style="width: 10%;">{{data_get($detail, 'project.p_project_code')}}</td>
<td style="width: 15;">{{data_get($detail, 'project.p_project_description')}}</td>
......
......@@ -18,12 +18,8 @@
<div class="field">
<label>Department</label>
<select onchange="selectDepartment(value);" name="department" id="department" class="ui fluid dropdown">
<option value="{{data_get($team,'staffdetail.deptname.id')}}">{{data_get($team,'staffdetail.deptname.description')}}</option>
@foreach($departments as $key => $department)
<option value="{{data_get($department,'id')}}">{{data_get($department,'code')}} | {{data_get($department,'description')}} </option>
@endforeach
</select>
<input type="hidden" name="department" id="department" value="{{data_get($team,'staffdetail.deptname.id')}}" readonly="readonly">
<input type="text" value="{{data_get($team,'staffdetail.deptname.description')}}">
</div>
<div class="field">
......@@ -37,19 +33,16 @@
<div class="item" data-value="{{data_get($staff,'id')}}" data-text="{{data_get($staff,'fullname')}}">
{{data_get($staff,'fullname')}}
</div>
@endforeach
<!-- <div class="item" data-value="{{data_get($team,'staffdetail.id')}}" data-text="{{data_get($team,'staffdetail.fullname')}}">
{{data_get($team,'staffdetail.fullname')}}
</div> -->
@endforeach
</div>
</div>
</div>
<div class="field">
<label>Role</label>
<input type="hidden" name="role" value="{{data_get($team,'role_id')}}">
<select name="role" class="ui fluid dropdown">
<option value="">{{data_get($teamRole,'role')}}</option>
<!-- <option value="{{data_get($team,'role_id')}}">{{data_get($teamRole,'role')}}</option> -->
@foreach($role as $key => $value)
<option value="{{data_get($value,'id')}} ">{{data_get($value,'role')}}</option>
@endforeach
......@@ -69,35 +62,4 @@
</form>
</div>
@endsection
@push('script')
<script>
function selectDepartment(i) {
// alert(i);
$.ajax({
url: "{{ URL::to('ajax/stafflist')}}"+"/"+i,
type: "get",
beforeSend: function ()
{
// $("#exampleModalCenter").modal('show');
block('loading-screen');
},
success: function(html)
{
// document.getElementById('nhtml2').style.display = 'none';
// $("#exampleModalCenter").modal('hide');
$('#divstaff').html(html);
// window.location.replace("{{ URL::to('ad/index')}}");
unblock('loading-screen');
}
});
}
</script>
@endpush
\ No newline at end of file
@endsection
\ No newline at end of file
......@@ -118,8 +118,8 @@ class DashboardController extends Controller
$profile = VwChargeableVerification::select('tmid', 'staff_id', 'year', 'month', 'phase', 'status', 'submission', 'fullname', 'roleid', 'pmstaffid')
->where('pmstaffid', $verifier->u_staffID)
->where('status', 2)
->groupby('staff_id')
// ->distinct('staff_id')
// ->groupby('staff_id')
->distinct('staff_id')
->orderby('roleid')
->with('countchargeable')
->get();
......
......@@ -413,19 +413,23 @@ class MaintenanceController extends Controller
->with('staffdetail')
->first();
// dd($team->staffdetail);
$departments = Department::all()
->except([8]);
$departments = Department::where('id', data_get($team,'staffdetail.fk_lkp_department'))->first();
// dd($departments);
foreach ($departments as $key => $value)
{
$staffs = Staff_info::where('fk_lkp_department', $value->id)
->get();
}
$staffs = Staff_info::where('fk_lkp_department', $departments->id)
->where('status',1)
->get();
// foreach ($departments as $key => $value)
// {
// $staffs = Staff_info::where('fk_lkp_department', $value->id)
// ->get();
// }
$teamRole = Role::where('id', $team->role_id)
->first();
$role = Role::all();
$role = Role::all()->except([7]);
$pid = $team->fk_project_id;
......
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