您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

reschedule_work_order.blade.php 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. @extends('contractor.layout.master')
  2. @section('ptitle','Contractor')
  3. @section('page_title', 'Dashboard')
  4. @section('subpage', 'Graph & Summary Report')
  5. @section('img_profile', asset($user->StaffDetail->user_pic))
  6. @section('login_name', $user->StaffDetail->name )
  7. @section('last_login', $user->last_login_at )
  8. @section('content')
  9. <style>
  10. .ui-tabs .ui-tabs-nav li.ui-tabs-active a { color: #EA5730 !important; }
  11. .ui-widget-content .bRed { color: #fff !important; }
  12. .ui-tabs .ui-tabs-nav li a { color: #636363 !important; }
  13. .ui-tabs .ui-tabs-nav li a:hover { color: #212121 !important; }
  14. .ui-tabs .ui-tabs-nav li.ui-tabs-active a { color: #2E6B9B !important; }
  15. .ui-widget-content a { color: #fff; }
  16. .dt-buttons { background: -webkit-linear-gradient(top, #F8F8F8 0%, #EFEFEF 100%); }
  17. .icos-download { padding-top: 0px; }
  18. .buttons-excel {
  19. padding: 7px 12px;
  20. display: block;
  21. color: #808080;
  22. font-size: 11px;
  23. }
  24. </style>
  25. <!-- Table work order -->
  26. <!-- 6 + 6 -->
  27. <div class="fluid">
  28. <form action="" class="main cussPayment">
  29. <fieldset>
  30. <div class="widget grid2 widgetH"></div>
  31. <div class="widget grid8">
  32. <div class="whead"><h6>Installer's Name </h6></div>
  33. <div class="formRow">
  34. <div class="grid3"><label><b>Select installer to assign work order : </b></label></div>
  35. <div class="grid9">
  36. <select class="styled" id="scid" name="scid" required>
  37. <option value=''>Please Choose Installer</option>
  38. @foreach ($installer as $c){
  39. <option value='{{$c->_id}}'>{{ $c->name }}</option>
  40. @endforeach
  41. </select>
  42. <b> * Any changes will automatically update, whether you drag or select</b>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="widget grid2 widgetH"></div>
  47. </fieldset>
  48. </form>
  49. <form action="" class="main cussPayment">
  50. <fieldset>
  51. <div class="widget grid2 widgetH"></div>
  52. <div class="widget grid8">
  53. <div class="whead"><h6>Type Work</h6></div>
  54. <div class="formRow">
  55. <div class="grid3"><label><b>Select type of work : </b></label></div>
  56. <div class="grid9">
  57. <select class="styled" id="type_work" name="type_work" required>
  58. <option value=''>Please Choose Type of Work</option>
  59. <option value='Pending Prelaid'>Prelaid</option>
  60. <option value='Pending Installer'>Activation</option>
  61. </select>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="widget grid2 widgetH"></div>
  66. </fieldset>
  67. </form>
  68. </div>
  69. <div class="fluid">
  70. <!-- Calendar -->
  71. <div class="widget grid2 widgetH"></div>
  72. <div class="widget grid8 widgetBg">
  73. <div class="whead"><h6 id="title">Calendar for {{ $wo }}</h6></div>
  74. <div id="reschedule_calendar"></div>
  75. <div class="formRow calenderW">
  76. <div class="grid6"><button id="cancel" href="#" class="buttonM bCalender">Cancel Reschedule</button></div>
  77. <div class="grid6"><button id="confirm" href="#" class="buttonM bCalender">Confirm Reschedule</button></div>
  78. </div>
  79. </div>
  80. <div class="widget grid2 widgetH"></div>
  81. </div>
  82. @endsection
  83. @section('external_js')
  84. <script>
  85. $(document).ready(function(){
  86. var origin = window.location.origin;
  87. //===== Dynamic table toolbars =====//
  88. $('#dyn1 .tOptions').click(function () {
  89. $('#dyn .tablePars').slideToggle(200);
  90. });
  91. $('.tOptions').click(function () {
  92. $(this).toggleClass("act");
  93. });
  94. var today = "{{ $today }}";
  95. var company_selection = ''; var type_work = '';
  96. var wo = '{{ $wo }}';
  97. var subscriber_id = '';
  98. console.log(wo);
  99. /* View all schedule */
  100. $('#reschedule_calendar').fullCalendar({
  101. header: {
  102. left: 'prev,next,today',
  103. center: 'title',
  104. right: 'month,agendaWeek,agendaDay'
  105. },
  106. defaultView: 'agendaWeek',
  107. defaultDate: today,
  108. navLinks: true, // can click day/week names to navigate views
  109. firstDay: 1,
  110. eventLimit: true, // allow "more" link when too many events
  111. events: {
  112. url: "{{ url('/contractor/get-all-calendar') }}",
  113. type: 'POST',
  114. data: function () { // a function that returns an object
  115. return {
  116. "installer": $('#scid').val(),
  117. "status": '',
  118. "wk":wo,
  119. "_token": "{{ csrf_token() }}"
  120. };
  121. },
  122. error: function() {
  123. alert('there was an error while fetching events!');
  124. },
  125. },
  126. selectable:true,
  127. eventDurationEditable:false,
  128. editable:false,
  129. select: function(start, end, allDay) {
  130. var start = $.fullCalendar.formatDate(start, "Y-MM-DD HH:mm:ss");
  131. var end = $.fullCalendar.formatDate(end, "Y-MM-DD HH:mm:ss");
  132. if(company_selection != '' && type_work != '') {
  133. $.ajax({
  134. type: "POST",
  135. url: "{{ url('/contractor/work-order/reschedule') }}",
  136. data: { "installer": company_selection, "start": start, "end": end, "wo": wo , "type_work": type_work ,"_token": "{{ csrf_token() }}"},
  137. success:function(data){
  138. $('#reschedule_calendar').fullCalendar('refetchEvents');
  139. }
  140. });
  141. }else {
  142. alert("ERROR!! Please choose installer and type work!");
  143. window.location.reload();
  144. }
  145. },
  146. });
  147. /* View schedule based on company */
  148. $('#scid').on('change',function(){
  149. company_selection = $('#scid').val();
  150. });
  151. /* View schedule based on company */
  152. $('#type_work').on('change',function(){
  153. type_work = $('#type_work').val();
  154. });
  155. /* Cancel add new schedule */
  156. $('#cancel').on('click',function(){
  157. window.location = "{{ url ('/customer-service/work-order/list')}}";
  158. });
  159. /* Confirm new schedule */
  160. $('#confirm').on('click',function(){
  161. if(company_selection != '' && type_work != ''){
  162. $.ajax({
  163. type:"POST",
  164. url: "{{ url('/contractor/work-order/update/reschedule') }}",
  165. data:{"wo": wo,"installer": company_selection, "type_work": type_work, "_token": "{{ csrf_token() }}"},
  166. success:function(response){
  167. if(response[0].result == "yes"){
  168. window.location = "{{ url ('/contractor/work-order/list')}}";
  169. }else if(response[0].result == "no"){
  170. alert("ERROR!! Please choose datetime for current work order !");
  171. }
  172. }
  173. });
  174. }else {
  175. alert("ERROR!! Please choose installer and type work!");
  176. }
  177. });
  178. });
  179. </script>
  180. @endsection