Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

view_add_new_schedule.blade.php 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. @extends('customer-service.layout.master')
  2. @section('ptitle','Customer Service')
  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>Company's Name </h6></div>
  33. <div class="formRow">
  34. <div class="grid3"><label><b>Select company 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 Company</option>
  38. @foreach ($company as $c){
  39. <option value='{{$c->_id}}'>{{ $c->name }}</option>
  40. @endforeach
  41. </select>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="widget grid2 widgetH"></div>
  46. </fieldset>
  47. </form>
  48. </div>
  49. <div class="fluid">
  50. <!-- Calendar -->
  51. <div class="widget grid2 widgetH"></div>
  52. <div class="widget grid8 widgetBg">
  53. @if($status == 'non-prelaid')
  54. @else
  55. <div class="whead"><h6 id="title">Calendar for {{ $wo }}</h6></div>
  56. <div id="new_calendar"></div>
  57. @endif
  58. <div class="formRow calenderW">
  59. <div class="grid6"><button id="cancel" href="#" class="buttonM bCalender">Cancel Schedule</button></div>
  60. <div class="grid6"><button id="confirm" href="#" class="buttonM bCalender">Confirm Schedule</button></div>
  61. </div>
  62. </div>
  63. <div class="widget grid2 widgetH"></div>
  64. </div>
  65. @endsection
  66. @section('external_js')
  67. <script>
  68. $(document).ready(function(){
  69. var origin = window.location.origin;
  70. //===== Dynamic table toolbars =====//
  71. $('#dyn1 .tOptions').click(function () {
  72. $('#dyn .tablePars').slideToggle(200);
  73. });
  74. $('.tOptions').click(function () {
  75. $(this).toggleClass("act");
  76. });
  77. var today = "{{ $today }}";
  78. var company_selection = '';
  79. var wo = '{{ $wo }}';
  80. var subscriber_id = '{{ $subscriber_id }}';
  81. var status = '{{ $status }}';
  82. var created_by = '{{ $user->_id }}';
  83. console.log(status);
  84. /* View all schedule */
  85. $('#new_calendar').fullCalendar({
  86. header: {
  87. left: 'prev,next,today',
  88. center: 'title',
  89. right: 'month,agendaWeek,agendaDay'
  90. },
  91. defaultView: 'agendaWeek',
  92. defaultDate: today,
  93. navLinks: true, // can click day/week names to navigate views
  94. firstDay: 1,
  95. eventLimit: true, // allow "more" link when too many events
  96. events: {
  97. url: "{{ url('/customer-service/get-all-calendar') }}",
  98. type: 'POST',
  99. data: function () { // a function that returns an object
  100. return {
  101. "company": $('#scid').val(),
  102. "status": '',
  103. "customer": '',
  104. "wk":"wo",
  105. "_token": "{{ csrf_token() }}"
  106. };
  107. },
  108. error: function() {
  109. alert('there was an error while fetching events!');
  110. },
  111. },
  112. selectable:true,
  113. eventDurationEditable:false,
  114. select: function(start, end, allDay) {
  115. var start = $.fullCalendar.formatDate(start, "Y-MM-DD HH:mm:ss");
  116. var end = $.fullCalendar.formatDate(end, "Y-MM-DD HH:mm:ss");
  117. if(company_selection != '' && status != 'non-prelaid') {
  118. $.ajax({
  119. type: "POST",
  120. url: "{{ url('/customer-service/work-order/add-schedule') }}",
  121. data: { "subscriber_id": subscriber_id, "vendor": company_selection, "start": start, "end": end, "wo": wo , "status": status, "created_by": created_by,"_token": "{{ csrf_token() }}"},
  122. success:function(data){
  123. $('#new_calendar').fullCalendar('refetchEvents');
  124. }
  125. });
  126. }else {
  127. alert("ERROR!! Please choose company !");
  128. window.location.reload();
  129. }
  130. },
  131. editable:true,
  132. });
  133. $('#scid').on('change',function(){
  134. company_selection = $('#scid').val();
  135. $('#new_calendar').fullCalendar('refetchEvents');
  136. $.ajax({
  137. url: "{{ url('/customer-service/get-company-color') }}",
  138. type: 'POST',
  139. data: { "company": $('#scid').val(), "_token": "{{ csrf_token() }}" },
  140. }).done(function(company_label) {
  141. $('.fc-widget-header').css({"background":company_label[0].bg,"color":company_label[0].text});
  142. $('.fc-widget-header a[data-goto]').css({"background": company_label[0].bg,"color":company_label[0].text});
  143. document.getElementById("title").innerHTML = 'Calendar '+ company_label[0].name;
  144. });
  145. });
  146. /* Cancel add new schedule */
  147. $('#cancel').on('click',function(){
  148. $.ajax({
  149. type:"POST",
  150. url: "{{ url('/customer-service/work-order/remove-schedule') }}",
  151. data:{"wo": wo, "_token": "{{ csrf_token() }}"},
  152. success:function(){
  153. //$('#calendar').fullCalendar('refetchEvents');
  154. window.location = "{{ url ('/customer-service/work-order/list')}}";
  155. }
  156. });
  157. });
  158. /* Confirm new schedule */
  159. $('#confirm').on('click',function(){
  160. if(company_selection != '') {
  161. $.ajax({
  162. type:"POST",
  163. url: "{{ url('/customer-service/work-order/confirm/schedule') }}",
  164. data:{"subscriber_id": subscriber_id, "vendor": company_selection, "status": status,"wo": wo,"_token": "{{ csrf_token() }}"},
  165. success:function(response){
  166. if(response[0].result == "yes"){
  167. window.location = "{{ url('/customer-service/work-order/confirm') }}"+"/"+wo;
  168. }else if(response[0].result == "no"){
  169. alert("ERROR!! Please choose datetime for current work order !");
  170. }
  171. }
  172. });
  173. }else {
  174. alert("ERROR!! Please choose company !");
  175. }
  176. });
  177. });
  178. </script>
  179. @endsection