File: /home/luxbsolr/cardsord.store/wp-content/plugins/product-modifier/templates/admin-page-simple.php
<?php
/**
* Admin Page Template - Fixed Version
*/
if (!defined('ABSPATH')) {
exit;
}
$settings = ProductModifier_Settings::get_settings();
?>
<div class="wrap product-modifier-admin">
<h1>Product Modifier - Bulk Editor</h1>
<!-- Filters and Search -->
<div class="pm-filters" style="margin: 20px 0; padding: 15px; background: white; border: 1px solid #ccd0d4;">
<div style="margin-bottom: 10px;">
<input type="text" id="pm-search" placeholder="Search products..." value="<?php echo isset($search) ? htmlspecialchars($search) : ''; ?>" style="width: 300px;">
<button type="button" id="pm-search-btn" class="button">Search</button>
</div>
<div style="margin-bottom: 10px;">
<select id="pm-category-filter" style="width: 200px;">
<option value="">All Categories</option>
<?php if (!empty($categories) && is_array($categories)): ?>
<?php foreach ($categories as $category): ?>
<?php if (is_object($category) && isset($category->slug) && isset($category->name)): ?>
<option value="<?php echo htmlspecialchars($category->slug); ?>">
<?php echo htmlspecialchars($category->name); ?>
</option>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
</select>
</div>
<div>
<button type="button" id="pm-save-all" class="button button-primary">Save All Changes</button>
<button type="button" id="pm-refresh" class="button">Refresh</button>
</div>
</div>
<!-- Products Table -->
<div class="pm-table-container">
<table class="wp-list-table widefat fixed striped" id="pm-products-table">
<thead>
<tr>
<th class="check-column"><input type="checkbox" id="pm-select-all"></th>
<th>Image</th>
<th>Name</th>
<th>SKU</th>
<th>Regular Price</th>
<th>Sale Price</th>
<th>Stock</th>
<th>Status</th>
<th>Categories</th>
<th>Tags</th>
<th>Weight</th>
<th>Short Description</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="pm-products-tbody">
<!-- Products will be loaded here via JavaScript -->
<tr>
<td colspan="13" style="text-align: center; padding: 20px;">
<div class="pm-loading" style="color: #666;">
<span class="spinner is-active" style="float: none; margin-right: 10px;"></span>
Loading products...
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Pagination Controls -->
<div class="pm-pagination" style="margin: 20px 0; padding: 15px; background: white; border: 1px solid #ccd0d4; text-align: center;">
<div style="display: flex; justify-content: space-between; align-items: center;">
<div class="pm-pagination-info">
<span>Showing <strong id="pm-current-start">1</strong> to <strong id="pm-current-end">10</strong> of <strong id="pm-total-products"><?php echo isset($products) && is_array($products) ? count($products) : 0; ?></strong> products</span>
</div>
<div class="pm-pagination-controls">
<button type="button" id="pm-first-page" class="button" title="First Page">«</button>
<button type="button" id="pm-prev-page" class="button" title="Previous Page">‹</button>
<span style="margin: 0 10px;">
Page <input type="number" id="pm-current-page" value="1" min="1" style="width: 50px; text-align: center;">
of <span id="pm-total-pages">1</span>
</span>
<button type="button" id="pm-next-page" class="button" title="Next Page">›</button>
<button type="button" id="pm-last-page" class="button" title="Last Page">»</button>
</div>
<div class="pm-pagination-size">
<label for="pm-products-per-page">Products per page:</label>
<select id="pm-products-per-page" style="margin-left: 5px;">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100" selected>100</option>
</select>
</div>
</div>
</div>
<!-- Simple CSS -->
<style>
.pm-filters {
margin: 20px 0;
padding: 15px;
background: white;
border: 1px solid #ccd0d4;
border-radius: 4px;
}
.pm-field {
width: 100%;
max-width: 150px;
padding: 3px 6px;
border: 1px solid #ddd;
border-radius: 3px;
}
.pm-product-row:hover {
background-color: #f9f9f9;
}
</style>
<!-- Simple JavaScript -->
<script>
jQuery(document).ready(function($) {
$('#pm-refresh').click(function() {
location.reload();
});
$('#pm-select-all').change(function() {
$('.pm-product-checkbox').prop('checked', this.checked);
});
});
</script>
</div>