Commit 94693b77 by hannan

changes update project

parent eccaa4c6
@extends('ui::layouts.app') @extends('ui::layouts.app')
@section('content') @section('content')
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
<br><br> <br><br>
<form class="ui form" action="{{ route('timesheet::maintenance.editproject') }}" method="POST"> <form class="ui form" action="{{ route('timesheet::maintenance.editproject') }}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="staffid" value="staffid"> <input type="hidden" name="staffid" value="{{$staffid}}">
<input type="hidden" name="pid" value="{{$pid}}">
<div class="field"> <div class="field">
<label>Project Code</label> <label>Project Code</label>
<input type="text" name="projectcode" value="{{data_get($project,'p_project_code')}}" disabled="disabled"> <input type="text" name="projectcode" value="{{data_get($project,'p_project_code')}}" disabled="disabled">
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<thead> <thead>
<tr> <tr>
<th style="width: 35%">staff</th> <th style="width: 35%">staff</th>
<th style="width: 5%"></th> <th style="width: 5%">project type</th>
<th style="width: 15%" class="center aligned">project code / task</th> <th style="width: 15%" class="center aligned">project code / task</th>
<th style="width: 25%" class="center aligned">description</th> <th style="width: 25%" class="center aligned">description</th>
<th style="width: 10%" class="center aligned">total hours</th> <th style="width: 10%" class="center aligned">total hours</th>
......
...@@ -146,13 +146,35 @@ class MaintenanceController extends Controller ...@@ -146,13 +146,35 @@ class MaintenanceController extends Controller
->where('status', 1) ->where('status', 1)
->get(); ->get();
$pid = $request->id;
// dd($project); // dd($project);
return view('timesheet::maintenance.updateProject',compact('pm', 'project', 'staffid')); return view('timesheet::maintenance.updateProject',compact('pm', 'project', 'staffid', 'pid'));
} }
public function editproject(Request $request){ public function editproject(Request $request){
dd($request); // dd($request);
$project = Project::where('id', $request->pid)->first();
$project->id = $request->pid;
$project->p_project_task_team = $request->projectmanager;
$project->p_project_sts = $request->status;
$project->save();
$sname = Staff_info::select('fullname')
->where('staff_id', $request->projectmanager)
->first();
// dd($sname);
$pteam = Pteam::where('fk_project_id', $request->pid)
->where('role_id', 1)
->first();
$pteam->pt_staff_id = $request->projectmanager;
$pteam->pt_team = $sname->fullname;
$pteam->save();
return redirect()->route('timesheet::maintenance.senaraiProject')->withSuccess('Project updated!'); return redirect()->route('timesheet::maintenance.senaraiProject')->withSuccess('Project updated!');
} }
......
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