<?php
// Prevent direct access
if (! defined('ABSPATH')) {
  exit;
}
?>
<div class="wrap">
    <h1><?php echo esc_html( get_admin_page_title() ); ?></h1>

    <div class="boostify-setting-notice" ></div>

    <form method="post" id="boostify-schedule">

        <table class="form-table">
            <tr>
                <th scope="row"><label for="boostify_post_count"><?php esc_html_e( '# of Posts ', 'boostify-blog-ai' ); ?></label></th>
                <td>
                    <input name="boostify_post_count" type="number" id="boostify_post_count" min="1" max="100"  value="<?php echo esc_attr( $setting['quantity'] ); ?>" required >

                    <label for="boostify_post_duration"><?php esc_html_e( 'Per ', 'boostify-blog-ai' ) ?></label>

                    <select name="boostify_post_duration"  id="boostify_post_duration" required>
                        <option value="">Select</option>
                        <option value="week" <?php echo ( $setting['duration'] === 'week' ) ? 'selected="selected"' : ''; ?> >Week</option>
                        <option value="month" <?php echo ( $setting['duration'] === 'month' ) ? 'selected="selected"' : ''; ?> >Month</option>
                    </select>
                </td>
            </tr>
            <tr>
                <th scope="row"><label for="boostify_post_topics"><?php esc_html_e( 'Topics', 'boostify-blog-ai' ) ?></label></th>
                <td>
                    <input type="text" name="boostify_post_topics" id="boostify_post_topics" value="<?php echo esc_attr( $setting['topics'] ); ?>" required >
                    <span class="boostify-help-text">Enter (comma separated) Topics.</span>
                </td>
            </tr>
            <tr>
                <th scope="row"><label for="boostify_post_keywords"><?php esc_html_e( 'Keywords', 'boostify-blog-ai' ) ?></label></th>
                <td>
                    <input type="text" name="boostify_post_keywords" id="boostify_post_keywords" value="<?php echo esc_attr( $setting['keywords'] ); ?>" required >
                    <span class="boostify-help-text">Enter (comma separated) Topics.</span>
                </td>
            </tr>
            <tr>
                <th scope="row"><label for="boostify_trust_ai"><?php esc_html_e( 'Trust AI', 'boostify-blog-ai' ) ?></label></th>
                <td>
                    <input type="checkbox" name="boostify_trust_ai" id="boostify_trust_ai" value="yes" <?php echo ( ! empty( $setting['trust_ai'] ) ) ? 'checked="checked"' : ''; ?> />
                    <span class="boostify-help-text">If checked, posts will be published automatically without admin approval.</span>
                </td>
            </tr>
            <tr>
                <th scope="row"><label for="boostify_post_image"><?php esc_html_e( 'Include Image', 'boostify-blog-ai' ) ?></label></th>
                <td>
                    <input type="checkbox" name="boostify_post_image" id="boostify_post_image" value="yes" <?php echo ( ! empty( $setting['image'] ) ) ? 'checked="checked"' : ''; ?> >
                    <span class="boostify-help-text">Add image in blog post</span>
                </td>
            </tr>
            <tr>
                <th scope="row"><label for="boostify_post_image_position"><?php esc_html_e( 'Image Position', 'boostify-blog-ai' ) ?></label></th>
                <td>
                    <select  name="boostify_post_image_position" id="boostify_post_image_position">
                        <option value="">Select</option>
                        <option value="top" <?php echo ( $setting['image_position'] === 'top' ) ? 'selected="selected"' : ''; ?> >Top</option>
                        <option value="middle" <?php echo ( $setting['image_position'] === 'middle' ) ? 'selected="selected"' : ''; ?> >Middle</option>
                        <option value="below" <?php echo ( $setting['image_position'] === 'below' ) ? 'selected="selected"' : ''; ?> >Below</option>
                    </select>
                    <span class="boostify-help-text"></span>
                </td>
            </tr>
          
        </table>    
        <p class="submit">
            <input type="submit" name="submit" id="submit" class="button button-primary" value="Save Changes"> 
            <a class="button button-primary" id="boostify-manual-run" style="display: none;" >Run Manually </a> 
            <span class="spinner" id="boostify-spinner"></span></p>
       
       
    </form>  
</div>
<?php
wp_enqueue_script( 'boosyify_blog_ai_admin_script');
