<?php
$gdprpref='wpf5gdpr-';
if(isset($_POST['gdprsetpp']))
{
	update_option($gdprpref.'pp-version',$_POST['gdprppversion']);
   update_option($gdprpref.'pp-lusr',$_POST['gdprlusr']);
   update_option($gdprpref.'pp-nlusr',$_POST['gdprnlusr']);
   update_option($gdprpref.'pp-bef',$_POST['befpp']);
   update_option($gdprpref.'pp-aft',$_POST['aftpp']);
    if(isset($_POST['wpgdprppeu']))
   {
	   update_option($gdprpref.'pp-eu','1');
   }
   else
   {
		update_option($gdprpref.'pp-eu','0');
   }
}


?>
<h3 >Privacy Policy - <a href="https://wpfreshstart5.com/support/knowledgebase/privacy-policy/" target="_blank" style="font-size:0.8em">Support</a></h3>
 <!-- 1. Place <b>[wpgdprPP]</b> shortcode on your existing Privacy Policy page to add an accept button.<br> -->
<p>Select your Privacy Policy page below, so users can be redirected there to give their consent.</p>

    <label for="">Redirect logged in users to Privacy Policy?</label>
	<label class="radio-inline"><input id="lusr" type="radio" style="margin-right:6px;margin-left:10;outline: none;"  name="gdprlusr" value="1" <?php if(get_option($gdprpref.'pp-lusr')=='1'){echo "checked";} ?>>Yes</label>
	<label class="radio-inline"><input id="lusr" type="radio" style="margin-right:6px;margin-left:10;outline: none;" name="gdprlusr" value="0" selected <?php if(get_option($gdprpref.'pp-lusr')=='0'){echo "checked";} ?>>No</label>
<br/>
<br/>

	<label for="">Redirect not logged in users to Privacy Policy</label>
	<label class="radio-inline"><input id="lusr" type="radio" style="margin-right:6px;margin-left:10;outline: none;"  name="gdprnlusr" value="1" <?php if(get_option($gdprpref.'pp-nlusr')=='1'){echo "checked";} ?>>Yes</label>
	<label class="radio-inline"><input id="lusr" type="radio" style="margin-right:6px;margin-left:10;outline: none;"  name="gdprnlusr" value="0" selected <?php if(get_option($gdprpref.'pp-nlusr')=='0'){echo "checked";}  ?>>No</label>

<br/>
<br/>


	<label>
	<input type="checkbox" <?php if(get_option($gdprpref.'pp-eu')=='1'){echo "checked";} ?> name="wpgdprppeu" style="margin-right:10px;">
Display only to visitors from EU</label>
<br/>
<br/>



	<label for="">Select Privacy Policy Page</label>
	<br>
	<p id="lusr" style="margin: 0 0 0px;"><?php wpfresh5_gdpr_all_pages('befpp') ?></p>
<p><b>Note:</b> you can create a GDPR ready Privacy Policy page <a href="<?php echo admin_url( 'admin.php?page=wp-freshstart5-legal' );?>">here</a></b>
<br/>
<br/>

	<label for="">What’s the version number of your current Privacy policy?</label>
	<br/>
	<input type="text" name="gdprppversion" title=" Make sure you change the version number every time when you make a change in the Privacy Policy documents so that your site visitors can be redirected afresh." value="<?php echo get_option($gdprpref.'pp-version'); ?>">
<br/>
<br/>
       <label for="">Select where to redirect after accepted</label>

	<p id="lusr" style="margin: 0 0 0px;"><?php wpfresh5_gdpr_all_pages('aftpp') ?></p>


 <input type="hidden" value="1" name="gdprsetpp">
<!--  <h4>Download your GDPR compliant Privacy Policy Template to modify</h4><br />
	<a href="http://teknikforce.com/dlsoft/wpgdpr_privacy_aErr.docx"><input type="button" class="btn btn-primary samplebtn" value="" class="btn btn-primary"></a> -->