I have Employee Form Edit. My problem is, my function for edit is working fine but I can't get the value of my employee type.
I have 4 employee type: 1. Staff 2. Supervisor 3. Manager 4. Super User
Every time I go to edit form, the employee type on drop down is always on staff (I want to display, if the employee is "Manager" then the drop box show Manager).
This is the code for blade.php and the controller
<div class="form-group">
<label for="editCustomerType">Customer Type</label><br/>
<select name="editCustomerType">
<option value="Staff">Staff</option>
<option value="Supervisor">Supervisor</option>
<option value="Manager">Manager</option>
<option value="Super User">Super User</option>
</select>
</div>
public function editroledetails(Request $request)
{
$user = \Auth::user();
$userphone = 0;
$reportTo = DB::select(DB::raw("select username from customer_type where customer_type = 'Supervisor' or customer_type ='Manager' "));
$select = DB::select(DB::raw("select customer_type from customer_type "));
$data = [
'editUsername' => $request->editUsername,
'editNik' => $request->editNik,
'editEmail' => $request->editEmail,
'editRegIdentities' => $request->editRegIdentities,
'editReportTo' => $request->editReportTo,
'editID' => $request->editID
];
//return $user->username;
return view('editroledetails', compact('user', 'userphone', 'data', 'reportTo', 'select'));
}
from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2IV1zvs
via IFTTT
Aucun commentaire:
Enregistrer un commentaire