<div class="row"><span>Developer Key: <span class="info"><span>Developer keys can be generated at <a href="https://api.cj.com" target="_blank" style="color: #FFF;">api.cj.com</a></span></span></span><div><input type="text" name="key" value="' . htmlspecialchars(\query\main::get_option('cj_key')) . '" style="background: #F8E0E0;" required /></div></div> <div class="row"><span>Site ID: <span class="info"><span>To see your website ID, log into your <a href="//cj.com" target="_blank" style="color: #FFF;">cj.com</a> account, then go in section <i>Account</i> and select <i>Websites.</i></span></span></span><div><input type="text" name="site-id" value="' . htmlspecialchars(\query\main::get_option('cj_site-id')) . '" style="background: #F8E0E0;" required /></div></div> <div class="row"><span>Deals Expiration (days) <span class="info"><span>Deals and some coupons do have not set an expiration date. This will be set automatically after a number of days that you can define here. It can be changed in preview mode.</span></span>:</span><div><input type="number" name="exp" value="' . (int) \query\main::get_option('cj_exp') . '" min="1" max="1000" required /></div></div> <div class="row"><span>Items Per Page:</span><div><input type="number" name="ipp" value="' . (int) \query\main::get_option('cj_ipp') . '" min="1" max="100" required /></div></div> </div>'; echo '<input type="hidden" name="csrf" value="' . $csrf . '" /> <button class="btn">Save</button> </form><br><br><br> <div class="title"> <h2>Category Mapping</h2> <span>Category Mapping for Data Automation</span> </div>'; $cj = new \plugin\CJApi\inc\client(\query\main::get_option('cj_key')); $categories_cj = $cj->categories(); $category_mapping = \plugin\CJApi\inc\actions::listCategoryMapping(); foreach ($categories_cj as $category) { if (!isset($category_mapping[$category])) { $category_mapping[$category] = 0; } } $categories_while = \query\main::while_categories(array('max' => 0, 'show' => 'subcats')); echo '<select name="template_category" style="display:none;">'; foreach ($categories_while as $cat) { echo '<option value="' . $cat->ID . '">' . $cat->name . '</option>'; } echo '</select> <input type="button" value="OK" name="template_category_OK" style="display:none;"><input type="button" value="Cancel" name="template_category_Cancel" style="display:none;"> <form action="#" method="POST"> <div class="form-table">';
<form action="#" method="GET" autocomplete="off"> <input type="hidden" name="plugin" value="CJApi/cj.php" /> <input type="hidden" name="action" value="links" /> View: <select name="view">'; foreach ($views = array('joined' => 'Joined', 'notjoined' => 'Not Joined') as $k => $v) { echo '<option value="' . $k . '"' . (isset($_GET['view']) && urldecode($_GET['view']) == $k || !isset($_GET['view']) && $k == 'joined' ? ' selected' : '') . '>' . $v . '</option>'; } echo '</select> '; echo 'Type: <select name="type">'; foreach ($types = array('' => 'All', 'coupon' => 'Coupon', 'sweepstakes' => 'Sweepstakes', 'product' => 'Product', 'sale/discount' => 'Sale/Discount', 'free shipping' => 'Free Shipping', 'seasonal link' => 'Seasonal') as $k => $v) { echo '<option value="' . $k . '"' . (isset($_GET['type']) && urldecode($_GET['type']) == $k ? ' selected' : '') . '>' . $v . '</option>'; } echo '</select> '; try { $categories = $cj->categories(); echo 'Category: <select name="category" style="max-width: 160px;"> <option value="">All</option>'; foreach ($categories as $v) { echo '<option value="' . $v . '"' . (isset($_GET['category']) && urldecode($_GET['category']) == $v ? ' selected' : '') . '>' . $v . '</option>'; } echo '</select> '; } catch (Exception $e) { $categories = array(); } if (isset($_GET['search'])) { echo '<input type="hidden" name="search" value="' . htmlspecialchars($_GET['search']) . '" />'; } if (isset($_GET['ids'])) { echo '<input type="hidden" name="ids" value="' . htmlspecialchars($_GET['ids']) . '" />'; }