You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.blade.php 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. @extends('market.layout.master')
  2. @section('ptitle', 'Marketing')
  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. </style>
  13. <!-- Table dealer -->
  14. <div class="fluid">
  15. <div class="widget grid12">
  16. <div class="whead"><h6>Dealer's List</h6></div>
  17. <div id="dyn1" class="shownpars cuss responsive">
  18. <a class="tOptions" title="Options"><img src="{{ url('assets/img/icons/options') }}" alt="" /></a>
  19. <table id="agent" cellpadding="0" cellspacing="0" border="0" class="dTable tMedia">
  20. <thead>
  21. <tr>
  22. <th>#</th>
  23. <th>Company Name</th>
  24. <th>Address</th>
  25. <th>City</th>
  26. <th>State</th>
  27. <th>Postcode.</th>
  28. <th width="90">Actions</th>
  29. </tr>
  30. </thead>
  31. </table>
  32. </div>
  33. <div class="dialog-delete" title="Delete Company">
  34. <p id="inner-delete"></p>
  35. </div>
  36. </div>
  37. @endsection
  38. @section('external_js')
  39. <script>
  40. function deleteA(cid,name) {
  41. var cid = cid;
  42. var name = name;
  43. $('.dialog-delete').attr('data-id' , cid);
  44. document.getElementById("inner-delete").innerHTML = "<p>Are you sure want to delete this company ( " + name + ")?</p>";
  45. $('.dialog-delete').dialog('open');
  46. return false;
  47. };
  48. // function editA(cid, name)
  49. // {
  50. // var cid = cid;
  51. // location.replace("{{route('editCompany', ['_id' => "+cid+"])}}");
  52. // }
  53. $(document).ready(function(){
  54. var origin = window.location.origin;
  55. var curr = '{{ $user->_id }}';
  56. //===== Dynamic table toolbars =====//
  57. $('#dyn1 .tOptions').click(function () {
  58. $('#dyn .tablePars').slideToggle(200);
  59. });
  60. $('.tOptions').click(function () {
  61. $(this).toggleClass("act");
  62. });
  63. //======= Filter data table ========//
  64. $('#agent').DataTable({
  65. "bJQueryUI": false,
  66. "bAutoWidth": true,
  67. "bSort": false,
  68. "sPaginationType": "full_numbers",
  69. "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  70. "oLanguage": {
  71. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  72. },
  73. "ordering": false,
  74. "serverSide": true,
  75. "processing": true,
  76. "ajax": "{{ url('/marketing/get-dealer-list') }}",
  77. "columns": [
  78. { "data": "index","name": "index"},
  79. { "data": "name","name": "name"},
  80. { "data": "address","name": "addres"},
  81. { "data": "city","name": "city"},
  82. { "data": "state","name": "state"},
  83. { "data": "postcode","name": "postcode"},
  84. { "data": "action","name": "action"},
  85. ],
  86. "columnDefs": [
  87. {
  88. "render": function ( data, type, row ) {
  89. if (data.indexOf("-You") >= 0) {
  90. var split = data.split('-');
  91. return '<small class="label label-info">'+split[1]+'</small>&nbsp;'+split[0];
  92. }else if (data.indexOf("New/") >= 0) {
  93. var split = data.split('/');
  94. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  95. }else {
  96. return data;
  97. }
  98. },
  99. "targets": 0
  100. },
  101. {
  102. "render": function ( data, type, row )
  103. {
  104. var link = "{{ url('/marketing/dealer/edit') }}"+"/"+data;
  105. return '<a href="'+link+'", class="tablectrl_medium bLightBlue tipS" onclick="editA(\''+data+'\',\'' + row.name + '\',)" title="Edit Dealer"><span class="iconb" data-icon="&#xe003;"></span></a> <a class="tablectrl_medium bRed tipS delModule" onclick="deleteA(\''+data+'\',\'' + row.name + '\',)" title="Delete Agent"><span class="iconb" data-icon="&#xe136;"></span></a>';
  106. },
  107. "targets": 6
  108. },
  109. ],
  110. });
  111. //===== Modal =====//
  112. $('.dialog-delete').dialog({
  113. autoOpen: false,
  114. width: 400,
  115. modal: true,
  116. buttons: {
  117. "Yes!": function ()
  118. {
  119. var cid = $(this).data('id');
  120. $.ajax({
  121. type: "POST",
  122. url: "{{ url('/marketing/dealer/delete-company') }}",
  123. data: { "_token": "{{ csrf_token() }}", "id": cid },
  124. success:function(data){
  125. if(data == "true"){
  126. window.location.reload();
  127. }else if(data == "false"){
  128. alert("ERROR!! Cant Delete Company !");
  129. }
  130. }
  131. });
  132. },
  133. "Cancel": function () {
  134. $(this).dialog("close");
  135. $('.dialog-delete').removeAttr('data-id');
  136. }
  137. }
  138. });
  139. $('.tipS').tipsy({gravity: 's',fade: true, html:true});
  140. });
  141. </script>
  142. @endsection