Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. <tbody>
  2. @foreach ($pendingDocumentLists as $list)
  3. <tr class = "info">
  4.  
  5. <td>{{ $list->title }}</td>
  6.  
  7. <td>
  8.  
  9. @if (Auth::id() == $list->approver_id)
  10.  
  11. <form class = "form-inline" method = "post" action = "{{ route ('document.pending', $list->id) }}">
  12.  
  13.  
  14. <div class = "form-group">
  15. <a href = "{{ route ('document.pending', $list->id) }}">
  16. <input type = "checkbox" name = "approve" value = "yes">
  17. <strong>Approve</strong>
  18. </input>
  19. </a>
  20. </div>
  21.  
  22. <div class = "form-group">
  23.  
  24. <a href = "{{ route ('document.pending', $list->id) }}">
  25. <input type = "checkbox" name = "reject">
  26. <strong>Reject</strong>
  27. </input>
  28. </a>
  29. </div>
  30.  
  31. </form>
  32. @endif
  33. </td>
  34. </tr>
  35. @endforeach
  36. </tbody>
  37.  
  38. public function updateIsApprove($id)
  39. {
  40. $document = Document::find($id);
  41.  
  42. if($approve == "yes")
  43. {
  44. $document->isApprove = 1;
  45. $document->save();
  46. }
  47. }
  48.  
  49. Route::get('/documents/pending',
  50. [
  51. 'uses' => 'AppHttpControllersDocumentController@documentsSentForApproval',
  52. 'as' => 'document.pending',
  53. ]);
  54.  
  55. Route::post('/documents/pending/approve/{id}',
  56. [
  57. 'uses' => 'AppHttpControllersDocumentController@updateIsApprove',
  58. 'as' => 'document.pending',
  59. ]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement