| 1 |
<?php |
| 2 |
|
| 3 |
namespace SyncBasalam\Admin\Components; |
| 4 |
|
| 5 |
defined('ABSPATH') || exit; |
| 6 |
|
| 7 |
class ProductListComponents |
| 8 |
{ |
| 9 |
public static function renderSyncProductStatusSynced() |
| 10 |
{ |
| 11 |
echo '<span class="dashicons dashicons-yes-alt basalam-status-success" title="� |
| 12 |
حصول با باسلا� |
| 13 |
سینک شده است."></span>'; |
| 14 |
} |
| 15 |
|
| 16 |
public static function renderSyncProductStatusPending() |
| 17 |
{ |
| 18 |
echo '<span class="dashicons dashicons-update basalam-status-warning" title="در حال سینک با باسلا� |
| 19 |
"></span>'; |
| 20 |
} |
| 21 |
|
| 22 |
public static function renderSyncProductStatusUnsync() |
| 23 |
{ |
| 24 |
echo '<span class="dashicons dashicons-no-alt basalam-status-error" title="� |
| 25 |
حصول در باسلا� |
| 26 |
ثبت نشده است یا فرایند سینک � |
| 27 |
وفق نبود"></span>'; |
| 28 |
} |
| 29 |
|
| 30 |
public static function renderUnsyncBasalamProductsTable($unsync_products) |
| 31 |
{ |
| 32 |
echo "<div class='basalam-flex-center-vertical basalam-flex-col'>"; |
| 33 |
if (empty($unsync_products)) return null; |
| 34 |
|
| 35 |
echo "<h3 class='basalam-margin-bottom-15 basalam-font-bold'>📦 � |
| 36 |
حصولات سینکنشده باسلا� |
| 37 |
:</h3>"; |
| 38 |
echo "<table class='basalam-p basalam-table-unsync'>"; |
| 39 |
|
| 40 |
echo "<thead class='basalam-table-header'> |
| 41 |
<tr> |
| 42 |
<th class='basalam-table-padding'>#</th> |
| 43 |
<th class='basalam-table-padding'>تصویر</th> |
| 44 |
<th class='basalam-table-padding'>عنوان</th> |
| 45 |
<th class='basalam-table-padding'>قی� |
| 46 |
ت (تو� |
| 47 |
ان)</th> |
| 48 |
<th class='basalam-table-padding'>آیدی باسلا� |
| 49 |
</th> |
| 50 |
<th class='basalam-table-padding basalam-table-cell-center' style='width: 14%;'>� |
| 51 |
حصول در باسلا� |
| 52 |
</th> |
| 53 |
</tr> |
| 54 |
</thead>"; |
| 55 |
|
| 56 |
echo "<tbody>"; |
| 57 |
|
| 58 |
foreach ($unsync_products as $index => $product) { |
| 59 |
echo "<tr class='basalam-table-row'> |
| 60 |
<td class='basalam-table-padding'>" . esc_html($index + 1) . "</td> |
| 61 |
<td class='basalam-table-padding'><img src='" . esc_url($product['photo']['md']) . "' alt='Product Image' class='basalam-product-img-table'></td> |
| 62 |
<td class='basalam-table-padding'>" . esc_html($product['title']) . "</td> |
| 63 |
<td class='basalam-table-padding'>" . esc_html(number_format($product['price'])) . "</td> |
| 64 |
<td class='basalam-table-padding'>" . esc_html($product['id']) . "</td> |
| 65 |
<td class='basalam-table-padding basalam-table-cell-center'> |
| 66 |
<button class='basalam-button basalam-p basalam-button-table basalam-height-35 basalam-margin-auto'> |
| 67 |
<a class='basalam-a' href='https://basalam.com/p/" . esc_attr($product['id']) . "' target='_blank'>� |
| 68 |
شاهده � |
| 69 |
حصول</a> |
| 70 |
</button> |
| 71 |
|
| 72 |
</td> |
| 73 |
</tr>"; |
| 74 |
} |
| 75 |
|
| 76 |
echo "</tbody></table>"; |
| 77 |
echo "</div>"; |
| 78 |
} |
| 79 |
} |
| 80 |
|