Example #1
0
function get_order_ads($sid, $column)
{
    if (isset($sid) && bsa_space($sid, 'order_ads') == $column) {
        return 'bsaOrderActive';
    } else {
        return null;
    }
}
Example #2
0
     echo '<div class="bsaProItemInner" style="background-color:' . bsa_space($sid, 'ad_bg') . '">';
     // -- START -- ITEM INNER
     echo '<div class="bsaProItemInner__thumb">';
     // -- START -- ITEM THUMB
     echo '<div class="bsaProItemInner__img" style="background-image: url(&#39;' . bsa_crop_tool($crop, !isset($sid) && !isset($_POST['bsa_ad_id']) || isset($example) ? $ad['img'] : bsa_upload_url() . $ad['img'], 550, 350) . '&#39;)"></div>';
     // -- ITEM -- IMG
     echo '</div>';
     // -- END -- ITEM THUMB
     echo '<div class="bsaProItemInner__copy">';
     // -- START -- ITEM COPY
     echo '<div class="bsaProItemInner__copyInnerBg" style="background-color:' . bsa_space($sid, 'ad_extra_color_1') . '"></div>';
     echo '<div class="bsaProItemInner__copyInner">';
     // -- START -- ITEM COPY INNER
     echo '<h3 class="bsaProItemInner__title" style="color:' . bsa_space($sid, 'ad_title_color') . '">' . $ad['title'] . '</h3>';
     // -- ITEM -- TITLE
     echo '<p class="bsaProItemInner__desc" style="color:' . bsa_space($sid, 'ad_desc_color') . '">' . $ad['description'] . '</p>';
     // -- ITEM -- DESCRIPTION
     echo '</div>';
     // -- END -- ITEM COPY INNER
     echo '</div>';
     // -- END -- ITEM COPY
     echo '</div>';
     // -- END -- ITEM INNER
     echo '</a>';
     // -- END -- LINK
     echo '</div>';
     // -- END -- ITEM
 }
 echo '</div>';
 // -- END -- ITEMS
 echo '</div>';
Example #3
0
     echo '</div>';
     echo '</div>';
     // -- END -- ITEM IMG
     echo '</div>';
     echo '</div>';
     // -- END -- ITEM THUMB
     echo '<div class="bsaProItemInner__copy">';
     // -- START -- ITEM COPY
     echo '<div class="bsaProItemInner__copyInner">';
     // -- START -- ITEM COPY INNER
     echo '<h3 class="bsaProItemInner__title" style="color:' . bsa_space($sid, 'ad_title_color') . '">' . $ad['title'] . '</h3>';
     // -- ITEM -- TITLE
     echo '<p class="bsaProItemInner__desc" style="color:' . bsa_space($sid, 'ad_desc_color') . '">' . $ad['description'] . '</p>';
     // -- ITEM -- DESCRIPTION
     if ($ad['url'] != '' && $ad['url'] != '#') {
         echo '<span class="bsaProItemInner__url" style="color:' . bsa_space($sid, 'ad_url_color') . '">http://' . $url['host'] . '</span>';
         // -- ITEM -- URL
     }
     echo '</div>';
     // -- END -- ITEM COPY INNER
     echo '</div>';
     // -- END -- ITEM COPY
     echo '</div>';
     // -- END -- ITEM INNER
     echo '</a>';
     // -- END -- LINK
     echo '</div>';
     // -- END -- ITEM
 }
 echo '</div>';
 // -- END -- ITEMS
     if ($ad['url'] != '') {
         if (isset($example)) {
             // url to form if example in ad space
             echo '<a class="bsaProItem__url" href="' . $form_url . '" target="_blank">';
         } else {
             if (isset($type) && $type == 'agency') {
                 echo '<a href="' . $agency_form . (strpos($agency_form, '?') ? '&' : '?') . 'bsa_pro_id=' . $ad['id'] . '&bsa_pro_url=1" target="_blank" class="bsaProItem__url bsaProItemInner__btn btn-floating btn-large waves-effect waves-light" style="background-color:' . bsa_space($sid, 'ad_extra_color_1') . '">';
             } else {
                 echo '<a href="' . get_site_url() . (strpos(get_site_url(), '?') ? '&' : '?') . 'bsa_pro_id=' . $ad['id'] . '&bsa_pro_url=1" target="_blank" class="bsaProItem__url bsaProItemInner__btn btn-floating btn-large waves-effect waves-light" style="background-color:' . bsa_space($sid, 'ad_extra_color_1') . '">';
             }
         }
     } else {
         echo '<a href="#">';
     }
     // -- ITEM -- BTN
     echo '<i class="mdi-content-add" style="color:' . bsa_space($sid, 'ad_extra_color_2') . '"></i>';
     echo '</a>';
     // -- ITEM -- BTN
     echo '</div>';
     // -- END -- ITEM BUTTON INNER
     echo '</div>';
     // -- END -- ITEM BUTTON
     echo '</div>';
     // -- END -- ITEM INNER
     echo '</div>';
     // -- END -- ITEM
     //		echo '</a>'; // -- END -- LINK
 }
 echo '</div>';
 // -- END -- ITEMS
 echo '</div>';
Example #5
0
        echo '<p class="bsaProItemInner__desc" style="color:' . bsa_space($sid, 'ad_desc_color') . '">' . $ad['description'] . '</p>';
        // -- ITEM -- DESCRIPTION
        echo '</div>';
        // -- END -- ITEM COPY INNER
        echo '</div>';
        // -- END -- ITEM COPY
        echo '</div>';
        // -- END -- ITEM INNER
        echo '</a>';
        // -- END -- LINK
        echo '</div>';
        // -- END -- ITEM
    }
    echo '</div>';
    // -- END -- ITEMS
    echo '</div>';
    // -- END -- CONTAINER
    // -- END -- TEMPLATE HTML
}
$bgNote = bsa_space($sid, "ad_extra_color_1") != '' ? bsa_space($sid, "ad_extra_color_1") : NULL;
$borderNote = bsa_space($sid, "ad_extra_color_2") != '' ? bsa_space($sid, "ad_extra_color_2") . ' ' . bsa_space($sid, "ad_extra_color_2") . ' transparent transparent' : NULL;
echo '
<style>
#bsa-paper-note-1 .bsaProItemInner.bsaNote:before {
	background: ' . $bgNote . ';
}
#bsa-paper-note-1 .bsaProItemInner.bsaNote.bsaRounded:before {
	border-color: ' . $borderNote . ';
}
</style>
';
Example #6
0
 $agency_form = get_option('bsa_pro_plugin_agency_ordering_form_url');
 if ($ad['url'] != '') {
     if (isset($example)) {
         // url to form if example in ad space
         echo '<a class="bsaProItem__url" href="' . $form_url . '" target="_blank">';
     } else {
         if (isset($type) && $type == 'agency') {
             echo '<a class="bsaProItem__url" href="' . $agency_form . (strpos($agency_form, '?') ? '&' : '?') . 'bsa_pro_id=' . $ad['id'] . '&bsa_pro_url=1" target="_blank">';
         } else {
             echo '<a class="bsaProItem__url" href="' . get_site_url() . (strpos(get_site_url(), '?') ? '&' : '?') . 'bsa_pro_id=' . $ad['id'] . '&bsa_pro_url=1" target="_blank">';
         }
     }
 } else {
     echo '<a href="#">';
 }
 echo '<div class="bsaProItemInner" style="background-color:' . bsa_space($sid, 'ad_bg') . '">';
 // -- START -- ITEM INNER
 echo '<div class="bsaProItemInner__thumb">';
 // -- START -- ITEM THUMB
 echo '<div class="bsaProAnimateThumb animated">';
 echo '<div class="bsaProItemInner__img" style="background-image: url(&#39;' . bsa_crop_tool($crop, !isset($sid) && !isset($_POST['bsa_ad_id']) || isset($example) ? $ad['img'] : bsa_upload_url() . $ad['img'], 400, 300) . '&#39;)"></div>';
 // -- ITEM -- IMG
 echo '</div>';
 echo '</div>';
 // -- END -- ITEM THUMB
 echo '</div>';
 // -- END -- ITEM INNER
 echo '</a>';
 // -- END -- LINK
 echo '</div>';
 // -- END -- ITEM
Example #7
0
        echo bsa_pro_ad_space($id, $max_width, $delay, $padding_top, $attachment, $crop);
        // Print items
        ?>
<style>
	.bsaProContainer .bsaProItemInner__copy { font-family: Verdana, Arial, sans-serif; }
	<?php 
        echo get_option('bsa_pro_plugin_custom_css') != '' ? get_option('bsa_pro_plugin_custom_css') : null;
        ?>
	<?php 
        echo file_get_contents(plugin_dir_path(__FILE__) . '/../frontend/css/asset/style.css');
        ?>
	<?php 
        if (strpos(bsa_space($id, 'template'), 'material-design') !== false) {
            ?>
		<?php 
            echo file_get_contents(plugin_dir_path(__FILE__) . '/../frontend/css/asset/material-design.css');
            ?>
	<?php 
        }
        ?>
	<?php 
        echo file_get_contents(plugin_dir_path(__FILE__) . '/../frontend/css/' . bsa_space($id, 'template') . '.css');
        ?>
</style>
<?php 
    } else {
        echo '(error 705) No access to the API.';
    }
} else {
    echo '(error 704) No access to the API.';
}
Example #8
0
function ads_pro_ad_space_function($atts, $content = null)
{
    extract(shortcode_atts(array('id' => $atts['id'], 'max_width' => isset($atts['max_width']) ? $atts['max_width'] : null, 'delay' => isset($atts['delay']) ? $atts['delay'] : null, 'padding_top' => isset($atts['padding_top']) ? $atts['padding_top'] : null, 'attachment' => isset($atts['attachment']) ? $atts['attachment'] : null, 'crop' => isset($atts['crop']) ? $atts['crop'] : null, 'hide_for_id' => isset($atts['hide_for_id']) ? $atts['hide_for_id'] : null, 'if_empty' => isset($atts['if_empty']) ? $atts['if_empty'] : null), $atts));
    $content = wpb_js_remove_wpautop($content, true);
    // fix unclosed/unwanted paragraph tags in $content
    $id = "{$id}";
    $max_width = "{$max_width}";
    $delay = "{$delay}";
    $padding_top = "{$padding_top}";
    $attachment = "{$attachment}";
    $crop = "{$crop}";
    $hide_for_id = "{$hide_for_id}";
    $if_empty = "{$if_empty}";
    ob_start();
    if (get_option('bsa_pro_plugin_' . 'hide_if_logged') != 'yes' && is_user_logged_in() && in_array(get_the_ID(), explode(',', $hide_for_id), false) !== true || !is_user_logged_in() && in_array(get_the_ID(), explode(',', $hide_for_id), false) !== true) {
        // Hide for logged users or specific pages
        if ($content != null && bsa_space($id, 'display_type') == 'link') {
            ?>
			<style>
				.bsaProLink-<?php 
            echo $id;
            ?>
 .bsaProLinkHover-<?php 
            echo $id;
            ?>
 {
					left: 0;
					width: <?php 
            echo $max_width . 'px';
            ?>
;
				}
			</style>
			<?php 
            echo '<div class="bsaProLink bsaProLink-' . $id . '">' . $content . '<div class="bsaProLinkHover bsaProLinkHover-' . $id . '">';
        }
        $ad_space_1 = bsa_pro_ad_space($id, $max_width, $delay, $padding_top, $attachment, $crop, $hide_for_id, $if_empty);
        $ad_space_2 = null;
        if (isset($if_empty)) {
            $ad_space_2 = bsa_pro_ad_space($if_empty, $max_width, $delay, $padding_top, $attachment, $crop, $hide_for_id);
        }
        if ($ad_space_1 != null) {
            bsa_pro_ad_space($id, $max_width, $delay, $padding_top, $attachment, $crop, $hide_for_id, $if_empty);
        } elseif ($ad_space_2 != null) {
            bsa_pro_ad_space($if_empty, $max_width, $delay, $padding_top, $attachment, $crop, $hide_for_id);
        }
        //		bsa_pro_ad_space($id, $max_width, $delay, $padding_top, $attachment, $crop, $hide_for_id);
        if ($content != null && bsa_space($id, 'display_type') == 'link') {
            echo '</div></div>';
        }
    }
    return ob_get_clean();
}
 public function notifyAction($type = NULL)
 {
     if (empty($_POST)) {
         return;
     }
     $paymentId = isset($_GET['oid']) ? $_GET['oid'] : null;
     if (isset($_POST) && !isset($_POST['stripeToken'])) {
         // PayPal Verify
         $payment_crc = $_POST['custom'];
         try {
             $timestamp = time();
             $data = json_encode($_POST);
             $this->wpdb->update($this->getTableName('ads'), array('p_time' => $timestamp, 'p_data' => $data), array('id' => $paymentId));
             if ($payment_crc != md5($_POST['item_number'] . bsa_number_format($_POST['mc_gross']))) {
                 throw new \Exception('price changed');
             }
             if ($_POST['payment_status'] == 'Pending') {
                 throw new \Exception('payment is pending');
             }
             if ($_POST['payment_status'] == 'Denied') {
                 throw new \Exception('payment is denied');
             }
         } catch (\Exception $e) {
             $error = $e->getMessage();
         }
         if (isset($error)) {
             $this->wpdb->update($this->getTableName('ads'), array('paid' => 0, 'p_error' => $error), array('id' => $paymentId));
         }
         if (isset($_POST) && isset($_POST['payment_status']) && $_POST['payment_status'] == 'Completed' && !isset($error)) {
             // change status
             $this->wpdb->update($this->getTableName('ads'), array('paid' => 1, 'status' => (get_option('bsa_pro_plugin_auto_accept') == 'no' or $type == 'agency') ? 'pending' : 'active'), array('id' => $paymentId));
             // change affiliate status
             if ($this->validReferral($paymentId)) {
                 $this->wpdb->update($this->getTableName('referrals'), array('order_status' => 'paid'), array('order_id' => $paymentId));
             }
         }
         // reset cache sessions
         unset($_SESSION['bsa_ad_' . $paymentId]);
     }
     if (isset($_POST) && isset($_POST['stripeToken'])) {
         // Stripe Verify
         if (isset($_POST['stripeToken']) && isset($_GET['oid'])) {
             require_once 'Stripe/init.php';
             // Set your API key
             \Stripe\Stripe::setApiKey(get_option('bsa_pro_plugin_secret_key'));
             try {
                 \Stripe\Charge::create(array('amount' => number_format(bsa_ad($_GET['oid'], 'cost'), 2, '', ''), 'currency' => 'usd', 'card' => $_POST['stripeToken'], 'description' => bsa_ad($_GET['oid'], 'buyer_email') . ' (' . number_format(bsa_ad($_GET['oid'], 'cost'), 2, '', '') . ')'));
                 $timestamp = time();
                 $this->wpdb->update($this->getTableName('ads'), array('paid' => 1, 'p_time' => $timestamp, 'p_data' => $_POST['stripeToken'], 'status' => (get_option('bsa_pro_plugin_auto_accept') == 'no' or $type == 'agency') ? 'pending' : 'active'), array('id' => $paymentId));
                 // change affiliate status
                 if ($this->validReferral($paymentId)) {
                     $this->wpdb->update($this->getTableName('referrals'), array('order_status' => 'paid'), array('order_id' => $paymentId));
                 }
                 echo 'TRUE';
             } catch (\Stripe\Error\Card $e) {
                 // The card has been declined
                 //					$error = $e->getMessage();
                 //					$this->wpdb->update(
                 //						$this->getTableName('ads'),
                 //						array(
                 //							'paid' => 0,
                 //							'p_error' => $error
                 //						),
                 //						array('id' => $paymentId)
                 //					);
                 //					echo 'FALSE';
             }
         }
         // change status to pending if pending cron task
         if ($this->getPendingTask($paymentId, 'ad')) {
             $this->wpdb->update($this->getTableName('ads'), array('status' => 'pending'), array('id' => $paymentId));
         }
         // reset cache sessions
         unset($_SESSION['bsa_ad_' . $paymentId]);
     }
     if (isset($error)) {
         echo FALSE;
     } else {
         // email sender
         $sender = get_option('bsa_pro_plugin_trans_email_sender');
         $email = get_option('bsa_pro_plugin_trans_email_address');
         // buyer sender
         $paymentEmail = bsa_ad($paymentId, 'buyer_email');
         $subject = get_option('bsa_pro_plugin_trans_buyer_subject');
         $message = get_option('bsa_pro_plugin_trans_buyer_message');
         $search = '[STATS_URL]';
         if ($type == 'agency') {
             $replace = get_option('bsa_pro_plugin_agency_ordering_form_url') . (strpos(get_option('bsa_pro_plugin_agency_ordering_form_url'), '?') == TRUE ? '&' : '?') . "bsa_pro_stats=1&bsa_pro_email=" . str_replace('@', '%40', $paymentEmail) . "&bsa_pro_id=" . $paymentId . "#bsaStats\r\n";
         } else {
             $replace = get_option('bsa_pro_plugin_ordering_form_url') . (strpos(get_option('bsa_pro_plugin_ordering_form_url'), '?') == TRUE ? '&' : '?') . "bsa_pro_stats=1&bsa_pro_email=" . str_replace('@', '%40', $paymentEmail) . "&bsa_pro_id=" . $paymentId . "#bsaStats\r\n";
         }
         $message = str_replace($search, $replace, $message);
         $headers = 'From: ' . $sender . ' <' . $email . '>' . "\r\n";
         wp_mail($paymentEmail, $subject, $message, $headers);
         if ($type == 'agency') {
             // seller sender
             $sellerSubject = get_option('bsa_pro_plugin_trans_seller_subject');
             $sellerMessage = get_option('bsa_pro_plugin_trans_seller_message');
             $sellerHeaders = 'From: ' . $sender . ' <' . $email . '>' . "\r\n";
             $getUserId = bsa_site(bsa_space(bsa_ad($paymentId, 'space_id'), 'site_id'), 'user_id');
             $userInfo = get_userdata($getUserId);
             $userEmail = $userInfo->user_email;
             wp_mail($userEmail, $sellerSubject, $sellerMessage, $sellerHeaders);
         }
         if (!isset($_POST['stripeToken'])) {
             echo TRUE;
         }
     }
 }
					' . get_option($bsaTrans . "form_left_header") . ' <span class="bsaLoader bsaLoaderInputs" style="display:none;"></span><br>
					<small style="margin-top: -10px;display: block;">
						<a href="' . get_option('bsa_pro_plugin_agency_ordering_form_url') . '" style="font-size:12px;font-weight: normal;text-decoration: none;">< ' . get_option($bsaTrans . 'agency_back_button') . '</a>
					</small>
				</h3>
				<div class="bsaProInput">
					<label for="bsa_pro_space_id">' . get_option($bsaTrans . "form_left_select_space") . '</label>
					<div class="bsaProSelectSpace">
						<select id="bsa_pro_space_id" name="space_id">
						';
            foreach ($spaces as $space) {
                if (in_array($space['id'], $space_verify)) {
                    if ($model->countAds($space["id"]) < bsa_space($space["id"], 'max_items') || bsa_space($space["id"], 'max_items') == 1 && get_option('bsa_pro_plugin_calendar') == 'yes') {
                        echo '<option value="' . $space["id"] . '" ' . ((isset($_POST["space_id"]) && $_POST["space_id"] == $space["id"] or isset($_GET['sid']) && $_GET['sid'] == $space["id"]) ? 'selected="selected"' : "") . '>' . $space["name"] . '</option>';
                    } else {
                        echo '<option value="" disabled>' . $space["name"] . ' (' . $model->countAds($space["id"]) . '/' . bsa_space($space["id"], 'max_items') . ')' . '</option>';
                    }
                }
            }
            echo '
							</select>
						</div>
					</div>
					<div class="bsaProInput">
						<label for="bsa_pro_buyer_email">' . get_option($bsaTrans . "form_left_email") . '</label>
						<input id="bsa_pro_buyer_email" name="buyer_email" type="email" value="' . bsaGetPost('buyer_email') . '" placeholder="' . get_option($bsaTrans . "form_left_eg_email") . '">
					</div>
					<div class="bsaProInput bsa_title_inputs_load" style="display: none">
						<label for="bsa_pro_title">' . get_option($bsaTrans . "form_left_title") . ' (<span class="bsa_pro_sign_title">' . get_option('bsa_pro_plugin_max_title') . '</span>)</label>
						<input id="bsa_pro_title" name="title" type="text" value="' . bsaGetPost('title') . '" placeholder="' . get_option($bsaTrans . "form_left_eg_title") . '" maxlength="' . get_option('bsa_pro_plugin_max_title') . '">
					</div>
Example #11
0
		</div>

		<div class="bsaCompare bsaCompareB <?php 
    echo $ctrA <= $ctrB ? 'bsaCompareWinner' : null;
    ?>
">

			<div class="bsaCompareSignature">B</div>

			<div class="bsaCompareAdId">Ad ID: <strong><?php 
    echo $get_ad_B;
    ?>
</strong></div>
			<div class="bsaCompareTemplate">Template: <strong><?php 
    echo bsa_space(bsa_ad($get_ad_B, 'space_id'), 'template');
    ?>
</strong></div>
			<div class="bsaCompareWeight">Traffic Weight: <strong><?php 
    echo $trafficB . '%';
    ?>
</strong></div>

			<div class="bsaCompareCTR"><div class="bsaCompareCTRInner"><strong><?php 
    echo $ctrB . '%';
    ?>
</strong><br>CTR</div></div>

			<div class="bsaCompareViews"><span><?php 
    echo $viewsB;
    ?>
Example #12
0
function selectedSpaceOpt($optName, $optValue)
{
    if (isset($_GET['space_id']) && bsa_space($_GET['space_id'], $optName) == $optValue || isset($_POST[$optName]) && $_POST[$optName] == $optValue) {
        echo 'selected="selected"';
    }
}
Example #13
0
        // -- END -- ITEM INNER
        echo '</a>';
        // -- END -- LINK
        echo '</div>';
        // -- END -- ITEM
    }
    echo '</div>';
    // -- END -- ITEMS
    echo '</div>';
    // -- END -- CONTAINER
    // -- END -- TEMPLATE HTML
}
$background = bsa_space($sid, "ad_bg") != '' ? bsa_space($sid, "ad_bg") : NULL;
$bgGradientFront = bsa_space($sid, "ad_extra_color_1") != '' ? 'bottom, transparent 75%, ' . bsa_space($sid, "ad_extra_color_1") . ' 95%' : NULL;
$bgGradientBack = bsa_space($sid, "ad_extra_color_1") != '' ? 'bottom, transparent, ' . bsa_space($sid, "ad_extra_color_1") : NULL;
$backgroundBack = bsa_space($sid, "ad_extra_color_2") != '' ? bsa_space($sid, "ad_extra_color_2") : NULL;
echo '
<style>
#bsa-paper-note-3 .bsaProItemInner .bsaFront .bsaCircle{
	margin-top: -10px;
	background: ' . $background . ';

	background-image: -webkit-linear-gradient(' . $bgGradientFront . ');
	background-image: -moz-linear-gradient(' . $bgGradientFront . ');
	background-image: linear-gradient(' . $bgGradientFront . ');
}
#bsa-paper-note-3 .bsaProItemInner:hover .bsaFront .bsaCircle {
	background-color: ' . $background . ';
}
#bsa-paper-note-3 .bsaProItemInner .bsaBack .bsaCircle{
	margin-top: -130px;
Example #14
0
        // -- END -- LINK
        echo '</div>';
        echo '</div>';
        // -- END -- ITEM THUMB
        echo '</div>';
        // -- END -- ITEM INNER
        echo '</div>';
        // -- END -- ITEM
    }
    echo '</div>';
    // -- END -- ITEMS
    echo '</div>';
    // -- END -- CONTAINER
    // -- END -- TEMPLATE HTML
}
if (isset($sid) && bsa_space($sid, "display_type") != 'corner' || !isset($sid)) {
    echo '<script>
	(function($){
		$(window).on("resize", function(){
			var sid = "' . $sid . '";
			var object = $(".bsaProContainer-" + sid + " .bsaProItemInner__img");
			var animateThumb = $(".bsaProContainer-" + sid + " .bsaProAnimateThumb");
			var innerThumb = $(".bsaProContainer-" + sid + " .bsaProItemInner__thumb");
			var parentWidth = "' . $width . '";
			var parentHeight = "' . $height . '";
			var objectWidth = object.width();
			if ( objectWidth < parentWidth ) {
				var scale = objectWidth / parentWidth;
				if ( objectWidth > 0 && objectWidth != 100 && scale > 0 ) {
					animateThumb.height(parentHeight * scale);
					innerThumb.height(parentHeight * scale);
Example #15
0
function checkedSpaceOpt($optName, $optValue)
{
    if (isset($_GET['space_id']) && in_array($optValue, explode(',', bsa_space($_GET['space_id'], $optName))) or isset($_POST[$optName]) && in_array($optValue, $_POST[$optName])) {
        echo 'checked="checked"';
    }
}
Example #16
0
     echo '<div class="bsaProItemInner__thumbBg" style="background-color:' . bsa_space($sid, 'ad_extra_color_1') . '"></div>';
     echo '<div class="bsaProItemInner__img" style="background-image: url(&#39;' . bsa_crop_tool($crop, !isset($sid) && !isset($_POST['bsa_ad_id']) || isset($example) ? $ad['img'] : bsa_upload_url() . $ad['img'], 400, 300) . '&#39;)"></div>';
     // -- ITEM -- IMG
     echo '</div>';
     // -- END -- ITEM THUMB
     echo '<div class="bsaProItemInner__copy">';
     // -- START -- ITEM COPY
     echo '<div class="bsaProItemInner__copyInner">';
     // -- START -- ITEM COPY INNER
     if ($ad['url'] != '' && $ad['url'] != '#') {
         echo '<span class="bsaProItemInner__url" style="color:' . bsa_space($sid, 'ad_url_color') . '">http://' . $url['host'] . '</span>';
         // -- ITEM -- URL
     }
     echo '<span class="bsaProItemInner__line"></span>';
     // -- ITEM -- LINE
     echo '<h3 class="bsaProItemInner__title" style="color:' . bsa_space($sid, 'ad_title_color') . '">' . $ad['title'] . '</h3>';
     // -- ITEM -- TITLE
     echo '</div>';
     // -- END -- ITEM COPY INNER
     echo '</div>';
     // -- END -- ITEM COPY
     echo '</div>';
     // -- END -- ITEM INNER
     if ($ad['url'] != '' or $ad['url'] == '#') {
         echo '</a>';
     }
     // -- END -- LINK
     echo '</div>';
     // -- END -- ITEM
 }
 echo '</div>';
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;
}