<?php 


$site_url = site_url();
$dm_affiliate_temp_aligment = 'center';
$aff_link_show = true;
$aff_performace_summary_show = true;
$aff_payment_details_show = true;
$aff_earnings_details_show = true;
$aff_traffic_statistics_show = true;


$affi_tmp_wid = 1050;   
$affi_tmp_bdr_wid= 1;
$affi_tmp_bdr_wid= 0;
$affi_tmp_padd_top= 10;
$affi_tmp_padd_bottom= 10;
$affi_ver_lnth= 0;
$affi_hor_lnth= 0;
$affi_blur_radius= 12;
$affi_spread_radius= 0;
$affi_tmp_br_radius = 0;    

$default_numaric_values = array(	
	"affi_tmp_wid" => $affi_tmp_wid,
	"affi_tmp_bdr_wid" => $affi_tmp_bdr_wid,
	"affi_tmp_bdr_wid" => $affi_tmp_bdr_wid,
    "affi_tmp_padd_top" => $affi_tmp_padd_top,
    "affi_tmp_padd_bottom" => $affi_tmp_padd_bottom,
    "affi_ver_lnth" => $affi_ver_lnth,
    "affi_hor_lnth" => $affi_hor_lnth,
    "affi_blur_radius" => $affi_blur_radius,
    "affi_spread_radius" => $affi_spread_radius,
    "affi_tmp_br_radius" => $affi_tmp_br_radius,
);


$affi_tmp_bdr_style = "solid";
$aff_traffic_statistics_outer = false;
$aff_earnings_details_outer = false;
$aff_payment_details_outer = false;
$aff_performace_summary_outer = false;
$aff_link_outer = false;
	
$default_style_values = array(	
	"affi_tmp_bdr_style" => $affi_tmp_bdr_style,
	"aff_traffic_statistics_outer" => $aff_traffic_statistics_outer,
	"aff_earnings_details_outer" => $aff_earnings_details_outer,
	"aff_payment_details_outer" => $aff_payment_details_outer,
	"aff_performace_summary_outer" => $aff_performace_summary_outer,
	"aff_link_outer" => $aff_link_outer,
	"dm_affiliate_temp_aligment" => $dm_affiliate_temp_aligment,
);

$affi_tmp_border_color = "#ddd";
$affi_tmp_affi_background = "#f9f9f9";
$affi_tmp_performace_background = "#f9f9f9";
$affi_tmp_payment_background = "#f9f9f9";
$affi_tmp_earnnings_background = "#f9f9f9";
$affi_tmp_traffic_background = "#f9f9f9";
$affi_shad_clr = "#999999";

$default_colorpicker_values = array(
	"affi_tmp_border_color" => $affi_tmp_border_color,
	"affi_tmp_affi_background" => $affi_tmp_affi_background,
	"affi_tmp_performace_background" => $affi_tmp_performace_background,
	"affi_tmp_payment_background" => $affi_tmp_payment_background,
	"affi_tmp_earnnings_background" => $affi_tmp_earnnings_background,
	"affi_tmp_traffic_background" => $affi_tmp_traffic_background,
	"affi_shad_clr" => $affi_shad_clr,
	
);

$html  =  '<div class="dap_member_affi_temp_outer"><div class="dap_member_affiliate_inner" id="dap_member_affiliate_inner">
								<div class="enter_name_outer aff_link_outer">
									<div class="dap_member_tiny_editor">
										<h3 class="section_heading">Affiliate Link</h3>
									</div>
									<div class="form-group row mt-4">
										<div class="col-sm-12">
											<div class="dap_member_tiny_editor"><h5 class="section_sub_heading">Your Affiliate Link - redirects to home page</h5> </div>
											<div class="affiliate_link">
												<p>'.SITE_URL_DAP.'/dap/a/?a=%%USERID%% <span><button class="btn btn-info btn-sm ml-2 "><a href="'.SITE_URL_DAP.'/dap/a/?a=%%USERID%%" target="_blank"><span class="dap_member_tiny_editor">Click to test here</span></a></button></span></p>
											</div>
										</div>
									</div>
									
									<div class="form-group row mt-4">
										<div class="col-sm-12">
											<div class="dap_member_tiny_editor">
												<h5 class="section_sub_heading">Affiliate Specific Page</h5>
											</div>
											<div class="dap_member_tiny_editor">
												<span>To link to a specific page, just add the text "&p=<insert_url_here>" to the end of your affiliate link, like this: (no "http://" in the 2nd link at the end - should start with "www")</span>
											</div>		
											<div class="affiliate_link ">
												<div class="input-group mb-1">
													<div class="input-group-prepend">
														<div class="input-group-text affiliate_link_to" data-url="'.SITE_URL_DAP.'/dap/a/?a=%%USERID%%&p=">'.SITE_URL_DAP.'/dap/a/?a=%%USERID%%&p=www.example.com/somepage.html</div>
													</div>
													<input type="text" placeholder="www.example.com/somepage.html" id="affiliate_link_to_field " class="form-control %%AFFBACKEND%%" name="affiliate_link_to_field" value="">
												</div>
											</div>
										</div>
									</div>
								</div>
								<div class="enter_name_outer aff_coupon_details_outer" style="display:none">
									<div class="dap_member_tiny_editor"><h3 class="section_heading">Your Referral Coupon Details: </h3></div>
									<div class="form-group row mt-4">
										<div class="col-sm-12">
											<div class="table-responsive affiliate_common_table_div">
												<table class="table table-bordered" id="aff_coupon_details_table">
													<thead>
														<tr>
															<th class="dap_member_tiny_editor">Coupon Code</th>
															<th class="dap_member_tiny_editor">Amount	</th>
															<th class="dap_member_tiny_editor">Used</th>
															<th class="dap_member_tiny_editor">Max Limit</th>
															<th class="dap_member_tiny_editor">Date Start</th>
															<th class="dap_member_tiny_editor">Date End</th>
														</tr>
													</thead>
													<tbody><tr  class="frontendVisibility"><td colspan="9">%%AFFCOUPONDETAILS%%</td></tr>
															<tr  class="backendVisibility">
																<td>PROMO</td>
																<td>$15</td>
																<td>10</td>
																<td>20</td>
																<td>12-31-1999</td>
																<td>12-31-9999</td>
															</tr>
													</tbody>
												</table>
											</div>
										</div>
									</div>
								</div>
								<div class="enter_name_outer aff_performace_summary_outer">
									<div class="dap_member_tiny_editor"><h3 class="section_heading">Affiliate Performance Summary</h3></div>
									<div class="form-group row mt-4">
										<div class="col-sm-12">
											<div class="table-responsive affiliate_common_table_div">
												<table class="table table-bordered" id="affiliate_performance_summary_table">
													<thead>
														<tr>
															<th class="dap_member_tiny_editor">Aff Id</th>
															<th class="dap_member_tiny_editor">Name</th>
															<th class="dap_member_tiny_editor">Email</th>
															<th class="dap_member_tiny_editor">Clicks</th>
															<th class="dap_member_tiny_editor">Referrals (Free & Paid)</th>
															<th class="dap_member_tiny_editor">Cash Earned</th>
															<th class="dap_member_tiny_editor">Credits Earned</th>
															<th class="dap_member_tiny_editor">Sales Generated</th>
															<th class="dap_member_tiny_editor">Earnings Per Click (EPC)</th>
														</tr>
													</thead>
													<tbody><tr><td colspan="9">%%AFFILIATESUMMARYDATAREPLACEDINFRONTEND%%</td></tr></tbody>
												</table>
											</div>
										</div>
									</div>
								</div>
								
								<div class="enter_name_outer aff_payment_details_outer">
									<div class="dap_member_tiny_editor"><h3 class="section_heading">Payment Details</h3></div>
									<div class="form-group row mt-4">
										<div class="col-sm-12">
											<div class="table-responsive affiliate_common_table_div">
												<table class="table table-bordered" id="payment_details_table">
													<thead>
														<tr>
															<th class="dap_member_tiny_editor">Aff Id</th>
															<th class="dap_member_tiny_editor">Name</th>
															<th class="dap_member_tiny_editor">Email</th>
															<th class="dap_member_tiny_editor">Date/Time</th>
															<th class="dap_member_tiny_editor">Amount Paid($)</th>
															<th class="dap_member_tiny_editor">Cash Credit</th>
														</tr>
													</thead>
													<tbody><tr><td colspan="6">%%PAYMENTDETAILSDATAREPLACEDINFRONTEND%%</td></tr></tbody>
												</table>
											</div>
										</div>
									</div>
								</div>
								
								<div class="enter_name_outer aff_earnings_details_outer">
									<div class="dap_member_tiny_editor"><h3 class="section_heading">Earnings Details</h3></div>
									<div class="form-group row mt-4">
												<div class="admin_earning_div">%%ADMINEARNINGSDETAILSDATAREPLACEDINFRONTEND%%</div> 
										<div class="col-sm-12 earnings_details_table_outer %%ADMINEARNINGSDETAILSDATAREPLACEDINFRONTENDCLASS%%">
											<div class="table-responsive affiliate_common_table_div">
												<table class="table table-bordered" id="earnings_details_table">
													<thead>
														<tr>
															<th class="dap_member_tiny_editor">Referral Details</th>
															<th class="dap_member_tiny_editor">Referral Date</th>
															<th class="dap_member_tiny_editor">Refund Date</th>
															<th class="dap_member_tiny_editor">Product</th>
															<th class="dap_member_tiny_editor">Earnings Type </th>
															
															
															
															
															<th class="dap_member_tiny_editor">Amount Earned <?php echo Dap_Config::get("CURRENCY_SYMBOL");?> </th>
															
															
														</tr>
													</thead>
													<tbody><tr><td colspan="12">%%EARNINGSDETAILSDATAREPLACEDINFRONTEND%%</td></tr></tbody>
												</table>
											</div>
										</div>
										
										
									</div>
								</div>
							
								<div class="enter_name_outer aff_traffic_statistics_outer">
									<div class="dap_member_tiny_editor"><h3 class="section_heading">Traffic Statistics</h3></div>
									<div class="form-group row mt-4">
										<div class="col-sm-12">
											<div class="table-responsive affiliate_common_table_div">
												<table class="table table-bordered" id="traffic_statistics_table">
													<thead>
														<tr>
															<th class="dap_member_tiny_editor">User Id</th>
															<th class="dap_member_tiny_editor">Name</th>
															<th class="dap_member_tiny_editor">HTTP Referer</th>
															<th class="dap_member_tiny_editor">Destination</th>
															<th class="dap_member_tiny_editor">Date/Time</th>
														</tr>
													</thead>
													<tbody><tr><td colspan="5">%%TRAFFICSTATISTICSDATAREPLACEDINFRONTEND%%</td></tr></tbody>
												</table>
											</div>
										</div>
									</div>
								</div>
							 </div>
					 </div>
					';
 
 

 

 
 
 
 
 
 

$css_file_path = dap_member_path."includes/templates/affiliate/template1/style.css?".rand(1,1000);

if(!isset($_SESSION['return_data'])){
echo json_encode(array('html'=>$html,'css_file_path'=>$css_file_path,'default_numaric_values'=>$default_numaric_values,'default_style_values'=>$default_style_values,'default_colorpicker_values'=>$default_colorpicker_values));
die;
}
