23e40e5307c8330df7a7f547e0d7c077349313c4.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <?php $__env->startSection('panel_content'); ?>
  2. <div class="row gutters-10 justify-content-center">
  3. <?php
  4. $count = DB::table('orders')->where('seller_id', Auth::user()->id)
  5. ->count();
  6. $grand_total = DB::table('orders')->where('seller_id', Auth::user()->id)
  7. ->sum('orders.grand_total');
  8. $product_storehouse_total = DB::table('orders')->where('seller_id', Auth::user()->id)
  9. ->sum('orders.product_storehouse_total');
  10. $total_turnover = "$".sprintf('%.2f',$grand_total);
  11. $total_profit = "$".sprintf('%.2f',($grand_total - $product_storehouse_total));
  12. ?>
  13. <div class="col-md-4 mx-auto mb-3">
  14. <div class="bg-grad-1 text-white rounded-lg overflow-hidden">
  15. <span class="size-30px rounded-circle mx-auto bg-soft-primary d-flex align-items-center justify-content-center mt-3">
  16. <i class="las la-upload la-2x" style="color: #007bff"></i>
  17. </span>
  18. <div class="px-3 pt-3 pb-3">
  19. <div class="h4 fw-700 text-center"><?php echo e($count); ?></div>
  20. <div class="opacity-50 text-center"><?php echo e(translate('Total Orders')); ?></div>
  21. </div>
  22. </div>
  23. </div>
  24. <div class="col-md-4 mx-auto mb-3">
  25. <div class="bg-grad-1 text-white rounded-lg overflow-hidden">
  26. <span class="size-30px rounded-circle mx-auto bg-soft-primary d-flex align-items-center justify-content-center mt-3">
  27. <i class="las la-upload la-2x" style="color: #007bff"></i>
  28. </span>
  29. <div class="px-3 pt-3 pb-3">
  30. <div class="h4 fw-700 text-center"><?php echo e($total_turnover); ?></div>
  31. <div class="opacity-50 text-center"><?php echo e(translate('Total Turnover')); ?></div>
  32. </div>
  33. </div>
  34. </div>
  35. <div class="col-md-4 mx-auto mb-3">
  36. <div class="bg-grad-1 text-white rounded-lg overflow-hidden">
  37. <span class="size-30px rounded-circle mx-auto bg-soft-primary d-flex align-items-center justify-content-center mt-3">
  38. <i class="las la-upload la-2x" style="color: #007bff"></i>
  39. </span>
  40. <div class="px-3 pt-3 pb-3">
  41. <div class="h4 fw-700 text-center"><?php echo e($total_profit); ?></div>
  42. <div class="opacity-50 text-center"><?php echo e(translate('Total Profit')); ?></div>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="card">
  48. <form id="sort_orders" action="" method="GET">
  49. <div class="card-header row gutters-5">
  50. <div class="col text-center text-md-left">
  51. <h5 class="mb-md-0 h6"><?php echo e(translate('Orders')); ?></h5>
  52. </div>
  53. <div class="col-md-3 ml-auto">
  54. <select class="form-control aiz-selectpicker" data-placeholder="<?php echo e(translate('Filter by Payment Status')); ?>" name="payment_status" onchange="sort_orders()">
  55. <option value=""><?php echo e(translate('Filter by Payment Status')); ?></option>
  56. <option value="paid" <?php if(isset($payment_status)): ?> <?php if($payment_status == 'paid'): ?> selected <?php endif; ?> <?php endif; ?>><?php echo e(translate('Paid')); ?></option>
  57. <option value="unpaid" <?php if(isset($payment_status)): ?> <?php if($payment_status == 'unpaid'): ?> selected <?php endif; ?> <?php endif; ?>><?php echo e(translate('Un-Paid')); ?></option>
  58. </select>
  59. </div>
  60. <div class="col-md-3 ml-auto">
  61. <select class="form-control aiz-selectpicker" data-placeholder="<?php echo e(translate('Filter by Payment Status')); ?>" name="delivery_status" onchange="sort_orders()">
  62. <option value=""><?php echo e(translate('Filter by Deliver Status')); ?></option>
  63. <option value="pending" <?php if(isset($delivery_status)): ?> <?php if($delivery_status == 'pending'): ?> selected <?php endif; ?> <?php endif; ?>><?php echo e(translate('Pending')); ?></option>
  64. <option value="confirmed" <?php if(isset($delivery_status)): ?> <?php if($delivery_status == 'confirmed'): ?> selected <?php endif; ?> <?php endif; ?>><?php echo e(translate('Confirmed')); ?></option>
  65. <option value="on_delivery" <?php if(isset($delivery_status)): ?> <?php if($delivery_status == 'on_delivery'): ?> selected <?php endif; ?> <?php endif; ?>><?php echo e(translate('On delivery')); ?></option>
  66. <option value="delivered" <?php if(isset($delivery_status)): ?> <?php if($delivery_status == 'delivered'): ?> selected <?php endif; ?> <?php endif; ?>><?php echo e(translate('Delivered')); ?></option>
  67. </select>
  68. </div>
  69. <div class="col-md-3">
  70. <div class="from-group mb-0">
  71. <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('Order Code')); ?> <?php echo e(translate('Or')); ?> <?php echo e(translate('Email')); ?>">
  72. </div>
  73. </div>
  74. </div>
  75. </form>
  76. <?php if(count($orders) > 0): ?>
  77. <div class="card-body p-3">
  78. <table class="table aiz-table mb-0">
  79. <thead>
  80. <tr>
  81. <th>#</th>
  82. <th><?php echo e(translate('Order Code')); ?></th>
  83. <th data-breakpoints="lg"><?php echo e(translate('Num. of Products')); ?></th>
  84. <!--<th data-breakpoints="lg"><?php echo e(translate('Customer')); ?></th>-->
  85. <th data-breakpoints="md"><?php echo e(translate('Amount')); ?></th>
  86. <th data-breakpoints="md"><?php echo e(translate('Profit')); ?></th>
  87. <th data-breakpoints="md"><?php echo e(translate('Pick Up Status')); ?></th>
  88. <th data-breakpoints="lg"><?php echo e(translate('Delivery Status')); ?></th>
  89. <th><?php echo e(translate('Payment Status')); ?></th>
  90. <th class="text-right"><?php echo e(translate('Options')); ?></th>
  91. </tr>
  92. </thead>
  93. <tbody>
  94. <?php $__currentLoopData = $orders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $order_id): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  95. <?php
  96. $order = \App\Models\Order::find($order_id->id);
  97. ?>
  98. <?php if($order != null): ?>
  99. <tr>
  100. <td>
  101. <?php echo e($key+1); ?>
  102. </td>
  103. <td>
  104. <a href="#<?php echo e($order->code); ?>" onclick="show_order_details(<?php echo e($order->id); ?>)"><?php echo e($order->code); ?></a>
  105. </td>
  106. <td>
  107. <?php echo e(count($order->orderDetails->where('seller_id', Auth::user()->id))); ?>
  108. </td>
  109. <!--<td>-->
  110. <!-- <?php if($order->user_id != null): ?>-->
  111. <!-- <?php echo e(optional($order->user)->name); ?>-->
  112. <!-- <?php else: ?>-->
  113. <!-- <?php echo e(translate('Guest')); ?> (<?php echo e($order->guest_id); ?>)-->
  114. <!-- <?php endif; ?>-->
  115. <!--</td>-->
  116. <td>
  117. <?php echo e(single_price($order->grand_total)); ?>
  118. </td>
  119. <td>
  120. <?php if($order->product_storehouse_total > 0): ?>
  121. <?php echo e(single_price($order->grand_total - $order->product_storehouse_total)); ?>
  122. <?php else: ?>
  123. <?php echo e(translate('None')); ?>
  124. <?php endif; ?>
  125. </td>
  126. <td>
  127. <?php if($order->product_storehouse_status): ?>
  128. <span class="badge badge-inline badge-success"><?php echo e(translate('Picked Up')); ?></span>
  129. <?php else: ?>
  130. <?php if($order->product_storehouse_total): ?>
  131. <span class="badge badge-inline badge-danger"><?php echo e(translate('Unpicked Up')); ?></span>
  132. <?php endif; ?>
  133. <?php endif; ?>
  134. </td>
  135. <td>
  136. <?php
  137. $status = $order->delivery_status;
  138. ?>
  139. <?php echo e(translate(ucfirst(str_replace('_', ' ', $status)))); ?>
  140. </td>
  141. <td>
  142. <?php if($order->payment_status == 'paid'): ?>
  143. <span class="badge badge-inline badge-success"><?php echo e(translate('Paid')); ?></span>
  144. <?php else: ?>
  145. <span class="badge badge-inline badge-danger"><?php echo e(translate('Unpaid')); ?></span>
  146. <?php endif; ?>
  147. </td>
  148. <td class="text-right">
  149. <a href="<?php echo e(route('seller.orders.show', encrypt($order->id))); ?>" class="btn btn-soft-info btn-icon btn-circle btn-sm" title="<?php echo e(translate('Order Details')); ?>">
  150. <i class="las la-eye"></i>
  151. </a>
  152. <a href="<?php echo e(route('seller.invoice.download', $order->id)); ?>" class="btn btn-soft-warning btn-icon btn-circle btn-sm" title="<?php echo e(translate('Download Invoice')); ?>">
  153. <i class="las la-download"></i>
  154. </a>
  155. </td>
  156. </tr>
  157. <?php endif; ?>
  158. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  159. </tbody>
  160. </table>
  161. <div class="aiz-pagination">
  162. <?php echo e($orders->links()); ?>
  163. </div>
  164. </div>
  165. <?php endif; ?>
  166. </div>
  167. <?php $__env->stopSection(); ?>
  168. <?php $__env->startSection('script'); ?>
  169. <script type="text/javascript">
  170. function sort_orders(el){
  171. $('#sort_orders').submit();
  172. }
  173. </script>
  174. <?php $__env->stopSection(); ?>
  175. <?php echo $__env->make('seller.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Users/shaoguo/Desktop/公司资料/小梦/商城/ebayShop/resources/views/seller/orders/index.blade.php ENDPATH**/ ?>