83493ddc19df892a6c4a78ed442c5346d26dc526.php 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767
  1. <?php $__env->startSection('content'); ?>
  2. <div class="aiz-titlebar text-left mt-2 mb-3">
  3. <div class="row align-items-center">
  4. <!--<div class="col-md-6">-->
  5. <!-- <h1 class="h3"><?php echo e(translate('All Sellers')); ?></h1>-->
  6. <!--</div>-->
  7. <div class="col text-left">
  8. <a href="<?php echo e(route('shops.create')); ?>" class="btn btn-circle btn-info">
  9. <span><?php echo e(translate('Add Virtual Seller')); ?></span>
  10. </a>
  11. </div>
  12. </div>
  13. </div>
  14. <div class="card">
  15. <form class="" id="sort_sellers" action="" method="GET">
  16. <div class="card-header row gutters-5">
  17. <div class="dropdown mb-2 mb-md-0">
  18. <button class="btn border dropdown-toggle" type="button" data-toggle="dropdown">
  19. <?php echo e(translate('Bulk Action')); ?>
  20. </button>
  21. <div class="dropdown-menu dropdown-menu-right">
  22. <a class="dropdown-item" href="#" onclick="bulk_delete()"><?php echo e(translate('Delete selection')); ?></a>
  23. </div>
  24. </div>
  25. <?php
  26. $salesmans = \App\Models\User::where('user_type', 'salesman')->orderBy('created_at', 'desc')->get();
  27. ?>
  28. <div class="col-md-2 ml-auto">
  29. <div class="form-group mb-0">
  30. <input type="text" class="aiz-date-range form-control" name="date" placeholder="<?php echo e(translate('Filter by date')); ?>" data-format="Y-MM-DD" data-separator=" to " data-advanced-range="true" autocomplete="on">
  31. </div>
  32. </div>
  33. <div class="col-md-2 ml-auto">
  34. <select class="form-control aiz-selectpicker" name="is_virtual_user" id="is_virtual_user" onchange="sort_sellers()">
  35. <option value=""><?php echo e(translate('All')); ?></option>
  36. <option value="1" <?php if(isset($is_virtual_user)): ?> <?php if($is_virtual_user == '1'): ?> selected <?php endif; ?> <?php endif; ?>><?php echo e(translate('Virtual Account')); ?></option>
  37. <option value="0" <?php if(isset($is_virtual_user)): ?> <?php if($is_virtual_user == '0'): ?> selected <?php endif; ?> <?php endif; ?>><?php echo e(translate('General Account')); ?></option>
  38. </select>
  39. </div>
  40. <div class="col-md-2 ml-auto">
  41. <select name="user_id" class="form-control aiz-selectpicker pos-customer" data-live-search="true" onchange="sort_sellers()">
  42. <option value=""><?php echo e(translate('All Ssalesman')); ?></option>
  43. </select>
  44. </div>
  45. <div class="col-md-2 ml-auto">
  46. <select class="form-control aiz-selectpicker" name="approved_status" id="approved_status" onchange="sort_sellers()">
  47. <option value=""><?php echo e(translate('Filter by Approval')); ?></option>
  48. <option value="1" <?php if(isset($approved)): ?> <?php if($approved == 'paid'): ?> selected <?php endif; ?> <?php endif; ?>><?php echo e(translate('Approved')); ?></option>
  49. <option value="0" <?php if(isset($approved)): ?> <?php if($approved == 'unpaid'): ?> selected <?php endif; ?> <?php endif; ?>><?php echo e(translate('Non-Approved')); ?></option>
  50. </select>
  51. </div>
  52. <div class="col-md-2">
  53. <div class="form-group mb-0">
  54. <input type="text" class="form-control" id="search" name="search"<?php if(isset($sort_search)): ?> value="<?php echo e($sort_search); ?>" <?php endif; ?> placeholder="<?php echo e(translate('Type name or email & Enter')); ?>">
  55. </div>
  56. </div>
  57. <button type="submit" class="btn btn-success btn-styled"><?php echo e(translate('Search')); ?></button>
  58. </div>
  59. <div class="card-body">
  60. <table class="table aiz-table mb-0">
  61. <thead>
  62. <tr>
  63. <th>
  64. <div class="form-group">
  65. <div class="aiz-checkbox-inline">
  66. <label class="aiz-checkbox">
  67. <input type="checkbox" class="check-all">
  68. <span class="aiz-square-check"></span>
  69. </label>
  70. </div>
  71. </div>
  72. </th>
  73. <th><?php echo e(translate('Name')); ?></th>
  74. <th data-breakpoints="lg"><?php echo e(translate('Phone')); ?></th>
  75. <th data-breakpoints="lg"><?php echo e(translate('Email Address')); ?></th>
  76. <th data-breakpoints="lg"><?php echo e(translate('Verification Info')); ?></th>
  77. <th data-breakpoints="lg"><?php echo e(translate('Approval')); ?></th>
  78. <th data-breakpoints="lg"><?php echo e(translate('Num. of Products')); ?></th>
  79. <th data-breakpoints="lg"><?php echo e(translate('Pending Balance')); ?></th>
  80. <th data-breakpoints="lg"><?php echo e(translate('Wallet Money')); ?></th>
  81. <th data-breakpoints="lg"><?php echo e(translate('Guarantee Money')); ?></th>
  82. <th data-breakpoints="lg"><?php echo e(translate('Views')); ?></th>
  83. <th data-breakpoints="lg"><?php echo e(translate('Comment Permission')); ?></th>
  84. <th data-breakpoints="lg"><?php echo e(translate('Home Display')); ?></th>
  85. <th data-breakpoints="lg"><?php echo e(translate('Total recharge')); ?></th>
  86. <th data-breakpoints="lg"><?php echo e(translate('Total withdrawal amount')); ?></th>
  87. <th data-breakpoints="lg"><?php echo e(translate('Recharge difference')); ?></th>
  88. <th data-breakpoints="lg"><?php echo e(translate('Salesman')); ?></th>
  89. <th width="10%"><?php echo e(translate('Options')); ?></th>
  90. </tr>
  91. </thead>
  92. <tbody>
  93. <?php
  94. $total_recharge = '0.00';
  95. $total_withdraw_money = '0.00';
  96. $total_difference = '0.00';
  97. ?>
  98. <?php $__currentLoopData = $shops; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $shop): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  99. <tr>
  100. <td>
  101. <div class="form-group">
  102. <div class="aiz-checkbox-inline">
  103. <label class="aiz-checkbox">
  104. <input type="checkbox" class="check-one" name="id[]" value="<?php echo e($shop->id); ?>">
  105. <span class="aiz-square-check"></span>
  106. </label>
  107. </div>
  108. </div>
  109. </td>
  110. <td><?php if($shop->user->banned == 1): ?> <i class="fa fa-ban text-danger" aria-hidden="true"></i> <?php endif; ?> <?php echo e($shop->name); ?> <?php if($shop->user->is_virtual == 1): ?> (<font color="red"><?php echo e(translate('Virtual')); ?></font>) <?php endif; ?></td>
  111. <td><?php echo e($shop->user->phone); ?></td>
  112. <td><?php echo e($shop->user->email); ?></td>
  113. <td>
  114. <?php if($shop->verification_info != null): ?>
  115. <a href="<?php echo e(route('sellers.show_verification_request', $shop->id)); ?>">
  116. <span class="badge badge-inline badge-info"><?php echo e(translate('Show')); ?></span>
  117. </a>
  118. <?php endif; ?>
  119. </td>
  120. <td>
  121. <label class="aiz-switch aiz-switch-success mb-0">
  122. <input onchange="update_approved(this)" value="<?php echo e($shop->id); ?>" type="checkbox" <?php if($shop->verification_status == 1) echo "checked";?> >
  123. <span class="slider round"></span>
  124. </label>
  125. </td>
  126. <td><?php echo e($shop->user->products->count()); ?></td>
  127. <td>
  128. <?php if($shop->admin_to_pay >= 0): ?>
  129. <?php echo e(single_price($shop->admin_to_pay)); ?>
  130. <?php else: ?>
  131. <?php echo e(single_price(abs($shop->admin_to_pay))); ?> (<?php echo e(translate('Due to Admin')); ?>)
  132. <?php endif; ?>
  133. </td>
  134. <td >
  135. <?php echo e(single_price($shop->user->balance)); ?>
  136. </td>
  137. <td >
  138. <?php echo e(single_price($shop->bzj_money)); ?>
  139. </td>
  140. <td >
  141. <?php echo e(translate('base num')); ?>:<?php echo e($shop->view_base_num); ?>
  142. <br>
  143. <?php echo e(translate('inc num')); ?>:<?php echo e($shop->view_inc_num); ?>
  144. </td>
  145. <td>
  146. <label class="aiz-switch aiz-switch-success mb-0">
  147. <input onchange="update_comment_permission(this)" value="<?php echo e($shop->id); ?>" type="checkbox" <?php if($shop->comment_permission == 1) echo "checked";?> >
  148. <span class="slider round"></span>
  149. </label>
  150. </td>
  151. <td>
  152. <label class="aiz-switch aiz-switch-success mb-0">
  153. <input onchange="update_home_display(this)" value="<?php echo e($shop->id); ?>" type="checkbox" <?php if($shop->home_display == 1) echo "checked";?> >
  154. <span class="slider round"></span>
  155. </label>
  156. </td>
  157. <?php
  158. $wallets = $shop->user->wallets;
  159. $recharge = 0;
  160. foreach ($wallets as $wallet) {
  161. if ($wallet->approval==1) $recharge += $wallet->amount;
  162. }
  163. $withdraws = $shop->user->seller_withdraw_requests;
  164. $withdraw_money = '0.00';
  165. foreach ($withdraws as $withdraw) {
  166. if ($withdraw->status==1) $withdraw_money += $withdraw->amount;
  167. }
  168. $difference = $recharge - $withdraw_money;
  169. $total_recharge += $recharge;
  170. $total_withdraw_money += $withdraw_money;
  171. $total_difference += $difference;
  172. ?>
  173. <td><?php echo e(single_price($recharge)); ?></td>
  174. <td><?php echo e(single_price($withdraw_money)); ?></td>
  175. <td><?php echo e(single_price($difference)); ?></td>
  176. <td>
  177. <?php
  178. $uid = $shop->user->leader_id;
  179. if( $uid == '')
  180. {
  181. echo '---';
  182. }
  183. else
  184. {
  185. $r = \App\Models\User::where('id',$uid)->first() ;
  186. echo $r['name'];
  187. }
  188. ?>
  189. </td>
  190. <td>
  191. <div class="dropdown">
  192. <button type="button" class="btn btn-sm btn-circle btn-soft-primary btn-icon dropdown-toggle no-arrow" data-toggle="dropdown" href="javascript:void(0);" role="button" aria-haspopup="false" aria-expanded="false">
  193. <i class="las la-ellipsis-v"></i>
  194. </button>
  195. <div class="dropdown-menu dropdown-menu-right dropdown-menu-xs">
  196. <a href="#" onclick="show_seller_profile('<?php echo e($shop->id); ?>');" class="dropdown-item">
  197. <?php echo e(translate('Profile')); ?>
  198. </a>
  199. <a href="<?php echo e(route('sellers.login', encrypt($shop->id))); ?>" class="dropdown-item">
  200. <?php echo e(translate('Log in as this Seller')); ?>
  201. </a>
  202. <a href="#" onclick="show_seller_payment_modal('<?php echo e($shop->id); ?>');" class="dropdown-item">
  203. <?php echo e(translate('Go to Payment')); ?>
  204. </a>
  205. <a href="<?php echo e(route('sellers.payment_history', encrypt($shop->user_id))); ?>" class="dropdown-item">
  206. <?php echo e(translate('Payment History')); ?>
  207. </a>
  208. <a href="<?php echo e(route('sellers.edit', encrypt($shop->id))); ?>" class="dropdown-item">
  209. <?php echo e(translate('Edit')); ?>
  210. </a>
  211. <?php if($shop->user->banned != 1): ?>
  212. <a href="#" onclick="confirm_ban('<?php echo e(route('sellers.ban', $shop->id)); ?>');" class="dropdown-item">
  213. <?php echo e(translate('Ban this seller')); ?>
  214. <i class="fa fa-ban text-danger" aria-hidden="true"></i>
  215. </a>
  216. <?php else: ?>
  217. <a href="#" onclick="confirm_unban('<?php echo e(route('sellers.ban', $shop->id)); ?>');" class="dropdown-item">
  218. <?php echo e(translate('Unban this seller')); ?>
  219. <i class="fa fa-check text-success" aria-hidden="true"></i>
  220. </a>
  221. <?php endif; ?>
  222. <a href="#" class="dropdown-item confirm-delete" data-href="<?php echo e(route('sellers.destroy', $shop->id)); ?>" class="">
  223. <?php echo e(translate('Delete')); ?>
  224. </a>
  225. <span onclick="show_chat_modal(<?php echo e($shop->user->id); ?>)" class="dropdown-item" style="cursor:pointer;">
  226. <?php echo e(translate('Message Seller')); ?>
  227. </span>
  228. <span onclick="show_seller_guarantee_money_modal(<?php echo e($shop->id); ?>)" class="dropdown-item" style="cursor:pointer;">
  229. <?php echo e(translate('Guarantee Money')); ?>
  230. </span>
  231. <span onclick="show_view(<?php echo e($shop->id); ?>,<?php echo e($shop->view_inc_num); ?>,<?php echo e($shop->view_base_num); ?>)" class="dropdown-item" style="cursor:pointer;">
  232. <?php echo e(translate('Views')); ?>
  233. </span>
  234. <span onclick="show_package(<?php echo e($shop->id); ?>,<?php echo e($shop->seller_package_id); ?>)" class="dropdown-item" style="cursor:pointer;">
  235. <?php echo e(translate('Set Package')); ?>
  236. </span>
  237. <span onclick="set_pid(<?php echo e($shop->id); ?>,<?php echo e($shop->user->pid); ?>)" class="dropdown-item" style="cursor:pointer;">
  238. <?php echo e(translate('Set Salesman')); ?>
  239. </span>
  240. </div>
  241. </div>
  242. </td>
  243. </tr>
  244. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  245. <?php if(count($shops)): ?>
  246. <tr>
  247. <td></td>
  248. <td></td>
  249. <td></td>
  250. <td></td>
  251. <td></td>
  252. <td></td>
  253. <td></td>
  254. <td></td>
  255. <td></td>
  256. <td></td>
  257. <td></td>
  258. <td></td>
  259. <td></td>
  260. <td><?php echo e(single_price($total_recharge)); ?></td>
  261. <td><?php echo e(single_price($total_withdraw_money)); ?></td>
  262. <td><?php echo e(single_price($total_difference)); ?></td>
  263. <td></td>
  264. <td></td>
  265. </tr>
  266. <?php endif; ?>
  267. </tbody>
  268. </table>
  269. <div class="aiz-pagination">
  270. <?php echo e($shops->appends(request()->input())->links()); ?>
  271. </div>
  272. </div>
  273. </form>
  274. </div>
  275. <?php $__env->stopSection(); ?>
  276. <?php $__env->startSection('modal'); ?>
  277. <!-- Delete Modal -->
  278. <?php echo $__env->make('modals.delete_modal', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  279. <div class="modal fade" id="chat_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  280. <div class="modal-dialog modal-dialog-centered modal-dialog-zoom product-modal" id="modal-size" role="document">
  281. <div class="modal-content position-relative">
  282. <div class="modal-header">
  283. <h5 class="modal-title fw-600 h5"><?php echo e(translate('Any query about this seller')); ?></h5>
  284. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  285. <span aria-hidden="true">&times;</span>
  286. </button>
  287. </div>
  288. <form action="<?php echo e(route('conversations.admin_store')); ?>" method="POST" enctype="multipart/form-data">
  289. <?php echo csrf_field(); ?>
  290. <input type="hidden" name="receiver_id" id="receiver_id" value="">
  291. <div class="modal-body gry-bg px-3 pt-3">
  292. <div class="form-group">
  293. <textarea class="form-control" rows="8" name="title" required
  294. placeholder="<?php echo e(translate('Title')); ?>"></textarea>
  295. </div>
  296. </div>
  297. <div class="modal-footer">
  298. <button type="button" class="btn btn-outline-primary fw-600"
  299. data-dismiss="modal"><?php echo e(translate('Cancel')); ?></button>
  300. <button type="submit" class="btn btn-primary fw-600"><?php echo e(translate('Send')); ?></button>
  301. </div>
  302. </form>
  303. </div>
  304. </div>
  305. </div>
  306. <!-- Seller Profile Modal -->
  307. <div class="modal fade" id="profile_modal">
  308. <div class="modal-dialog">
  309. <div class="modal-content" id="profile-modal-content">
  310. </div>
  311. </div>
  312. </div>
  313. <!-- Seller Payment Modal -->
  314. <div class="modal fade" id="payment_modal">
  315. <div class="modal-dialog">
  316. <div class="modal-content" id="payment-modal-content">
  317. </div>
  318. </div>
  319. </div>
  320. <!-- Ban Seller Modal -->
  321. <div class="modal fade" id="confirm-ban">
  322. <div class="modal-dialog">
  323. <div class="modal-content">
  324. <div class="modal-header">
  325. <h5 class="modal-title h6"><?php echo e(translate('Confirmation')); ?></h5>
  326. <button type="button" class="close" data-dismiss="modal">
  327. </button>
  328. </div>
  329. <div class="modal-body">
  330. <p><?php echo e(translate('Do you really want to ban this seller?')); ?></p>
  331. </div>
  332. <div class="modal-footer">
  333. <button type="button" class="btn btn-light" data-dismiss="modal"><?php echo e(translate('Cancel')); ?></button>
  334. <a class="btn btn-primary" id="confirmation"><?php echo e(translate('Proceed!')); ?></a>
  335. </div>
  336. </div>
  337. </div>
  338. </div>
  339. <!-- Unban Seller Modal -->
  340. <div class="modal fade" id="confirm-unban">
  341. <div class="modal-dialog">
  342. <div class="modal-content">
  343. <div class="modal-header">
  344. <h5 class="modal-title h6"><?php echo e(translate('Confirmation')); ?></h5>
  345. <button type="button" class="close" data-dismiss="modal">
  346. </button>
  347. </div>
  348. <div class="modal-body">
  349. <p><?php echo e(translate('Do you really want to unban this seller?')); ?></p>
  350. </div>
  351. <div class="modal-footer">
  352. <button type="button" class="btn btn-light" data-dismiss="modal"><?php echo e(translate('Cancel')); ?></button>
  353. <a class="btn btn-primary" id="confirmationunban"><?php echo e(translate('Proceed!')); ?></a>
  354. </div>
  355. </div>
  356. </div>
  357. </div>
  358. <!-- Guarantee Money Modal -->
  359. <div class="modal fade" id="guarantee_money">
  360. <div class="modal-dialog">
  361. <div class="modal-content" id="guarantee-money-content">
  362. </div>
  363. </div>
  364. </div>
  365. <?php $__env->stopSection(); ?>
  366. <?php $__env->startSection('script'); ?>
  367. <script src="https://cdn.bootcdn.net/ajax/libs/layer/3.5.1/layer.min.js"></script>
  368. <script type="text/javascript">
  369. function show_seller_guarantee_money_modal(id){
  370. $.post('<?php echo e(route('sellers.guarantee_money_modal')); ?>',{_token:'<?php echo e(@csrf_token()); ?>', id:id}, function(data){
  371. $('#guarantee_money #guarantee-money-content').html(data);
  372. $('#guarantee_money').modal('show', {backdrop: 'static'});
  373. });
  374. }
  375. function show_bzj(shop_id, bzj) {
  376. layer.prompt( {
  377. title: "保证金金额", //提示框标题
  378. value: bzj //初始时的值,默认空字符
  379. }, function (value, index, elem)
  380. {
  381. $.post( '<?php echo e(route('sellers.setbzj')); ?>', {
  382. _token: '<?php echo e(@csrf_token()); ?>',
  383. shop_id: shop_id,
  384. bzj: value
  385. }, function (data)
  386. {
  387. layer.msg( data.msg, function ()
  388. {
  389. location.reload();
  390. } );
  391. }, 'json' );
  392. layer.close( index );
  393. } );
  394. }
  395. function set_pid(shop_id,pid)
  396. {
  397. <?php
  398. $Salesmans = \App\Models\User::where('user_type','salesman')->get();
  399. ?>
  400. var html = '';
  401. <?php $__currentLoopData = $Salesmans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $us): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  402. html +="<option ";
  403. if( pid == <?php echo $us['id'];?> )
  404. {
  405. html += ' selected ';
  406. }
  407. html += " value='<?php echo $us['id'];?>'> <?php echo $us['name'];?></option>";
  408. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  409. var html2 = "<select class='form-control' name='userid' id='userid'> ";
  410. html = html2+html+"</select>";
  411. layer.open({
  412. type: 1,
  413. title:'设置推销员',
  414. skin:'layui-layer-rim',
  415. area:['450px', 'auto'],
  416. content: ' <div class="row" style="width: 420px; margin-left:7px; margin-top:10px;">'
  417. +'<div class="col-sm-12">'
  418. +'<div class="input-group">'
  419. + html
  420. +'</div>'
  421. +'</div>'
  422. +'</div>'
  423. ,
  424. btn:['保存','取消'],
  425. btn1: function (index,layero) {
  426. var userid = $("#userid").val();
  427. $.post('<?php echo e(route('sellers.setpid')); ?>',{_token:'<?php echo e(@csrf_token()); ?>', shop_id:shop_id,pid:userid}, function(data){
  428. layer.msg(data.msg,function(){
  429. location.reload();
  430. });
  431. },'json');
  432. },
  433. btn2:function (index,layero) {
  434. layer.close(index);
  435. }
  436. });
  437. }
  438. function show_package(shop_id,seller_package_id)
  439. {
  440. <?php
  441. $seller_packages = \App\Models\SellerPackage::all();
  442. ?>
  443. var html = '';
  444. <?php $__currentLoopData = $seller_packages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $seller_package): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  445. html +="<option ";
  446. if( seller_package_id == <?php echo $seller_package['id'];?> )
  447. {
  448. html += ' selected ';
  449. }
  450. html += " value='<?php echo $seller_package['id'];?>'> <?php echo $seller_package['name'];?></option>";
  451. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  452. var html2 = "<select class='form-control' name='packageid' id='packageid'> ";
  453. html = html2+html+"</select>";
  454. layer.open({
  455. type: 1,
  456. title:'设置套餐',
  457. skin:'layui-layer-rim',
  458. area:['450px', 'auto'],
  459. content: ' <div class="row" style="width: 420px; margin-left:7px; margin-top:10px;">'
  460. +'<div class="col-sm-12">'
  461. +'<div class="input-group">'
  462. + html
  463. +'</div>'
  464. +'</div>'
  465. +'</div>'
  466. ,
  467. btn:['保存','取消'],
  468. btn1: function (index,layero) {
  469. var packageid = $("#packageid").val();
  470. $.post('<?php echo e(route('sellers.setpackage')); ?>',{_token:'<?php echo e(@csrf_token()); ?>', shop_id:shop_id,packageid:packageid}, function(data){
  471. layer.msg(data.msg,function(){
  472. location.reload();
  473. });
  474. },'json');
  475. },
  476. btn2:function (index,layero) {
  477. layer.close(index);
  478. }
  479. });
  480. }
  481. function show_view(shop_id,view_inc_num,view_base_num) {
  482. var content = ' <div class="row" style="width: 420px; margin-left:7px; margin-top:10px;">'
  483. +'<div class="col-sm-12">'
  484. +'<div class="input-group">'
  485. +'<span class="input-group-addon"> 基础访问量:</span>'
  486. +'<input id="base_num" type="text" value="'+view_base_num+'" class="form-control" placeholder="基础访问量">'
  487. +'</div>'
  488. +'</div>'
  489. +'<div class="col-sm-12" style="margin-top:3px;">'
  490. +'<div class="input-group">'
  491. +'<span class="input-group-addon"> 每日递增量:</span>'
  492. +'<input id="inc_num" type="text" value="'+view_inc_num+'" class="form-control" placeholder="每日递增">'
  493. +'</div>'
  494. +'</div>'
  495. +'</div>';
  496. layer.open({
  497. type: 1,
  498. title:'访问量',
  499. skin:'layui-layer-rim',
  500. area:['450px', 'auto'],
  501. content: content,
  502. btn:['保存','取消'],
  503. btn1: function (index,layero) {
  504. var inc_num = $("#inc_num").val();
  505. var base_num = $("#base_num").val();
  506. $.post('<?php echo e(route('sellers.setviews')); ?>',{_token:'<?php echo e(@csrf_token()); ?>', shop_id:shop_id,inc_num:inc_num,base_num:base_num}, function(data){
  507. layer.msg(data.msg,function(){
  508. location.reload();
  509. });
  510. },'json');
  511. },
  512. btn2:function (index,layero) {
  513. layer.close(index);
  514. }
  515. });
  516. return false;
  517. layer.prompt({
  518. title: "访问量", //提示框标题
  519. value: views, //初始时的值,默认空字符
  520. },function(value, index, elem){
  521. $.post('<?php echo e(route('sellers.setviews')); ?>',{_token:'<?php echo e(@csrf_token()); ?>', shop_id:shop_id,view_inc_num:view_inc_num}, function(data){
  522. layer.msg(data.msg,function(){
  523. location.reload();
  524. });
  525. },'json');
  526. layer.close(index);
  527. });
  528. }
  529. function show_chat_modal(receiver_id) {
  530. $('#receiver_id').val(receiver_id);
  531. $('#chat_modal').modal('show');
  532. }
  533. $(document).on("change", ".check-all", function() {
  534. if(this.checked) {
  535. // Iterate each checkbox
  536. $('.check-one:checkbox').each(function() {
  537. this.checked = true;
  538. });
  539. } else {
  540. $('.check-one:checkbox').each(function() {
  541. this.checked = false;
  542. });
  543. }
  544. });
  545. function show_seller_payment_modal(id){
  546. $.post('<?php echo e(route('sellers.payment_modal')); ?>',{_token:'<?php echo e(@csrf_token()); ?>', id:id}, function(data){
  547. $('#payment_modal #payment-modal-content').html(data);
  548. $('#payment_modal').modal('show', {backdrop: 'static'});
  549. $('.demo-select2-placeholder').select2();
  550. });
  551. }
  552. function show_seller_profile(id){
  553. $.post('<?php echo e(route('sellers.profile_modal')); ?>',{_token:'<?php echo e(@csrf_token()); ?>', id:id}, function(data){
  554. $('#profile_modal #profile-modal-content').html(data);
  555. $('#profile_modal').modal('show', {backdrop: 'static'});
  556. });
  557. }
  558. function update_approved(el){
  559. if(el.checked){
  560. var status = 1;
  561. }
  562. else{
  563. var status = 0;
  564. }
  565. $.post('<?php echo e(route('sellers.approved')); ?>', {_token:'<?php echo e(csrf_token()); ?>', id:el.value, status:status}, function(data){
  566. if(data == 1){
  567. AIZ.plugins.notify('success', '<?php echo e(translate('Approved sellers updated successfully')); ?>');
  568. }
  569. else{
  570. AIZ.plugins.notify('danger', '<?php echo e(translate('Something went wrong')); ?>');
  571. }
  572. });
  573. }
  574. function update_comment_permission(el){
  575. if(el.checked){
  576. var status = 1;
  577. }
  578. else{
  579. var status = 0;
  580. }
  581. $.post('<?php echo e(route('sellers.comment_permission')); ?>', {_token:'<?php echo e(csrf_token()); ?>', id:el.value, status:status}, function(data){
  582. if(data == 1){
  583. AIZ.plugins.notify('success', '<?php echo e(translate('Comment permission sellers updated successfully')); ?>');
  584. }
  585. else{
  586. AIZ.plugins.notify('danger', '<?php echo e(translate('Something went wrong')); ?>');
  587. }
  588. });
  589. }
  590. function update_home_display(el){
  591. if(el.checked){
  592. var status = 1;
  593. }
  594. else{
  595. var status = 0;
  596. }
  597. $.post('<?php echo e(route('sellers.home_display')); ?>', {_token:'<?php echo e(csrf_token()); ?>', id:el.value, status:status}, function(data){
  598. if(data == 1){
  599. AIZ.plugins.notify('success', '<?php echo e(translate('Home display sellers updated successfully')); ?>');
  600. }
  601. else{
  602. AIZ.plugins.notify('danger', '<?php echo e(translate('Something went wrong')); ?>');
  603. }
  604. });
  605. }
  606. function sort_sellers(el){
  607. return false
  608. $('#sort_sellers').submit();
  609. }
  610. function confirm_ban(url)
  611. {
  612. $('#confirm-ban').modal('show', {backdrop: 'static'});
  613. document.getElementById('confirmation').setAttribute('href' , url);
  614. }
  615. function confirm_unban(url)
  616. {
  617. $('#confirm-unban').modal('show', {backdrop: 'static'});
  618. document.getElementById('confirmationunban').setAttribute('href' , url);
  619. }
  620. function bulk_delete() {
  621. var data = new FormData($('#sort_sellers')[0]);
  622. $.ajax({
  623. headers: {
  624. 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  625. },
  626. url: "<?php echo e(route('bulk-seller-delete')); ?>",
  627. type: 'POST',
  628. data: data,
  629. cache: false,
  630. contentType: false,
  631. processData: false,
  632. success: function (response) {
  633. if(response == 1) {
  634. location.reload();
  635. }
  636. }
  637. });
  638. }
  639. </script>
  640. <?php $__env->stopSection(); ?>
  641. <?php echo $__env->make('backend.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /www/wwwroot/www.easybuyjp.shop/resources/views/backend/sellers/index.blade.php ENDPATH**/ ?>