<?php
echo DapMemberShowLoader();

$affi_blur_radius = 12;
$affi_shad_clr = "#999";
$edit_id = '';

$page_action = "affiliate";

$allMemberPages_obj = DAP_MemberPages::loadByAction($page_action);
$page_id_already_used = array();
if(count($allMemberPages_obj)){
	foreach($allMemberPages_obj as $allMemberPage_obj){
		$page_id_already_used[] = $allMemberPage_obj->getPageId();
	}
}

  

$aff_link_outer = "checked='checked'";
$aff_performace_summary_outer = "checked='checked'";
$aff_payment_details_outer = "checked='checked'";
$aff_earnings_details_outer = "checked='checked'";
$aff_traffic_statistics_outer = "checked='checked'";
$aff_coupon_details_outer = "";

if(isset($_GET['id']) and is_numeric($_GET['id'])){
	$mp_obj = DAP_MemberPages::loadById($_GET['id']);
	if($mp_obj && ($mp_obj->getAction() == $page_action)){
		$edit_id = $mp_obj->getId();
		$template =  $mp_obj->getTemplateHtml();
		$styling_options = $mp_obj->getStylingOptions();
		$styling_options = explode("|||",$styling_options);
		 
		
		if(isset($styling_options[0])){
		
			$dispaly_opitons = explode("||",$styling_options[0]);
			//Display Options
			$aff_link_show = $dispaly_opitons[0];
			$aff_performace_summary_show = $dispaly_opitons[1];
			$aff_payment_details_show = $dispaly_opitons[2];
			$aff_earnings_details_show = $dispaly_opitons[3];
			$aff_traffic_statistics_show = $dispaly_opitons[4];	
			
			if($aff_link_show == 'false'){
				$aff_link_outer = '';
			}
			
			if($aff_performace_summary_show == 'false'){
				$aff_performace_summary_outer = '';
			}	
			if($aff_payment_details_show  == 'false'){
				$aff_payment_details_outer = '';
			}	
			if($aff_earnings_details_show  == 'false'){
				$aff_earnings_details_outer = '';
			}	
			if($aff_traffic_statistics_show == 'false'){
				$aff_traffic_statistics_outer = '';
			}		
			
			
		}
		
		if(isset($styling_options[1])){
			
			$external_shadow_customizer = explode("||",$styling_options[1]);
			$affi_spread_radius = $external_shadow_customizer[0];
			$affi_blur_radius = $external_shadow_customizer[1];
			$affi_hor_lnth = $external_shadow_customizer[2];
			$affi_ver_lnth = $external_shadow_customizer[3];
			$affi_shad_clr = $external_shadow_customizer[4];

		}
		
		
		if(isset($styling_options[2])){
			
			$template_Style = explode("||",$styling_options[2]);
			
			$affi_tmp_wid = $template_Style[0];
			$affi_tmp_bdr_style = $template_Style[1];
			$affi_tmp_bdr_wid = $template_Style[2];
			$affi_tmp_br_radius = $template_Style[3];
			$affi_tmp_border_color = $template_Style[4];
			$affi_tmp_padd_top = $template_Style[5];
			$affi_tmp_padd_bottom = $template_Style[6];
			$dm_affiliate_temp_aligment = $template_Style[7];
			
		}
		
		
		if(isset($styling_options[3])){
			
			$background_color = explode("||",$styling_options[3]);
			$affi_tmp_affi_background = $background_color[0];
			$affi_tmp_performace_background = $background_color[1];
			$affi_tmp_payment_background  = $background_color[2];
			$affi_tmp_earnnings_background = $background_color[3];
			$affi_tmp_traffic_background = $background_color[4];
			
			
			
		}
		
		if(isset($styling_options[4])){
			if($styling_options[4] == 'true'){
				$aff_coupon_details_outer = "checked='checked'";	
			}	
		}
		
		
		
	}else{
		unset($mp_obj);
	}	
}

?>

<div id="dap_member_page_wrapper">
	<div class="dap_member_affiliate_outer common_outer">
		<ul class="nav nav-tabs custom_tabbar" id="dap_member_affiliate_tabs" role="tablist"> 
		  <li class="nav-item">
			<a class="nav-link <?php if(!$mp_obj){ echo 'active';} ?>" href="#dap_member_affiliated_general"  role="tab" aria-selected="true"><span>1</span> <span class="fa_tick"><i class="fa fa-check"></i></span> General</a>
		  </li>
		  <li class="nav-item">
			<a class="nav-link <?php if($mp_obj){ echo 'active';} ?>" href="#dap_member_affiliated_preview"  role="tab" aria-selected="false"><span>2</span> <span class="fa_tick"><i class="fa fa-check"></i></span> Customizer</a>
		  </li>
		  <li class="nav-item ">
			<a class="nav-link" href="#dap_member_affiliated_shortdetails"  role="tab" aria-selected="false"><span>3</span> <span class="fa_tick"><i class="fa fa-check"></i></span> Short Details</a>
		  </li>
		</ul>
		
		<div class="tab-content dap_member_content">
			<div class="tab-pane <?php if(!$mp_obj){ echo 'active';} ?>" id="dap_member_affiliated_general" role="tabpanel" aria-labelledby="template-tab">
				<div class="master_heading d-flex align-items-center justify-content-between">
					<h4><i class="fa fa-retweet mr-2"></i> Affiliate Details Page</h4>
				</div>
				
				<h3 class="section_heading"><span class="count">1</span>Enter a Name for your Affiliate Details Page</h3>
				<div class="form-group row mb-4">
				  <div class="col-sm-7">
				   <div class="input-group mb-1">
					<div class="input-group-prepend">
					  <div class="input-group-text"><?php echo site_url();?></div>
					</div>
					<input type="text" placeholder="Enter Name" id="affiliate_name" class="form-control" name="affiliate_name" value="" <?php if($mp_obj){ echo 'disabled=disbled';}?>>
					<input type="hidden"  id="page_id" class="form-control" name="page_id" value="<?php if(isset($mp_obj)){echo $mp_obj->getPageId();}?>">
				  </div>
				  <div class="page_response"></div>
				 </div>
				 <div class="col-sm-2">
					
					<button type="button" class="dap_member_affiliate_create_page_btn btn btn-success create_btn theme-btn" onclick="dap_member_affiliate_create_page_btn(this)" <?php if(isset($mp_obj)){ echo 'disabled=disbled';}?>>Click to Create</button>
				 </div>
				</div>
				
				<div class="form-group row mb-4">
				  <div class="col-sm-7">
					<div class="or">
					  <span>OR</span>
					</div>
				  </div>
				</div>
				
				<div class="form-group row">
					<div class="col-sm-2 align-items-center d-flex">
						<label> Select an existing page</label>
					</div>
					<div class="col-sm-5 pl-1">
						<select class="form-control" id="affiliate_page_url" name="affiliate_page_url" <?php if(isset($mp_obj)){ echo 'disabled=disbled';}?>>
							<option value="">Select a URL</option>
							<?php
							$page_ids = get_all_page_ids();
							foreach($page_ids as $page){
								$page_name = get_page( $page );
							    $selected = '';
								if ($page_name->post_status == 'publish'){
									
									if(isset($mp_obj) && ($mp_obj->getPageId() == $page)){
										$selected = 'selected=selected';
									}else if(in_array($page,$page_id_already_used)){
										continue;
										
									}
								?>
								<option value='<?php echo ($page); ?>' <?php echo $selected;?> >
								<?php echo get_permalink($page); ?>
								</option>
								<?php }

							}//close foreach loop ?>
						</select>
					</div>
				</div>
				
				<h3 class="section_heading"><span class="count">2</span> Select Template</h3>
				<ul class="choices-template row ml-3">
					 <li class="onecolumn_template1 <?php if(($mp_obj) && ($mp_obj->getTemplate() == 'template1')){ echo "activeCustomize";}?>">
						<label>
							<div class="template_preview_img">
								<img src="<?= plugin_dir_url(__FILE__) ?>includes/templates/affiliate/template1/preview.jpg" onclick="dap_affiliate_preview_temp('affiliate','template1')" class="select_temp">
							</div>
							<div class="active-box-div">
								<div class="true-icon">
									<i class="fa fa-check">
									</i>
								</div>
							</div>
							<div class="pre-box-div">
								<div class="pre-icon">
									<input type="button" class="preview_temp btn btn-success mr-2" onclick="dap_affiliate_preview_temp('affiliate','template1')" value="Preview">
									<input type="button" class="preview_temp btn btn-warning" onclick="dap_affiliate_customize_temp('affiliate','template1')" value="Customize">
								</div>
							</div>
						</label>
					</li>
				 </ul>
				 
				 <div class="row">
					<div class="col-sm-12 tab_bottom_button">
						  <a class="btn btn-success mb-2 theme-btn" href="<?php echo admin_url('admin.php?page=dap_member_pages') ?>">Return To Member Pages</a>
						   <?php if(isset($mp_obj)){ ?>
							<button type="button" class="btn btn-success theme-btn" onclick="dap_save_affiliate_info('1')">Save</button>
						  <?php } ?>
						  <button type="button" class="btn btn-success theme-btn" onclick="dap_member_goto_next_tab('#dap_member_affiliated_preview');">Next <img src="<?php echo plugin_dir_url(__FILE__); ?>includes/images/next-arrow.png" alt=""></button>
						  
					</div>
				 </div>
			</div> <!-- General Tab -->
			
			<div class="tab-pane <?php if($mp_obj){ echo 'active';} ?>" id="dap_member_affiliated_preview" role="tabpanel" aria-labelledby="template-tab">
				<div class="master_heading d-flex align-items-center">
					<h4><i class="fa fa-info mr-2" aria-hidden="true"></i> Affiliate Details</h4>
					<input type="hidden" name="affiliate_edit_id" value='<?php echo $edit_id; ?>'>
					<input type="hidden" name="template_selected_name" value='<?php if($mp_obj){ echo $mp_obj->getTemplate();}?>'>
				</div>
				
				<div class="row">
					<div class="col-sm-3 profile_left_part">
						<div class="customized-optional">
						  <div class="customizer_heading">Display Options </div>
							<ul class="templates-styles afflilate_show_section_option">
								<li>
									<label><b>Affiliate Link</b></label>
									<div class="input-group ">											
										 <input type="checkbox" <?php echo $aff_link_outer; ?> data-id="aff_link_outer" name="aff_link_outer" value="" data-toggle="toggle">
									</div>
								</li>
								<li>
									<label><b>Affiliate Performance Summary</b></label>
									<div class="input-group ">											
										 <input type="checkbox"  <?php echo $aff_performace_summary_outer; ?> data-id="aff_performace_summary_outer" name="aff_performace_summary_outer" value="" data-toggle="toggle">
									</div>
								</li>
								<li>
									<label><b>Payment Details</b></label>
									<div class="input-group ">											
										 <input type="checkbox"  <?php echo $aff_payment_details_outer; ?> data-id="aff_payment_details_outer" name="aff_payment_details_outer" value="" data-toggle="toggle">
									</div>
								</li>
								<li>
									<label><b>Earnings Details</b></label>
									<div class="input-group ">											
										 <input type="checkbox"  <?php echo $aff_earnings_details_outer; ?> data-id="aff_earnings_details_outer" name="aff_earnings_details_outer" value="" data-toggle="toggle">
									</div>
								</li>
								<li>
									<label><b>Traffic Statistics</b></label>
									<div class="input-group ">											
										 <input type="checkbox"  <?php echo $aff_traffic_statistics_outer; ?>  data-id="aff_traffic_statistics_outer" name="aff_traffic_statistics_outer" value="" data-toggle="toggle">
									</div>
								</li>
								
							</ul>
						</div>
						<div class="customized-optional">
						  <div class="customizer_heading">Affiliate Coupon</div>
							<ul class="templates-styles afflilate_show_section_option">
								<li>
									<label><b>Show Affiliate Coupon</b></label>
									<div class="input-group ">											
										 <input type="checkbox"  <?php echo $aff_coupon_details_outer; ?>  data-id="aff_coupon_details_outer" name="aff_coupon_details_outer" value="" data-toggle="toggle">
										 <div class="tool-tip"><i class="fa fa-info-circle" aria-hidden="true"></i><div class="toll-tip-desc">If you want to offer coupons to your affiliates, and want them to see the coupon details in their affiliate profile, enable this section. </br>

It'll ONLY show for affiliates who have a coupon.</div></div>
									</div>
									
									
								</li>
							</ul>
						</div>	
						
						<div class="customized-optional">
						  <div class="customizer_heading">External Shadow Customizer</div>
							<ul class="templates-styles">
							 <li>
								<label>Spread Radius </label>
									<div class="input-group ">
										<div class="input-group colorpicker-component m_top_bottom">
											<input id="affi_spread_radius"  name="affi_spread_radius" class="form-control" data-slider-id='ex1Slider' type="text" data-slider-min="0" data-slider-max="20" data-slider-step="1" data-slider-value="<?php echo $affi_spread_radius; ?>" /> 
										</div>
									</div>
								</li>
								<li>
									<label>Blur Radius </label>
									<div class="input-group ">
										<div class="input-group colorpicker-component m_top_bottom">
											<input id="affi_blur_radius"  name="affi_blur_radius" class="form-control" data-slider-id='ex1Slider' type="text" data-slider-min="0" data-slider-max="20" data-slider-step="1" data-slider-value="<?php echo $affi_blur_radius; ?>" /> 
										</div>
									</div>
								</li>
								<li>
									<label>Horizontal Length </label>
									<div class="input-group ">
										<div class="input-group colorpicker-component m_top_bottom">
											<input id="affi_hor_lnth"  name="affi_hor_lnth" class="form-control" data-slider-id='ex1Slider' type="text" data-slider-min="0" data-slider-max="20" data-slider-step="1" data-slider-value="<?php echo $affi_hor_lnth; ?>" /> 
										</div>
									</div>
								</li>
								<li>
									<label>Vertical Length </label>
									<div class="input-group ">
										<div class="input-group colorpicker-component m_top_bottom">
											<input id="affi_ver_lnth"  name="affi_ver_lnth" class="form-control" data-slider-id='ex1Slider' type="text" data-slider-min="0" data-slider-max="20" data-slider-step="1" data-slider-value="<?php echo $affi_ver_lnth; ?>" /> 
										</div>
									</div>
								</li>
								<li>
									<label>Shadow Color  </label>
									<div class="input-group ">
										 <div id="affi_shad_clr_div" class="input-group colorpicker-component">
										  <input type="text" value="<?php echo $affi_shad_clr;?>" name="affi_shad_clr" id="affi_shad_clr" class="form-control temp_style_fields" />
										  <span class="input-group-addon">
											<i style="background-color:><?php echo $affi_shad_clr;?>"></i>
										   </span>
									  </div>
									</div>
								</li>
							</ul>
						</div>
					</div>
					
					<div class="col-sm-6 profile_center_part ">
						<div class="dap_affiliate_template_outer_link">
						 <?php if($mp_obj){ echo '<link rel="stylesheet" href="'.plugin_dir_url(__FILE__).'includes/templates/affiliate/'.$mp_obj->getTemplate().'/style.css?'.rand(10,1000).'">';	 }?>
						</div>
						
						<div class="customize_html_outer">
							<?php if($mp_obj){ echo stripcslashes($mp_obj->getTemplateHtml()); }?>
						</div>
					</div>
					<div class="col-sm-3 profile_right_part">
						<div class="customized-optional">
						  <div class="customizer_heading">Template Style </div>
							<ul class="templates-styles">
								<li>
									<label>Template Alignment</label>
									<div class="input-group ">
										<select class="input-group form-control" id="dm_affiliate_temp_aligment" name="dm_affiliate_temp_aligment">
										<?php 
										$dm_affiliate_temp_aligment_array = array('center'=>'Center','left'=>'Left','right'=>'Right');

										foreach($dm_affiliate_temp_aligment_array as $key=>$value){
											$slected = '';
											if($key == $dm_affiliate_temp_aligment ){

											$slected = 'selected=selected';
											}
											echo "<option value='".$key."' $slected >$value</option>";
										}
										?>
											
											
										</select>
									</div>
							</li>
								
								
								<li class="customized_optional_single_column m_top_bottom">
									<label>Template Width</label>
									<div class="input-group ">
										<div class="input-group colorpicker-component">
											<input id="affi_tmp_wid" class="form-control" data-slider-id='ex1Slider' type="text" data-slider-min="400" data-slider-max="1400" data-slider-step="1" data-slider-value="<?php echo $affi_tmp_wid;?>" name="affi_tmp_wid"/> 
										</div>
									</div>
								</li>
								
								<li>
									<label>Border Style  </label>
									<div class="input-group ">
										<select class="input-group form-control" id="affi_tmp_bdr_style" name="affi_tmp_bdr_style">
											<?php 
											
											$affi_tmp_bdr_style_array = array('none'=>'None','solid'=>'Solid','dashed'=>'Dashed','dotted'=>'Dotted');
											
											foreach($affi_tmp_bdr_style_array as $key=>$value){
												 $slected = '';
												if($key == $affi_tmp_bdr_style ){
													
													$slected = 'selected=selected';
												}
												echo "<option value='".$key."' $slected >$value</option>";
											}
											?>
										
										</select>
									</div>
								</li>
								<li>
									<label>Border Width</label>
									<div class="input-group ">
										<div class="input-group colorpicker-component m_top_bottom">
											<input id="affi_tmp_bdr_wid"  name="affi_tmp_bdr_wid" class="form-control" data-slider-id='ex1Slider' type="text" data-slider-min="0" data-slider-max="50" data-slider-step="1" data-slider-value="<?php echo $affi_tmp_bdr_wid; ?>" /> 
										</div>
									</div>
								</li>
								<li>
									<label>Border Radius</label>
									<div class="input-group ">
										<div class="input-group colorpicker-component m_top_bottom">
											<input id="affi_tmp_br_radius"  name="affi_tmp_br_radius" class="form-control" data-slider-id='ex1Slider' type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="<?php echo $affi_tmp_br_radius; ?>" /> 
										</div>
									</div>
								</li>
								
								<li>
									<label>Border Color </label>
									<div class="input-group ">
									  <div id="affi_tmp_border_color_div" class="input-group colorpicker-component"> 
									  <input type="text" value="<?php echo $affi_tmp_border_color;?>" name="affi_tmp_border_color" class="form-control" id="affi_tmp_border_color" />									  
									   <span class="input-group-addon">
										  <i style="background-color:<?php echo $affi_tmp_border_color;?>"></i>
									   </span>
									  </div>
									</div>
									
								</li>
								<li>
									<label>Padding Top </label>
									<div class="input-group ">
										<div class="input-group colorpicker-component m_top_bottom">
											<input id="affi_tmp_padd_top"  name="affi_tmp_padd_top" class="form-control" data-slider-id='ex1Slider' type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="<?php echo $affi_tmp_padd_top; ?>" /> 
										</div>
									</div>
								</li>
								<li>
									<label>Padding Bottom </label>
									<div class="input-group ">
										<div class="input-group colorpicker-component m_top_bottom">
											<input id="affi_tmp_padd_bottom"  name="affi_tmp_padd_bottom" class="form-control" data-slider-id='ex1Slider' type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="<?php echo $affi_tmp_padd_bottom; ?>" /> 
										</div>
									</div>
								</li>
							</ul>
						</div>
					
					 <div class="customized-optional">
						  <div class="customizer_heading">Background Color </div>
							<ul class="templates-styles">
								<li class="show_orderbump_top_bottom_outer">
									<label>Affiliate Link </label>
									<div class="input-group ">
									  <div id="affi_tmp_affi_background_div" class="input-group colorpicker-component">
									  <input type="text" value="<?php echo $affi_tmp_affi_background;?>" name="affi_tmp_affi_background" id="affi_tmp_affi_background" class="form-control temp_style_fields" />
									  <span class="input-group-addon">
										  <i style="background-color:<?php echo $affi_tmp_affi_background;?>"></i>
									   </span>
									  </div>
									</div>
								</li>
								<li class="show_orderbump_top_bottom_outer">
									<label>Affiliate Performance Summary </label>
									<div class="input-group ">
									  <div id="affi_tmp_performace_background_div" class="input-group colorpicker-component">
									  <input type="text" value="<?php echo $affi_tmp_performace_background;?>" name="affi_tmp_performace_background" id="affi_tmp_performace_background" class="form-control temp_style_fields" />
									  <span class="input-group-addon">
										  <i style="background-color:<?php echo $affi_tmp_performace_background;?>"></i>
									   </span>
									  </div>
									</div>
								</li>
								<li class="show_orderbump_top_bottom_outer">
									<label>Payment Details </label>
									<div class="input-group ">
									  <div id="affi_tmp_payment_background_div" class="input-group colorpicker-component">
									  <input type="text" value="<?php echo $affi_tmp_payment_background;?>" name="affi_tmp_payment_background" id="affi_tmp_payment_background" class="form-control temp_style_fields" />
									  <span class="input-group-addon">
										  <i style="background-color:<?php echo $affi_tmp_payment_background;?>"></i>
									   </span>
									  </div>
									</div>
								</li>
								<li class="show_orderbump_top_bottom_outer">
									<label>Earnings Details </label>
									<div class="input-group ">
									  <div id="affi_tmp_earnnings_background_div" class="input-group colorpicker-component">
									  <input type="text" value="<?php echo $affi_tmp_earnnings_background;?>" name="affi_tmp_earnnings_background" id="affi_tmp_earnnings_background" class="form-control temp_style_fields" />
									  <span class="input-group-addon">
										  <i style="background-color:<?php echo $affi_tmp_earnnings_background;?>"></i>
									   </span>
									  </div>
									</div>
								</li>
								<li class="show_orderbump_top_bottom_outer">
									<label>Traffic Statistics </label>
									<div class="input-group ">
									  <div id="affi_tmp_traffic_background_div" class="input-group colorpicker-component">
									  <input type="text" value="<?php echo $affi_tmp_traffic_background;?>" name="affi_tmp_traffic_background" id="affi_tmp_traffic_background" class="form-control temp_style_fields" />
									  <span class="input-group-addon">
										  <i style="background-color:<?php echo $affi_tmp_traffic_background;?>"></i>
									   </span>
									  </div>
									</div>
								</li>
							</ul>
						</div>
					</div>
					  <div class="col-sm-12 tab_bottom_button">
						  <button type="button" class="btn btn-success theme-btn" onclick="dap_member_goto_next_tab('#dap_member_affiliated_general');"><img src="<?php echo plugin_dir_url(__FILE__); ?>includes/images/prev-arrow.png" alt=""> Previous</button>
							<button type="button" class="btn btn-success theme-btn" onclick="dap_save_affiliate_info()">Save & Next <img src="<?php echo plugin_dir_url(__FILE__); ?>includes/images/next-arrow.png" alt=""></button>
						   <?php if(isset($mp_obj) && 0){ ?>
							
							 <button type="button" class="btn btn-success theme-btn" onclick="dap_member_goto_next_tab('#dap_member_affiliated_shortdetails');">Next <img src="<?php echo plugin_dir_url(__FILE__); ?>includes/images/next-arrow.png" alt=""></button>
						  <?php } ?> 
					</div>
				</div>
			</div> <!-- Preview Tab -->
			
			<div class="tab-pane" id="dap_member_affiliated_shortdetails" role="tabpanel" aria-labelledby="template-tab">
				<div class="row">
					<div class="col-sm-12 my-5 ">
									
						
						<div class="dap_member_login_details">
							<span class="check_heading">Here is your Affiliate page URL:</span>
							<span class="shortcode_page_link">
							<?php 
							if($mp_obj){
							echo  '<a href="'.get_permalink($mp_obj->getPageId()).'" target="_blank">'.get_permalink($mp_obj->getPageId()).'</a>';
							} 
							?>
							</span>
							<br><br>
							<div class="">
							<span class="check_heading">Here is your Affiliate page Shortcode:</span>
							<span id="dynamic_copyable_text_login" class="d-inline shortcode_display" >
							<?php 
							if($mp_obj){
								echo  dapMemberGetAffilateShortcodeNameById($mp_obj->getId());
							}
							?>
							</span>
							<span data-id="dynamic_copyable_text_login" class="copy-btn theme-button" onclick="dap_member_copy_to_clipboard(this)"><i class="fa fa-files-o" aria-hidden="true"></i> Copy</span>
							</div>
							
							
			
						</div>
						
						
						
					</div>
					
					
					
					
				
					<div class="col-sm-12 tab_bottom_button">
						  
						  <button type="button" class="btn btn-success theme-btn" onclick="dap_member_goto_next_tab('#dap_member_affiliated_preview');"><img src="<?php echo plugin_dir_url(__FILE__); ?>includes/images/prev-arrow.png" alt=""> Previous</button>
						  <?php if(isset($mp_obj)){ ?>
							<button type="button" class="btn btn-success theme-btn" onclick="dap_save_affiliate_info('1')">Save</button>
						  <?php } ?>
						  <a class="btn btn-success theme-btn" href="<?php echo admin_url('admin.php?page=dap_member_pages') ?>">Return To Member Pages</a>
						  
					</div>
				 </div>
			</div> <!-- Short Details -->
		</div>
	</div>
</div>		


<!-- perview tempate popup start -->
<div class="modal fade " id="dap_affiliate_preview_wrapper_modal">
	<div class="modal-dialog  modal-lg">
	    <div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
				<i class="fa fa-close"></i></button>
				<h4 class="modal-title w-100" > Preview
				</h4>
			</div>
			<div class="modal-body">
			</div>
	    </div>
	</div>
 </div>
<!-- perview tempate popup end --> 
<style>
	.frontendVisibility{display:none}
</style>
