<?php 


$loader_html =  DapMemberShowLoader();
$curr_sym = pppGetCurrencySymbol();

$currency_symbol = '$';
$price_buynow  = 0;
$buynow_section_show = 'none';
$rent_section_show = 'none';
$membership_section_show = 'none';
$pricing_section_show = 'none';
$product_id  = 0;
$post_image = '';
$payment_mode = 'live';
$show_teaser_content = 'N';
$teaser_content = '';
$not_logged_in_message = 'Sorry, this content is for members only.';
$no_access_msg = 'Sorry, it appears that you do not have access to this content.';
$show_msg_above_btn = 'N';
$btn_above_text = '';
$buynow_btn_text = 'Buy Now';
$rent_btn_text = 'Rent';
$membership_btn_text = 'Membership';
$shopping_cart_option = 'spc';
$spc_checkout_id = 0;
$layout_template = '';
$landing_url = '';
$membership_buynow_url = '';
$after_payment_action = 'same_page';
$pppEnabled = 'N';

if(isset($postId)){
	$dapwp_post_obj = Dap_PayPerPost::loadPayPerPostByPostId($postId);

	if(isset($dapwp_post_obj)){
		$dapwp_post_meta_buynow_obj = Dap_PayPerPostMeta::loadPayPerPostMetaByPostIdAndButtonType($postId, 'buynow');
		$dapwp_post_meta_rent_obj = Dap_PayPerPostMeta::loadPayPerPostMetaByPostIdAndButtonType($postId, 'rent');
		$dapwp_post_meta_membership_obj = Dap_PayPerPostMeta::loadPayPerPostMetaByPostIdAndButtonType($postId, 'membership');
		$currency_text = $dapwp_post_obj->getCurrencyCode();
		$currency_symbol = $dapwp_post_obj->getCurrencySymbol();
		$product_id = $dapwp_post_obj->getProductId();
		$post_image = $dapwp_post_obj->getPostImage();
		$payment_mode = $dapwp_post_obj->getPaymentMode();

		//echo "<pre>";
		//print_r($dapwp_post_obj);
		//echo "</pre>";
		$show_teaser_content = $dapwp_post_obj->getShowTeaserContent();
		$teaser_content = $dapwp_post_obj->getTeaserContent();
		$not_logged_in_message = $dapwp_post_obj->getNotLoggedIn();
		$no_access_msg = $dapwp_post_obj->getNotHaveAccess();
		$show_msg_above_btn = $dapwp_post_obj->getShowMsgAboveBtn();
		$spc_checkout_id = $dapwp_post_obj->getSpcCheckoutId();
		$layout_template = $dapwp_post_obj->getButtonLayoutoption();
		$landing_url = $dapwp_post_obj->getLandingURL();
		$after_payment_action = $dapwp_post_obj->getAfterPaymentAction();

		 


		$pricing_section_show = 'block';
		if(isset($dapwp_post_meta_buynow_obj)){	
			$buynow_section_show = 'block';
			$buynow_price = $dapwp_post_meta_buynow_obj->getPrice();
			$buynow_access_day = $dapwp_post_meta_buynow_obj->getAccessDays();
			$btn_above_text = $dapwp_post_meta_buynow_obj->getBtnAboveText();
			$buynow_btn_text = $dapwp_post_meta_buynow_obj->getBtnText();
			$shopping_cart_option = $dapwp_post_meta_buynow_obj->getShoppingCart();
		}

		if(isset($dapwp_post_meta_rent_obj)){	
			$rent_section_show = 'flex';
			$rent_price = $dapwp_post_meta_rent_obj->getPrice();
			$rent_access_day = $dapwp_post_meta_rent_obj->getAccessDays();
			$rent_btn_text = $dapwp_post_meta_rent_obj->getBtnText();
			
			$btn_above_text = $dapwp_post_meta_rent_obj->getBtnAboveText();
			$shopping_cart_option = $dapwp_post_meta_rent_obj->getShoppingCart();
		}

		if(isset($dapwp_post_meta_membership_obj)){	
			$membership_section_show = 'flex';
			$membership_price = $dapwp_post_meta_membership_obj->getPrice();
			$membership_access_day = $dapwp_post_meta_membership_obj->getAccessDays();
			$membership_btn_text = $dapwp_post_meta_membership_obj->getBtnText();
			$btn_above_text = $dapwp_post_meta_membership_obj->getBtnAboveText();
			$shopping_cart_option = $dapwp_post_meta_membership_obj->getShoppingCart();
			$membership_buynow_url = $dapwp_post_meta_membership_obj->getBuyLink();
			$membership_buynow_url_array = explode("&membershipId=",$membership_buynow_url);
			if(isset($membership_buynow_url_array[1])){
				$membership_buynow_url  = $membership_buynow_url_array[0];
			}else{
				$membership_buynow_url_array = explode("?membershipId=",$membership_buynow_url);		
				if(isset($membership_buynow_url_array[1])){
					$membership_buynow_url  = $membership_buynow_url_array[0];
				}	
			}
			 
		} 
	}
}
echo $loader_html;
?>


<script src="//cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js"></script>
<div class="tab-pane active" id="general" role="tabpanel">
<h3>General Settings</h3>
<div class="tab-content-wrapper">
	<div class="metabox_individual metabox_list">
		<label for="dap_custom_metabox_show_teaser" class="metabox_label">Do you want to enable Pay-Per-Post?</label>
		<div class="metabox_right-content">
			<div class="switch_onoff">
				<input class="checkbox" name="dap_custom_metabox[enable_pay_per_post]" type="checkbox" id="enable_pay_per_post" value="Y" checked>
				<label for="enable_pay_per_post"></label>
			</div>
		</div>
	</div>
	<div class="enable_pay_per_post_wrapper" <?php if((isset($dapwp_post_obj) && ($dapwp_post_obj->getEnablePayPerPost() == 'N')) || !isset($dapwp_post_obj)){ echo 'style="display:none"';}?>>
	<div class="metabox_individual payment_option">
		<label for="dap_custom_metabox_show_teaser" class="metabox_label">Please select the payment options</label>
		<div class="wrapper_metabox_payment_option payment_options_outer metabox_right-content">
			<label>
				<input type="checkbox" name="payment_options[]" data-payment-option="buynow" value="buynow" <?php if(isset($dapwp_post_meta_buynow_obj)){echo "checked='checked'";} ?>>
				Buy Now (one-time payment, lifetime access)
			</label>
			<label>
				<input type="checkbox" name="payment_options[]" data-payment-option="rent"  value="rent" <?php if(isset($dapwp_post_meta_rent_obj)){echo "checked='checked'";} ?> >
				Rent (one-time payment, limited-time access)
			</label>
			<label>
				<input type="checkbox" name="payment_options[]" data-payment-option="membership" class="dapwp_membership_payment_checkbox" value="purchase_membership" <?php if(isset($dapwp_post_meta_membership_obj)){ echo "checked='checked'" ;} ?>>
				Purchase membership and get full access
			</label>
		</div>
	</div>
	<div class="metabox_individual metabox_list">
		<label for="dap_custom_metabox_show_teaser"  class="metabox_label">
			Select Currency
		</label>
		<div class="currency_symbol_outer metabox_right-content">									 
			<select  id="currency_symbol" name="currency_symbol"  class="form-control">
					<option value="USD" <?= isset($currency_text) && $currency_text == 'USD' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['USD']) ?>">United States Dollars (<?= html_entity_decode($curr_sym['USD']) ?>)</option>
					<option value="EUR" <?= isset($currency_text) && $currency_text == 'EUR' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['EUR']) ?>">Euro (<?= html_entity_decode($curr_sym['EUR']) ?>)</option>
					<option value="GBP" <?= isset($currency_text) && $currency_text == 'GBP' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['GBP']) ?>">United Kingdom Pounds (<?= html_entity_decode($curr_sym['GBP']) ?>)</option>
					<option value="DZD" <?= isset($currency_text) && $currency_text == 'DZD' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['DZD']) ?>">Algeria Dinars (<?= html_entity_decode($curr_sym['DZD']) ?>)</option>
					<option value="AUD" <?= isset($currency_text) && $currency_text == 'AUD' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['AUD']) ?>">Australia Dollars (<?= html_entity_decode($curr_sym['AUD']) ?>)</option>
					<option value="ARS" <?= isset($currency_text) && $currency_text == 'ARS' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['ARS']) ?>">Argentinian pesos (<?= html_entity_decode($curr_sym['ARS']) ?>)</option>
					<option value="BSD" <?= isset($currency_text) && $currency_text == 'BSD' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['BSD']) ?>">Bahamas Dollars (<?= html_entity_decode($curr_sym['BSD']) ?>)</option>
					<option value="BBD" <?= isset($currency_text) && $currency_text == 'BBD' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['BBD']) ?>">Barbados Dollars (<?= html_entity_decode($curr_sym['BBD']) ?>)</option>
					<option value="BEF" <?= isset($currency_text) && $currency_text == 'BEF' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['BEF']) ?>">Belgium Francs (<?= html_entity_decode($curr_sym['BEF']) ?>)</option>
					<option value="BMD" <?= isset($currency_text) && $currency_text == 'BMD' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['BMD']) ?>">Bermuda Dollars (<?= html_entity_decode($curr_sym['BMD']) ?>)</option>
					<option value="BRR" <?= isset($currency_text) && $currency_text == 'BRR' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['BRR']) ?>">Brazil Real (<?= html_entity_decode($curr_sym['BRR']) ?>)</option>
					<option value="BGL" <?= isset($currency_text) && $currency_text == 'BGL' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['BGL']) ?>">Bulgaria Lev (<?= html_entity_decode($curr_sym['BGL']) ?>)</option>
					<option value="CAD" <?= isset($currency_text) && $currency_text == 'CAD' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['CAD']) ?>">Canada Dollars (<?= html_entity_decode($curr_sym['CAD']) ?>)</option>
					<option value="CLP" <?= isset($currency_text) && $currency_text == 'CLP' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['CLP']) ?>">Chile Pesos (<?= html_entity_decode($curr_sym['CLP']) ?>)</option>
					<option value="CNY" <?= isset($currency_text) && $currency_text == 'CNY' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['CNY']) ?>">China Yuan Renmimbi (<?= html_entity_decode($curr_sym['CNY']) ?>)</option>
					<option value="CYP" <?= isset($currency_text) && $currency_text == 'CYP' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['CYP']) ?>">Cyprus Pounds (<?= html_entity_decode($curr_sym['CYP']) ?>)</option>
					<option value="CSK" <?= isset($currency_text) && $currency_text == 'CSK' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['CSK']) ?>">Czech Republic Koruna (<?= html_entity_decode($curr_sym['CSK']) ?>)</option>
					<option value="DKK" <?= isset($currency_text) && $currency_text == 'DKK' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['DKK']) ?>">Denmark Kroner (<?= html_entity_decode($curr_sym['DKK']) ?>)</option>
					<option value="NLG" <?= isset($currency_text) && $currency_text == 'NLG' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['NLG']) ?>">Dutch Guilders (<?= html_entity_decode($curr_sym['NLG']) ?>)</option>
					<option value="EGP" <?= isset($currency_text) && $currency_text == 'EGP' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['EGP']) ?>">Egypt Pounds (<?= html_entity_decode($curr_sym['EGP']) ?>)</option>
					<option value="FJD" <?= isset($currency_text) && $currency_text == 'FJD' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['FJD']) ?>">Fiji Dollars (<?= html_entity_decode($curr_sym['FJD']) ?>)</option>
					<option value="FIM" <?= isset($currency_text) && $currency_text == 'FIM' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['FIM']) ?>">Finland Markka (<?= html_entity_decode($curr_sym['FIM']) ?>)</option>
					<option value="FRF" <?= isset($currency_text) && $currency_text == 'FRF' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['FRF']) ?>">France Francs (<?= html_entity_decode($curr_sym['FRF']) ?>)</option>
					<option value="DEM" <?= isset($currency_text) && $currency_text == 'DEM' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['DEM']) ?>">Germany Deutsche Marks (<?= html_entity_decode($curr_sym['DEM']) ?>)</option>
					<option value="GRD" <?= isset($currency_text) && $currency_text == 'GRD' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['GRD']) ?>">Greece Drachmas (<?= html_entity_decode($curr_sym['GRD']) ?>)</option>
					<option value="HKD" <?= isset($currency_text) && $currency_text == 'HKD' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['HKD']) ?>">Hong Kong Dollars (<?= html_entity_decode($curr_sym['HKD']) ?>)</option>
					<option value="HUF" <?= isset($currency_text) && $currency_text == 'HUF' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['HUF']) ?>">Hungary Forint (<?= html_entity_decode($curr_sym['HUF']) ?>)</option>
					<option value="ISK" <?= isset($currency_text) && $currency_text == 'ISK' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['ISK']) ?>">Iceland Krona (<?= html_entity_decode($curr_sym['ISK']) ?>)</option>
					<option value="INR" <?= isset($currency_text) && $currency_text == 'INR' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['INR']) ?>">India Rupees (<?= html_entity_decode($curr_sym['INR']) ?>)</option>
					<option value="IDR" <?= isset($currency_text) && $currency_text == 'IDR' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['IDR']) ?>">Indonesia Rupiah (<?= html_entity_decode($curr_sym['IDR']) ?>)</option>
					<option value="IEP" <?= isset($currency_text) && $currency_text == 'IEP' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['IEP']) ?>">Ireland Punt (<?= html_entity_decode($curr_sym['IEP']) ?>)</option>
					<option value="ILS" <?= isset($currency_text) && $currency_text == 'ILS' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['ILS']) ?>">Israel New Shekels (<?= html_entity_decode($curr_sym['ILS']) ?>)</option>
					<option value="ITL" <?= isset($currency_text) && $currency_text == 'ITL' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['ITL']) ?>">Italy Lira (<?= html_entity_decode($curr_sym['ITL']) ?>)</option>
					<option value="JMD" <?= isset($currency_text) && $currency_text == 'JMD' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['JMD']) ?>">Jamaica Dollars (<?= html_entity_decode($curr_sym['JMD']) ?>)</option>
					<option value="JPY" <?= isset($currency_text) && $currency_text == 'JPY' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['JPY']) ?>">Japan Yen (<?= html_entity_decode($curr_sym['JPY']) ?>)</option>
					<option value="JOD" <?= isset($currency_text) && $currency_text == 'JOD' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['JOD']) ?>">Jordan Dinar (<?= html_entity_decode($curr_sym['JOD']) ?>)</option>
					<option value="LBP" <?= isset($currency_text) && $currency_text == 'LBP' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['LBP']) ?>">Lebanon Pounds (<?= html_entity_decode($curr_sym['LBP']) ?>)</option>
					<option value="LUF" <?= isset($currency_text) && $currency_text == 'LUF' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['LUF']) ?>">Luxembourg Francs (<?= html_entity_decode($curr_sym['LUF']) ?>)</option>
					<option value="MYR" <?= isset($currency_text) && $currency_text == 'MYR' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['MYR']) ?>">Malaysia Ringgit (<?= html_entity_decode($curr_sym['MYR']) ?>)</option>
					<option value="MXP" <?= isset($currency_text) && $currency_text == 'MXP' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['MXP']) ?>">Mexico Pesos (<?= html_entity_decode($curr_sym['MXP']) ?>)</option>
					<option value="NLG" <?= isset($currency_text) && $currency_text == 'NLG' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['NLG']) ?>">Netherlands Guilders (<?= html_entity_decode($curr_sym['NLG']) ?>)</option>
					<option value="NZD" <?= isset($currency_text) && $currency_text == 'NZD' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['NZD']) ?>">New Zealand Dollars (<?= html_entity_decode($curr_sym['NZD']) ?>)</option>
					<option value="NOK" <?= isset($currency_text) && $currency_text == 'NOK' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['NOK']) ?>">Norway Kroner (<?= html_entity_decode($curr_sym['NOK']) ?>)</option>
					<option value="PKR" <?= isset($currency_text) && $currency_text == 'PKR' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['PKR']) ?>">Pakistan Rupees (<?= html_entity_decode($curr_sym['PKR']) ?>)</option>
					<option value="PHP" <?= isset($currency_text) && $currency_text == 'PHP' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['PHP']) ?>">Philippines Pesos (<?= html_entity_decode($curr_sym['PHP']) ?>)</option>
					<option value="PLZ" <?= isset($currency_text) && $currency_text == 'PLZ' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['PLZ']) ?>">Poland Zloty (<?= html_entity_decode($curr_sym['PLZ']) ?>)</option>
					<option value="PTE" <?= isset($currency_text) && $currency_text == 'PTE' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['PTE']) ?>">Portugal Escudo (<?= html_entity_decode($curr_sym['PTE']) ?>)</option>
					<option value="ROL" <?= isset($currency_text) && $currency_text == 'ROL' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['ROL']) ?>">Romania Leu (<?= html_entity_decode($curr_sym['ROL']) ?>)</option>
					<option value="RUR" <?= isset($currency_text) && $currency_text == 'RUR' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['RUR']) ?>">Russia Rubles (<?= html_entity_decode($curr_sym['RUR']) ?>)</option>
					<option value="SAR" <?= isset($currency_text) && $currency_text == 'SAR' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['SAR']) ?>">Saudi Arabia Riyal (<?= html_entity_decode($curr_sym['SAR']) ?>)</option>
					<option value="SGD" <?= isset($currency_text) && $currency_text == 'SGD' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['SGD']) ?>">Singapore Dollars (<?= html_entity_decode($curr_sym['SGD']) ?>)</option>
					<option value="SKK" <?= isset($currency_text) && $currency_text == 'SKK' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['SKK']) ?>">Slovakia Koruna (<?= html_entity_decode($curr_sym['SKK']) ?>)</option>
					<option value="ZAR" <?= isset($currency_text) && $currency_text == 'ZAR' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['ZAR']) ?>">South Africa Rand (<?= html_entity_decode($curr_sym['ZAR']) ?>)</option>
					<option value="KRW" <?= isset($currency_text) && $currency_text == 'KRW' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['KRW']) ?>">South Korea Won (<?= html_entity_decode($curr_sym['KRW']) ?>)</option>
					<option value="ESP" <?= isset($currency_text) && $currency_text == 'ESP' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['ESP']) ?>">Spain Pesetas (<?= html_entity_decode($curr_sym['ESP']) ?>)</option>
					<option value="SDD" <?= isset($currency_text) && $currency_text == 'SDD' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['SDD']) ?>">Sudan Dinar (<?= html_entity_decode($curr_sym['SDD']) ?>)</option>
					<option value="SEK" <?= isset($currency_text) && $currency_text == 'SEK' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['SEK']) ?>">Sweden Krona (<?= html_entity_decode($curr_sym['SEK']) ?>)</option>
					<option value="CHF" <?= isset($currency_text) && $currency_text == 'CHF' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['CHF']) ?>">Switzerland Francs (<?= html_entity_decode($curr_sym['CHF']) ?>)</option>
					<option value="TWD" <?= isset($currency_text) && $currency_text == 'TWD' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['TWD']) ?>">Taiwan Dollars (<?= html_entity_decode($curr_sym['TWD']) ?>)</option>
					<option value="THB" <?= isset($currency_text) && $currency_text == 'THB' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['THB']) ?>">Thailand Baht (<?= html_entity_decode($curr_sym['THB']) ?>)</option>
					<option value="TTD" <?= isset($currency_text) && $currency_text == 'TTD' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['TTD']) ?>">Trinidad and Tobago Dollars (<?= html_entity_decode($curr_sym['TTD']) ?>)</option>
					<option value="TRL" <?= isset($currency_text) && $currency_text == 'TRL' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['TRL']) ?>">Turkey Lira (<?= html_entity_decode($curr_sym['TRL']) ?>)</option>
					<option value="VEB" <?= isset($currency_text) && $currency_text == 'VEB' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['VEB']) ?>">Venezuela Bolivar (<?= html_entity_decode($curr_sym['VEB']) ?>)</option>
					<option value="ZMK" <?= isset($currency_text) && $currency_text == 'ZMK' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['ZMK']) ?>">Zambia Kwacha (<?= html_entity_decode($curr_sym['ZMK']) ?>)</option>
					<option value="XCD" <?= isset($currency_text) && $currency_text == 'XCD' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['XCD']) ?>">Eastern Caribbean Dollars (<?= html_entity_decode($curr_sym['XCD']) ?>)</option>
					<option value="XDR" <?= isset($currency_text) && $currency_text == 'XDR' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['XDR']) ?>">Special Drawing Right (IMF) (<?= html_entity_decode($curr_sym['XDR']) ?>)</option>
					<option value="XAG" <?= isset($currency_text) && $currency_text == 'XAG' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['XAG']) ?>">Silver Ounces (<?= html_entity_decode($curr_sym['XAG']) ?>)</option>
					<option value="XAU" <?= isset($currency_text) && $currency_text == 'XAU' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['XAU']) ?>">Gold Ounces (<?= html_entity_decode($curr_sym['XAU']) ?>)</option>
					<option value="XPD" <?= isset($currency_text) && $currency_text == 'XPD' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['XPD']) ?>">Palladium Ounces (<?= html_entity_decode($curr_sym['XPD']) ?>)</option>
					<option value="XPT" <?= isset($currency_text) && $currency_text == 'XPT' ? 'selected' : '' ?> data-symbol="<?= html_entity_decode($curr_sym['XPT']) ?>">Platinum Ounces (<?= html_entity_decode($curr_sym['XPT']) ?>)</option>
				</select>
			
			
		</div>
	</div>

	<div class="metabox_individual metabox_list items-align-start pricing_section_outer" style="display:<?php echo $pricing_section_show;?>">
		<div class="Pricing-options">
			<h3>Pricing</h3>
			<div class="pay-per-post-block " >
				<div class="metabox_individual metabox_list pricing_wrapper_buynow" style="display:<?php echo $buynow_section_show;?>">
					<div class="Pricing-option-block ">
						<label for="dap_custom_metabox_show_teaser"  class="metabox_label">
							Buy Now
						</label>
						<div class="metabox_right-content">
							<span class="currency__symbol"><?php echo $currency_symbol; ?></span><input type="number" name="dap_custom_metabox[buy_price]" class="price" value="<?php echo $buynow_price; ?>"  >
						</div>
					</div>
				</div>
				<div class="metabox_individual metabox_list pricing_wrapper_rent" style="display:<?php echo $rent_section_show;?>">
					<div class="Pricing-option-block ">
						<label for="dap_custom_metabox_show_teaser"  class="metabox_label">
							Rent:
						</label>
						<div class="metabox_right-content">
							<span class="currency__symbol"><?php echo $currency_symbol; ?></span><input type="number" name="dap_custom_metabox[rent_price]" class="price" value="<?php echo $rent_price; ?>"  >
						</div>
					</div>
					<div class="Pricing-option-block ">
						<label for="dap_custom_metabox_show_teaser"  class="metabox_label">
							How many days of access:
						</label>
						<div class="metabox_right-content"><input type="number" name="dap_custom_metabox[access]" class="access_day" value="<?php echo $rent_access_day;  ?>"  >
						</div>
					</div>
				</div>
				<div class="metabox_individual metabox_list pricing_wrapper_membership" style="display:<?php echo $membership_section_show;?>">
					<div class="Pricing-option-block">
						<label for="dap_custom_metabox_show_teaser"  class="metabox_label membership_label">
							Membership: 
						</label>
						<div class="metabox_right-content">
							<span>&nbsp;The membership pricing/access gets picked up from DAP products page >> Billing & Access Tab.</span>
						</div>
					</div>
					
				</div>
			</div>

		</div>
	</div>

	<div class="metabox_individual metabox_list items-align-start">
		<label for="dap_custom_metabox_show_teaser"  class="metabox_label">
		Select a DAP Product  	<small>Users will get access to this product when they purchase this post. You can create a dummy product in DAP for this.</small>
		</label>
		<div class="metabox_right-content">
			<select  id="productid" name="productid"  class="product_ids form-control">
				<option value="0">Select Product</option>
				<?php
					$productList = Dap_Product::loadProducts("","A");
					foreach ($productList as $prod) {    ?>
					<option value="<?php echo $prod->getId(); ?>"  <?php if($product_id == $prod->getId()){ echo 'selected="selected"'; } ?> >
					<?php echo $prod->getName(); ?></option>
				<?php } ?>
			</select> 
		</div>
	</div>

	<div class="metabox_individual metabox_list items-align-start">
		<label for="dap_custom_metabox_show_teaser"  class="metabox_label">
			Enter an image for this post <small style="display: inline-block;width: auto;float: none;color: #e60c0c;">(optional)</small>
		</label>
		<div class="post_image_input metabox_right-content">
			<input type="button" value="Choose File" class="dap_member_login_image_upload" id="myfile"> <span class="image_name" style="display:none"></span>
			<div class="or_div"><span>Or</span></div>
			<input class="post_image" type="text" name="post_image" value="<?php echo $post_image; ?>"  >
		</div>
	</div>
	
	<div class="metabox_individual metabox_list items-align-start">
		<label class="metabox_label">
			Payment Mode 
		</label>

		<div class="wrapper_metabox_payment_option button_layout_options_outer metabox_right-content">
			<label class="radio-btn--outer">
				<input type="radio" name="payment_mode" value="live" <?php if($payment_mode == 'live'){echo " checked='checked'";}?>>
				Live
			</label>
			<label class="radio-btn--outer">
				<input type="radio" name="payment_mode" value="sandbox" <?php if($payment_mode == 'sandbox'){echo " checked='checked'";}?>>
				Sandbox
			</label>		 
		</div>
	</div>
	
	</div>
	
	<div class="metabox--actions-btn">
		
		<a href="#" class="metabox-btn metabox-next--btn metabox-save--btn" onclick="dapwp_save_payper_post(this,'yes')" >Save</a>
		<a href="#" class="metabox-btn metabox-next--btn" onclick="dapwp_goto_next_tab('messages')">Next</a>
	</div>
</div>
</div>


<div class="tab-pane " id="messages" role="tabpanel">
<h3>Messages</h3>
<div class="tab-content-wrapper">
	<div class="metabox_individual metabox_list border--bottom--none metabox-label-nowrap">
		<label for="dap_custom_metabox_show_teaser"  class="metabox_label">
			Do you want to display teaser Content?									
		</label>
		<div class="metabox_right-content">
			<div class="switch_onoff">
				<input class="checkbox" name="show_teaser_content" type="checkbox" id="show_teaser_content" value="Y" <?php if($show_teaser_content == 'Y'){ echo "checked='checked'"; }?>>
				<label for="show_teaser_content"></label>
			</div>
		</div>
	</div>

	<div class="metabox_individual metabox_list items-align-start border--bottom--none teaser-content-wrapper" <?php if($show_teaser_content != 'Y'){ echo "style='display:none'"; }?>>
		<label class="metabox_label">
			Teaser Content
		</label>
		<div class="metabox_right-content">
			<textarea class="dapwp_textare_tinymce"  id="teaser_content">
				<?php echo $teaser_content;?>
				</textarea>
		</div>
	</div>

	<div class="metabox_individual metabox_list items-align-start border--top--add">
		<label class="metabox_label">
			What message should show to not-logged-in members 
		</label>
		<div class="metabox_right-content">
			<div class="dap_metabox_tiny_editor" id="not_logged_in_message"> <?php echo $not_logged_in_message;?>
			</div>
		</div>
	</div>

	<div class="metabox_individual payment_option">
		<label for="dap_custom_metabox_logged_in_message_nothave_access"  class="metabox_label">
			 What message should show if user does not have access 
		</label>
		<div class="metabox_right-content">
			<div class="dap_metabox_tiny_editor"  id="no_access_msg"><?php echo $no_access_msg;?>
		</div>
		</div>
	</div>

	<div class="metabox--actions-btn">
		<a href="#" class="metabox-btn metabox-prev--btn" onclick="dapwp_goto_next_tab('general')">Previous</a>
		<a href="#" class="metabox-btn metabox-next--btn metabox-save--btn" onclick="dapwp_save_payper_post(this,'yes')" >Save</a>
		<a href="#" class="metabox-btn metabox-next--btn" onclick="dapwp_goto_next_tab('button_configuration')"> Next</a>
	</div>
</div>
</div>

<div class="tab-pane " id="button_configuration" role="tabpanel">
<h3>Button Configuration</h3>
<div class="tab-content-wrapper">
	<div class="metabox_individual metabox_list border--bottom--none metabox-label-nowrap">
		<label for="dap_custom_metabox_show_teaser" class="metabox_label">Do you want to display any message above the buttons?</label>
		<div class="metabox_right-content">
			<div class="switch_onoff">
				<input class="checkbox" name="dap_custom_metabox[enable_above_btn_msg]" type="checkbox" id="enable_above_btn_msg" value="Y" <?php if($show_msg_above_btn == "Y"){ echo 'checked="checked"';}  ?>>
				<label for="enable_above_btn_msg"></label>
			</div>
		</div>
	</div>

	<div class="metabox_individual metabox_list above_btn_msg_wrapper items-align-start border--bottom--none" <?php if($show_msg_above_btn == "Y"){}else{ echo 'style="display:none"';}?>>
		<label for="dap_custom_metabox_show_teaser" class="metabox_label">Enter Message</label>
		<div class="metabox_right-content">
			<textarea id="above_text_textarea" class="above_text dapwp_textare_tinymce"  > <?php echo $btn_above_text; ?></textarea>
		</div>
	</div>


	<div class="metabox_individual metabox_list items-align-start border--top--add button-text-customizer">
		<div class="Pricing-options">
			<h3>Cutomize Text</h3>
			<div class="pay-per-post-block">
				<div class="metabox_individual metabox_list btn_text_wrapper_buynow" <?php if(!$dapwp_post_meta_buynow_obj){ echo 'style="display:none"';}?>>
					<label for="dap_custom_metabox_show_teaser" class="metabox_label">Buy Now</label>
					<div class="metabox_right-content">
						<input type="text" class=" btn_text_buynow" value="<?php echo $buynow_btn_text;?>">
					</div>
				</div>
				<div class="metabox_individual metabox_list btn_text_wrapper_rent" <?php if(!$dapwp_post_meta_rent_obj){ echo 'style="display:none"';}?>>
					<label for="dap_custom_metabox_show_teaser" class="metabox_label">Rent</label>
					<div class="metabox_right-content">
						<input type="text" class="btn_text_rent" value="<?php echo $rent_btn_text;?>">
					</div>
				</div>
				<div class="metabox_individual metabox_list btn_text_wrapper_membership" <?php if(!$dapwp_post_meta_membership_obj){ echo 'style="display:none"';}?>>
					<label for="dap_custom_metabox_show_teaser" class="metabox_label">Membership</label>
					<div class="metabox_right-content">
						<input type="text" class="btn_text_membership" value="<?php echo $membership_btn_text;?>">
					</div>
				</div>										
			</div>
		</div>
	</div>

	<div class="metabox--actions-btn">
		<a href="#" class="metabox-btn metabox-prev--btn" onclick="dapwp_goto_next_tab('messages')">Previous</a>
		<a href="#" class="metabox-btn metabox-next--btn metabox-save--btn" onclick="dapwp_save_payper_post(this,'yes')" >Save</a>
		<a href="#" class="metabox-btn metabox-next--btn" onclick="dapwp_goto_next_tab('payment_button')">Next</a>
	</div>
</div>
</div>
<?php $showSPCCheckout = 'no'; if(class_exists(SPC_Checkout)){ $showSPCCheckout = 'yes'; } 
if($showSPCCheckout == 'no'){
	$shopping_cart_option = 'other';	
}

?>
<div class="tab-pane " id="payment_button" role="tabpanel">
<h3>Payment Button</h3>
<div class="tab-content-wrapper">
<div class="metabox_individual metabox_list">
		<label for="  "  class="metabox_label">
			Payment Options
		</label>								
		<div class="wrapper_metabox_payment_option button_layout_options_outer metabox_right-content">
			<label class="radio-btn--outer">
				<input type="radio" name="use_spc" value="spc" <?php if($shopping_cart_option == 'spc'){ echo "checked='checked'";} ?>>
				SmartPayCart.com
			</label>
			<label class="radio-btn--outer"> 
				<input type="radio" name="use_spc" value="other" <?php if($shopping_cart_option == 'other'){ echo "checked='checked'";} ?>>
				Paypal button
			</label>		 
		</div>
	</div>

	<div class="metabox_individual metabox_list spc_button_link" <?php if($shopping_cart_option != 'spc'){ echo 'style="display:none"';  }?>>
		<label for="dap_custom_metabox_show_teaser" class="metabox_label">
			Select checkout URL
		</label>
		<div class="metabox_right-content">
			<select  name="other_buy_button_link_select"  class="form-control">
				
				<option value=0>Select</option>
					<?php
					if($showSPCCheckout == 'yes'){
						$rows = SPC_Checkout::loadCheckoutWithoutDonationAndCredits();
					  foreach($rows as $row){
						  if( $row->getCheckoutPage() != '' && $row->getCheckoutPage() != 0){
							  $permalink = get_permalink($row->getCheckoutPage());
							  $find = array( 'http://', 'https://' );
							  $replace = 'https://';
							  $permalinkurl = str_replace( $find, $replace, $permalink );
						  ?>
							<option value="<?php echo $permalink;?>" checkout_id="<?php echo $row->getCheckoutPage();?>"
									<?php if($row->getCheckoutPage() == $spc_checkout_id){ echo 'selected="selected"';} ?>>
							<?php echo $permalinkurl; ?>
							</option>
						  <?php
						  }
					  }
					  }
					?>
			</select>
		</div>
	</div>							
   
	<div class="metabox_individual metabox_list membership_buynow_url_wrapper" style="display:<?php echo $membership_section_show;?>">
		<label class="metabox_label">
			Enter Membership Buy Button URL/Link
			<small>(Will be used for membership purchase. You can create this button in SPC >> buy button page)</small>
		</label>
		<div class="metabox_right-content">
			<input type="text" name="membership_buynow_url" id="membership_buynow_url" class="membership_buynow_url" value="<?php echo $membership_buynow_url;?>">
		</div>	
				
		
	</div>	
	  
	<div class="metabox_individual metabox_list spc_outer select-layout-block">
		<label for="  "  class="metabox_label">
			Button layout
		</label>								
		<div class="wrapper_metabox_payment_option dapwp_template_list button_layout_options_outer metabox_right-content <?php if($layout_template != ''){ echo "temp_selected";} ?>">
			<div class="layout--outer template1 <?php if($layout_template == 'template1'){ echo "selected";} ?>" data-temp="template1">
				<h5>Horizontal Template</h5>
				<img src="<?php echo plugin_dir_url(__FILE__).'includes/images/ppp_horizontal_temp.jpg'; ?>" alt="layout"/>
				<a href="javascript:void(0)" onclick="dapwp_select_temp('template1')" >Select</a>
			</div>
			<div class="layout--outer template2 <?php if($layout_template == 'template2'){ echo "selected";} ?>" data-temp="template2">
				<h5>Vertical Template</h5>
				<img src="<?php echo plugin_dir_url(__FILE__).'includes/images/ppp_vertical_temp.jpg'; ?>" alt="layout"/>
				<a href="javascript:void(0)" onclick="dapwp_select_temp('template2')">Select</a>
			</div>		 
		</div>
	</div>
	 
   <div class="metabox--actions-btn">
		<a href="#" class="metabox-btn metabox-prev--btn" onclick="dapwp_goto_next_tab('button_configuration')">Previous</a>
		<a href="#" class="metabox-btn metabox-next--btn metabox-save--btn" onclick="dapwp_save_payper_post(this,'yes')" >Save</a>
		<a href="#" class="metabox-btn metabox-next--btn" onclick="dapwp_goto_next_tab('landing_page')">Next</a>
	</div>

</div>	
</div>	

<div class="tab-pane " id="button_layout" role="tabpanel">
<h3>Button Preview </h3>

<div class="tab-content-wrapper">
	

	<div class="metabox_individual metabox_list your_button_create_outer items-align-start">
		<h4 class="btn_customize_link">Click <a href="<?= admin_url('admin.php?page=dap_pay_per_post_settings'); ?>">here</a> to customize the style</h4>
		<div class="metabox_right-content">
			<div class="button-layout-view button-layout-preivew_wrapper">
				<div class="temp_above_text" > </div>
				<?php /*
					$button_type ="buynow";
					$button_type1="rent";
					$button_type2 ="membership";
					$buybutton_data = DAP_PayPerPostCustomizer::loadByType($button_type);
					$rentbutton_data = DAP_PayPerPostCustomizer::loadByType($button_type1);
					$membershipbutton_data = DAP_PayPerPostCustomizer::loadByType($button_type2);
					
					$buybutton_html = '';
					if(isset($buybutton_data )){
						$buybutton_html = $buybutton_data->getButtonHtml();
					}
					$rentbutton_html = '';
					if(isset($rentbutton_data )){
						$rentbutton_html =  $rentbutton_data->getButtonHtml();
					}
					
					$membershipbutton_html = '';
					if(isset($membershipbutton_data)){
						
						$membershipbutton_html = $membershipbutton_data->getButtonHtml();
					}
					echo $buybutton_html;
					echo $rentbutton_html;
					echo $membershipbutton_html;
					*/
				?>
			</div>
		</div>
	</div>
	
	  
	<div class="metabox--actions-btn"> 
		<a href="#" class="metabox-btn metabox-prev--btn" onclick="dapwp_goto_next_tab('button_configuration')">Previous</a>
		<a href="#" class="metabox-btn metabox-next--btn" onclick="dapwp_goto_next_tab('landing_page')">Next</a>
	</div>
</div>


</div>


<div class="tab-pane " id="landing_page" role="tabpanel">
<h3>Landing Page </h3>
<div class="tab-content-wrapper">
	<div class="metabox_individual metabox_list">
		<label class="metabox_label">Landing Page</label>
		<div class="metabox_right-content">
			<select  id="after_payment_action" name="after_payment_action"  class="form-control">
				<option value="diff_page" <?php if($after_payment_action == 'diff_page'){echo 'selected="selected"';} ?>>Redirect to a different page</option>
				<option value="same_page" <?php if($after_payment_action == 'same_page'){echo 'selected="selected"';} ?>>Refresh the same Page</option>
			</select>
		</div>
	</div>

	<div class="metabox_individual metabox_list diff_page_wrapper" <?php if($after_payment_action == 'same_page'){echo 'style="display:none"';} ?>>
		<label class="metabox_label">Enter Redirect URL</label>
		<div class="metabox_right-content">
			<input id="landing_url" type="text" name="landing_url" value="<?php echo $landing_url;?>" >
		</div>
	</div>
	<div class="metabox--actions-btn">
		<a href="#" class="metabox-btn metabox-prev--btn" onclick="dapwp_goto_next_tab('payment_button')">Previous</a>
		<a href="#" class="metabox-btn metabox-next--btn dap_save_post_meta" onclick="dapwp_save_payper_post(this)">Save</a>
	</div>
</div> 
</div>



