<?php if(!class_exists('woocommerce')){ ?>
    <div class="notice inline notice-warning notice-alt">
        <p> 
        The <strong>WooCommerce</strong> plugin is required and must be activated to use this feature.           
        </p>
    </div>
<?php } 
if(class_exists('woocommerce')){

    global 
    $ST_OPTION_st_proqyz_IELTS_LMS_enable_evaluation,
    $ST_OPTION_st_proqyz_IELTS_LMS_writing_task1_evaluation_enable,
    $ST_OPTION_st_proqyz_IELTS_LMS_writing_task2_evaluation_enable,
    $ST_OPTION_st_proqyz_IELTS_LMS_writing_task1and2_evaluation_enable,
    $ST_OPTION_st_proqyz_IELTS_LMS_writing_task1_evaluation_plan_id,
    $ST_OPTION_st_proqyz_IELTS_LMS_writing_task2_evaluation_plan_id,
    $ST_OPTION_st_proqyz_IELTS_LMS_writing_task1and2_evaluation_plan_id,
    $ST_OPTION_st_proqyz_IELTS_LMS_writing_evaluation_instructions,
    $ST_OPTION_st_proqyz_IELTS_LMS_speaking_evaluation_instructions,
    $ST_OPTION_st_proqyz_IELTS_LMS_speaking_evaluation_enable,
    $ST_OPTION_st_proqyz_IELTS_LMS_speaking_evaluation_plan_id;

    $input_writing_task1_title      = 'writing-task-1-plan-title';
    $input_writing_task1_price      = 'writing-task-1-plan-price';

    $input_writing_task2_title      = 'writing-task-2-plan-title';
    $input_writing_task2_price      = 'writing-task-2-plan-price';

    $input_writing_task1and2_title  = 'writing-task-1-and-2-plan-title';
    $input_writing_task1and2_price  = 'writing-task-1-and-2-plan-price';

    # speaking
    $input_speaking_plan_title      = 'speaking-plan-title';
    $input_speaking_plan_price      = 'speaking-plan-price';


    $enable_evaluation                      = 0;

    # writing evaluation
    $writing_evaluation_instructions        = '';

    $writing_evalation_plan1                = null;
    $writing_evaluation_plan1_title         = "Writing Task 1 Evaluation cost";
    $writing_evaluation_plan1_price         = 0;
    $writing_evaluation_plan1_enable        = 0;

    $writing_evaluation_plan2_title         = "Writing Task 2 Evaluation cost";
    $writing_evaluation_plan2_price         = 0;
    $writing_evaluation_plan2_enable        = 0;

    $writing_evaluation_plan1and2_title     = "Writing Task 1 + 2 Evaluation cost";
    $writing_evaluation_plan1and2_price     = 0;
    $writing_evaluation_plan1and2_enable    = 0;

    # speaking evaluation
    $speaking_evaluation_instructions       = 'speaks';

    $speaking_evaluation_plan_title         = "Speaking Evaluation cost";
    $speaking_evaluation_plan_price         = 0;
    $speaking_evaluation_plan_enable        = 0;

    $writing_evalation_task1_plan_id = get_option($ST_OPTION_st_proqyz_IELTS_LMS_writing_task1_evaluation_plan_id, false);
    # get writing product for task 1
    if(!wc_get_product( $writing_evalation_task1_plan_id )){
        $product_args = array(
            'post_title' => $writing_evaluation_plan1_title,
            'post_status' => 'publish',
            'post_type' => 'product',
            'post_excerpt' => '',
            'post_content' => stripslashes(html_entity_decode( 'Auto generated product for writing task 1 evaluation enrollment please do not delete or update.', ENT_QUOTES, 'UTF-8' ) ),
            'post_author' => get_current_user_id()
        );

        $writing_evalation_task1_plan_id = wp_insert_post( $product_args );
        if ( ! is_wp_error( $writing_evalation_task1_plan_id ) ) {
            $product = wc_get_product( $writing_evalation_task1_plan_id );
            if( $product ){
                wp_set_object_terms( $writing_evalation_task1_plan_id, 'simple', 'product_type' );
                update_post_meta( $writing_evalation_task1_plan_id, '_stock_status', 'instock' );
                update_post_meta( $writing_evalation_task1_plan_id, 'total_sales', '0' );
                update_post_meta( $writing_evalation_task1_plan_id, '_downloadable', 'no' );
                update_post_meta( $writing_evalation_task1_plan_id, '_virtual', 'yes' );
                update_post_meta( $writing_evalation_task1_plan_id, '_regular_price', $writing_evaluation_plan1_price );
                update_post_meta( $writing_evalation_task1_plan_id, '_featured', 'no' );
                update_post_meta( $writing_evalation_task1_plan_id, '_price', $writing_evaluation_plan1_price );
                update_post_meta( $writing_evalation_task1_plan_id, '_sold_individually', 'yes' );
                update_post_meta( $writing_evalation_task1_plan_id, '_manage_stock', 'no' );
                update_post_meta( $writing_evalation_task1_plan_id, '_backorders', 'no' );
                if (version_compare(WC_VERSION, '3.0', '>=' ) ) {
                    $product->set_reviews_allowed( false );
                    $product->set_catalog_visibility( 'hidden' );
                    $product->save();
                }  
                update_option($ST_OPTION_st_proqyz_IELTS_LMS_writing_task1_evaluation_plan_id, $writing_evalation_task1_plan_id); 
            }   
        }
    }

    $writing_evalation_task2_plan_id = get_option($ST_OPTION_st_proqyz_IELTS_LMS_writing_task2_evaluation_plan_id, false);
    # get writing product for task 2
    if(!wc_get_product( $writing_evalation_task2_plan_id )){
        $product_args = array(
            'post_title' => $writing_evaluation_plan2_title,
            'post_status' => 'publish',
            'post_type' => 'product',
            'post_excerpt' => '',
            'post_content' => stripslashes(html_entity_decode( 'Auto generated product for writing task 2 evaluation enrollment please do not delete or update.', ENT_QUOTES, 'UTF-8' ) ),
            'post_author' => get_current_user_id()
        );
            
        $writing_evalation_task2_plan_id = wp_insert_post( $product_args );
        if ( ! is_wp_error( $writing_evalation_task2_plan_id ) ) {
            $product = wc_get_product( $writing_evalation_task2_plan_id );
            if( $product ){
                wp_set_object_terms( $writing_evalation_task2_plan_id, 'simple', 'product_type' );
                update_post_meta( $writing_evalation_task2_plan_id, '_stock_status', 'instock' );
                update_post_meta( $writing_evalation_task2_plan_id, 'total_sales', '0' );
                update_post_meta( $writing_evalation_task2_plan_id, '_downloadable', 'no' );
                update_post_meta( $writing_evalation_task2_plan_id, '_virtual', 'yes' );
                update_post_meta( $writing_evalation_task2_plan_id, '_regular_price', $writing_evaluation_plan2_price );
                update_post_meta( $writing_evalation_task2_plan_id, '_featured', 'no' );
                update_post_meta( $writing_evalation_task2_plan_id, '_price', $writing_evaluation_plan2_price );
                update_post_meta( $writing_evalation_task2_plan_id, '_sold_individually', 'yes' );
                update_post_meta( $writing_evalation_task2_plan_id, '_manage_stock', 'no' );
                update_post_meta( $writing_evalation_task2_plan_id, '_backorders', 'no' );
                update_option($ST_OPTION_st_proqyz_IELTS_LMS_writing_task2_evaluation_plan_id, $writing_evalation_task2_plan_id); 
            }   
        }
    }

    $writing_evalation_task1and2_plan_id = get_option($ST_OPTION_st_proqyz_IELTS_LMS_writing_task1and2_evaluation_plan_id, false);
    # get writing product for task 1 + 2
    if(!wc_get_product( $writing_evalation_task1and2_plan_id )){
        $product_args = array(
            'post_title' => $writing_evaluation_plan1and2_title,
            'post_status' => 'publish',
            'post_type' => 'product',
            'post_excerpt' => '',
            'post_content' => stripslashes(html_entity_decode( 'Auto generated product for writing task 1 + 2 evaluation enrollment please do not delete or update.', ENT_QUOTES, 'UTF-8' ) ),
            'post_author' => get_current_user_id()
        );
            
        $writing_evalation_task1and2_plan_id = wp_insert_post( $product_args );
        if ( ! is_wp_error( $writing_evalation_task1and2_plan_id ) ) {
            $product = wc_get_product( $writing_evalation_task1and2_plan_id );
            if( $product ){
                wp_set_object_terms( $writing_evalation_task1and2_plan_id, 'simple', 'product_type' );
                update_post_meta( $writing_evalation_task1and2_plan_id, '_stock_status', 'instock' );
                update_post_meta( $writing_evalation_task1and2_plan_id, 'total_sales', '0' );
                update_post_meta( $writing_evalation_task1and2_plan_id, '_downloadable', 'no' );
                update_post_meta( $writing_evalation_task1and2_plan_id, '_virtual', 'yes' );
                update_post_meta( $writing_evalation_task1and2_plan_id, '_regular_price', $writing_evaluation_plan1and2_price );
                update_post_meta( $writing_evalation_task1and2_plan_id, '_featured', 'no' );
                update_post_meta( $writing_evalation_task1and2_plan_id, '_price', $writing_evaluation_plan1and2_price );
                update_post_meta( $writing_evalation_task1and2_plan_id, '_sold_individually', 'yes' );
                update_post_meta( $writing_evalation_task1and2_plan_id, '_manage_stock', 'no' );
                update_post_meta( $writing_evalation_task1and2_plan_id, '_backorders', 'no' );    
                update_option($ST_OPTION_st_proqyz_IELTS_LMS_writing_task1and2_evaluation_plan_id, $writing_evalation_task1and2_plan_id); 
            }   
        }
    }

    # speaking evaluation
    $speaking_evalation_plan_id = get_option($ST_OPTION_st_proqyz_IELTS_LMS_speaking_evaluation_plan_id, false);
    # get writing product for task 2
    if(!wc_get_product( $speaking_evalation_plan_id )){
        $product_args = array(
            'post_title' => $speaking_evaluation_plan_title,
            'post_status' => 'publish',
            'post_type' => 'product',
            'post_excerpt' => '',
            'post_content' => stripslashes(html_entity_decode( 'Auto generated product for Speaking evaluation enrollment please do not delete or update.', ENT_QUOTES, 'UTF-8' ) ),
            'post_author' => get_current_user_id()
        );
            
        $speaking_evalation_plan_id = wp_insert_post( $product_args );
        if ( ! is_wp_error( $speaking_evalation_plan_id ) ) {
            $product = wc_get_product( $speaking_evalation_plan_id );
            if( $product ){
                wp_set_object_terms( $speaking_evalation_plan_id, 'simple', 'product_type' );
                update_post_meta( $speaking_evalation_plan_id, '_stock_status', 'instock' );
                update_post_meta( $speaking_evalation_plan_id, 'total_sales', '0' );
                update_post_meta( $speaking_evalation_plan_id, '_downloadable', 'no' );
                update_post_meta( $speaking_evalation_plan_id, '_virtual', 'yes' );
                update_post_meta( $speaking_evalation_plan_id, '_regular_price', $speaking_evaluation_plan_price );
                update_post_meta( $speaking_evalation_plan_id, '_featured', 'no' );
                update_post_meta( $speaking_evalation_plan_id, '_price', $speaking_evaluation_plan_price );
                update_post_meta( $speaking_evalation_plan_id, '_sold_individually', 'yes' );
                update_post_meta( $speaking_evalation_plan_id, '_manage_stock', 'no' );
                update_post_meta( $speaking_evalation_plan_id, '_backorders', 'no' );
                update_option($ST_OPTION_st_proqyz_IELTS_LMS_speaking_evaluation_plan_id, $speaking_evalation_plan_id); 
            }   
        }
    }


    # post handler
    if(isset($_POST['st-proqyz-ielts-lms-evaluation-save']) && $_POST['st-proqyz-ielts-lms-evaluation-save'] == 1){
        if(isset($_POST[$ST_OPTION_st_proqyz_IELTS_LMS_enable_evaluation])){
            update_option($ST_OPTION_st_proqyz_IELTS_LMS_enable_evaluation, $_POST[$ST_OPTION_st_proqyz_IELTS_LMS_enable_evaluation]);
        } else {
            update_option($ST_OPTION_st_proqyz_IELTS_LMS_enable_evaluation, 0);
        }
    }

    if(isset($_POST['st-proqyz-writing-evaluation-save']) && $_POST['st-proqyz-writing-evaluation-save'] == 1){

        $writing_evaluation_instructions = $_POST[$ST_OPTION_st_proqyz_IELTS_LMS_writing_evaluation_instructions];
        $writing_evaluation_instructions = stripslashes($writing_evaluation_instructions);
        update_option($ST_OPTION_st_proqyz_IELTS_LMS_writing_evaluation_instructions, $writing_evaluation_instructions);
        
        # task 1 enable
        if(isset($_POST[$ST_OPTION_st_proqyz_IELTS_LMS_writing_task1_evaluation_enable])){
            $writing_evaluation_plan1_enable = $_POST[$ST_OPTION_st_proqyz_IELTS_LMS_writing_task1_evaluation_enable];
        }
        update_option($ST_OPTION_st_proqyz_IELTS_LMS_writing_task1_evaluation_enable,$writing_evaluation_plan1_enable);

        # task 2 enable
        if(isset($_POST[$ST_OPTION_st_proqyz_IELTS_LMS_writing_task2_evaluation_enable])){
            $writing_evaluation_plan2_enable = $_POST[$ST_OPTION_st_proqyz_IELTS_LMS_writing_task2_evaluation_enable];
        }
        update_option($ST_OPTION_st_proqyz_IELTS_LMS_writing_task2_evaluation_enable,$writing_evaluation_plan2_enable);

        # task 1 + 2 enable
        if(isset($_POST[$ST_OPTION_st_proqyz_IELTS_LMS_writing_task1and2_evaluation_enable])){
            $writing_evaluation_plan1and2_enable = $_POST[$ST_OPTION_st_proqyz_IELTS_LMS_writing_task1and2_evaluation_enable];
        }
        update_option($ST_OPTION_st_proqyz_IELTS_LMS_writing_task1and2_evaluation_enable,$writing_evaluation_plan1and2_enable);

        # task 1 title
        if(isset($_POST[$input_writing_task1_title]) && !empty($_POST[$input_writing_task1_title])){
            $writing_evaluation_plan1_title   = $_POST[$input_writing_task1_title];
        }
        # task 1 price
        if(isset($_POST[$input_writing_task1_price]) && !empty($_POST[$input_writing_task1_price])){
            if($_POST[$input_writing_task1_price] < 0){

            } else {
                $writing_evaluation_plan1_price    = $_POST[$input_writing_task1_price];
            }
        }
        # task 1
        update_post_meta( $writing_evalation_task1_plan_id, '_regular_price', $writing_evaluation_plan1_price );
        update_post_meta( $writing_evalation_task1_plan_id, '_price', $writing_evaluation_plan1_price );
        wp_update_post([
            'ID'         => $writing_evalation_task1_plan_id,
            'post_title' => $writing_evaluation_plan1_title
        ]);

        # task 2 title
        if(isset($_POST[$input_writing_task2_title]) && !empty($_POST[$input_writing_task2_title])){
            $writing_evaluation_plan2_title    = $_POST[$input_writing_task2_title];
        }
        # task 2 price
        if(isset($_POST[$input_writing_task2_price]) && !empty($_POST[$input_writing_task2_price])){
            if($_POST[$input_writing_task2_price] < 0){

            } else {
                $writing_evaluation_plan2_price    = $_POST[$input_writing_task2_price];
            }
        }
        # task 2
        update_post_meta( $writing_evalation_task2_plan_id, '_regular_price', $writing_evaluation_plan2_price );
        update_post_meta( $writing_evalation_task2_plan_id, '_price', $writing_evaluation_plan2_price );
        wp_update_post([
            'ID'         => $writing_evalation_task2_plan_id,
            'post_title' => $writing_evaluation_plan2_title
        ]);

        # task 1 + 2 title
        if(isset($_POST[$input_writing_task1and2_title]) && !empty($_POST[$input_writing_task1and2_title])){
            $writing_evaluation_plan1and2_title    = $_POST[$input_writing_task1and2_title];
        }
        # task 1 + 1 price
        if(isset($_POST[$input_writing_task1and2_price]) && !empty($_POST[$input_writing_task1and2_price])){
            if($_POST[$input_writing_task1and2_price] < 0){

            } else {
                $writing_evaluation_plan1and2_price    = $_POST[$input_writing_task1and2_price];
            }
        }

        # task 1 + 2
        update_post_meta( $writing_evalation_task1and2_plan_id, '_regular_price', $writing_evaluation_plan1and2_price );
        update_post_meta( $writing_evalation_task1and2_plan_id, '_price', $writing_evaluation_plan1and2_price );
        wp_update_post([
            'ID'         => $writing_evalation_task1and2_plan_id,
            'post_title' => $writing_evaluation_plan1and2_title
        ]);

        
        

        
    }

    if(isset($_POST['st-proqyz-speaking-evaluation-save']) && $_POST['st-proqyz-speaking-evaluation-save'] == 1){

        $speaking_evaluation_instructions = $_POST[$ST_OPTION_st_proqyz_IELTS_LMS_speaking_evaluation_instructions];
        $speaking_evaluation_instructions = stripslashes($speaking_evaluation_instructions);
        update_option($ST_OPTION_st_proqyz_IELTS_LMS_speaking_evaluation_instructions, $speaking_evaluation_instructions);
        

        # task 1 enable
        if(isset($_POST[$ST_OPTION_st_proqyz_IELTS_LMS_speaking_evaluation_enable])){
            $speaking_evaluation_plan_enable = $_POST[$ST_OPTION_st_proqyz_IELTS_LMS_speaking_evaluation_enable];
        }
        update_option($ST_OPTION_st_proqyz_IELTS_LMS_speaking_evaluation_enable,$speaking_evaluation_plan_enable);

        # task 1 title
        if(isset($_POST[$input_speaking_plan_title]) && !empty($_POST[$input_speaking_plan_title])){
            $speaking_evaluation_plan_title   = $_POST[$input_speaking_plan_title];
        }
        # task 1 price
        if(isset($_POST[$input_speaking_plan_price]) && !empty($_POST[$input_speaking_plan_price])){
            if($_POST[$input_speaking_plan_price] < 0){

            } else {
                $speaking_evaluation_plan_price    = $_POST[$input_speaking_plan_price];
            }
        }

        # task 1
        update_post_meta( $speaking_evalation_plan_id, '_regular_price', $speaking_evaluation_plan_price );
        update_post_meta( $speaking_evalation_plan_id, '_price', $speaking_evaluation_plan_price );
        wp_update_post([
            'ID'         => $speaking_evalation_plan_id,
            'post_title' => $speaking_evaluation_plan_title
        ]);

    }


    # update meta
    $enable_evaluation                      = get_option($ST_OPTION_st_proqyz_IELTS_LMS_enable_evaluation,0);


    
    $writing_evaluation_instructions        = get_option($ST_OPTION_st_proqyz_IELTS_LMS_writing_evaluation_instructions);
    $writing_evaluation_instructions        = stripslashes($writing_evaluation_instructions);

    $speaking_evaluation_instructions       = get_option($ST_OPTION_st_proqyz_IELTS_LMS_speaking_evaluation_instructions);
    $speaking_evaluation_instructions       = stripslashes($speaking_evaluation_instructions);

    $product                                = wc_get_product( $writing_evalation_task1_plan_id );
    $writing_evaluation_plan1_title         = $product->get_title();
    $writing_evaluation_plan1_price         = $product->get_price();

    $product                                = wc_get_product( $writing_evalation_task2_plan_id );
    $writing_evaluation_plan2_title         = $product->get_title();
    $writing_evaluation_plan2_price         = $product->get_price();

    $product                                = wc_get_product( $writing_evalation_task1and2_plan_id );
    $writing_evaluation_plan1and2_title     = $product->get_title();
    $writing_evaluation_plan1and2_price     = $product->get_price();

    $product                                = wc_get_product( $speaking_evalation_plan_id );
    $speaking_evaluation_plan_title         = $product->get_title();
    $speaking_evaluation_plan_price         = $product->get_price();


    
    $writing_evaluation_plan1_enable        = get_option($ST_OPTION_st_proqyz_IELTS_LMS_writing_task1_evaluation_enable);
    $writing_evaluation_plan2_enable        = get_option($ST_OPTION_st_proqyz_IELTS_LMS_writing_task2_evaluation_enable);
    $writing_evaluation_plan1and2_enable    = get_option($ST_OPTION_st_proqyz_IELTS_LMS_writing_task1and2_evaluation_enable);
    $speaking_evaluation_plan_enable        = get_option($ST_OPTION_st_proqyz_IELTS_LMS_speaking_evaluation_enable);



?>
<h2>Evaluation Price</h2>
<p>In this section, you can add or adjust the price you want to charge for your speaking and writing evaluation services.</p>

<form method="POST">
    <table class="form-table">
        <tbody>
            <tr class="">
                <th scope="row" class="titledesc">Enable Evaluation</th>
                <td class="forminp forminp-checkbox ">
                    <fieldset>
                        <legend class="screen-reader-text">
                            <span>Enable Evaluation</span>
                        </legend>
                        <label for="<?php echo $ST_OPTION_st_proqyz_IELTS_LMS_enable_evaluation; ?>">
                            <input 
                                name="<?php echo $ST_OPTION_st_proqyz_IELTS_LMS_enable_evaluation; ?>" 
                                id="<?php echo $ST_OPTION_st_proqyz_IELTS_LMS_enable_evaluation; ?>" 
                                type="checkbox" 
                                class="" 
                                value="1" 
                                <?php echo ($enable_evaluation == '1')? 'checked' : ''; ?>
                            />	

                        </label> 
																
                    </fieldset>
                </td>
            </tr>

        </tbody>
    </table>

    <p class="submit">
        <button name="save" class="button-primary woocommerce-save-button" type="submit" value="Save changes">
            Save changes
        </button>
        <input 
            type="hidden" 
            id="st-proqyz-ielts-lms-evaluation-save" 
            name="st-proqyz-ielts-lms-evaluation-save" 
            value="1" 
        />		
    </p>
</form>


<div class="row">
    <div class="writing__container">
        <div id="poststuff">
            <div id="writing-evalution" class="postbox st-proqyz__evaluation-metabox">
                <div class="postbox-header">
                    <h2 class="hndle">Writing Evaluation</h2>
                    <div class="handle-actions hide-if-no-js">
                        <button type="button" class="handlediv" aria-expanded="true">
                            <span class="toggle-indicator" aria-hidden="true"></span>
                        </button>
                    </div>
                </div>
                <div class="inside" style="display: block;">
                    <div id="writing-evaluation-metabox-content" class="metabox__content">

                    <form method="POST">
                        <table class="form-table">
                            <tbody>
                                <!-- begin::writing instructions -->
                                <tr class="">
                                    <th scope="row" class="titledesc">Instructions</th>
                                    <td class="forminp forminp-checkbox ">
                                        <fieldset>
                                            <legend class="screen-reader-text">
                                                <span>Enable Evaluation</span>
                                            </legend>
                                            <?php 
                                                wp_editor($writing_evaluation_instructions,$ST_OPTION_st_proqyz_IELTS_LMS_writing_evaluation_instructions, array(
                                                    'media_buttons' => true, // Show media upload buttons
                                                    'textarea_name' => $ST_OPTION_st_proqyz_IELTS_LMS_writing_evaluation_instructions,
                                                    'textarea_rows' => 5, // Custom height (number of rows)
                                                    'teeny'         => false,
                                                )); 
                                            ?>
                                                                                    
                                        </fieldset>
                                    </td>
                                </tr>
                                <!-- end::writing instructions -->

                                <tr class="hr-only" style="border: 1px dotted #cbcaca;"></tr> 

                                <!-- begin::writing task 1 -->
                                <tr class="">
                                    <th scope="row" class="titledesc">Writing Task 1</th>
                                    <td class="forminp forminp-checkbox ">
                                        <fieldset>
                                            <legend class="screen-reader-text">
                                                <span>Writing Task 1</span>
                                            </legend>
                                            <label for="<?php echo $ST_OPTION_st_proqyz_IELTS_LMS_writing_task1_evaluation_enable; ?>">
                                                <input 
                                                    name="<?php echo $ST_OPTION_st_proqyz_IELTS_LMS_writing_task1_evaluation_enable; ?>" 
                                                    id="<?php echo $ST_OPTION_st_proqyz_IELTS_LMS_writing_task1_evaluation_enable; ?>" 
                                                    type="checkbox" 
                                                    class="<?php echo $ST_OPTION_st_proqyz_IELTS_LMS_writing_task1_evaluation_enable; ?>" 
                                                    value="1" 
                                                    <?php echo ($writing_evaluation_plan1_enable == 1)? 'checked' : ''; ?>
                                                />	
                                                Enable Writing Task 1 Evaluation				
                                            </label>
                                        </fieldset>
                                    </td>
                                </tr>
                                <tr class="">
                                    <th scope="row" class="titledesc">Title</th>
                                    <td class="forminp forminp-checkbox ">
                                        <fieldset>
                                            <legend class="screen-reader-text">
                                                <span>Title</span>
                                            </legend>
                                            <label for="<?php echo $input_writing_task1_title; ?>">
                                                <input 
                                                    name="<?php echo $input_writing_task1_title; ?>" 
                                                    id="<?php echo $input_writing_task1_title; ?>" 
                                                    type="text" 
                                                    class="regular-text" 
                                                    value="<?php echo $writing_evaluation_plan1_title; ?>" 
                                                />
                                            </label>
                                        </fieldset>
                                    </td>
                                </tr> 
                                <tr class="">
                                    <th scope="row" class="titledesc">Price</th>
                                    <td class="forminp forminp-checkbox ">
                                        <fieldset>
                                            <legend class="screen-reader-text">
                                                <span>Price</span>
                                            </legend>
                                            <label for="<?php echo $input_writing_task1_price; ?>">
                                                <input 
                                                    name="<?php echo $input_writing_task1_price; ?>" 
                                                    id="<?php echo $input_writing_task1_price; ?>" 
                                                    type="text" 
                                                    class="regular-text" 
                                                    value="<?php echo $writing_evaluation_plan1_price; ?>" 
                                                />	

                                            </label>
                                        </fieldset>
                                    </td>
                                </tr> 
                                <!-- end::writing task 1 -->

                                <tr class="hr-only" style="border: 1px dotted #cbcaca;"></tr> 

                                <!-- begin::writing task 2 -->
                                <tr class="">
                                    <th scope="row" class="titledesc">
                                        Writing Task 2
                                    </th>
                                    <td class="forminp forminp-checkbox ">
                                        <fieldset>
                                            <legend class="screen-reader-text">
                                                <span>Writing Task 2</span>
                                            </legend>
                                            <label for="<?php echo $ST_OPTION_st_proqyz_IELTS_LMS_writing_task2_evaluation_enable; ?>">
                                                <input 
                                                    name="<?php echo $ST_OPTION_st_proqyz_IELTS_LMS_writing_task2_evaluation_enable; ?>" 
                                                    id="<?php echo $ST_OPTION_st_proqyz_IELTS_LMS_writing_task2_evaluation_enable; ?>" 
                                                    type="checkbox" 
                                                    class="<?php echo $ST_OPTION_st_proqyz_IELTS_LMS_writing_task2_evaluation_enable; ?>" 
                                                    value="1" 
                                                    <?php echo ($writing_evaluation_plan2_enable == 1)? 'checked' : ''; ?>
                                                />	
                                                Enable Writing Task 2 Evaluation				
                                            </label>
                                        </fieldset>
                                    </td>
                                </tr>
                                <tr class="">
                                    <th scope="row" class="titledesc">Title</th>
                                    <td class="forminp forminp-checkbox ">
                                        <fieldset>
                                            <legend class="screen-reader-text">
                                                <span>Title</span>
                                            </legend>
                                            <label for="<?php echo $input_writing_task2_title; ?>">
                                                <input 
                                                    name="<?php echo $input_writing_task2_title; ?>" 
                                                    id="<?php echo $input_writing_task2_title; ?>" 
                                                    type="text" 
                                                    class="regular-text" 
                                                    value="<?php echo $writing_evaluation_plan2_title; ?>" 
                                                />	
                                            </label>
                                        </fieldset>
                                    </td>
                                </tr> 
                                <tr class="">
                                    <th scope="row" class="titledesc">Price</th>
                                    <td class="forminp forminp-checkbox ">
                                        <fieldset>
                                            <legend class="screen-reader-text">
                                                <span>Price</span>
                                            </legend>
                                            <label for="<?php echo $input_writing_task2_price; ?>">
                                                <input 
                                                    name="<?php echo $input_writing_task2_price; ?>" 
                                                    id="<?php echo $input_writing_task2_price; ?>" 
                                                    type="text" 
                                                    class="regular-text" 
                                                    value="<?php echo $writing_evaluation_plan2_price; ?>" 
                                                />	

                                            </label>
                                        </fieldset>
                                    </td>
                                </tr> 
                                <!--end::writing task 1 -->


                                <tr class="hr-only" style="border: 1px dotted #cbcaca;"></tr> 

                                <!-- begin::writing task 1 + 2 -->
                                <tr class="">
                                    <th scope="row" class="titledesc">
                                        Writing Task 1 + 2
                                    </th>
                                    <td class="forminp forminp-checkbox ">
                                        <fieldset>
                                            <legend class="screen-reader-text">
                                                <span>Writing Task 1 + 2</span>
                                            </legend>
                                            <label for="<?php echo $ST_OPTION_st_proqyz_IELTS_LMS_writing_task1and2_evaluation_enable; ?>">
                                                <input 
                                                    name="<?php echo $ST_OPTION_st_proqyz_IELTS_LMS_writing_task1and2_evaluation_enable; ?>" 
                                                    id="<?php echo $ST_OPTION_st_proqyz_IELTS_LMS_writing_task1and2_evaluation_enable; ?>" 
                                                    type="checkbox" 
                                                    class="<?php echo $ST_OPTION_st_proqyz_IELTS_LMS_writing_task1and2_evaluation_enable; ?>" 
                                                    value="1" 
                                                    <?php echo ($writing_evaluation_plan1and2_enable == 1)? 'checked' : ''; ?>
                                                />	
                                                Enable Writing Task 1 + 2 Evaluation				
                                            </label>
                                        </fieldset>
                                    </td>
                                </tr>
                                <tr class="">
                                    <th scope="row" class="titledesc">Title</th>
                                    <td class="forminp forminp-checkbox ">
                                        <fieldset>
                                            <legend class="screen-reader-text">
                                                <span>Title</span>
                                            </legend>
                                            <label for="<?php echo $input_writing_task1and2_title; ?>">
                                                <input 
                                                    name="<?php echo $input_writing_task1and2_title; ?>" 
                                                    id="<?php echo $input_writing_task1and2_title; ?>" 
                                                    type="text" 
                                                    class="regular-text" 
                                                    value="<?php echo $writing_evaluation_plan1and2_title; ?>" 
                                                />	

                                            </label>
                                        </fieldset>
                                    </td>
                                </tr> 
                                <tr class="">
                                    <th scope="row" class="titledesc">Price</th>
                                    <td class="forminp forminp-checkbox ">
                                        <fieldset>
                                            <legend class="screen-reader-text">
                                                <span>Price</span>
                                            </legend>
                                            <label for="<?php echo $input_writing_task1and2_price; ?>">
                                                <input 
                                                    name="<?php echo $input_writing_task1and2_price; ?>" 
                                                    id="<?php echo $input_writing_task1and2_price; ?>" 
                                                    type="text" 
                                                    class="regular-text" 
                                                    value="<?php echo $writing_evaluation_plan1and2_price; ?>" 
                                                />	

                                            </label>
                                        </fieldset>
                                    </td>
                                </tr> 
                                <!-- end::writing task 1 + 2 -->


                            </tbody>
                        </table>

                        <p class="submit">
                            <button name="save" class="button-primary woocommerce-save-button" type="submit" value="Save changes">
                                Save changes
                            </button>
                            <input 
                                type="hidden" 
                                id="st-proqyz-writing-evaluation-save" 
                                name="st-proqyz-writing-evaluation-save" 
                                value="1" 
                            />		
                        </p>
                    </form>                    


                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="speaking__container">
        <div id="poststuff">
            <div id="speaking-evalution" class="postbox st-proqyz__evaluation-metabox">
                <div class="postbox-header">
                    <h2 class="hndle">Speaking Evaluation</h2>
                    <div class="handle-actions hide-if-no-js">
                        <button type="button" class="handlediv" aria-expanded="true">
                            <span class="toggle-indicator" aria-hidden="true"></span>
                        </button>
                    </div>
                </div>
                <div class="inside" style="display: block;">
                    <div id="speaking-evaluation-metabox-content" class="metabox__content">

                    <form method="POST">
                        <table class="form-table">
                            <tbody>
                                <!-- begin::writing instructions -->
                                <tr class="">
                                    <th scope="row" class="titledesc">Instructions</th>
                                    <td class="forminp forminp-checkbox ">
                                        <fieldset>
                                            <legend class="screen-reader-text">
                                                <span>Enable Evaluation</span>
                                            </legend>
                                            <?php 
                                                wp_editor($speaking_evaluation_instructions,$ST_OPTION_st_proqyz_IELTS_LMS_speaking_evaluation_instructions, array(
                                                    'media_buttons' => true, // Show media upload buttons
                                                    'textarea_name' => $ST_OPTION_st_proqyz_IELTS_LMS_speaking_evaluation_instructions,
                                                    'textarea_rows' => 5, // Custom height (number of rows)
                                                    'teeny'         => false,
                                                )); 
                                            ?>

                                        </fieldset>
                                    </td>
                                </tr>
                                <!-- end::writing instructions -->

                                <tr class="hr-only" style="border: 1px dotted #cbcaca;"></tr> 

                                <!-- begin::speaking -->
                                <tr class="">
                                    <th scope="row" class="titledesc">Speaking</th>
                                    <td class="forminp forminp-checkbox ">
                                        <fieldset>
                                            <legend class="screen-reader-text">
                                                <span>Speaking Evaluation</span>
                                            </legend>
                                            <label for="<?php echo $ST_OPTION_st_proqyz_IELTS_LMS_speaking_evaluation_enable; ?>">
                                                <input 
                                                    name="<?php echo $ST_OPTION_st_proqyz_IELTS_LMS_speaking_evaluation_enable; ?>" 
                                                    id="<?php echo $ST_OPTION_st_proqyz_IELTS_LMS_speaking_evaluation_enable; ?>" 
                                                    type="checkbox" 
                                                    class="<?php echo $ST_OPTION_st_proqyz_IELTS_LMS_speaking_evaluation_enable; ?>" 
                                                    value="1" 
                                                    <?php echo ($speaking_evaluation_plan_enable == 1)? 'checked' : ''; ?>
                                                />	
                                                Enable Speaking Evaluation				
                                            </label>
                                        </fieldset>
                                    </td>
                                </tr>
                                <tr class="">
                                    <th scope="row" class="titledesc">Title</th>
                                    <td class="forminp forminp-checkbox ">
                                        <fieldset>
                                            <legend class="screen-reader-text">
                                                <span>Title</span>
                                            </legend>
                                            <label for="<?php echo $input_speaking_plan_title; ?>">
                                                <input 
                                                    name="<?php echo $input_speaking_plan_title; ?>" 
                                                    id="<?php echo $input_speaking_plan_title; ?>" 
                                                    type="text" 
                                                    class="regular-text" 
                                                    value="<?php echo $speaking_evaluation_plan_title; ?>" 
                                                />
                                            </label>
                                        </fieldset>
                                    </td>
                                </tr> 
                                <tr class="">
                                    <th scope="row" class="titledesc">Price</th>
                                    <td class="forminp forminp-checkbox ">
                                        <fieldset>
                                            <legend class="screen-reader-text">
                                                <span>Price</span>
                                            </legend>
                                            <label for="<?php echo $input_speaking_plan_price; ?>">
                                                <input 
                                                    name="<?php echo $input_speaking_plan_price; ?>" 
                                                    id="<?php echo $input_speaking_plan_price; ?>" 
                                                    type="text" 
                                                    class="regular-text" 
                                                    value="<?php echo $speaking_evaluation_plan_price; ?>" 
                                                />	

                                            </label>
                                        </fieldset>
                                    </td>
                                </tr> 
                                <!-- end::writing task 1 -->

                                


                            </tbody>
                        </table>

                        <p class="submit">
                            <button name="save" class="button-primary woocommerce-save-button" type="submit" value="Save changes">
                                Save changes
                            </button>
                            <input 
                                type="hidden" 
                                id="st-proqyz-speaking-evaluation-save" 
                                name="st-proqyz-speaking-evaluation-save" 
                                value="1" 
                            />		
                        </p>
                    </form>                    


                    </div>
                </div>
            </div>
        </div>
    </div>                                            







</div>








<?php } ?>
