<?php

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Provide a admin area view for the plugin
 *
 * This file is used to markup the admin-facing aspects of the plugin.
 *
 * @link       https://webequipe.com
 * @since      1.0.0
 *
 * @package    Webequipe_Spin_Win_Wheel
 * @subpackage Webequipe_Spin_Win_Wheel/admin/partials/tabs
 */

// If this file is called directly, abort.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

require __DIR__ . '/data-process.php'; ?>

<div class="wsww-finish-tabs">

    <div class="card">
        <div class="card-body">
            <h5 class="card-title wsww-card-title mb-3">Message Setting</h5>
            <div class="mb-3">
                <label for="wsww-win-message" class="form-label">Win Message</label>
                <textarea id="wsww-win-message" name="win_message" type="text" class="form-control" rows="3"><?php echo esc_textarea( $spin->win_message); ?></textarea>
            </div>
            
            <div class="mb-3">
                <p class="wsww-helper-text">You can use dynamic tags <code>{label}</code> <code>{value}</code> <code>{coupon_code}</code> to display wheel data.</p>
            </div>

            <div class="mb-3">
                <label for="wsww-lose-message" class="form-label">Lose Message</label>
                <textarea id="wsww-lose-message" name="loss_message" type="text" class="form-control" rows="3"><?php echo esc_textarea( $spin->loss_message); ?></textarea>
            </div> 
        </div>
    </div>
    <div class="card mt-4">
        <div class="card-body">
             <h5 class="card-title wsww-card-title mb-3">Email Setting</h5>
            <div class="mb-3">
                <label for="wsww-send-email-after-submit" class="form-label">Send email after submit</label>
                <select id="wsww-send-email-after-submit" class="form-select" name="send_email">
                    <option value="yes" <?php echo $webequipe_sww_spin_send_email === 'yes' ? 'selected' : ''; ?>>Yes</option>
                    <option value="no" <?php echo $webequipe_sww_spin_send_email === 'no' ? 'selected' : ''; ?>>No</option>

                </select>
            </div>
            <div class="mb-3">
                <label for="wsww-from-name" class="form-label">From Name</label>
                <input name="from_name" type="text" class="form-control" id="wsww-from-name" value="<?php echo esc_attr( $spin->from_name); ?>">
            </div>
            <div class="mb-3">
                <label for="wsww-from-address" class="form-label">From Address</label>
                <input name="from_address" type="text" class="form-control" id="wsww-from-address" value="<?php echo esc_attr( $spin->from_address); ?>">
            </div>
            <div class="mb-3">
                <label for="wsww-from-subject" class="form-label">Subject</label>
                <input name="from_subject" type="text" class="form-control" id="wsww-from-subject" value="<?php echo esc_attr( $spin->from_subject); ?>">
            </div>
            <div class="mb-3">
                <label for="wsww-from-message" class="form-label">Body</label>
                <textarea id="wsww-from-message" name="from_message" type="text" class="form-control" rows="3"><?php echo esc_textarea( $spin->from_message); ?></textarea>
            </div>
            <div class="mb-3">
               <p class="wsww-helper-text">You can use dynamic tags <code>{customer_name}</code> <code>{customer_phone}</code> <code>{customer_email}</code> <code>{company_name}</code> <code>{company_url}</code> <code>{spin_label}</code> <code>{spin_value}</code> <code>{coupon_code}</code> <code>{today}</code> to display wheel data.</p>
            </div>
        </div>
    </div>
    <div class="card mt-4">
        <div class="card-body">
             <h5 class="card-title wsww-card-title mb-3">Notification Setting</h5>
            <div class="mb-3">
                <label for="wsww-admin-notification-after-submit" class="form-label">Send admin notification after submit</label>
                <select id="wsww-admin-notification-after-submit" class="form-select" name="admin_geting_email">
                    <option value="yes" <?php echo $webequipe_sww_spin_admin_getting_email === 'yes' ? 'selected' : ''; ?>>Yes</option>
                    <option value="no" <?php echo $webequipe_sww_spin_admin_getting_email === 'no' ? 'selected' : ''; ?>>No</option>
                </select>
            </div>
           
        </div>
    </div>

</div>
