ReportTaskController.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace App\Http\Controllers\Admin;
  3. use Illuminate\Http\Request;
  4. use App\Http\Requests;
  5. use App\Http\Controllers\Controller;
  6. use App\User;
  7. use App\Models\Task;
  8. class ReportTaskController extends Controller
  9. {
  10. public function completed_task_by_user(){
  11. $data['title'] = "Report - Completed Tasks";
  12. $data['all'] = "";
  13. $data['user_name'] = "";
  14. $data['tdate'] = "";
  15. $data['fdate'] = "";
  16. $data['users'] = User::where('utype',2)->where('active',1)->get();
  17. return view('admin.report.completed_task_by_user',$data);
  18. }
  19. public function search_completed_task_by_user(Request $req){
  20. $fromdate = $req->fromdate;
  21. $todate = $req->todate;
  22. $user_id = $req->user_id;
  23. $user_name = User::find($user_id)->name;
  24. $data['title'] = "Report - Completed Tasks";
  25. $data['user_name'] = $user_name;
  26. $data['tdate'] = $todate;
  27. $data['fdate'] = $fromdate;
  28. $data['all'] = Task::where('start_time','>=',$fromdate)->with('proj_name')
  29. ->where('closing_time','<=',$todate)
  30. ->where('user_id',$user_id)
  31. ->where('status',6)->orderBy('proj_id')->get();
  32. $data['users'] = User::where('utype',2)->where('active',1)->get();
  33. return view('admin.report.completed_task_by_user',$data);
  34. }
  35. public function work_flow()
  36. {
  37. $data['title'] = "Work flow";
  38. $data['all'] = User::where('utype',2)->get();
  39. return view('admin.report.work_flow',$data);
  40. }
  41. }