projects.blade.php 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. @extends('layouts.master')
  2. @section('style')
  3. <link href="{{URL::asset('assets/dropzone/dropzone.css')}}" rel="stylesheet" type="text/css"/>
  4. <style type="text/css">
  5. .cls-show-time{
  6. color: #000;
  7. font-style: italic;
  8. font-size: 12px;
  9. }
  10. </style>
  11. @endsection
  12. @section('content')
  13. <!-- Main content -->
  14. <section class="content">
  15. <!-- Main row -->
  16. <div class="row">
  17. <div class="col-md-7">
  18. <section class="panel tasks-widget">
  19. <header class="panel-heading">
  20. WORK PROGRESS
  21. </header>
  22. <div class="table-responsive project-list">
  23. <table class="table table-striped">
  24. <thead>
  25. <tr>
  26. <th colspan="2">
  27. Project Name
  28. </th>
  29. <th>
  30. Client
  31. </th>
  32. <th>
  33. Description
  34. </th>
  35. <th>
  36. Action
  37. </th>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. @if (session('data'))
  42. <div class="alert alert-success">
  43. {{ session('data') }}
  44. </div>
  45. @endif
  46. @foreach($projj as $proj)
  47. <tr>
  48. <td>
  49. <div class="task-checkbox">
  50. <input class="flat-grey" type="checkbox"/>
  51. </div>
  52. </td>
  53. <td>
  54. <a href="{{url("admin/project_details/$proj->id")}}">{{$proj->name}}</a>
  55. <span class="cls-show-time">
  56. @if(count($proj->tasks) > 0)
  57. <?php
  58. $pend = 0;
  59. $donee = 0;
  60. $not_assign = 0;
  61. ?>
  62. @foreach($proj->tasks as $pt)
  63. @if($pt->user_id == 0)
  64. <?php $not_assign++; ?>
  65. @elseif($pt->status < 6 && $pt->user_id > 0)
  66. <?php $pend++; ?>
  67. @elseif($pt->status == 6)
  68. <?php $donee++; ?>
  69. @endif
  70. @endforeach
  71. <br>
  72. Not Assigned: {{$not_assign}},
  73. Pending: {{$pend}},
  74. Done: {{$donee++}}
  75. @else
  76. {{"No tasks added"}}
  77. @endif
  78. </span>
  79. <br>
  80. <small>
  81. <i class="fa fa-clock-o">
  82. </i>
  83. Created {{$proj->created_time}}
  84. </small>
  85. </br>
  86. </td>
  87. <td>
  88. {{$proj->client->name or 'No client selected'}}
  89. </td>
  90. <td>
  91. {{str_limit($proj->description, $limit = 30, $end = '...')}}
  92. </td>
  93. <td>
  94. <a href="" style="color: #7dcc93;">
  95. <i class="fa fa-pencil-square-o" aria-hidden="true"></i>
  96. </a>
  97. &nbsp; &nbsp;
  98. <a onclick="return confirm ('want to delete?')" href="{{url("admin/remove_proj/$proj->id")}}" style="color:#FD4B39;">
  99. <i class="fa fa-times" aria-hidden="true"></i>
  100. </a>
  101. <input type="hidden" id="proj_id" value="{{$proj->id}}">
  102. &nbsp; &nbsp;
  103. <i class="fa fa-paperclip upload-cls" aria-hidden="true" data-toggle="modal" data-target="#att_modal"></i>
  104. </td>
  105. </tr>
  106. @endforeach
  107. </tbody>
  108. </table>
  109. <hr>
  110. </hr>
  111. </div>
  112. <div class="panel-body">
  113. <div class=" add-task-row">
  114. </div>
  115. <div class="table-foot">
  116. </div>
  117. </div>
  118. </section>
  119. </div>
  120. <div class="col-md-5">
  121. <div class="panel">
  122. <header class="panel-heading">
  123. Add Project
  124. </header>
  125. <div class="ibox-content">
  126. @include('layouts.message')
  127. <form role="form" action="{{url('admin/add_proj')}}" method="POST">
  128. {!! csrf_field() !!}
  129. <div class="form-group">
  130. <label for="Add new Project">
  131. New Project
  132. </label>
  133. <input name="proj_name" class="form-control" id="new-project" placeholder="Add new project" required="" type="new-project">
  134. </input>
  135. </div>
  136. <div class="form-group">
  137. <label for="Add new Project">
  138. Client
  139. </label>
  140. <select name="client_id" id="" class="form-control">
  141. <option>Select client</option>
  142. @foreach($client_list as $client)
  143. <option value="{{ $client->id }}">{{ $client->name }}</option>
  144. @endforeach
  145. </select>
  146. </div>
  147. <div class="form-group">
  148. <label for="Add new Project">
  149. Description
  150. </label>
  151. <textarea name="description" rows="5" class="form-control" id="new-project" placeholder="Add new project" ></textarea>
  152. </div>
  153. <div class="form-group">
  154. <button class="btn btn-info" type="submit">
  155. Submit
  156. </button>
  157. </div>
  158. </form>
  159. <p>
  160. </p>
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. </section>
  166. <!-- row end -->
  167. <!-- /.content -->
  168. <!-- MODAL ATTATCHMENTSSS -->
  169. <div class="modal fade" tabindex="-1" id="att_modal" role="dialog">
  170. <div class="modal-dialog" role="document">
  171. <div class="modal-content">
  172. <div class="modal-header">
  173. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  174. <h4 class="modal-title">Attachment</h4>
  175. </div>
  176. <div class="modal-body">
  177. <form action="{{url('admin/add_file')}}" class="dropzone" id="my-awesome-dropzone">
  178. {!! csrf_field() !!}
  179. <input type="hidden" name="proj_id" class="cls-proj-id" value="">
  180. </form>
  181. </div>
  182. <div class="modal-footer">
  183. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  184. </div>
  185. </div><!-- /.modal-content -->
  186. </div><!-- /.modal-dialog -->
  187. </div><!-- /.modal -->
  188. @endsection
  189. @section('script')
  190. <script src="{{URL::asset('assets/dropzone.js')}}" type="text/javascript"></script>
  191. <script type="text/javascript">
  192. $('.upload-cls').click(function(event) {
  193. var id = $(this).prev('input').val();
  194. $('.cls-proj-id').val(id);
  195. });
  196. </script>
  197. @endsection