<div class="wrap">

<?php include(sprintf("%s/the_header.php", dirname(__FILE__))); ?>

<form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">

        <table class="form-table">  
            <tr valign="top">
                <th scope="row"><?php esc_html_e( 'Envato Username:', 'ad-overlay-anything' );?></th>
                <td><input type="text" size="20" name="aoa_envato_name" id="aoa_envato_name" value="<?php echo get_option( 'aoa_envato_name', '' ); ?>" /><br />
			<?php printf( esc_html__( "This is your username when signing into any %sEnvato%s marketplace.", 'ad-overlay-anything'), 
			'<a target="_blank" href="' . esc_url( 'http://codecanyon.net/sign_in' ) . '">',
			'</a>'
		 	); ?>
		</td>
            </tr>
            <tr valign="top">
                <th scope="row"><?php esc_html_e( 'Envato Purchase Code:', 'ad-overlay-anything' );?></th>
                <td><input type="text" size="40" name="aoa_envato_code" id="aoa_envato_code" value="<?php echo get_option( 'aoa_envato_code', '' ); ?>" /><br />
			<?php printf( esc_html__( "On your %sEnvato downloads%s page, click the 'Download' button for Video Link Checker and select 'License certificate & purchase code'", 'ad-overlay-anything'), 
			'<a target="_blank" href="' . esc_url( 'http://codecanyon.net/downloads' ) . '">',
			'</a>'
		 	); ?>
		</td>
            </tr>
            <tr valign="top">
                <th scope="row"><?php esc_html_e( 'Premium Support Until:', 'ad-overlay-anything' );?></th>
                <td><?php echo empty( $support ) ? '<em>Unknown - save license information</em>' : $support;?><br /><?php esc_html_e( "Premium support is for immediate assistance with any technical issues or third party assets.", 'ad-overlay-anything' );?></td>
            </tr>

            <tr valign="top">
                <th scope="row"><?php esc_html_e( 'Cookie Duration in Hours:', 'ad-overlay-anything' );?></th>
                <td><input type="text" size="40" name="aoa_cookie_hours" id="aoa_cookie_hours" value="<?php echo get_option( 'aoa_cookie_hours', 0 ); ?>" /><br /><?php esc_html_e( "Show only 1 ad per user during this time.", 'ad-overlay-anything' ); ?></td>
            </tr>

            <tr valign="top">
                <th scope="row"><?php esc_html_e( 'Show Ad after:', 'ad-overlay-anything' );?></th>
                <td><input type="text" size="40" name="aoa_show_ad" id="aoa_show_ad" value="<?php echo get_option( 'aoa_show_ad', 0 ); ?>" /><br /><?php esc_html_e( "Number of seconds before showing Ads after the page is loaded", 'ad-overlay-anything' ); ?></td>
            </tr>

            <tr valign="top">
                <th scope="row"><?php esc_html_e( 'Repeat Ad after:', 'ad-overlay-anything' );?></th>
                <td><input type="text" size="40" name="aoa_repeat_ad" id="aoa_repeat_ad" value="<?php echo get_option( 'aoa_repeat_ad', 0 ); ?>" /><br /><?php esc_html_e( "Repeat ads every X number of seconds after the page is loaded", 'ad-overlay-anything' ); ?></td>
            </tr>

            <tr valign="top">
            <tr valign="top">
                <th scope="row"><?php esc_html_e( 'Close Text/Button delay:', 'ad-overlay-anything' );?></th>
                <td><input type="text" size="40" name="aoa_close_delay" id="aoa_close_delay" value="<?php echo get_option( 'aoa_close_delay', 0 ); ?>" /><br /><?php esc_html_e( "Number of seconds before showing the Close Text and Close Button on Ads", 'ad-overlay-anything' ); ?></td>
            </tr>

            <tr valign="top">
                <th scope="row"><?php esc_html_e( 'Auto Close Ad after:', 'ad-overlay-anything' );?></th>
                <td><input type="text" size="40" name="aoa_close_after" id="aoa_close_after" value="<?php echo get_option( 'aoa_close_after', 0 ); ?>" /><br /><?php esc_html_e( "Number of seconds before automatically closing Ads", 'ad-overlay-anything' ); ?></td>
            </tr>



            <tr valign="top">
                <th scope="row"><?php esc_html_e( 'Automatically Overlay these html elements:', 'ad-overlay-anything' );?></th>
                <td><input type="text" size="40" name="aoa_auto_elements" id="aoa_auto_elements" value="<?php echo get_option( 'aoa_auto_elements', 'iframe' ); ?>" /><br /><?php esc_html_e( "Automatically overlay an ad on these html elements in post content (optional).", 'ad-overlay-anything' );?></td>
            </tr>
            <tr valign="top">
                <th scope="row"><?php esc_html_e( 'Automatically Overlay elements with Ad Id:', 'ad-overlay-anything' );?></th>
                <td><input type="text" size="40" name="aoa_auto_id" id="aoa_auto_id" value="<?php echo get_option( 'aoa_auto_id', '' ); ?>" /><br /><?php esc_html_e( "Enter the Ad Id(s) to overlay on the elements found in the post content. Leave blank to disable.", 'ad-overlay-anything' );?></td>
            </tr>
            <tr valign="top">
                <th scope="row"><?php esc_html_e( 'Random Ads Status:', 'ad-overlay-anything' );?></th>
                <td>
			<?php $optValue = get_option( 'aoa_random_status', 'Active' ); ?>
			<select name="aoa_random_status">
				<option value="Active" <?php echo ($optValue == 'Active') ? "SELECTED" : "" ?>>Active</option>
				<option value="Inactive" <?php echo ($optValue == 'Inactive') ? "SELECTED" : "" ?>>Inactive</option>
			</select>
			<br /><?php esc_html_e( "Normally using an Ad Id of 0 will select a random Ad. Select Inactive to not show anything.", 'ad-overlay-anything' );?>
		</td>
            </tr>
            <tr valign="top">
                <th scope="row"><?php esc_html_e( 'Show Ads on Mobile:', 'ad-overlay-anything' );?></th>
                <td>
			<?php $optValue = get_option( 'aoa_mobile_ads', 'Active' ); ?>
			<select name="aoa_mobile_ads">
				<option value="Active" <?php echo ($optValue == 'Active') ? "SELECTED" : "" ?>>Active</option>
				<option value="Inactive" <?php echo ($optValue == 'Inactive') ? "SELECTED" : "" ?>>Inactive</option>
			</select>
			<br /><?php esc_html_e( "Whether to show ads to visitors on mobile devices.", 'ad-overlay-anything' );?>
		</td>
            </tr>
            <tr valign="top">
                <th scope="row"><?php esc_html_e( 'Custom CSS:', 'ad-overlay-anything' );?></th>
		<td><textarea rows="10" cols="60" name="aoa_custom_css"><?php echo get_option( 'aoa_custom_css' ); ?></textarea></td>
            </tr>
            <tr valign="top">
                <th scope="row"><?php esc_html_e( 'Domain whitelist:', 'ad-overlay-anything' );?></th>
		<td>
			<?php $whitelist = array_filter( get_option( 'aoa_domain_whitelist', array() ) ); ?>
			<?php $whitelist = is_array( $whitelist ) ? implode( "\n", $whitelist ) : ''; ?>
			<textarea rows="10" cols="60" name="aoa_domain_whitelist"><?php echo $whitelist; ?></textarea>
			<br /><?php esc_html_e( "Do not show ads if the referering domain is on the whitelist, such as google.com", 'ad-overlay-anything' );?>
		</td>
            </tr>
            <tr valign="top">
                <th scope="row"><?php esc_html_e( 'Admin only?', 'ad-overlay-anything' );?></th>
		<?php $optValue = get_option( 'aoa_admin_only', false ); ?>
		<td><input type="checkbox" name="aoa_admin_only" value="TRUE" <?php echo ($optValue == TRUE) ? "CHECKED" : "" ?>/> &nbsp; <?php esc_html_e( 'If checked, ads will only show to administrator. Useful for testing on live site.', 'ad-overlay-anything' );?></td>
            </tr>
	</table>

	<input class="button-primary" type="submit" name="save_settings" value="<?php esc_html_e('Save Settings', 'ad-overlay-anything'); ?> &raquo;" />

</form>

</div>
