<?php echo '</div>'; } elseif ($model->affiliateWithdrawalDone()) { echo '<div class="updated settings-error">'; ?> <p><?php echo bsa_get_trans('affiliate_program', 'success'); ?> </p> <?php echo '</div>'; } ?> <?php if (bsa_role() == 'user') { ?> <form action="" method="post" class="bsaNewWithdrawal" style="display: none"> <input type="hidden" value="affiliateNewWithdrawal" name="bsaProAction"> <input type="hidden" value="<?php echo get_current_user_id(); ?> " name="orderId"> <table class="bsaAdminTable form-table"> <tbody class="bsaTbody"> <tr> <th scope="row"><label><?php echo bsa_get_trans('affiliate_program', 'earnings'); ?> </label></th> <td>
$before = ''; } if (get_option('bsa_pro_plugin_symbol_position') != 'before') { $after = ' <small>' . get_option('bsa_pro_plugin_currency_symbol') . '</small>'; } else { $after = ''; } $model = new BSA_PRO_Model(); $countSpaces = $model->countSpaces(); $countAds = $model->countAds(); $countEarnings = $model->countEarnings(); $getPendingAds = $model->getPendingAds('admin_dashboard'); $getLastAds = $model->getLastAds(); $getAffiliateWithdrawals = $model->getAffiliateWithdrawals('pending', bsa_role()); $getSites = $model->getSites(bsa_role(), 'pending'); $getWithdrawals = $model->getWithdrawals('pending', bsa_role()); ?> <div style="float:right;"> <strong><a href="http://codecanyon.net/item/ads-pro-multipurpose-wordpress-ad-manager/10275010?ref=scripteo">ADS PRO</a></strong> - Version <?php echo get_option('bsa_pro_plugin_version'); ?> </div> <h2> <i class="dashicons dashicons-megaphone"></i> ADS PRO - Dashboard </h2> <div class="bsaDashboard"> <div class="bsaDashboard-stats"> <div class="bsaDashboard-stat"> <div class="bsaDashboard-inner greenBg"> <span class="dashicons dashicons-welcome-widgets-menus"></span> <span class="bsaDashboard-title">Spaces / Ads</span>
public function form($instance) { if (bsa_role() == 'admin') { // Check values if ($instance) { $shortcode = esc_attr($instance['shortcode']); } else { $shortcode = ''; } ?> <p> <label for="<?php echo $this->get_field_id('shortcode'); ?> "><?php _e('Shortcode', 'wp_widget_plugin'); ?> </label><br> <input id="<?php echo $this->get_field_id('shortcode'); ?> " name="<?php echo $this->get_field_name('shortcode'); ?> " style="width:100%;" value="<?php echo $shortcode; ?> " /> </p> <?php } else { echo "<p>You haven't permission to manage ads.</p>"; } }
public function getUserSpaces($columns = 'id', $adm_type = NULL) { $table_name = $this->getTableName('spaces'); if ($adm_type == NULL) { // USER - MARKETING AGENCY if ($this->getUserSites('id', 'user') != NULL) { $sql = "SELECT {$columns}\n\t\t\t\tFROM {$table_name}\n\t\t\t\tWHERE `site_id` IN ({$this->getUserSites('id', bsa_role())}) AND `status` != 'blocked'"; } else { $sql = "SELECT {$columns}\n\t\t\t\tFROM {$table_name}\n\t\t\t\tWHERE `status` != 'blocked'"; } } elseif ($adm_type == 'admin_dashboard') { // GET ADMIN SPACES - DASHBOARD $sql = "SELECT {$columns}\n\t\t\tFROM {$table_name}\n\t\t\tWHERE site_id IS NULL AND status != 'blocked' OR site_id IS NULL AND status != 'blocked'"; } elseif ($adm_type == 'admin') { // GET ADMIN SPACES - MARKETING AGENCY if ($this->getUserSites('id', 'user') != NULL) { $sql = "SELECT {$columns}\n\t\t\t\tFROM {$table_name}\n\t\t\t\tWHERE `site_id` IS NULL AND `status` != 'blocked' OR `site_id` IN ({$this->getUserSites('id', 'user')}) AND `status` != 'blocked'"; } else { $sql = "SELECT {$columns}\n\t\t\t\tFROM {$table_name}\n\t\t\t\tWHERE `site_id` IS NULL AND `status` != 'blocked'"; } } if ($this->wpdb->get_results($sql, ARRAY_A)) { $spaces = ''; foreach ($this->wpdb->get_results($sql, ARRAY_A) as $key => $space) { $spaces .= ($key > 0 ? ',' : '') . $space['id']; } return $spaces; } else { return 0; } }
function bsa_pro_create_menu() { if (is_multisite() && is_main_site() || !is_multisite()) { $count = strlen(get_option('bsa_pro_plugin_purchase_code')); $icon_url = plugins_url('../frontend/img/bsa-icon.png', __FILE__); $role = bsa_role() == 'admin' ? 'a' : 'u'; $affiliate_name = bsa_get_trans('affiliate_program', 'affiliate'); add_menu_page('ADS PRO - Dashboard', 'ADS PRO', 'manage_options', 'bsa-pro-sub-menu', 'bsa_pro_head_menu', $icon_url, 100.77477); add_submenu_page('bsa-pro-sub-menu', 'Spaces and Ads', 'Spaces and Ads', 'manage_options', 'bsa-pro-sub-menu-spaces', 'bsa_pro_sub_menu_spaces'); add_submenu_page('bsa-pro-sub-menu', 'Add new Space', 'Add new Space', 'manage_options', 'bsa-pro-sub-menu-add-new-space', 'bsa_pro_sub_menu_add_new_space'); add_submenu_page('bsa-pro-sub-menu', 'Add new Ad', 'Add new Ad', 'read', 'bsa-pro-sub-menu-add-new-ad', 'bsa_pro_sub_menu_add_new_ad'); if ($count == 36) { add_submenu_page('bsa-pro-sub-menu', 'Standard Ad Creator', 'Standard Ad Creator', 'manage_options', 'bsa-pro-sub-menu-creator', 'bsa_pro_sub_menu_creator'); add_submenu_page('bsa-pro-sub-menu', 'Ads Schedule', 'Ads Schedule', 'manage_options', 'bsa-pro-sub-menu-cron', 'bsa_pro_sub_menu_cron'); add_submenu_page('bsa-pro-sub-menu', 'A/B Tests', 'A/B Tests', 'manage_options', 'bsa-pro-sub-menu-ab-tests', 'bsa_pro_sub_menu_ab_tests'); add_submenu_page('bsa-pro-sub-menu', $role == 'a' ? 'Users Manager' : 'Your Ads', $role == 'a' ? 'Users Manager' : 'Your Ads', 'read', 'bsa-pro-sub-menu-users', 'bsa_pro_sub_menu_users'); if (is_plugin_active('bsa-pro-ap-scripteo/bsa-pro-ap.php')) { add_submenu_page('bsa-pro-sub-menu', $affiliate_name != '' ? $affiliate_name : 'Affiliate Program', $affiliate_name != '' ? $affiliate_name : 'Affiliate Program', 'read', 'bsa-pro-sub-menu-affiliate', 'bsa_pro_sub_menu_affiliate'); } } add_submenu_page('bsa-pro-sub-menu', 'Settings', 'Settings', 'manage_options', 'bsa-pro-sub-menu-opts', 'bsa_pro_sub_menu_settings'); add_submenu_page('bsa-pro-sub-menu', 'Translations', 'Translations', 'manage_options', 'bsa-pro-sub-menu-trans', 'bsa_pro_sub_menu_translations'); // add_submenu_page('bsa-pro-sub-menu', 'Updates', 'Updates', 'manage_options', 'bsa-pro-sub-menu-upd', 'bsa_pro_sub_menu_updates'); } }
if (get_option('bsa_pro_plugin_symbol_position') == 'before') { $before = get_option('bsa_pro_plugin_currency_symbol'); } else { $before = ''; } if (get_option('bsa_pro_plugin_symbol_position') != 'before') { $after = get_option('bsa_pro_plugin_currency_symbol'); } else { $after = ''; } $getUsers = $model->getUsersList(); $getUserActiveAds = $model->getUserAds(get_current_user_id()); $getUserPendingAds = $model->getUserAds(get_current_user_id(), 'pending'); $get_free_ads = $model->getUserCol(get_current_user_id(), 'free_ads'); if (bsa_role() == 'admin') { // ADMIN SECTION ?> <h2> <span class="dashicons dashicons-admin-users"></span> Users Manager <?php if (isset($_GET['bsa-form']) && $_GET['bsa-form'] == 'free-ads') { ?> - Set free ads <?php } elseif (isset($_GET['bsa-form']) && $_GET['bsa-form'] == 'give-access') { ?> - Set access to ads <?php }
function ads_pro_bar_link($wp_admin_bar) { if (get_option('bsa_pro_plugin_' . 'link_bar') != 'yes' && is_multisite() && is_main_site() || get_option('bsa_pro_plugin_' . 'link_bar') != 'yes' && !is_multisite() || get_option('bsa_pro_plugin_' . 'link_bar') != 'yes' && get_current_blog_id() != 1 && is_main_site(1)) { $model = new BSA_PRO_Model(); $get_free_ads = $model->getUserCol(get_current_user_id(), 'free_ads'); $free_ads = bsa_role() == 'admin' ? null : '(' . get_option('bsa_pro_plugin_trans_free_ads') . ' ' . ($get_free_ads['free_ads'] > 0 ? $get_free_ads['free_ads'] : 0) . ')'; $link = bsa_role() == 'admin' ? 'admin.php?page=bsa-pro-sub-menu' : 'admin.php?page=bsa-pro-sub-menu-users'; $args = array('id' => 'ads_pro_bar_link', 'title' => '<img src="' . plugins_url('../frontend/img/bsa-icon.png', __FILE__) . '" alt="" style="width:16px;display:inline-block;"> ADS PRO ' . $free_ads, 'href' => get_admin_url(1) . $link, 'meta' => array('class' => 'ads_pro_bar_link'), 'icon' => plugins_url('../frontend/img/bsa-icon.png', __FILE__)); if ($get_free_ads['free_ads'] >= 0 or bsa_role() == 'admin') { $wp_admin_bar->add_node($args); } } }
function bsa_get_billing_models_callback() { if (get_option('bsa_pro_plugin_symbol_position') == 'before') { $before = get_option('bsa_pro_plugin_currency_symbol'); } else { $before = ''; } if (get_option('bsa_pro_plugin_symbol_position') != 'before') { $after = get_option('bsa_pro_plugin_currency_symbol'); } else { $after = ''; } if ($_POST && $_POST['bsa_space_id']) { $sid = $_POST['bsa_space_id']; $admin = isset($_POST['bsa_pro_admin']) ? $_POST['bsa_pro_admin'] : null; // if admin panel echo '<div class="bsaProInputsGroup bsaProInputsBillingModel">'; if (bsa_space($sid, 'cpc_price') != NULL && bsa_space($sid, 'cpc_price') != 0.0 || $admin == 1 && bsa_space($sid, 'cpc_price') == 0.0 && bsa_role() == 'admin') { echo ' <div class="bsaProInput"> <div class="bsaInputInner bsaInputInnerModel"> <input id="bsa_pro_cpc_model" type="radio" name="ad_model" value="cpc" onchange="selectBillingModel()"> <label for="bsa_pro_cpc_model">' . get_option("bsa_pro_plugin_trans_" . "form_right_cpc_name") . '</label> </div> </div>'; } if (bsa_space($sid, 'cpm_price') != NULL && bsa_space($sid, 'cpm_price') != 0.0 || $admin == 1 && bsa_space($sid, 'cpm_price') == 0.0 && bsa_role() == 'admin') { echo ' <div class="bsaProInput"> <div class="bsaInputInner bsaInputInnerModel"> <input id="bsa_pro_cpm_model" type="radio" name="ad_model" value="cpm" onchange="selectBillingModel()"> <label for="bsa_pro_cpm_model">' . get_option("bsa_pro_plugin_trans_" . "form_right_cpm_name") . '</label> </div> </div>'; } if (bsa_space($sid, 'cpd_price') != NULL && bsa_space($sid, 'cpd_price') != 0.0 || $admin == 1 && bsa_space($sid, 'cpd_price') == 0.0 && bsa_role() == 'admin') { echo ' <div class="bsaProInput"> <div class="bsaInputInner bsaInputInnerModel"> <input id="bsa_pro_cpd_model" type="radio" name="ad_model" value="cpd" onchange="selectBillingModel()"> <label for="bsa_pro_cpd_model">' . get_option("bsa_pro_plugin_trans_" . "form_right_cpd_name") . '</label> </div> </div>'; } do_action('bsa-pro-billing-models-callback', $sid); echo '</div>'; if (bsa_space($sid, 'cpc_price') != NULL && bsa_space($sid, 'cpc_price') != 0.0 || $admin == 1 && bsa_space($sid, 'cpc_price') == 0.0 && bsa_role() == 'admin') { echo '<div class="bsaProInputsGroup bsaProInputsValues bsaProInputsValuesCPC" style="display: none;">'; do_action('bsa-pro-billing-models-before', $sid, 'cpc', $before, $after); if (bsa_space($sid, 'cpc_contract_1') != NULL && bsa_space($sid, 'cpc_contract_1') != 0) { echo ' <div class="bsaProInput"> <div class="bsaInputInner"> <input id="bsa_pro_ad_limit_cpc_1" type="radio" name="ad_limit_cpc" value="' . bsa_space($sid, 'cpc_contract_1') . '"> <label for="bsa_pro_ad_limit_cpc_1"> <span class="bsaProExpiration">' . bsa_space($sid, 'cpc_contract_1') . ' ' . get_option("bsa_pro_plugin_trans_" . "form_right_clicks") . '</span> '; if (isset($_POST['bsa_order'])) { echo '<span class="bsaProPrice">' . $before . bsa_number_format(bsa_space($sid, 'cpc_price')) . $after . '</span>'; } echo ' </label> </div> </div>'; } elseif ($admin == 1 && bsa_space($sid, 'cpc_price') == 0.0 && bsa_role() == 'admin') { echo ' <div class="bsaProInput"> <div class="bsaInputInner"> <label for="bsa_pro_ad_limit_cpc_1">Display Limit (clicks)</label> <input id="bsa_pro_ad_limit_cpc_1" type="number" name="ad_limit_cpc" value="" style="margin-top:10px;width: 100%;"> </div> </div>'; } if (bsa_space($sid, 'cpc_contract_2') != NULL && bsa_space($sid, 'cpc_contract_2') != 0) { echo ' <div class="bsaProInput"> <div class="bsaInputInner"> <input id="bsa_pro_ad_limit_cpc_2" type="radio" name="ad_limit_cpc" value="' . bsa_space($sid, 'cpc_contract_2') . '"> <label for="bsa_pro_ad_limit_cpc_2"> <span class="bsaProExpiration">' . bsa_space($sid, 'cpc_contract_2') . ' ' . get_option("bsa_pro_plugin_trans_" . "form_right_clicks") . '</span>'; if (isset($_POST['bsa_order'])) { $cpc_2 = bsa_space($sid, 'cpc_price') * (bsa_space($sid, 'cpc_contract_2') / bsa_space($sid, 'cpc_contract_1')); $d_cpc_2 = bsa_space($sid, 'discount_2') > 0 ? $cpc_2 * (bsa_space($sid, 'discount_2') / 100) : 0; echo '<span class="bsaProPrice">' . $before . bsa_number_format($cpc_2 - $d_cpc_2) . $after . '</span>'; if (bsa_space($sid, 'discount_2') > 0) { echo '<span class="bsaProDiscount">(-' . bsa_space($sid, 'discount_2') . '%)</span>'; } } echo ' </label> </div> </div>'; } if (bsa_space($sid, 'cpc_contract_3') != NULL && bsa_space($sid, 'cpc_contract_3') != 0) { echo ' <div class="bsaProInput"> <div class="bsaInputInner"> <input id="bsa_pro_ad_limit_cpc_3" type="radio" name="ad_limit_cpc" value="' . bsa_space($sid, 'cpc_contract_3') . '"> <label for="bsa_pro_ad_limit_cpc_3"> <span class="bsaProExpiration">' . bsa_space($sid, 'cpc_contract_3') . ' ' . get_option("bsa_pro_plugin_trans_" . "form_right_clicks") . '</span>'; if (isset($_POST['bsa_order'])) { $cpc_3 = bsa_space($sid, 'cpc_price') * (bsa_space($sid, 'cpc_contract_3') / bsa_space($sid, 'cpc_contract_1')); $d_cpc_3 = bsa_space($sid, 'discount_3') > 0 ? $cpc_3 * (bsa_space($sid, 'discount_3') / 100) : 0; echo '<span class="bsaProPrice">' . $before . bsa_number_format($cpc_3 - $d_cpc_3) . $after . '</span>'; if (bsa_space($sid, 'discount_3') > 0) { echo '<span class="bsaProDiscount">(-' . bsa_space($sid, 'discount_3') . '%)</span>'; } } echo ' </label> </div> </div>'; } echo '</div>'; } if (bsa_space($sid, 'cpm_price') != NULL && bsa_space($sid, 'cpm_price') != 0.0 || $admin == 1 && bsa_space($sid, 'cpm_price') == 0.0 && bsa_role() == 'admin') { echo '<div class="bsaProInputsGroup bsaProInputsValues bsaProInputsValuesCPM" style="display: none;">'; do_action('bsa-pro-billing-models-before', $sid, 'cpm', $before, $after); if (bsa_space($sid, 'cpm_contract_1') != NULL && bsa_space($sid, 'cpm_contract_1') != 0) { echo ' <div class="bsaProInput"> <div class="bsaInputInner"> <input id="bsa_pro_ad_limit_cpm_1" type="radio" name="ad_limit_cpm" value="' . bsa_space($sid, 'cpm_contract_1') . '"> <label for="bsa_pro_ad_limit_cpm_1"> <span class="bsaProExpiration">' . bsa_space($sid, 'cpm_contract_1') . ' ' . get_option("bsa_pro_plugin_trans_" . "form_right_views") . '</span> '; if (isset($_POST['bsa_order'])) { echo '<span class="bsaProPrice">' . $before . bsa_number_format(bsa_space($sid, 'cpm_price')) . $after . '</span>'; } echo ' </label> </div> </div>'; } elseif ($admin == 1 && bsa_space($sid, 'cpm_price') == 0.0 && bsa_role() == 'admin') { echo ' <div class="bsaProInput"> <div class="bsaInputInner"> <label for="bsa_pro_ad_limit_cpm_1">Display Limit (views)</label> <input id="bsa_pro_ad_limit_cpm_1" type="number" name="ad_limit_cpm" value="" style="margin-top:10px;width: 100%;"> </div> </div>'; } if (bsa_space($sid, 'cpm_contract_2') != NULL && bsa_space($sid, 'cpm_contract_2') != 0) { echo ' <div class="bsaProInput"> <div class="bsaInputInner"> <input id="bsa_pro_ad_limit_cpm_2" type="radio" name="ad_limit_cpm" value="' . bsa_space($sid, 'cpm_contract_2') . '"> <label for="bsa_pro_ad_limit_cpm_2"> <span class="bsaProExpiration">' . bsa_space($sid, 'cpm_contract_2') . ' ' . get_option("bsa_pro_plugin_trans_" . "form_right_views") . '</span>'; if (isset($_POST['bsa_order'])) { $cpm_2 = bsa_space($sid, 'cpm_price') * (bsa_space($sid, 'cpm_contract_2') / bsa_space($sid, 'cpm_contract_1')); $d_cpm_2 = bsa_space($sid, 'discount_2') > 0 ? $cpm_2 * (bsa_space($sid, 'discount_2') / 100) : 0; echo '<span class="bsaProPrice">' . $before . bsa_number_format($cpm_2 - $d_cpm_2) . $after . '</span>'; if (bsa_space($sid, 'discount_2') > 0) { echo '<span class="bsaProDiscount">(-' . bsa_space($sid, 'discount_2') . '%)</span>'; } } echo ' </label> </div> </div>'; } if (bsa_space($sid, 'cpm_contract_3') != NULL && bsa_space($sid, 'cpm_contract_3') != 0) { echo ' <div class="bsaProInput"> <div class="bsaInputInner"> <input id="bsa_pro_ad_limit_cpm_3" type="radio" name="ad_limit_cpm" value="' . bsa_space($sid, 'cpm_contract_3') . '"> <label for="bsa_pro_ad_limit_cpm_3"> <span class="bsaProExpiration">' . bsa_space($sid, 'cpm_contract_3') . ' ' . get_option("bsa_pro_plugin_trans_" . "form_right_views") . '</span>'; if (isset($_POST['bsa_order'])) { $cpm_3 = bsa_space($sid, 'cpm_price') * (bsa_space($sid, 'cpm_contract_3') / bsa_space($sid, 'cpm_contract_1')); $d_cpm_3 = bsa_space($sid, 'discount_3') > 0 ? $cpm_3 * (bsa_space($sid, 'discount_3') / 100) : 0; echo '<span class="bsaProPrice">' . $before . bsa_number_format($cpm_3 - $d_cpm_3) . $after . '</span>'; if (bsa_space($sid, 'discount_3') > 0) { echo '<span class="bsaProDiscount">(-' . bsa_space($sid, 'discount_3') . '%)</span>'; } } echo ' </label> </div> </div>'; } echo '</div>'; } if (bsa_space($sid, 'cpd_price') != NULL && bsa_space($sid, 'cpd_price') != 0.0 || $admin == 1 && bsa_space($sid, 'cpd_price') == 0.0 && bsa_role() == 'admin') { echo '<div class="bsaProInputsGroup bsaProInputsValues bsaProInputsValuesCPD" style="display: none;">'; do_action('bsa-pro-billing-models-before', $sid, 'cpd', $before, $after); if (bsa_space($sid, 'cpd_contract_1') != NULL && bsa_space($sid, 'cpd_contract_1') != 0) { echo ' <div class="bsaProInput"> <div class="bsaInputInner"> <input id="bsa_pro_ad_limit_cpd_1" type="radio" name="ad_limit_cpd" value="' . bsa_space($sid, 'cpd_contract_1') . '"> <label for="bsa_pro_ad_limit_cpd_1"> <span class="bsaProExpiration">' . bsa_space($sid, 'cpd_contract_1') . ' ' . get_option("bsa_pro_plugin_trans_" . "form_right_days") . '</span>'; if (isset($_POST['bsa_order'])) { echo '<span class="bsaProPrice">' . $before . bsa_number_format(bsa_space($sid, 'cpd_price')) . $after . '</span>'; } echo ' </label> </div> </div>'; } elseif ($admin == 1 && bsa_space($sid, 'cpd_price') == 0.0 && bsa_role() == 'admin') { echo ' <div class="bsaProInput"> <div class="bsaInputInner"> <label for="bsa_pro_ad_limit_cpd_1">Display Limit (days)</label> <input id="bsa_pro_ad_limit_cpd_1" type="number" name="ad_limit_cpd" value="" style="margin-top:10px;width: 100%;"> </div> </div>'; } if (bsa_space($sid, 'cpd_contract_2') != NULL && bsa_space($sid, 'cpd_contract_2') != 0) { echo ' <div class="bsaProInput"> <div class="bsaInputInner"> <input id="bsa_pro_ad_limit_cpd_2" type="radio" name="ad_limit_cpd" value="' . bsa_space($sid, 'cpd_contract_2') . '"> <label for="bsa_pro_ad_limit_cpd_2"> <span class="bsaProExpiration">' . bsa_space($sid, 'cpd_contract_2') . ' ' . get_option("bsa_pro_plugin_trans_" . "form_right_days") . '</span>'; if (isset($_POST['bsa_order'])) { $cpd_2 = bsa_space($sid, 'cpd_price') * (bsa_space($sid, 'cpd_contract_2') / bsa_space($sid, 'cpd_contract_1')); $d_cpd_2 = bsa_space($sid, 'discount_2') > 0 ? $cpd_2 * (bsa_space($sid, 'discount_2') / 100) : 0; echo '<span class="bsaProPrice">' . $before . bsa_number_format($cpd_2 - $d_cpd_2) . $after . '</span>'; if (bsa_space($sid, 'discount_2') > 0) { echo '<span class="bsaProDiscount">(-' . bsa_space($sid, 'discount_2') . '%)</span>'; } } echo ' </label> </div> </div>'; } if (bsa_space($sid, 'cpd_contract_3') != NULL && bsa_space($sid, 'cpd_contract_3') != 0) { echo ' <div class="bsaProInput"> <div class="bsaInputInner"> <input id="bsa_pro_ad_limit_cpd_3" type="radio" name="ad_limit_cpd" value="' . bsa_space($sid, 'cpd_contract_3') . '"> <label for="bsa_pro_ad_limit_cpd_3"> <span class="bsaProExpiration">' . bsa_space($sid, 'cpd_contract_3') . ' ' . get_option("bsa_pro_plugin_trans_" . "form_right_days") . '</span>'; if (isset($_POST['bsa_order'])) { $cpd_3 = bsa_space($sid, 'cpd_price') * (bsa_space($sid, 'cpd_contract_3') / bsa_space($sid, 'cpd_contract_1')); $d_cpd_3 = bsa_space($sid, 'discount_3') > 0 ? $cpd_3 * (bsa_space($sid, 'discount_3') / 100) : 0; echo '<span class="bsaProPrice">' . $before . bsa_number_format($cpd_3 - $d_cpd_3) . $after . '</span>'; if (bsa_space($sid, 'discount_3') > 0) { echo '<span class="bsaProDiscount">(-' . bsa_space($sid, 'discount_3') . '%)</span>'; } } echo ' </label> </div> </div>'; } echo '</div>'; } if (isset($_POST['bsa_order'])) { do_action('bsa-pro-billing-models-callback-sub', $sid, $_POST['bsa_order'], $before, $after); } } else { echo 'Spaces can not be download.'; } die; }
<?php $model = new BSA_PRO_Model(); $role = bsa_role() == 'admin' ? 'a' : 'u'; $decode_ids = $model->getUserCol(get_current_user_id()); $get_ids = json_decode($decode_ids['ad_ids']); $get_free_ads = $model->getUserCol(get_current_user_id(), 'free_ads'); function getAdValue($val) { if (isset($_GET['ad_id'])) { return bsa_ad($_GET['ad_id'], $val); } else { if (isset($_POST[$val]) || isset($_SESSION['bsa_ad_status'])) { if (isset($_SESSION['bsa_ad_status']) == 'ad_added') { $_SESSION['bsa_clear_form'] = 'ad_added'; unset($_SESSION['bsa_ad_status']); } $status = isset($_SESSION['bsa_clear_form']) ? $_SESSION['bsa_clear_form'] : ''; if ($status == 'ad_added') { return ''; } else { return $_POST[$val]; } } else { return ''; } } } ?> <h2> <?php