service_details.blade.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. @extends('layouts.master')
  2. @section('style')
  3. <style>
  4. .activity-btn:hover{
  5. color: #48C2A9;
  6. border-color: #48C2A9;
  7. }
  8. .remarks-div {
  9. height: 250px;
  10. /*background-color: #eee;*/
  11. overflow-y: auto;
  12. }
  13. .activity-div {
  14. height: 250px;
  15. overflow-y: auto;
  16. }
  17. .panel-service .panel-body{
  18. height:350px;
  19. overflow-y: auto;
  20. }
  21. .bg-grey{background: #ddd;}
  22. .table{font-size: 12px;}
  23. .table-company tr th,.table-company tr td{font-size: 12px;}
  24. .table-company tr th{ width: 25% !important; }
  25. .table-company tr td{ width:auto !important; }
  26. .table-service tr th,.table-service tr td{font-size: 12px;vertical-align: middle !important;}
  27. @media screen and (min-width: 768px){
  28. #modalUpload .modal-content{ top:10%;width: 30%;margin: 0 auto; }
  29. }
  30. .remarks-footer{
  31. padding-top: 8px;
  32. font-size: 11px;
  33. color: #616A75;
  34. }
  35. </style>
  36. @endsection
  37. @section('content')
  38. <!-- Main content -->
  39. <h3 class="title">{{ $title }}</h3>
  40. <section class="content">
  41. <!-- Main row -->
  42. <div class="row">
  43. <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
  44. <div class="panel panel-default">
  45. <div class="panel-heading">Company Info</div>
  46. <table class="table table-company">
  47. <tr>
  48. <th>
  49. Company Name
  50. </th>
  51. <td>
  52. {{$all->name}}
  53. <input type="hidden" value="{{$all->id}}" id="company_id">
  54. </td>
  55. </tr>
  56. <?php
  57. $ary_industry = [
  58. 1=>"Recreation",2=>"Food",3=>"Training",
  59. 4=>"Professionals",5=>"Industry",6=>"Agriculture",7=>"Germents",8=>"Health",9=>"Apperal",10=>"E-Commerce"
  60. ];
  61. ?>
  62. <tr>
  63. <th>Industry</th>
  64. <td>
  65. @foreach($ary_industry as $key=>$indus)
  66. @if($key == $all->industry)
  67. {{$indus}}
  68. @endif
  69. @endforeach
  70. </td>
  71. </tr>
  72. <tr>
  73. <th>Mobile</th>
  74. <td>{{$all->mob1}}, {{$all->mob2}}</td>
  75. </tr>
  76. <tr>
  77. <th>Email</th>
  78. <td>{{$all->email1}}, {{$all->email2}}</td>
  79. <input type="hidden" class="hdn-email1" value="{{$all->email1}}">
  80. <input type="hidden" class="hdn-email2" value="{{$all->email2}}">
  81. </tr>
  82. <tr>
  83. <th>Website</th>
  84. <td>{{$all->web}}</td>
  85. </tr>
  86. <tr>
  87. <th>Address</th>
  88. <td>{{$all->address}}</td>
  89. </tr>
  90. <tr>
  91. <th>Remarks</th>
  92. <td>{{$all->remarks}}</td>
  93. </tr>
  94. </table>
  95. </div>
  96. <div class="panel panel-default">
  97. <!-- Default panel contents -->
  98. <div class="panel-heading">Adress Book <button class="btn btn-success btn-xs pull-right" data-toggle="modal" data-target=".add-modal">Add Contract Person</button></div>
  99. <table class="table table-bordered">
  100. <tr>
  101. <th>Name</th>
  102. <th>Designation</th>
  103. <th>Mobile</th>
  104. <th>Email</th>
  105. </tr>
  106. @foreach($all->contact_persons as $cp)
  107. <tr>
  108. <td>{{$cp->name}}</td>
  109. <td>{{$cp->degisnation}}</td>
  110. <td>{{$cp->mob1}}<br>{{$cp->mob2}}</td>
  111. <td>{{$cp->email1}}<br>{{$cp->email2}}</td>
  112. </tr>
  113. @endforeach
  114. </table>
  115. </div>
  116. <div class="panel panel-default">
  117. <div class="panel-heading">Remarks</div>
  118. <div class="panel-body">
  119. <textarea class="form-control" name="" id="remarkss" placeholder="Write down remarks"></textarea>
  120. <button class="btn btn-success btn-xs remarks-btn" style="margin-top:10px;margin-bottom: 20px;"><i class="fa fa-comment-o"></i> Remark</button>
  121. <div class="remarks-div"></div>
  122. </div>
  123. </div>
  124. </div>
  125. <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
  126. <div class="panel panel-default panel-service">
  127. <!-- Default panel contents -->
  128. <div class="panel-heading">
  129. {{ $service->services?$service->services->name:'--' }}
  130. <a class="btn btn-primary btn-xs pull-right" data-toggle='modal' data-target='#modalUpload' href="{{ url('admin/company/service/upload') }}/{{ $service->id }}"><i class="fa fa-cloud-upload"></i> New Attachment</a>
  131. </div>
  132. <!-- Table -->
  133. <div class="panel-body">
  134. <table class="table table-bordered table-service">
  135. <thead>
  136. <tr>
  137. <th>Deployment Unit</th>
  138. <td>{{ $service->deployment_unit_details }}</td>
  139. </tr>
  140. <tr>
  141. <th>Start Date</th>
  142. <td>{{ date('d M, Y',strtotime($service->start_date)) }}</td>
  143. </tr>
  144. <tr>
  145. <th style=''>Contact Info</th>
  146. <td>
  147. <strong>Name : </strong> {{ $service->contact_person }} <br>
  148. <strong>Phone : </strong> {{ $service->contact_number }}
  149. </td>
  150. </tr>
  151. <tr>
  152. <th>PO Details</th>
  153. <td>
  154. {{ $service->po_details }}
  155. </td>
  156. </tr>
  157. <tr>
  158. <th>Renew Cycle</th>
  159. <td><span class="label label-info">{{ $service->renewal_cycle }} Year</span></td>
  160. </tr>
  161. <tr>
  162. <th>Renew Session</th>
  163. <td><span class="label label-info">{{ $service->free_session }} Year</span></td>
  164. </tr>
  165. <tr>
  166. <th>Attachments</th>
  167. <td>
  168. @if($service->attachments)
  169. @foreach($service->attachments as $row)
  170. <a class='btn btn-default btn-xs' target="_blank" href="{{ asset('assets/uploads/service') }}/{{ $row->file_name }}">{{ !empty($row->title)?$row->title:$row->file_name }} <i class="fa fa-cloud-download"></i></a> <br>
  171. @endforeach
  172. @endif
  173. </td>
  174. </tr>
  175. </thead>
  176. </table>
  177. </div>
  178. </div>
  179. <div class="panel panel-default">
  180. <div class="panel-heading">
  181. <h3 class="panel-title">Activity</h3>
  182. </div>
  183. <div class="panel-body">
  184. <div style="min-height: 250px;" class="activity-div"></div>
  185. </div>
  186. <div class="panel-footer">
  187. <button class="btn btn-xs activity-btn" data-fullText="Already called.">
  188. Mobile
  189. <i class="fa fa-mobile" aria-hidden="true"></i>
  190. </button>
  191. <button class="btn btn-xs activity-btn" data-toggle="modal" data-target=".modal-email" data-fullText="mail">
  192. Email
  193. <i class="fa fa-envelope-o" aria-hidden="true"></i>
  194. </button>
  195. <button class="btn btn-xs activity-btn" data-fullText="Already send a sms.">
  196. SMS
  197. <i class="fa fa-comments-o" aria-hidden="true"></i>
  198. </button>
  199. </div>
  200. </div>
  201. </div>
  202. </div>
  203. </section>
  204. <!-- Modal to add services -->
  205. @include('admin.company_info.service_modal')
  206. <!-- end modal to add services -->
  207. <!-- Modal Add Contract person -->
  208. @include('admin.company_info.add_contact_info')
  209. <!-- /.modal -->
  210. <!-- Modal Email -->
  211. @include('admin.company_info.modal_email')
  212. <!-- /.modal -->
  213. <!-- Modal File Upload -->
  214. <div class="modal fade" id="modalUpload">
  215. <div class="modal-dialog modal-md">
  216. </div>
  217. </div>
  218. <!-- /.modal -->
  219. @endsection
  220. @section('script')
  221. <script src="{{URL::asset('assets/ckeditor/ckeditor.js')}}"></script>
  222. <script type="text/javascript">
  223. $(document).ready(function(){
  224. $( ".date" ).datepicker({
  225. changeMonth: true,
  226. changeYear: true,
  227. dateFormat:"yy-mm-dd"
  228. });
  229. $('body').on('hidden.bs.modal', '.modal', function () {
  230. $(this).removeData('bs.modal');
  231. });
  232. $('#lnkAssignService').click(function(e){
  233. e.preventDefault();
  234. var com_id=$(this).data('company_id');
  235. var com_name=$(this).data('company_name');
  236. $('span#company_name').text(com_name);
  237. $('input[name="hdn_com_id"]').val(com_id);
  238. $('#modalService').modal('show');
  239. });
  240. $('#btn_assign_service').click(function(){
  241. var com_id=$('input[name="hdn_com_id"]').val();
  242. var service=$('#ddlService').val();
  243. var contact_person=$('#contact_person').val();
  244. var contact_number=$('#contact_number').val();
  245. var deployement_unit=$('#deployement_unit').val();
  246. var po_details=$('#po_details').val();
  247. var renewal_cycle=$('#renewal_cycle').val();
  248. var free_session=$('#free_session').val();
  249. var start_date=$('#start_date').val();
  250. var token='{{ csrf_token() }}';
  251. if(com_id.length==0 || service.length==0){
  252. $('#spn_msg').text('Service name must be selected !');
  253. return false;
  254. }
  255. $.ajax({
  256. url: '{{ url('admin/company/service/assign') }}',
  257. type: 'POST',
  258. dataType: 'json',
  259. data: {com_id:com_id,service:service,contact_person:contact_person,contact_number:contact_number,deployement_unit:deployement_unit,po_details:po_details,renewal_cycle:renewal_cycle,free_session:free_session,start_date:start_date,_token:token}
  260. })
  261. .done(function(res) {
  262. if(res.ok)
  263. {
  264. alert(res.msg);
  265. $('#modalService').modal('hide');
  266. }
  267. });
  268. });
  269. var company_id = $('#company_id').val();
  270. var com_service_id='{{ $service->id }}';
  271. //fetch remarks
  272. $.ajax({
  273. url: "{{url('admin/save_remarks')}}",
  274. type: 'POST',
  275. data: {remarks: '0', company_id: company_id,company_service_id:com_service_id},
  276. })
  277. .done(function(data) {
  278. $('.remarks-div').html(data);
  279. });
  280. //fetch activity
  281. $.ajax({
  282. url: "{{url('admin/save_activity')}}",
  283. type: 'POST',
  284. data: {val: '0', company_id: company_id},
  285. })
  286. .done(function(data) {
  287. $('.activity-div').html(data);
  288. });
  289. //ck editor
  290. CKEDITOR.replace( 'editor1' );
  291. CKEDITOR.replace( 'comment_txt' );
  292. });
  293. $('.activity-btn').click(function(event) {
  294. var email1 = $('.hdn-email1').val();
  295. var email2 = $('.hdn-email2').val();
  296. $('.to-email').val(email1+', '+email2);
  297. var val = $(this).attr("data-fullText");
  298. if(val != 'mail'){
  299. if(confirm('Want to add in activity list ?')){
  300. var company_id = $('#company_id').val();
  301. $.ajax({
  302. url: "{{url('admin/save_activity')}}",
  303. type: 'POST',
  304. data: {val: val, company_id: company_id},
  305. })
  306. .done(function(data) {
  307. $('.activity-div').html(data);
  308. });
  309. }
  310. }
  311. });
  312. $('.email-send').click(function(event){
  313. var val = "An email sent.";
  314. var company_id = $('#company_id').val();
  315. var email1 = $('.hdn-email1').val();
  316. var email2 = $('.hdn-email2').val();
  317. var email_subj = $('.email_subj').val();
  318. var attachment_id = $('.attachment_id').val();
  319. var email_body = CKEDITOR.instances.editor1.getData();
  320. if(email1.length > 0){
  321. $.ajax({
  322. url: "{{url('admin/send_email_to_company')}}",
  323. type: 'POST',
  324. data: {email1: email1,email2: email2, subj: email_subj, email_body:email_body,attachment_id: attachment_id},
  325. })
  326. .done(function(data){
  327. if(data == 'success'){
  328. $.ajax({
  329. url: "{{url('admin/save_activity')}}",
  330. type: 'POST',
  331. data: {val: val, company_id: company_id},
  332. })
  333. .done(function(data) {
  334. $('.activity-div').html(data);
  335. });
  336. alert('Email Send successfully!!');
  337. }
  338. else{
  339. alert('Sorry! email not send ...');
  340. }
  341. });
  342. }
  343. else{
  344. alert('Email 01 filed is mendatory. Email address not available!');
  345. }
  346. });
  347. $( ".activity-div" ).on( "click",".remove-activity",function() {
  348. var id = $(this).attr("data-id");
  349. var company_id = $('#company_id').val();
  350. if(confirm('Want to delete?'))
  351. {
  352. $.ajax({
  353. url: "{{url('admin/remove_activity')}}",
  354. type: 'POST',
  355. data: {id: id,company_id: company_id},
  356. })
  357. .done(function(data) {
  358. $('.activity-div').html(data);
  359. alert('Data removed successfully!');
  360. });
  361. }
  362. });
  363. $('.remarks-btn').click(function(event) {
  364. var remarks = $('#remarkss').val();
  365. var company_id = $('#company_id').val();
  366. var company_service_id='{{ $service->id }}';
  367. if(remarks.length > 0){
  368. $.ajax({
  369. url: "{{url('admin/save_remarks')}}",
  370. type: 'POST',
  371. data: {remarks: remarks, company_id: company_id,company_service_id:company_service_id},
  372. })
  373. .done(function(data) {
  374. $('.remarks-div').html(data);
  375. $('#remarkss').val('');
  376. });
  377. }
  378. else{
  379. alert('Please fill up remarks field');
  380. }
  381. });
  382. $( ".remarks-div" ).on( "click",".remove-remarks",function() {
  383. var id = $(this).attr("data-id");
  384. var company_id = $('#company_id').val();
  385. if(confirm('Want to delete?'))
  386. {
  387. $.ajax({
  388. url: "{{url('admin/remove_remarks')}}",
  389. type: 'POST',
  390. data: {id: id,company_id: company_id},
  391. })
  392. .done(function(data) {
  393. $('.remarks-div').html(data);
  394. alert('Data removed successfully!');
  395. });
  396. }
  397. });
  398. </script>
  399. @endsection