public function renderDupeTable($listings, $column = 'post_id') { if (empty($listings)) { return ''; } // get current page with paging as url param $page = $_REQUEST['page']; if (isset($_REQUEST['paged'])) { $page .= '&paged=' . $_REQUEST['paged']; } $msg = ''; foreach ($listings as $dupe) { $account_title = WPLE_eBayAccount::getAccountTitle($dupe->account_id); $msg .= '<b>' . __('Listings for product', 'wplister') . ' #' . $dupe->post_id . ' (' . $account_title . '):</b>'; $msg .= '<br>'; $duplicateListings = WPLE_ListingQueryHelper::getAllListingsForProductAndAccount($dupe->post_id, $dupe->account_id); foreach ($duplicateListings as $listing) { $color = $listing->status == 'archived' ? 'silver' : ''; $msg .= '<span style="color:' . $color . '">'; $msg .= ' • '; $msg .= '' . $listing->auction_title . ''; if ($listing->ebay_id) { $msg .= ' (#' . $listing->ebay_id . ')'; } $msg .= ' – <i>' . $listing->status . '</i>'; $msg .= '<br>'; if (in_array($listing->status, array('prepared', 'verified', 'ended', 'sold'))) { $archive_link = sprintf('<a class="archive button button-small" href="?page=%s&action=%s&auction=%s">%s</a>', $page, 'archive', $listing->id, __('Click to move to archive', 'wplister')); $msg .= ' ' . $archive_link; $msg .= '<br>'; } if (in_array($listing->status, array('selected'))) { $delete_link = sprintf('<a class="delete button button-small button-primary" href="?page=%s&action=%s&auction=%s">%s</a>', $page, 'delete_listing', $listing->id, __('Click to remove this listing', 'wplister')); $msg .= ' ' . $delete_link; $msg .= '<br>'; } $msg .= '</span>'; } $msg .= '<br>'; } return $msg; }