<?php
$wpfs5_pp_page_id = 0;
$wpfs5_tc_page_id = 0;
$wpfs5_cp_page_id = 0;
function wpfresh5_settings_legal_tab_privacygenerator( $settings ) {
	$settings = isset( $settings['legal']['common'] ) ? $settings['legal']['common'] : false;
	$site_title = get_bloginfo( 'name' );
	$admin_email = get_bloginfo( 'admin_email' );
	// var_dump($settings);
	$company = isset( $settings['company'] ) ? trim( $settings['company'] ) : '';
	$country = isset( $settings['country'] ) ? trim( $settings['country'] ) : '';
	$address = isset( $settings['address'] ) ? trim( $settings['address'] ) : '';
?>
<h3>GDPR Compliant Privacy Policy Generator</h3>
<p>Complete this wizard and click "Generate Privacy Policy" in step 4 to generate a GDPR compliant Privacy Policy that applies to your business/website</p>
<div id="wpfresh5-wizard2" class="wpfresh5-wizard">
	<fieldset>
	    <legend><i class="fa fa-list-ul"></i> 1. Your Details </legend>
	    <div class="form-section">
	    	<table class="form-table">
	    	    <?php wpfresh5_field_text( 'Your Website Name', 'wpfresh5_privacywizard[webinfo][name]', $site_title, false, '', 'Your WP Site Name' ); ?>
	    	    <?php wpfresh5_field_text( 'Your Company Name (Optional)', 'wpfresh5_privacywizard[webinfo][company]', $company, false, '', 'If you are a business entity' ); ?>
	    	    <?php wpfresh5_field_text( 'Your Website URL', 'wpfresh5_privacywizard[webinfo][url]', get_site_url(), false, '', 'Your WP Site URL' ); ?>
	    	    <?php wpfresh5_field_text( 'Your e-mail', 'wpfresh5_privacywizard[webinfo][email]', $admin_email ); ?>
	    	    <?php wpfresh5_field_text( 'Last Updated', 'wpfresh5_privacywizard[webinfo][lastupdated]', date( 'd-m-Y') ); ?>
	    	    <?php wpfresh5_field_textarea( 'Your Address', 'wpfresh5_privacywizard[webinfo][address]', $address, false, 'regular-text' ); ?>
	    	    <?php wpfresh5_field_text( 'Your Country', 'wpfresh5_privacywizard[webinfo][country]', $country ); ?>
	    	</table>
	    	<br/>
	          <nav>
	                <span class="form-nav-next button button-primary">Next <i class="fa fa-angle-double-right"></i></span>
	          </nav>
	    </div>
	</fieldset>
	<fieldset>
	      <legend><i class="fa fa-drivers-license"></i> 2. Use of your data </legend>
	      <div class="form-section">
	      	<h3> Check those that apply</h3>
	      	<table class="form-table">
	      	    	<?php wpfresh5_field_checkbox_inner( 'Affiliate Marketing', 'wpfresh5_privacywizard[datause][ganalytics]' ); ?>
	      	    	<?php wpfresh5_field_checkbox_inner( 'Email Marketing', 'wpfresh5_privacywizard[datause][ganalytics]' ); ?>
	      	    	<?php wpfresh5_field_checkbox_inner( 'News and updates', 'wpfresh5_privacywizard[datause][ganalytics]' ); ?>
	      	    	<?php wpfresh5_field_checkbox_inner( 'Offer personalized services', 'wpfresh5_privacywizard[datause][ganalytics]' ); ?>
	      	</table>
	      	<br/>
	            <nav>
	                  <span class="form-nav-prev button button-secondary"><i class="fa fa-angle-double-left"></i> Prev</span>
	                  <span class="form-nav-next button button-primary">Next <i class="fa fa-angle-double-right"></i></span>
	            </nav>
	      </div>
	</fieldset>
	<fieldset>
	      <legend><i class="fa fa-database"></i> 3. Data Access </legend>
	      <div class="form-section">
	      	<table class="form-table">
	    	    <?php wpfresh5_field_text( 'Your Hosting Company', 'wpfresh5_privacywizard[dataaccess][hosting]', '', false, '', 'Your Hosting Company Name' ); ?>
	    	    <?php wpfresh5_field_text( 'Autoresponder Service', 'wpfresh5_privacywizard[dataaccess][autoresponder]', '', false, '', 'Your Autoresponder service (if applies)' ); ?>
	    	    <?php wpfresh5_field_textarea( 'Any other services', 'wpfresh5_privacywizard[dataaccess][otherservices]', '', false, 'regular-text', 'Any other services/people with access to your data' ); ?>
	      	</table>
	      	<br/>
	            <nav>
	                  <span class="form-nav-prev button button-secondary"><i class="fa fa-angle-double-left"></i> Prev</span>
	                  <span class="form-nav-next button button-primary">Next <i class="fa fa-angle-double-right"></i></span>
	            </nav>
	      </div>
	</fieldset>
	<fieldset>
	      <legend><i class="fa fa-server"></i> 3. Third party services </legend>
	      <div class="form-section">
	      	    <h3> Check those that apply on your website</h3>
	      	    <table class="form-table">
	      	    	<?php wpfresh5_field_checkbox_inner( 'Google Analytics', 'wpfresh5_privacywizard[third][ganalytics]' ); ?>
	      	    	<?php wpfresh5_field_checkbox_inner( 'Google Ads', 'wpfresh5_privacywizard[third][gads]' ); ?>
	      	    	<?php wpfresh5_field_checkbox_inner( 'Facebook Analytics', 'wpfresh5_privacywizard[third][facebook]' ); ?>
	      	    	<?php wpfresh5_field_checkbox_inner( 'Social Media', 'wpfresh5_privacywizard[third][socialmedia]' ); ?>
	      	    </table>
	      	    <br/>
	            <nav>
	                  <span class="form-nav-prev button button-secondary"><i class="fa fa-angle-double-left"></i> Prev</span>
	                  <span class="form-nav-next button button-primary">Next <i class="fa fa-angle-double-right"></i></span>
	            </nav>
	      </div>
	</fieldset>
	<fieldset>
	      <legend><i class="fa fa-check"></i> Finish</legend>
	      <div class="form-section">
				<table class="form-table">
					<?php $options = array( array( 'label' => 'New Page', 'value' => 'new' ), array( 'label' => 'Existing Page', 'value' => 'existing' ) ) ?>
					<?php wpfresh5_field_select( 'Save Policy to', 'wpfresh5_privacywizard[saveto][type]', 0, $options, false, 'Warning: if you select an existing page, its previous contents will be deleted', '', 'wpfresh5_privacy_page', '' ); ?>
    				<?php wpfresh5_field_text( '&nbsp;&nbsp;&nbsp;Page Title', 'wpfresh5_privacywizard[saveto][pagename]', 'Privacy Policy', false, '', 'The Title for the new page', '', 'privacyp_pagename_row' ); ?>

					<tr valign="top" id="privacyp_pageid_row" style="display:none">
					        <th scope="row">&nbsp;&nbsp;&nbsp;Page</th>
					        <td>
					            <?php $args = array(
					                'echo'                  => 1,
					                'name'                  => 'wpfresh5_privacywizard[saveto][pageid]',
					                'id'                    => 'wpfresh5_privacywizard_pageid', // string
					                'show_option_none'      => 'Select Page', // string
					                'option_none_value'     => 0, // string
					            );
					            wp_dropdown_pages( $args );
					            ?>
	                            <p class="description">Your existing page</p>
		                    </td>
					    </tr>
				</table>
	          <p>That's it!</p>
	          <p>Just click the "Generate Privacy Policy" Button to generate your Privacy Policy page.</p>
	          <input type="hidden" name="wpfresh5_save_privacypol" id="wpfresh5_save_privacypol" value="0">
	          <p> <span class="form-nav-prev button button-secondary"><i class="fa fa-angle-double-left"></i> Prev</span> <button type="submit" id="generate-ppolicy" class="button button-primary"> <i class="fa fa-mail-forward"></i> Generate Privacy Policy</button></p>
	      </div>
	</fieldset>
     </div>
     <p>Note: While WP Freshstart 5 implements many of the GDPR requirements it may not be enough to cover the unique compliance needs of your business. We recommend you consult a professional privacy or GDPR consultant to make sure your business practices and site structure is compliant to GDPR and implement any extra measure if needed.</p>
     
<?php
}

function wpfresh5_settings_legal_tab_termsgenerator( $settings ) {
	$settings = isset( $settings['legal']['common'] ) ? $settings['legal']['common'] : false;
	$site_title = get_bloginfo( 'name' );
	$admin_email = get_bloginfo( 'admin_email' );
	// var_dump($settings);
	$country = isset( $settings['country'] ) ? trim( $settings['country'] ) : '';
	$state = isset( $settings['state'] ) ? trim( $settings['state'] ) : '';
?>
<h3>GDPR Compliant Terms and Conditions Generator</h3>
<p>Complete this wizard and click "Generate Terms and Conditions Page" in step 4 to generate a GDPR compliant T&C Page that applies to your business/website</p>
<div id="wpfresh5-wizard3" class="wpfresh5-wizard">
	<fieldset>
	    <legend><i class="fa fa-list-ul"></i> 1. Your Details </legend>
	    <div class="form-section">
	    	<table class="form-table">
	    	    <?php wpfresh5_field_text( 'Your Website Name', 'wpfresh5_tandcwizard[webinfo][name]', $site_title, false, '', 'Your WP Site Name' ); ?>
	    	    <?php wpfresh5_field_text( 'Your Website URL', 'wpfresh5_tandcwizard[webinfo][url]', get_site_url(), false, '', 'Your WP Site URL' ); ?>
	    	    <?php wpfresh5_field_text( 'Your e-mail', 'wpfresh5_tandcwizard[webinfo][email]', $admin_email ); ?>
	    	    <?php wpfresh5_field_text( 'Last Updated', 'wpfresh5_tandcwizard[webinfo][lastupdated]', date( 'd-m-Y') ); ?>
	    	    <?php wpfresh5_field_text( 'Your Country', 'wpfresh5_tandcwizard[webinfo][country]', $country ); ?>
	    	    <?php wpfresh5_field_text( 'Your State', 'wpfresh5_tandcwizard[webinfo][state]', $state ); ?>
	    	</table>
	    	<br/>
	          <nav>
	                <span class="form-nav-next button button-primary">Next <i class="fa fa-angle-double-right"></i></span>
	          </nav>
	    </div>
	</fieldset>
	<fieldset>
	      <legend><i class="fa fa-tag"></i> 2. Site Settings </legend>
	      <div class="form-section">
	      	    <h3> Check those that apply for your website/business</h3>
	      	    <table class="form-table">
	      	        <?php wpfresh5_field_checkbox_inner( 'Medical Advice/Disclaimer', 'wpfresh5_tandcwizard[website][medical]' ); ?>
	      	        <?php wpfresh5_field_checkbox_inner( 'Online Payments', 'wpfresh5_tandcwizard[website][payments]', '', 'taconlinepayments' ); ?>
    				<?php wpfresh5_field_text( '&nbsp;&nbsp;&nbsp;Payment Processor', 'wpfresh5_tandcwizard[website][paymentprocessor]', '', false, '', '', '', 'tandc_payment_row', false ); ?>
    				<?php wpfresh5_field_textarea( '&nbsp;&nbsp;&nbsp;Payment Processor Address', 'wpfresh5_tandcwizard[website][paymentprocessoraddr]', '', false, '', '', '', 'tandc_payment_row', false ); ?>
	      	        <?php wpfresh5_field_checkbox_inner( 'California Transparency Act', 'wpfresh5_tandcwizard[website][california]' ); ?>
	      	        <?php wpfresh5_field_checkbox_inner( 'Subcontracting', 'wpfresh5_tandcwizard[website][subcontracting]' ); ?>
	      	        <?php wpfresh5_field_checkbox_inner( 'Training&Developent for your Employees', 'wpfresh5_tandcwizard[website][training]' ); ?>
	      	        <?php wpfresh5_field_checkbox_inner( 'Users can create accounts on your website', 'wpfresh5_tandcwizard[website][accounts]' ); ?>
	      	        <?php wpfresh5_field_checkbox_inner( 'You can terminate users accounts', 'wpfresh5_tandcwizard[website][terminate]' ); ?>
	      	    </table>
	      	    <br/>
	            <nav>
	                  <span class="form-nav-prev button button-secondary"><i class="fa fa-angle-double-left"></i> Prev</span>
	                  <span class="form-nav-next button button-primary">Next <i class="fa fa-angle-double-right"></i></span>
	            </nav>
	      </div>
	</fieldset>
	<fieldset>
	      <legend><i class="fa fa-check"></i> Finish</legend>
	      <div class="form-section">
				<table class="form-table">
					<?php $options = array( array( 'label' => 'New Page', 'value' => 'new' ), array( 'label' => 'Existing Page', 'value' => 'existing' ) ) ?>
					<?php wpfresh5_field_select( 'Save Policy to', 'wpfresh5_tandcwizard[saveto][type]', 0, $options, false, 'Warning: if you select an existing page, its previous contents will be deleted', '', 'wpfresh5_tandc_page', '' ); ?>
    				<?php wpfresh5_field_text( '&nbsp;&nbsp;&nbsp;Page Title', 'wpfresh5_tandcwizard[saveto][pagename]', 'Terms and Conditions', false, '', 'The Title for the new page', '', 'tandc_pagename_row' ); ?>

					<tr valign="top" id="tandc_pageid_row" style="display:none">
					        <th scope="row">&nbsp;&nbsp;&nbsp;Page</th>
					        <td>
					            <?php $args = array(
					                'echo'                  => 1,
					                'name'                  => 'wpfresh5_tandcwizard[saveto][pageid]',
					                'id'                    => 'wpfresh5_tandc_pageid', // string
					                'show_option_none'      => 'Select Page', // string
					                'option_none_value'     => 0, // string
					            );
					            wp_dropdown_pages( $args );
					            ?>
	                            <p class="description">Your existing page</p>
		                    </td>
					    </tr>
				</table>
	          <p>That's it!</p>
	          <p>Just click the "Generate Terms and Conditions Page" Button to generate your Cookie Policy page.</p>
	          <input type="hidden" name="wpfresh5_save_tandc" id="wpfresh5_save_tandc" value="0">
	          <p> <span class="form-nav-prev button button-secondary"><i class="fa fa-angle-double-left"></i> Prev</span> <button type="submit" id="generate-tandc" class="button button-primary"> <i class="fa fa-mail-forward"></i> Generate Terms and Conditions Page</button></p>
	      </div>
	</fieldset>
     </div>
     <p>Note: While WP Freshstart 5 implements many of the GDPR requirements it may not be enough to cover the unique compliance needs of your business. We recommend you consult a professional privacy or GDPR consultant to make sure your business practices and site structure is compliant to GDPR and implement any extra measure if needed.</p>
<?php
}

function wpfresh5_settings_legal_tab_cookiesgenerator( $settings ) {
	$settings = isset( $settings['legal']['common'] ) ? $settings['legal']['common'] : false;
	$site_title = get_bloginfo( 'name' );
	$admin_email = get_bloginfo( 'admin_email' );
	// var_dump($settings);
	$country = isset( $settings['country'] ) ? trim( $settings['country'] ) : '';
	$state = isset( $settings['state'] ) ? trim( $settings['state'] ) : '';
?>
<h3>GDPR Compliant Cookie Policy Generator</h3>
<p>Complete this wizard and click "Generate Cookie Policy" in step 4 to generate a GDPR compliant Cookie Policy Page (required by EU laws) that applies to your business/website</p>
<div id="wpfresh5-wizard4" class="wpfresh5-wizard">
	<fieldset>
	    <legend><i class="fa fa-list-ul"></i> 1. Your Details </legend>
	    <div class="form-section">
	    	<table class="form-table">
	    	    <?php wpfresh5_field_text( 'Your Website Name', 'wpfresh5_cookiewizard[webinfo][name]', $site_title, false, '', 'Your WP Site Name' ); ?>
	    	    <?php wpfresh5_field_text( 'Your Website URL', 'wpfresh5_cookiewizard[webinfo][url]', get_site_url(), false, '', 'Your WP Site URL' ); ?>
	    	    <?php wpfresh5_field_text( 'Your e-mail', 'wpfresh5_cookiewizard[webinfo][email]', $admin_email ); ?>
	    	    <?php wpfresh5_field_text( 'Last Updated', 'wpfresh5_cookiewizard[webinfo][lastupdated]', date( 'd-m-Y') ); ?>
	    	    <?php wpfresh5_field_text( 'Your Country', 'wpfresh5_cookiewizard[webinfo][country]', $country ); ?>
	    	    <?php wpfresh5_field_text( 'Your State', 'wpfresh5_cookiewizard[webinfo][state]', $state ); ?>
	    	</table>
	    	<br/>
	          <nav>
	                <span class="form-nav-next button button-primary">Next <i class="fa fa-angle-double-right"></i></span>
	          </nav>
	    </div>
	</fieldset>
	<fieldset>
	      <legend><i class="fa fa-tag"></i> 2. Site Cookies </legend>
	      <div class="form-section">
	      	    <h3> Your website sets cookies for: (check those that apply)</h3>
	      	    <table class="form-table">
	      	        <?php wpfresh5_field_checkbox_inner( 'Account Registration', 'wpfresh5_cookiewizard[website][account]' ); ?>
	      	        <?php wpfresh5_field_checkbox_inner( 'Login Features', 'wpfresh5_cookiewizard[website][login]' ); ?>
	      	        <?php wpfresh5_field_checkbox_inner( 'Newsletter Subscription', 'wpfresh5_cookiewizard[website][newsletter]' ); ?>
	      	        <?php wpfresh5_field_checkbox_inner( 'Placing Orders', 'wpfresh5_cookiewizard[website][orders]' ); ?>
	      	        <?php wpfresh5_field_checkbox_inner( 'Survey Responses', 'wpfresh5_cookiewizard[website][survey]' ); ?>
	      	        <?php wpfresh5_field_checkbox_inner( 'Form Submissions', 'wpfresh5_cookiewizard[website][form]' ); ?>
	      	        <?php wpfresh5_field_checkbox_inner( 'Site Preferences', 'wpfresh5_cookiewizard[website][preferences]' ); ?>
	      	    </table>
	      	    <br/>
	            <nav>
	                  <span class="form-nav-prev button button-secondary"><i class="fa fa-angle-double-left"></i> Prev</span>
	                  <span class="form-nav-next button button-primary">Next <i class="fa fa-angle-double-right"></i></span>
	            </nav>
	      </div>
	</fieldset>
	<fieldset>
	      <legend><i class="fa fa-external-link"></i> 3. Third Party Cookies </legend>
	      <div class="form-section">
	      	<h3> Your website sets these third-parties on your web site: (check those that apply)</h3>
	      	<table class="form-table">
	      	    <?php wpfresh5_field_checkbox_inner( 'Google Analytics', 'wpfresh5_cookiewizard[third][ganalytics]' ); ?>
	      	    <?php wpfresh5_field_checkbox_inner( 'Other analytics providers', 'wpfresh5_cookiewizard[third][analytics]' ); ?>
	      	    <?php wpfresh5_field_checkbox_inner( 'Google AdSense', 'wpfresh5_cookiewizard[third][adsense]' ); ?>
	      	    <?php wpfresh5_field_checkbox_inner( 'Behavioural Advertising', 'wpfresh5_cookiewizard[third][behavioural]' ); ?>
	      	    <?php wpfresh5_field_checkbox_inner( 'Website Optimization', 'wpfresh5_cookiewizard[third][optimization]' ); ?>
	      	    <?php wpfresh5_field_checkbox_inner( 'Conversion Tracking', 'wpfresh5_cookiewizard[third][conversion]' ); ?>
	      	    <?php wpfresh5_field_checkbox_inner( 'Content Customization', 'wpfresh5_cookiewizard[third][customization]' ); ?>
	      	    <?php wpfresh5_field_checkbox_inner( 'Affiliate Tracking', 'wpfresh5_cookiewizard[third][afftracking]' ); ?>
	      	    <?php wpfresh5_field_checkbox_inner( 'Social Media Tools', 'wpfresh5_cookiewizard[third][socialmedia]' ); ?>
	      	</table>
	      	<br/>
	            <nav>
	                  <span class="form-nav-prev button button-secondary"><i class="fa fa-angle-double-left"></i> Prev</span>
	                  <span class="form-nav-next button button-primary">Next <i class="fa fa-angle-double-right"></i></span>
	            </nav>
	      </div>
	</fieldset>
	<fieldset>
	      <legend><i class="fa fa-envelope-o"></i> 3. Contact methods </legend>
	      <div class="form-section">
	      	    <h3> Users can contact me regarding my use of cookies...</h3>
	      	    <table class="form-table">
        			<?php wpfresh5_field_checkbox( 'By e-mail', 'wpfresh5_cookiewizard[contact][email]', 0, 'cookiec_email', '', '' ); ?>
    				<?php wpfresh5_field_text( '&nbsp;&nbsp;&nbsp;E-mail address', 'wpfresh5_cookiewizard[contact][emailaddress]', $admin_email, false, '', '', '', 'cookiew_email_row', false ); ?>
	    			<?php wpfresh5_field_checkbox( 'By visiting a link', 'wpfresh5_cookiewizard[contact][url]', 0, 'cookiec_url', '', '' ); ?>
					<?php wpfresh5_field_text( '&nbsp;&nbsp;&nbsp;URL', 'wpfresh5_cookiewizard[contact][urladdress]', site_url(), false, '', '', '', 'cookiew_url_row', false ); ?>
	    			<?php wpfresh5_field_checkbox( 'By phone', 'wpfresh5_cookiewizard[contact][phone]', 0, 'cookiec_phone', '', '' ); ?>
					<?php wpfresh5_field_text( '&nbsp;&nbsp;&nbsp;Telephone number', 'wpfresh5_cookiewizard[contact][phoneaddress]', '', false, '', '', '', 'cookiew_phone_row', false ); ?>
	      	    </table>
	      	    <br/>
	            <nav>
	                  <span class="form-nav-prev button button-secondary"><i class="fa fa-angle-double-left"></i> Prev</span>
	                  <span class="form-nav-next button button-primary">Next <i class="fa fa-angle-double-right"></i></span>
	            </nav>
	      </div>
	</fieldset>
	<fieldset>
	      <legend><i class="fa fa-check"></i> Finish</legend>
	      <div class="form-section">
				<table class="form-table">
					<?php $options = array( array( 'label' => 'New Page', 'value' => 'new' ), array( 'label' => 'Existing Page', 'value' => 'existing' ) ) ?>
					<?php wpfresh5_field_select( 'Save Policy to', 'wpfresh5_cookiewizard[saveto][type]', 0, $options, false, 'Warning: if you select an existing page, its previous contents will be deleted', '', 'wpfresh5_cookie_page', '' ); ?>
    				<?php wpfresh5_field_text( '&nbsp;&nbsp;&nbsp;Page Title', 'wpfresh5_cookiewizard[saveto][pagename]', 'Cookie Policy', false, '', 'The Title for the new page', '', 'cookiew_pagename_row' ); ?>

					<tr valign="top" id="cookiew_pageid_row" style="display:none">
					        <th scope="row">&nbsp;&nbsp;&nbsp;Page</th>
					        <td>
					            <?php $args = array(
					                'echo'                  => 1,
					                'name'                  => 'wpfresh5_cookiewizard[saveto][pageid]',
					                'id'                    => 'wpfresh5_cookiewizard_pageid', // string
					                'show_option_none'      => 'Select Page', // string
					                'option_none_value'     => 0, // string
					            );
					            wp_dropdown_pages( $args );
					            ?>
	                            <p class="description">Your existing page</p>
		                    </td>
					    </tr>
				</table>
	          <p>That's it!</p>
	          <p>Just click the "Generate Cookie Policy" Button to generate your Cookie Policy page.</p>
	          <input type="hidden" name="wpfresh5_save_cookiepol" id="wpfresh5_save_cookiepol" value="0">
	          <p> <span class="form-nav-prev button button-secondary"><i class="fa fa-angle-double-left"></i> Prev</span> <button type="button" id="generate-cpolicy" class="button button-primary"> <i class="fa fa-mail-forward"></i> Generate Cookie Policy</button></p>
	      </div>
	</fieldset>
     </div>
     <p>Note: While WP Freshstart 5 implements many of the GDPR requirements it may not be enough to cover the unique compliance needs of your business. We recommend you consult a professional privacy or GDPR consultant to make sure your business practices and site structure is compliant to GDPR and implement any extra measure if needed.</p>

<?php
}

function wpfresh5_legal_generator( $settings ) {
	if( isset( $_POST['wpfresh5_save_cookiepol'] ) && ( $_POST['wpfresh5_save_cookiepol'] == 1 ) ) {
		wpfresh5_generate_cookiepolicy( );
		if( isset( $_POST['wpfresh5_cookiewizard'] ) ) {
		    $webinfo = $_POST['wpfresh5_cookiewizard']['webinfo'];
		    $settings['legal']['common']['country'] = $webinfo['country'];
		    $settings['legal']['common']['state'] = $webinfo['state'];
		}
	}
	else if( isset( $_POST['wpfresh5_save_privacypol'] ) && ( $_POST['wpfresh5_save_privacypol'] == 1 ) ) {
		wpfresh5_generate_privacypolicy( );
		if( isset( $_POST['wpfresh5_privacywizard'] ) ) {
		    $webinfo = $_POST['wpfresh5_privacywizard']['webinfo'];
		    $settings['legal']['common']['company'] = $webinfo['company'];
		    $settings['legal']['common']['address'] = $webinfo['address'];
		    $settings['legal']['common']['country'] = $webinfo['country'];
		}
	}
	else if( isset( $_POST['wpfresh5_save_tandc'] ) && ( $_POST['wpfresh5_save_tandc'] == 1 ) ) {
		wpfresh5_generate_tandc( );
		if( isset( $_POST['wpfresh5_tandcwizard'] ) ) {
		    $webinfo = $_POST['wpfresh5_tandcwizard']['webinfo'];
		    // $settings['legal']['common']['company'] = $webinfo['company'];
		    $settings['legal']['common']['state'] = $webinfo['state'];
		    // $settings['legal']['common']['address'] = $webinfo['address'];
		    $settings['legal']['common']['country'] = $webinfo['country'];
		}
	}
	return $settings;
}

function wpfresh5_generate_cookiepolicy( ) {
	global $wpfs5_cp_page_id;
	$values = isset( $_POST['wpfresh5_cookiewizard'] ) ? $_POST['wpfresh5_cookiewizard'] : false;
	if( !$values )
		return;
	// website, webinfo, third, saveto
	$webinfo = isset( $values['webinfo'] ) ? $values['webinfo'] : false;
	$website = isset( $values['website'] ) ? $values['website'] : false;
	$thirdparty = isset( $values['third'] ) ? $values['third'] : false;
	$saveto = isset( $values['saveto'] ) ? $values['saveto'] : false;

	$sitename = $webinfo['name'];
	$siteurl = $webinfo['url'];
	$lastupdated = $webinfo['lastupdated'];

$page_content = '<h2>Cookie Policy for '.$sitename.'</h2>';
if( !empty( $lastupdated ) )
	$page_content .= '<p><b>Last updated: </b>'.$lastupdated.'</p>';

$page_content .= '<p>This is the Cookie Policy for '.$sitename.', accessible from '.$siteurl.'</p>

<h3>What Are Cookies</h3>

<p>As is common practice with almost all professional websites this site uses cookies, which are tiny files that are downloaded to your computer, to improve your experience. This page describes what information they gather, how we use it and why we sometimes need to store these cookies. We will also share how you can prevent these cookies from being stored however this may downgrade or \'break\' certain elements of the sites functionality.</p>

<p>For more general information on cookies see the <a href="https://en.wikipedia.org/wiki/HTTP_cookie#Privacy_and_third-party_cookies" target="_blank">Wikipedia article on HTTP Cookies.</a></p>

<h3>How We Use Cookies</h3>

<p>We use cookies for a variety of reasons detailed below. Unfortunately in most cases there are no industry standard options for disabling cookies without completely disabling the functionality and features they add to this site. It is recommended that you leave on all cookies if you are not sure whether you need them or not in case they are used to provide a service that you use.</p>

<h3>Disabling Cookies</h3>

<p>You can prevent the setting of cookies by adjusting the settings on your browser (see your browser Help for how to do this). Be aware that disabling cookies will affect the functionality of this and many other websites that you visit. Disabling cookies will usually result in also disabling certain functionality and features of the this site. Therefore it is recommended that you do not disable cookies.</p>

<p>You can usually find these settings in the &#8216;Option&#8217; or &#8216;Preferences&#8217; menu on your browser. To understand these settings, the following links may be helpful, or you can use the &#8216;Help&#8217; option in your browser for more details.</p>
<p>
<ul>
<li><a href="https://support.microsoft.com/it-it/help/278835/how-to-delete-cookie-files-in-internet-explorer"><span style="color: #003366;">Cookie settings in <strong>Internet Explorer</strong></span></a></li>
<li><a href="https://support.mozilla.org/t5/Cookies-and-cache/Enable-and-disable-cookies-that-websites-use-to-track-your/ta-p/2784"><span style="color: #003366;">Cookie settings in <strong>Firefox</strong></span></a></li>
<li><a href="https://support.google.com/chrome/answer/95647?co=GENIE.Platform%3DDesktop&amp;hl=en"><span style="color: #003366;">Cookie settings in <strong>Chrome</strong></span></a></li>
<li><a href="https://support.apple.com/en-us/HT201265"><span style="color: #003366;">Cookie settings in <strong>Safari web</strong> and <strong>IOS</strong></span></a></li>
</ul>
</p>
<h3>The Cookies We Set</h3>
';

if( isset( $website['account'] ) ) {
	$page_content .= '<h4>Account related cookies</h4>

<p>If you create an account with us then we will use cookies for the management of the signup process and general administration. These cookies will usually be deleted when you log out however in some cases they may remain afterwards to remember your site preferences when logged out.</p>';
}

if( isset( $website['login'] ) ) {
	$page_content .= '<h4>Login related cookies</h4>

<p>We use cookies when you are logged in so that we can remember this fact. This prevents you from having to log in every single time you visit a new page. These cookies are typically removed or cleared when you log out to ensure that you can only access restricted features and areas when logged in.</p>';
}

if( isset( $website['newsletter'] ) ) {
	$page_content .= '<h4>Email newsletters related cookies</h4>

<p>This site offers newsletter or email subscription services and cookies may be used to remember if you are already registered and whether to show certain notifications which might only be valid to subscribed/unsubscribed users.</p>';
}

if( isset( $website['orders'] ) ) {
	$page_content .= '<h4>Orders processing related cookies</h4>

<p>This site offers e-commerce or payment facilities and some cookies are essential to ensure that your order is remembered between pages so that we can process it properly.</p>';
}

if( isset( $website['survey'] ) ) {
	$page_content .= '<h4>Surveys related cookies</h4>

<p>From time to time we offer user surveys and questionnaires to provide you with interesting insights, helpful tools, or to understand our user base more accurately. These surveys may use cookies to remember who has already taken part in a survey or to provide you with accurate results after you change pages.</p>';
}

if( isset( $website['form'] ) ) {
	$page_content .= '<h4>Forms related cookies</h4>

<p>When you submit data to through a form such as those found on contact pages or comment forms cookies may be set to remember your user details for future correspondence.</p>';
}

if( isset( $website['preferences'] ) ) {
	$page_content .= '<h4>Site preferences cookies</h4>

<p>In order to provide you with a great experience on this site we provide the functionality to set your preferences for how this site runs when you use it. In order to remember your preferences we need to set cookies so that this information can be called whenever you interact with a page is affected by your preferences.</p>';
}

$page_content .=  '<h3>Third Party Cookies</h3>

<p>In some special cases we also use cookies provided by trusted third parties. The following section details which third party cookies you might encounter through this site.</p>
';

if( isset( $thirdparty['ganalytics'] ) ) {
	$page_content .= '<p>This site uses Google Analytics which is one of the most widespread and trusted analytics solution on the web for helping us to understand how you use the site and ways that we can improve your experience. These cookies may track things such as how long you spend on the site and the pages that you visit so we can continue to produce engaging content.</p>

<p>For more information on Google Analytics cookies, see the official Google Analytics page.</p>';
}

if( isset( $thirdparty['analytics'] ) ) {
	$page_content .= '<p>Third party analytics are used to track and measure usage of this site so that we can continue to produce engaging content. These cookies may track things such as how long you spend on the site or pages you visit which helps us to understand how we can improve the site for you.</p>';
}

if( isset( $thirdparty['optimization'] ) ) {
	$page_content .= '<p>From time to time we test new features and make subtle changes to the way that the site is delivered. When we are still testing new features these cookies may be used to ensure that you receive a consistent experience whilst on the site whilst ensuring we understand which optimisations our users appreciate the most.</p>';
}

if( isset( $thirdparty['conversion'] ) ) {
	$page_content .= '<p>As we sell products it\'s important for us to understand statistics about how many of the visitors to our site actually make a purchase and as such this is the kind of data that these cookies will track. This is important to you as it means that we can accurately make business predictions that allow us to monitor our advertising and product costs to ensure the best possible price.</p>';
}

if( isset( $thirdparty['adsense'] ) ) {
	$page_content .= '<p>The Google AdSense service we use to serve advertising uses a DoubleClick cookie to serve more relevant ads across the web and limit the number of times that a given ad is shown to you.</p>

<p>For more information on Google AdSense see the official Google AdSense privacy FAQ.</p>';
}

if( isset( $thirdparty['behavioural'] ) ) {
	$page_content .= '<p>We use adverts to offset the costs of running this site and provide funding for further development. The behavioural advertising cookies used by this site are designed to ensure that we provide you with the most relevant adverts where possible by anonymously tracking your interests and presenting similar things that may be of interest.</p>';
}

if( isset( $thirdparty['tracking'] ) ) {
	$page_content .= '<p>Several partners advertise on our behalf and affiliate tracking cookies simply allow us to see if our customers have come to the site through one of our partner sites so that we can credit them appropriately and where applicable allow our affiliate partners to provide any bonus that they may provide you for making a purchase.</p>';
}

if( isset( $thirdparty['socialmedia'] ) ) {
	$page_content .= '<p>We also use social media buttons and/or plugins on this site that allow you to connect with your social network in various ways. For these to work the following social media sites including; {List the social networks whose features you have integrated with your site?:12}, will set cookies through our site which may be used to enhance your profile on their site or contribute to the data they hold for various purposes outlined in their respective privacy policies.</p>';
}

	$page_content .= '<h3>More Information</h3>';

	$page_content .= '<p>Hopefully that has clarified things for you and as was previously mentioned if there is something that you aren\'t sure whether you need or not it\'s usually safer to leave cookies enabled in case it does interact with one of the features you use on our site.</p>

	<p>You can learn more about cookies and the following third-party websites:</p>

	<p><ul><li>AllAboutCookies: http://www.allaboutcookies.org/</li>
	<li>Network Advertising Initiative: http://www.networkadvertising.org/</li></ul></p>
';

	$contact = isset( $values['contact'] ) ? $values['contact'] : false;
	if( $contact ) {
		$email_address = ( isset( $contact['email'] ) && $contact['email'] ) ? trim( $contact['emailaddress'] ) : false;
		$url_address = ( isset( $contact['url'] ) && $contact['url'] ) ? trim( $contact['urladdress'] ) : false;
		$phone_address = ( isset( $contact['phone'] ) && $contact['phone'] ) ? trim( $contact['phoneaddress'] ) : false;

		$page_content .= '<p>However if you are still looking for more information then you can contact us through one of our preferred contact methods:</p>';
		if( $email_address ) {
			$page_content .= '<p><b>E-mail:</b> <a href="mailto:'.$email_address.'">'.$email_address.'</p>';
		}
		if( $url_address ) {
			$page_content .= '<p><b>URL:</b> <a href="'.$url_address.'">'.$url_address.'</p>';
		}
		if( $phone_address ) {
			$page_content .= '<p><b>Telephone:</b> <a href="tel:'.$phone_address.'">'.$phone_address.'</p>';
		}
	}
// However if you are still looking for more information then you can contact us through one of our preferred contact methods:

// Email:
// By visiting this link:
// Phone:</p>';

	// var_dump($saveto);
	if( $saveto['type'] == 'new' ) {
		// Generate New Page with name $saveto['pagename']
		// Create post object
		$my_post = array(
		  'post_title'    => empty( $saveto['pagename'] ) ? 'Cookie Policy' : $saveto['pagename'],
		  'post_content'  => $page_content,
		  'post_status'   => 'publish',
		  'post_type' => 'page'
		);
		// Insert the post into the database
		$page_id = wp_insert_post( $my_post );
	}
	else {
		// Update contents of page with id $saveto['pageid']
		$page_id = $saveto['pageid'];
		if( $page_id ) {
			$my_post = array(
			      'ID'           => $page_id,
			      'post_content' => $page_content,
			  );

			// Update the post into the database
			  wp_update_post( $my_post );
		}
	}
	$wpfs5_cp_page_id = $page_id;
	// die(9);
}

function wpfresh5_generate_privacypolicy( ) {
	global $wpfs5_pp_page_id;
	$values = isset( $_POST['wpfresh5_privacywizard'] ) ? $_POST['wpfresh5_privacywizard'] : false;
	if( !$values )
		return;
	// website, webinfo, third, saveto
	$webinfo = isset( $values['webinfo'] ) ? $values['webinfo'] : false;
	$datause = isset( $values['datause'] ) ? $values['datause'] : false;
	$dataaccess = isset( $values['dataaccess'] ) ? $values['dataaccess'] : false;
	$thirdparty = isset( $values['third'] ) ? $values['third'] : false;
	$saveto = isset( $values['saveto'] ) ? $values['saveto'] : false;

	$sitename = $webinfo['name'];
	$siteurl = $webinfo['url'];
	$lastupdated = $webinfo['lastupdated'];
	$company = $webinfo['company'];
	$email = $webinfo['email'];
	$address = $webinfo['address'];
	$country = $webinfo['country'];
	$hosting = trim($dataaccess['hosting']);
	$autoresponder = trim($dataaccess['autoresponder']);
	$otherservices = trim($dataaccess['otherservices']);

$page_content = '<h2>Privacy Policy for '.$sitename.'</h2>';
if( !empty( $lastupdated ) )
	$page_content .= '<p><b>Last updated: </b>'.$lastupdated.'</p>';

$page_content .= 'PLEASE READ THE FOLLOWING PRIVACY POLICY CAREFULLY BEFORE DOWNLOADING, READING, USING, ACCESSING, OR PURCHASING ANY PRODUCT OR SERVICE THROUGH OUR WEBSITE OR SERVICES.

<h3>1. OVERVIEW</h3>';

if( isset( $webinfo['company'] ) && !empty( $webinfo['company'] ) )
	$page_content .= '<p>[COMPANYNAME] ("[WEBSITE]," "us," or "we") respects the privacy of users of our website and its related services.</p>';
else
	$page_content .= '<p>[WEBSITE] ("us," or "we") respects the privacy of users of our website and its related services.</p>';

$page_content .= '<p>The following privacy policy (the "Policy") tells you about the information that [WEBSITE] collects through the Services and how we may use or disclose that collected information.</p>

By accessing the Services, continuing to access the Services, purchasing any products or services through the Services, downloading and/or using the Application, or submitting any information through the Services, you are consenting to the information collection and use practices described in this Policy, as modified from time to time by us, as described below. Your use of the Services is also governed by the Terms of Service all of which are to be expressly incorporated and included as part of this Policy.

<h3>2. UPDATES</h3>
[WEBSITE] reserves the right to make changes to this Policy at any time, and will post any revised Policy on this page. You will know we have changed the Policy when you see a new updated date at the top of this Policy. [WEBSITE] will not notify the Services\' users of any such changes by email or other personal contact. We encourage you to check the date of this Policy whenever you visit the Services so that you will know when you need to review the Policy for modifications.

<h3>3. INFORMATION COLLECTION</h3>
<h4>Age Restriction.</h4>

[WEBSITE] does not intend to use the Services to collect any information from children under age 18. By submitting any information through the Services, you represent and warrant that you are older than age 18.

<h4>Collection of Submitted Information.</h4>

[WEBSITE] may collect and store any information you submit or upload through the Services, whether through your submission of information through a form, purchase of a product, or otherwise. This information may include, but is not limited to, your name, address, email address, telephone number, payment information, or any other information submitted by you or any user through the Services.

<h4>Collection from Third-Parties.</h4>

[WEBSITE] may collect information about you from third-parties, including from any account through which you log into, or otherwise interact with, [WEBSITE] (e.g., Facebook or Google). If applicable, [WEBSITE] may have access to certain information from your linked Google or Facebook account, including your public profile information, your email address, or other information possessed by those third-parties. [WEBSITE] may aggregate any information about you collected from any source.

<h4>Passive Information Collection.</h4>

[WEBSITE] may also collect passive information about your device, visit, or use of the Services, including, but not limited to, the date and time of your visit, the length of your visit, the specific webpages you visited, your IP address, the type of web browser and operating system used, the address of any website that directed you to the Services, and information about your mobile device used to access the Services (including phone number, operating system details, and any applicable unique identifiers for you or your device, including your devices\' Unique Device Identifier (UDID), any Apple or iOS identifiers (e.g., IDFA or an Advertising Identifier), any Google or Android identifiers (e.g., Android or Google Advertising ID), any Windows identifiers (e.g., Windows Advertising ID), or any other similar identifiers which identify you or your device). [WEBSITE] may collect and aggregate usage information related to your use of the Services.

<h4>Cookies and Related Technologies.</h4>

We, or other third-parties assisting us, may use cookies, web beacons, local shared objects (sometimes called "flash cookies"), or other similar technology in connection with your use of the Services (collectively, "Cookies"). Cookies are small data files that may have unique identifiers, and reside, among other places, on your computer or mobile device, in emails we send to you, and on our web pages. Cookies may transmit information about you and your use of the Services, such as your browser type, search preferences, data relating to advertisements that have been displayed to you or that you have clicked on, and the date and time of your use. Cookies may track activities over time and across websites. You can disable some (but not all) Cookies in your device or browser settings, but doing so may affect your ability to use the services provided through the Services.

<h4>Third-Party Vendors and Advertisers.</h4>

[WEBSITE] may use third-party vendors or advertisers to collect and analyze information about your use of the Services. These third-parties may use cookies or other similar mechanisms to provide us with information and analysis about your use of the Services. This information collection and analysis allows us to better understand how the Services are being used so that we can strive to provide the most relevant content to our users. These third-parties may collect information about your online activities over time and across different websites. This information may be used to serve interest-based advertisements on our website or other websites across the internet. We may combine information gathered from one or more of these services.

<h4>Analytics Services.</h4>

[WEBSITE] may, from time to time, use one or more analytics service providers, including, for example, Google or Facebook. [WEBSITE] may use the following Google analytics features: AdWords, Remarketing, Google Display Network Impression Reporting, DoubleClick, and Google Analytics Demographics and Interest Reporting. We may combine information gathered from one or more of these services.

For information on how Google collects and uses the information collected through [WEBSITE] use of the Google analytics and advertising services, if applicable, see the Google, Inc. Privacy Policy here (https://www.google.com/intl/en/policies/privacy/).

For more information about the Google analytics features used by [WEBSITE], if applicable, click here (https://support.google.com/analytics/answer/2404395?hl=en&ref_topic=1631776&rd=1).

For information on how to see and change your Google Ad Settings, click here (https://support.google.com/ads/answer/2662856?hl=en).

For information on the use of the Google Analytics Opt-Out Browser Add-On, click here (https://tools.google.com/dlpage/gaoptout/). However, [WEBSITE] does not necessarily endorse this add-on and does not guarantee that using the add-on will be effective.

For more information on how Facebook Analytics may collect and use the information collected through [WEBSITE]\'s use of the Facebook\'s analytics and advertising services, if applicable, see the Facebook data use policy and related policies here. (https://www.facebook.com/full_data_use_policy).

The Services may, from time to time, also include social media functions allowing you to like or share content on social media platforms like Facebook or Twitter. These features may collect your information through the use of cookies or other technologies. These features may be hosted by a third-party and governed by the third-party\'s privacy policy.

[WEBSITE] does not guarantee that it will take action in response to do-not-track signals or similar mechanisms. Additionally, some third-party service providers may still collect tracking information even if you have enabled your browser\'s do-not-track functionality or utilized a similar do-not-track mechanism.

<h3>4. INFORMATION USE PRACTICES</h3>
[WEBSITE] may use the collected information or data described above, individually or in the aggregate, for any lawful purpose, including, but not limited to, such purposes as connecting sellers, affiliates, and customers, analyzing and tracking user activity on the Services for individual users or for groups of users, tracking and analyzing usage trends, personalizing the Services to better reflect your preferences, serving more relevant advertisements, or enhancing your and other users\' use of the Services. All collected information may be linked to specific website users and may result in the tracking of the usage information for individual users.

[WEBSITE] may also use your submitted information to contact you, via regular mail, email, text message, telephone, or otherwise, regarding your account, the Services, your purchased services or products, or other relevant or promotional information or offers as determined by [WEBSITE] or its partners. By submitting your contact information to [WEBSITE] or [WEBSITE]\' partners, you consent to receiving such communications.

<h3>5. DISCLOSURE OF INFORMATION</h3>
Except for the limitations expressly discussed herein, if any, [WEBSITE] may disclose, sell, or transfer any collected information to third-parties for any lawful purpose in our sole discretion.

<h4>Disclosure of Customer, Affiliate, or Seller Information.</h4>

[WEBSITE] may disclose any collected information about a customer to all sellers whose products or services the customer purchases and to any affiliates through whom the customer is linked to the seller. [WEBSITE] may disclose any collected information about an affiliate to all sellers whose products or services the affiliate advertises and to any customers that were linked to a seller through the affiliate. [WEBSITE] may disclose any collected information about a seller to any affiliates and to any customers who purchase the seller\'s products or services. The disclosed information about a customer, affiliate, or seller include, but are not limited to, the person\'s name, user name, contact information, and information related to any transactions between those persons.

<h4>Third-Party Services.</h4>

If you log in to [WEBSITE] through a third-party service like Facebook or Google, then those third-parties may have access to certain information about your use of [WEBSITE]. For more information on the type of information those third-parties may collect about you, please review the privacy policies for those third-parties.

<h4>Vendors.</h4>

[WEBSITE] may use third-party companies, agents, or contractors to perform services on our behalf. For example, [WEBSITE] may partner with other companies to personalize our web pages, analyze our website or usage information, process payments or credit card transactions, fulfill or ship orders, collect debts, analyze or enhance the data collected by the Services (including user\'s interaction with the Services), or otherwise assist [WEBSITE] in better serving the Services\' users. During the course of providing [WEBSITE] with these services, these third-parties may have access to your personal and non-personal information in order to provide the services we requested from those third-parties.

<h4>Affiliates and Marketing.</h4>

[WEBSITE] may disclose your collected information, including information about any purchases you make through the Services, to [WEBSITE]\' affiliated entities. [WEBSITE] may also disclose your information to third-parties for marketing purposes. These affiliates and third-parties may contact you via any method of contact you provide to [WEBSITE].

<h4>Legal Compliance.</h4>

[WEBSITE] also reserves the right to disclose personal information when we reasonably believe disclosure is required by law, if we reasonably believe disclosure is necessary to establish or exercise legal rights, or in situations involving potential threats to physical safety.

<h4>Merger or Acquisition.</h4>

In the event that [WEBSITE] is acquired by or merged with a third-party, we reserve the right to sell or otherwise transfer any and all information we have collected from you as part of that transaction and such third-party will assume the rights and obligations with respect to that information as described in this Policy.

<h3>6. DATA PROTECTION</h3>

WHAT DO WE DO WITH YOUR PERSONAL DATA?

<h4>Main Uses of Your Data</h4>

This section of the Policy describes the things that we do with your data which relate directly to your use of the Site and our services. They are the things that we hope you would expect us to do with your information. We will use your information:
<ul>
<li>to provide the products available on our Site to you;</li>
<li>to contact you for your views on our services and to notify you occasionally about important changes to our Terms of Use or this Policy or developments to this Site or our services.</li>
</ul>

<h4>Technical Uses</h4>

This section of the Policy describes the things that we do with your data that arise from our monitoring of the Site and the collection of your information whilst using the Site. We may use this information:
<ul>
<li>to identify patterns that we can use in our marketing strategy and to help us develop, administer, support and improve our services and features and adverts;</li>
<li>to conduct reviews that assist us in the improvement and optimization of our Site;</li>
<li>to ensure that content from our Site is presented in the most effective manner for you and for your computer;</li>
<li>to administer our Site and for internal operations, including troubleshooting, data analysis, testing, research, statistical and survey purposes; and</li>
<li>as part of our efforts to keep our Site safe and secure.</li>
</ul>

We may combine technical information with other information that we have about you to help us with our processing of your information as described in this Policy.

<h4>Use of your data for marketing and communications</h4>

When you join a mailing list, which is not required to use the site, we may use personal information, like your email address, to provide marketing messages to you or allow us or third parties to communicate with you on third party services. We will always seek your consent before doing so and you can opt out of marketing and other communications at any time by contacting us at '.$email.'. You can always make use of the Site without having to agree to marketing. The types of things that we may do include:

<ul>
<li>providing direct marketing advertisements and communications to you via email, text, post or telephone or via our selected third parties;</li>
<li>making suggestions and recommendations to you and other users of our Site about goods or services that may interest you or them;</li>
<li>communicating with you on third party social media platforms and sharing your information with that social media platform;</li>
<li>monitoring the effectiveness of our direct marketing communications and your responses to it.</li>
</ul>

<h3>7. WHO HAS ACCESS TO YOUR PERSONAL DATA?</h3>

We retain access to all personal information that we have collected from you or about you.

';

if( !empty( $autoresponder ) ) {
	$page_content .= 'Our product fulfillment company and email marketing companies also retain some of the data (for example your name and email are passed to our email marketing partner '.$autoresponder.' so we may send product confirmation and marketing emails).
';
}

$page_content .= 'When our service is available via the websites of our partners, those partners may have access to your information. We may also have links to other websites from our Site. We are not responsible for the content, security, privacy policies and practices of any other websites, even if you access them using links from this Site or if you can access this Site or use our services from them. We recommend that you check the policy of each website that you visit and make sure that you are comfortable with the terms of such policies before providing any personal information.

If our business is sold or merged, or if we sell or buy any business or assets, we may disclose your personal data to the prospective seller or buyer of such business or assets. We will make sure that any such transfer is done in a secure way.

If we offer or supply a service to you that is provided on our behalf by a third party we may have to pass your information to them in order to deliver the service. By using this Site you consent to us providing your information to the third parties authorized by us to provide such services. We may also use third parties to provide services on our behalf which may include processing (but not using themselves) your information e.g. to complete partial addresses or to augment the information we hold about you. In either case, we will not pass your information to anyone who is not also subject to adequate privacy commitments in our contract with them and we will not allow the third party to use your information for marketing purposes without your consent.

';

if( !empty( $otherservices ) ) {
	$page_content .= '<b>Other services with access to your data:</b>

	'.$otherservices.'

';
}
$page_content .= 'We will not otherwise disclose, sell or distribute your information to any third party without your permission unless we are required to do so by law or to obtain professional advice. We will retain your information for as long as is reasonable and necessary and no longer than permitted by law.

<h3>8. PERSONAL DATA STORAGE</h3>

We maintain your data at the server of our internet service provider, our email marketing company, our offices and our product fulfillment centers.

If you leave a comment on this website that information is stored at our hosting company '.$hosting.'. That information includes your name, your avatar, your comment, the time you left the comment and your ISP address.

For any Europeans using the site, the data that we collect from you may be transferred to, and stored at, a destination outside the European Economic Area ("EEA"). It may also be processed by staff operating outside the EEA who work for us or for one of our suppliers or contractors. Territories outside of the EEA may not have equivalent legal protections to those that apply within the EEA but we are under a duty to make sure that our suppliers and contractors located outside of the EEA continue to take all steps reasonably necessary to ensure that your data is treated securely and in accordance with this Policy. By submitting your personal data to us, you agree to this transfer, storing or processing.

Unfortunately, the transmission of information via the internet is not completely secure. Although we will do our best to protect your personal data, we cannot guarantee the security of your data transmitted to our Site; any transmission is at your own risk. Once we have received your information, we will use strict procedures and security features to try to prevent unauthorized access.

We follow strict security procedures to ensure that your personal information is not damaged, destroyed or disclosed to a third party without your permission and to prevent unauthorized access to it. The computers that store the information are kept in a secure facility with restricted physical access and we use secure firewalls and other measures to restrict electronic access. If we are working with third parties, we will require them to have in place similar measures to protect your information.

<h3>9.SHARING YOUR PERSONAL DATA</h3>

We may share your personal data as follows:

<ul>
<li>Third Parties Designated by You. We may share your personal data with third parties where you have provided your consent to do so.</li>
<li>Our Third Party Service Providers. We may share your personal data with our third party service providers who provide services such as data analysis, payment processing, information technology and related infrastructure provision, customer service, email delivery, auditing and other similar services.</li>
</ul>

<h3>10. YOUR RIGHTS</h3>

You have the right to use our Site without consenting to marketing and communication services that we provide. We will inform you (before collecting your data) if we intend to use your data for such purposes or if we intend to disclose your information to any third party for such purposes. We always use the most recently submitted form to be your current consent status. If you are a registered user, but not signed in when you submit a form, we will not be able to use your saved settings so will deem your consent choice to be as per the form you submit at the time. You can exercise your right to prevent such processing by ticking certain boxes on the forms we use to collect your data. You can also exercise the right at any time by contacting us at '.$email.'.

Your Rights:

<ul>
<li><b>Opt-out</b>. You may contact us anytime to opt-out of: (i) direct marketing communications; (ii) automated decision-making and/or profiling; (iii) our collection of sensitive personal data; (iv) any new processing of your personal data that we may carry out beyond the original purpose; or (v) the transfer of your personal data outside the EEA. Please note that your use of some of the Site may be ineffective upon opt-out.</li>
<li><b>Access</b>. You may access the information we hold about you at any time via your profile/account or by contacting us directly.</li>
<li><b>Amend</b>. You can also contact us to update or correct any inaccuracies in your personal data.
<li><b>Move</b>. Your personal data is portable – i.e. you to have the flexibility to move your data to other service providers as you wish.</li>
<li><b>Erase and forget</b>. In certain situations, for example when the information we hold about you is no longer relevant or is incorrect, you can request that we erase your data.</li>
</ul>

If you wish to exercise any of these rights, please contact us. In your request, please make clear: (i) what personal data is concerned; and (ii) which of the above rights you would like to enforce. For your protection, we may only implement requests with respect to the personal data associated with the particular email address that you use to send us your request, and we may need to verify your identity before implementing your request. We will try to comply with your request as soon as reasonably practicable and in any event, within one month of your request. Please note that we may need to retain certain information for recordkeeping purposes and/or to complete any transactions that you began prior to requesting such change or deletion.

The Data Protection Act 1998 (DPA) and the GDPR (in Europe) gives you the right to access information held about you. Your right of access can be exercised in accordance with the DPA and GDPR.

*Asking us to not process your data does require us to delete your data, which is legally considered processing your data. So respectfully inform you that we’d have to do that one thing.

<h3>11.	COMPLAINTS</h3>
We are committed to resolve any complaints about our collection or use of your personal data. If you would like to make a complaint regarding this Policy or our practices in relation to your personal data, please contact us at: '.$email.'. We will reply to your complaint as soon as we can and in any event, within 30 days. We hope to resolve any complaint brought to our attention, however if you feel that your complaint has not been adequately resolved, you reserve the right to contact your local data protection supervisory authority

<h3>12. THIRD-PARTY LINKS</h3>
The Services may contain links to websites not owned or controlled by [WEBSITE]. [WEBSITE] does not necessarily review or endorse the content of these linked websites. You should review the terms of service and privacy policies of all websites you visit.

<h3>13. SECURITY</h3>
We use commercially reasonable efforts to protect the information we collect on the Services. Unfortunately, however, no security system can be guaranteed to be 100% effective. Accordingly, we cannot and do not guarantee the security of your personal information and cannot assume liability for improper access to it. Do not submit confidential information through the Services.

You are responsible for restricting access to your computer or mobile device through which you access the Services. Users of public or shared computers or unprotected mobile devices should log out at the completion of each visit to our Services. By using the Services, or providing personal information to us through any means, you agree that we can communicate with you electronically regarding security, privacy, and administrative issues relating to your use of these Services.

<h3>14.	INTERNATIONAL DATA TRANSFER</h3>
Your information, including personal data that we collect from you, may be transferred to, stored at and processed by us outside the country in which you reside, where data protection and privacy regulations may not offer the same level of protection as in other parts of the world. By accepting this Policy, you agree to this transfer, storing or processing. We will take all steps reasonably necessary to ensure that your data is treated securely and in accordance with this Policy.

<h3>15. DATA RETENTION</h3>
[WEBSITE] may retain the personal and non-personal information or other collected data, individually or in the aggregate, as described above, after you delete your account or have ceased using the Services. However, [WEBSITE] does not guarantee that any information will continue to be available after such deletion or cessation.

<h3>16. VIEWING AND UPDATING INFORMATION</h3>
You are responsible for updating and maintaining the accuracy of your personal information that you provide to or through the Services. If you believe you have submitted inaccurate information through the Services, and would like [WEBSITE] to change such information, please contact [WEBSITE] at the address below.

<h3>17. CONTACT</h3>
If you have questions concerning this Privacy Policy, please contact [WEBSITE] at the following address:

'.$email.'
[WEBSITE]
'.$address.'
'.$country;



// var_dump($webinfo);die();
$page_content = str_replace ( '[WEBSITE]', $sitename, $page_content );
$page_content = str_replace ( '[COMPANYNAME]', $company, $page_content );
// $page_content = str_replace ( '[NAMEANDADDRESS]', $address.'<br/>'.$country, $page_content );
// $page_content = str_replace ( '[HOSTINGCOMPANY]', $hosting, $page_content );

	if( $saveto['type'] == 'new' ) {
		// Generate New Page with name $saveto['pagename']
		// Create post object
		$my_post = array(
		  'post_title'    => empty( $saveto['pagename'] ) ? 'Privacy Policy' : $saveto['pagename'],
		  'post_content'  => $page_content,
		  'post_status'   => 'publish',
		  'post_type' => 'page'
		);
		// Insert the post into the database
		$page_id = wp_insert_post( $my_post );
	}
	else {
		// Update contents of page with id $saveto['pageid']
		$page_id = $saveto['pageid'];
		if( $page_id ) {
			$my_post = array(
			      'ID'           => $page_id,
			      'post_content' => $page_content,
			  );

			// Update the post into the database
			  wp_update_post( $my_post );
		}
	}
	$wpfs5_pp_page_id = $page_id;
}

function wpfresh5_generate_tandc( ) {
	global $wpfs5_tc_page_id;
	$values = isset( $_POST['wpfresh5_tandcwizard'] ) ? $_POST['wpfresh5_tandcwizard'] : false;
	if( !$values )
		return;
	// website, webinfo, third, saveto
	$webinfo = isset( $values['webinfo'] ) ? $values['webinfo'] : false;
	$website = isset( $values['website'] ) ? $values['website'] : false;
	// $thirdparty = isset( $values['third'] ) ? $values['third'] : false;
	$saveto = isset( $values['saveto'] ) ? $values['saveto'] : false;

	$sitename = $webinfo['name'];
	$siteurl = $webinfo['url'];
	$lastupdated = $webinfo['lastupdated'];
	$email = $webinfo['email'];
	$country = $webinfo['country'];
	$state = $webinfo['state'];

$page_content = '<h2>Terms and Conditions for '.$sitename.'</h2>';
if( !empty( $lastupdated ) )
	$page_content .= '<p><b>Last updated: </b>'.$lastupdated.'</p>';

$page_content .= 'Welcome to the '.$sitename.' web site located at "'.$siteurl.'" (this "Site"), which is owned by '.$sitename.' ("us", "we"). Please read this page carefully before using this Site. By accessing or using this Site in any way, you agree to and are bound by the terms, conditions, policies and notices contained on this page (these "Terms"), including but not limited to conducting this transaction electronically.

These Terms are effective as of '.$lastupdated.'.

<h3>CONTENT MANAGEMENT</h3>

All contents of this Site are: '.date('Y').' '.$sitename.'. All rights reserved. This Site contains copyrighted material, trademarks, service marks, logos, trade dress and other proprietary content, including but not limited to text, excepts from a book, photographs, buttons, images, video and graphics, and the entire selection, coordination, arrangement and "look and feel" of this Site and the content are copyrighted as a collective work under United States copyright laws (collectively, the "Content").

Except as provided in these Terms, you may not use, modify, republish, frame, license, transfer, post, transmit, create derivative works from, or otherwise exploit any Content from this Site, in whole or in part, without the express permission of '.$sitename.'.

Reproduction, distribution, republication, and/or retransmission of material contained within this website is prohibited without prior written consent of '.$sitename.'. Any other use, including the reproduction, modification, distribution, transmission, republication, display or performance, of the content on this site is strictly prohibited. Nothing contained in these Terms shall be construed as conferring any other license or right, express or implied, under any of '.$sitename.'‘s intellectual property rights.';

if( isset( $website['medical'] ) ) {
	$page_content .= '<h4>MEDICAL ADVICE</h4>

You must not rely on the information on this website as an alternative to medical advice from your doctor or other professional healthcare provider. If you have any specific questions about any medical matter you should consult your doctor or other professional healthcare provider. If you think you may be suffering from any medical condition you should seek immediate medical attention. You should never delay seeking medical advice, disregard medical advice, or discontinue medical treatment because of information on this website.

The information and materials made available on this website have been prepared by '.$sitename.' for general informational purposes only and should not be construed as medical advice on any subject matter, or to answer specific medical problems you may have. No recipients of content from this site, clients or otherwise, should act or refrain from acting on the basis of any content included in the site without seeking the appropriate medical or other professional advice on the particular facts and circumstances at issue from a doctor licensed in the recipient’s state. The content of this website contains general information and may not reflect current medical developments. '.$sitename.' expressly disclaims all liability in respect to actions taken or not taken based on any or all the contents of this website.

While we try to ensure the accuracy of the information on this website, we cannot guarantee that all of the information is accurate or complete. You should be aware that medicine is constantly changing and varies by circumstance. Therefore, information on a given medical or medical issue may not be current or apply to your particular situation. You should not act or refrain from acting upon this information without seeking the advice of professional doctor in your geographical area. Viewing and use of any of the information on this site does not create an attorney-client relationship between you and '.$sitename.'.';
}

$page_content .= '<h4>CHILDREN ONLINE PRIVACY PROTECTION ACT</h4>

Our Website is not intended for children under 13 years of age. No one under age 13 may provide any information to or on the Website. We do not knowingly collect personal information from children under 13. If you are under 13, do not use or provide any information on this Website or on or through any of its features/register on the Website, make any payments through the Website, use any of the interactive or public comment features of this Website or provide any information about yourself to us, including your name, address, telephone number, email address, or any screen name or user name you may use.

If we learn we have collected or received personal information from a child under 13 without verification of parental consent, we will delete that information. If you believe we might have any information from or about a child under 13, please contact us at '.$email.'

We are committed to complying with the Children’s Online Privacy Protection Act (COPPA). Schools and parents should supervise their children’s online activities and consider the use of other means to provide a child-friendly, online environment. If you would like to learn more about COPPA, visit the Federal Trade Commission home page at http://www.ftc.gov.

If you are living in the EU and are under the age of 16, it is required by law that you obtain consent from your parents before subscribing to any email list. We do not target, cater or provide products or services for 16 years and under and thus do not have a parental approval process.';

if( isset( $website['payments'] ) ) {
	$pprocessor = trim( $website['paymentprocessor'] );
	$pprocessoraddress = trim( $website['paymentprocessoraddr'] );
	$page_content .= '<h3>ONLINE PAYMENTS</h3>

The Company allows clients to make payments for legal services via an online portal. We have engaged third-party service providers to perform many of the services related to payment processing, including card processing, identity verification, fraud analysis and regulatory compliance.

The Company partners with '.$pprocessor.' to facilitate card payments for clients. We may share your personal or transactional information with this third-party service provider when it is necessary to process payments. Information about '.$pprocessor.' can be found at:

'.$pprocessoraddress.'


We do not control these third parties’ tracking technologies or how they may be used. If you have any questions about an advertisement or other targeted content, you should contact the responsible provider directly.';
}

if( isset( $website['accounts'] ) ) {
	$page_content .= '<h3>USER ACCOUNTS</h3>

	When you create an account with us, you must provide us information that is	accurate, complete, and current at all times. Failure to do so constitutes a breach of the Terms, which may result in immediate termination of your account on our Service.

	You are responsible for safeguarding the password that you use to access the Service and for any activities or actions under your password, whether your password is with our Service or a third-party service.

	You agree not to disclose your password to any third party. You must notify us immediately upon becoming aware of any breach of security or unauthorized use of your account.';
}

if( isset( $website['terminate'] ) ) {
	$page_content .= '<h3>TERMINATION</h3>

	We may terminate or suspend access to our Service immediately, without prior notice or liability, for any reason whatsoever, including without limitation if you breach the Terms.

	All provisions of the Terms which by their nature should survive termination shall survive termination, including, without limitation, ownership provisions, warranty disclaimers, indemnity and limitations of liability.

	We may terminate or suspend your account immediately, without prior notice or liability, for any reason whatsoever, including without limitation if you	breach the Terms.

	Upon termination, your right to use the Service will immediately cease. If you wish to terminate your account, you may simply discontinue using the Service.

	All provisions of the Terms which by their nature should survive termination shall survive termination, including, without limitation, ownership provisions, warranty disclaimers, indemnity and limitations of liability.';
}

$page_content .= '<h3>EXTERNAL LINKS</h3>

As a convenience to you, '.$sitename.' may provide links to web sites and access to content, products and services of third parties, including without limitation, '.$sitename.' affiliates and strategic partners and other entities ("Linked Sites"). You should refer to the separate terms of use, privacy policies, and other notices posted on Linked Sites before you use them. Some of those links contain trackable cookies, which means that website owner will know that their website has shown up in your website browser more than once. And they may know that you visited this website before you visited their website.

'.$sitename.' does not author, edit or monitor these Linked Sites, and is not responsible or liable for (a) the availability of or content provided on such Linked Sites, nor does inclusion of any link imply endorsement of the Linked Sites by '.$sitename.' or vice versa; (b) third party content accessible through such Linked Sites; (c) any loss or damage whatsoever you may incur from dealing with any Linked Site; or (d) your dealings with any third parties found on or through this Site, the payment for and delivery of goods if any, or any terms, conditions, warranties, or representations associated with such dealings. You bear all risk associated with the use of such Linked Sites, third party services, and your correspondence or business dealings with third parties found on or through this Site.

<h3>DMCA PROVISIONS</h3>

The Digital Millennium Copyright Act of 1998, found at 17 U.S.C. 512 (“DMCA”), provides recourse for owners of copyrighted materials who believe that their rights under United States copyright law have been infringed upon on the Internet.

Under the DMCA, the bona fide owner of copyrighted materials who has a good faith belief that their copyright has been infringed may contact not only the person or entity infringing on their copyright, but may also contact the designated agent of an Internet service provider to report alleged infringements of their protected works, when such alleged infringements appear on pages contained within the system of the Internet service provider (“ISP”).

The owner of this website and the ISP are committed to complying with international trade law, international trade practices, all United States laws, including United States copyright law. Upon receipt of a properly filed complaint under the DMCA, the owner and/or the ISP of this website will block access to the allegedly infringing material. The website owner and/or the ISP will forward a copy of the notification of claimed copyright infringement to the alleged infringer. Anyone who believes in good faith that a notice of copyright infringement has wrongfully been filed against them, may submit a Counter notice to the website owner and/or the ISP.

<h3>NOTIFICATION OF CLAIMED COPYRIGHT INFRINGEMENT</h3>

Please send DMCA notifications of claimed copyright infringement to:

'.$sitename.' ('.$email.')';

if( isset( $website['california'] ) ) {
	$page_content .= '<h3>CALIFORNIA TRANSPARENCY ACT</h3>

	'.$sitename.' is committed to upholding fair and safe employment and workplace conditions. To achieve this, we build meaningful partnerships with those who share our values, and work to develop sustainable and long-lasting improvements that extend through our supply chain. We believe that a well-managed and healthy supply chain is integral to building a stable, successful business.';
}

$page_content .= '<h3>Code of Conduct</h3>

'.$sitename.'’s Code of Conduct is communicated to and signed by all our supply chain partners. This Code of Conduct was developed using established international frameworks, including the International Bill of Human Rights and the ILO Fundamental Principles and Rights at Work — such as the Forced Labour Convention (No.29), Abolition of Forced Labour Convention (No.105), Minimum Age Convention (No. 138) and Worst Forms of Child Labour Convention (No. 182) amongst others. In addition, the Code of Conduct draws from the ETI Base Code, recognized as one of the leading frameworks in the global beauty industry.';

if( isset( $website['subcontracting'] ) ) {
	$page_content .= '<h3>SUBCONTRACTING</h3>

 '.$sitename.' is conscious that certain employment conditions deeper in supply chains may represent a more significant risk of forced and trafficked labour. Our partners are only permitted to use subcontractors where prior written consent has been provided and the same monitoring process is applied to subcontractors. We ask that all partners confirm that any raw materials used in '.$sitename.' Products are derived from sources that are compliant with local employment regulations.';
}

if( isset( $website['training'] ) ) {
	$page_content .= '<h3>TRAINING & DEVELOPMENT</h3>

 '.$sitename.' is aware that only through developing and empowering our own employees can we effectively implement our values. Therefore, we have developed a training and education program to ensure key employees — particularly those who interact and have relationships with our factories — understand the risks associated with manufacturing offshore and are aware of the systems and processes in place should any issues be identified.

This statement is made pursuant to the California Transparency in Supply Chains Act of 2010 (SB 657) and sets out the policies and processes at '.$sitename.' to prevent the occurrence of slavery and human trafficking in our supply chain and other operations.';
}

$page_content .= '<h3>NO WARRANTIES</h3>

'.$sitename.' makes no representation of any kind regarding this Site, Content or any portion thereof, WHICH ARE PROVIDED ON AN "AS IS" AND "AS AVAILABLE" BASIS, WITH ALL FAULTS. '.$sitename.' EXPRESSLY DISCLAIMS ALL WARRANTIES OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT, AS WELL AS ALL WARRANTIES ARISING BY USAGE OF TRADE, COURSE OF DEALING, OR COURSE OF PERFORMANCE.

Without prejudice to the generality of the foregoing paragraph, '.$sitename.' does not warrant that this website will be constantly available, or available at all; or the information on this website is complete, true, accurate or non-misleading.

<h3>LIMITATIONS OF LIABILITY</h3>

'.$sitename.' will not be liable to you (whether under the law of contract, the law of torts or otherwise) in relation to the contents of, or use of, or otherwise in connection with, this website:

<ul>
<li>[to the extent that the website is provided free-of-charge, for any direct loss;</li>
<li>for any indirect, special or consequential loss; or</li>
<li>for any business losses, loss of revenue, income, profits or anticipated savings, loss of contracts or business relationships, loss of reputation or goodwill, or loss or corruption of information or data.</li>
</ul>

IN NO EVENT SHALL '.$sitename.' BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, PUNITIVE, exemplary, INCREASED OR CONSEQUENTIAL DAMAGES, LOSS OF PROFITS, DATA, GOODWILL OR USE, INCURRED BY YOU OR ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT (INCLUDING NEGLIGENCE AND STRICT LIABILITY), ARISING FROM YOUR ACCESS TO OR INABILITY TO ACCESS, OR USE OF, THIS SITE, EVEN IF '.$sitename.' HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

Without limiting the generality of the foregoing, under no circumstances shall '.$sitename.' or any other party involved in creating, producing, or distributing this Site be liable for any direct, indirect, incidental, special or consequential damages or loss of profits, good will, use, data or other intangible losses (even if advised of the possibility of such damages) that result from (a) any delay, failure, interruption or corruption of this Site or any data or information transmitted in connection with the use of this Site; (b) personal injury or death caused by your use or misuse of this Site; (c) the cost of procurement of substitute goods and services resulting from your use of any goods, data, information or services purchased or obtained or messages received or transactions entered into, through or from this Site; (d) unauthorized access to or alteration of your transmissions or data; and (e) any other matter relating to our Site. You hereby acknowledge that this paragraph shall apply to all nutraceuticals, products, and services available through this Site. Because some states do not allow the exclusion or limitation of liability for consequential or incidental damages, in such states, liability is limited to the fullest extent permitted by law.

Notwithstanding the above, '.$sitename.' sole liability for any reason to you, and your sole and exclusive remedy for any cause or claim whatsoever, shall be limited to the amount paid by you for any product, information or service purchased by you from us through this Site.

In accordance with the 1996 Communications and Decency Act, Section 230, we are also not liable for comments user of this website leave as comments. While we will certainly delete comments that don’t adhere to our personal standards, if someone claims you are a car thief, you have to sue them not us.

REASONABLENESS

By using this website, you agree that the exclusions and limitations of liability set out in this website disclaimer are reasonable. If you do not think they are reasonable, you must not use this website.

UNENFORCEABLE PROVISIONS

If any provision of this website disclaimer is, or is found to be, unenforceable under applicable law, that will not affect the enforceability of the other provisions of this website disclaimer.

GOVERNING LAW

Use of this Site is governed by '.$state.' / '.$country.' law. Any claim related to the Site and any product purchased through this Site shall be brought in a federal or state court within one (1) year after the claim arises. Users of this Site consent to the jurisdiction and venue of such courts as the most convenient and appropriate for the resolution of disputes concerning this Site.

ACKNOWLEDGEMENT

You acknowledge (a) that you have read and understood these Terms; and (b) that these Terms have the same force and effect as a signed agreement.

CHANGES TO OUR PRIVACY POLICY AND TERMS OF USE

'.$sitename.' may change these Terms from time to time. Please review these Terms periodically for any updates or changes. Your continued use of this Site following the posting of any updates or changes to these Terms constitutes your acceptance of such changes. If you object to any provision of these Terms or any subsequent modifications to these Terms, your exclusive recourse is to immediately terminate use of this Site.

'.$sitename.' also reserves the right to modify or terminate your access to the Site (or portions of this Site) at any time, temporarily or permanently, with or without notice to you. '.$sitename.' may also impose limits on certain features, services or all of this Site without notice or liability. You acknowledge and agree that '.$sitename.' will not be liable to you or any third party in the event that '.$sitename.' exercises its right to modify or terminate access to this Site or portions of this Site.

It is our policy to post any changes we make to our privacy policy on this page. If we make material changes to how we treat our users’ personal information, we will notify you through a notice on the Website home page. The date the privacy policy was last revised is identified at the top of the page. You are responsible for ensuring we have an up-to-date active and deliverable email address for you, and for periodically visiting our Website and this privacy policy to check for any changes.

Price and availability information on this Site are subject to change without notice.
';



	if( $saveto['type'] == 'new' ) {
		// Generate New Page with name $saveto['pagename']
		// Create post object
		$my_post = array(
		  'post_title'    => empty( $saveto['pagename'] ) ? 'Terms and Conditions' : $saveto['pagename'],
		  'post_content'  => $page_content,
		  'post_status'   => 'publish',
		  'post_type' => 'page'
		);
		// Insert the post into the database
		$page_id = wp_insert_post( $my_post );
	}
	else {
		// Update contents of page with id $saveto['pageid']
		$page_id = $saveto['pageid'];
		if( $page_id ) {
			$my_post = array(
			      'ID'           => $page_id,
			      'post_content' => $page_content,
			  );

			// Update the post into the database
			  wp_update_post( $my_post );
		}
	}
	$wpfs5_tc_page_id = $page_id;
	// die(9);
}
function wpfresh5_settings_content_tab_gdprfake( $settings = false ) {
?>
     <table class="form-table">
        <?php wpfresh5_field_checkbox( 'Enable cookie consent notice', 'ffggg', 0, false, '', 'If you check this, visitors will see a cookie consent notice' ); ?>
        <?php wpfresh5_field_checkbox( 'Disable EU traffic', 'ffggg', 0, false, '', 'If you check this, EU visitors will not be able to reach your website' ); ?>
        <?php wpfresh5_field_checkbox( 'Add checkbox to contact forms', 'ffggg', 0, false, '', 'If you check this, you will add a terms acceptance checkbox to your comments/forms' ); ?>
        <?php wpfresh5_field_checkbox( 'Force T&C acceptance', 'ffggg', 0, false, '', 'If you check this, your visitors will need to accept your T&C before browsing your website' ); ?>
    </table>
	<br/>
	<p>You can find more settings inside our <a href="<?php echo admin_url('admin.php?page=wp-freshstart5-gdpr');?>">GDPR specific page</a></p>
<?php
}
?>