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 @@ ...@@ -12,6 +12,7 @@
<div class="ui styled fluid accordion"> <div class="ui styled fluid accordion">
@foreach($profile as $key => $staff) @foreach($profile as $key => $staff)
<?php <?php
// dd($staff);
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID)); $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)); $checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID)->where('tp_timesheet_sts', 3));
?> ?>
...@@ -22,7 +23,8 @@ ...@@ -22,7 +23,8 @@
<table class="ui unstackable celled table"> <table class="ui unstackable celled table">
<thead> <thead>
<tr> <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"> <th style="width: 15%;" class="center aligned">
<?php <?php
// dd($profile); // dd($profile);
...@@ -61,7 +63,7 @@ ...@@ -61,7 +63,7 @@
</tr> </tr>
</thead> </thead>
@foreach($details as $key => $detail) @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> <tr>
<td style="width: 10%;">{{data_get($detail, 'project.p_project_code')}}</td> <td style="width: 10%;">{{data_get($detail, 'project.p_project_code')}}</td>
<td style="width: 15;">{{data_get($detail, 'project.p_project_description')}}</td> <td style="width: 15;">{{data_get($detail, 'project.p_project_description')}}</td>
......
...@@ -18,12 +18,8 @@ ...@@ -18,12 +18,8 @@
<div class="field"> <div class="field">
<label>Department</label> <label>Department</label>
<select onchange="selectDepartment(value);" name="department" id="department" class="ui fluid dropdown"> <input type="hidden" name="department" id="department" value="{{data_get($team,'staffdetail.deptname.id')}}" readonly="readonly">
<option value="{{data_get($team,'staffdetail.deptname.id')}}">{{data_get($team,'staffdetail.deptname.description')}}</option> <input type="text" value="{{data_get($team,'staffdetail.deptname.description')}}">
@foreach($departments as $key => $department)
<option value="{{data_get($department,'id')}}">{{data_get($department,'code')}} | {{data_get($department,'description')}} </option>
@endforeach
</select>
</div> </div>
<div class="field"> <div class="field">
...@@ -38,18 +34,15 @@ ...@@ -38,18 +34,15 @@
{{data_get($staff,'fullname')}} {{data_get($staff,'fullname')}}
</div> </div>
@endforeach @endforeach
<!-- <div class="item" data-value="{{data_get($team,'staffdetail.id')}}" data-text="{{data_get($team,'staffdetail.fullname')}}">
{{data_get($team,'staffdetail.fullname')}}
</div> -->
</div> </div>
</div> </div>
</div> </div>
<div class="field"> <div class="field">
<label>Role</label> <label>Role</label>
<input type="hidden" name="role" value="{{data_get($team,'role_id')}}">
<select name="role" class="ui fluid dropdown"> <select name="role" class="ui fluid dropdown">
<option value="">{{data_get($teamRole,'role')}}</option> <option value="">{{data_get($teamRole,'role')}}</option>
<!-- <option value="{{data_get($team,'role_id')}}">{{data_get($teamRole,'role')}}</option> -->
@foreach($role as $key => $value) @foreach($role as $key => $value)
<option value="{{data_get($value,'id')}} ">{{data_get($value,'role')}}</option> <option value="{{data_get($value,'id')}} ">{{data_get($value,'role')}}</option>
@endforeach @endforeach
...@@ -70,34 +63,3 @@ ...@@ -70,34 +63,3 @@
</div> </div>
@endsection @endsection
\ No newline at end of file
@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
...@@ -118,8 +118,8 @@ class DashboardController extends Controller ...@@ -118,8 +118,8 @@ class DashboardController extends Controller
$profile = VwChargeableVerification::select('tmid', 'staff_id', 'year', 'month', 'phase', 'status', 'submission', 'fullname', 'roleid', 'pmstaffid') $profile = VwChargeableVerification::select('tmid', 'staff_id', 'year', 'month', 'phase', 'status', 'submission', 'fullname', 'roleid', 'pmstaffid')
->where('pmstaffid', $verifier->u_staffID) ->where('pmstaffid', $verifier->u_staffID)
->where('status', 2) ->where('status', 2)
->groupby('staff_id') // ->groupby('staff_id')
// ->distinct('staff_id') ->distinct('staff_id')
->orderby('roleid') ->orderby('roleid')
->with('countchargeable') ->with('countchargeable')
->get(); ->get();
......
...@@ -413,19 +413,23 @@ class MaintenanceController extends Controller ...@@ -413,19 +413,23 @@ class MaintenanceController extends Controller
->with('staffdetail') ->with('staffdetail')
->first(); ->first();
// dd($team->staffdetail); // dd($team->staffdetail);
$departments = Department::all()
->except([8]); $departments = Department::where('id', data_get($team,'staffdetail.fk_lkp_department'))->first();
// dd($departments); // dd($departments);
foreach ($departments as $key => $value)
{ $staffs = Staff_info::where('fk_lkp_department', $departments->id)
$staffs = Staff_info::where('fk_lkp_department', $value->id) ->where('status',1)
->get(); ->get();
} // foreach ($departments as $key => $value)
// {
// $staffs = Staff_info::where('fk_lkp_department', $value->id)
// ->get();
// }
$teamRole = Role::where('id', $team->role_id) $teamRole = Role::where('id', $team->role_id)
->first(); ->first();
$role = Role::all(); $role = Role::all()->except([7]);
$pid = $team->fk_project_id; $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