<a href="#" class="btn">Show</a> <ul> <li><a href="?plugin=CJApi/cj.php&action=links">Links</a></li> <li><a href="?plugin=CJApi/main.php&action=sales">Sales</a></li> <li><a href="?plugin=CJApi/options.php">Settings</a></li> </ul> </div> </div> <span>List of advertisers</span> </div>'; $csrf = $_SESSION['cjapi_csrf'] = \site\utils::str_random(10); /** New Cj Client */ $cj = new \plugin\CJApi\inc\client(\query\main::get_option('cj_key')); /** */ echo '<div class="page-toolbar"> <form action="#" method="GET" autocomplete="off"> <input type="hidden" name="plugin" value="CJApi/cj.php" /> <input type="hidden" name="action" value="list" /> 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> '; if (isset($_GET['search'])) { echo '<input type="hidden" name="search" value="' . htmlspecialchars($_GET['search']) . '" />'; }
<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="options"> <a href="#" class="btn">Show</a> <ul> <li><a href="?plugin=CJApi/cj.php&action=links">Links</a></li> <li><a href="?plugin=CJApi/main.php&action=sales">Sales</a></li> <li><a href="?plugin=CJApi/options.php">Settings</a></li> </ul> </div> </div> <span>Sales generated by this website or all your websites</span> </div>'; /** New Cj Client */ $cj = new \plugin\CJApi\inc\client(\query\main::get_option('cj_key')); /** */ echo '<div class="page-toolbar"> <form action="#" method="GET" autocomplete="off"> <input type="hidden" name="plugin" value="CJApi/main.php" /> <input type="hidden" name="action" value="sales" /> <select name="interval">'; for ($i = 0; $i <= 12; $i++) { echo '<option value="' . ($date = date('Y-m-01', $time = strtotime('-' . $i . ' month')) . ',' . date('Y-m-d', $time = strtotime('last day of -' . $i . ' month'))) . '"' . (isset($_GET['interval']) && urldecode($_GET['interval']) == $date ? ' selected' : '') . '>' . date('F, Y', $time) . '</option>'; } echo '</select> Website: '; $websites = array(0 => 'All'); if (($website = \query\main::get_option('cj_site-id')) && !empty($website)) {