<?php

if ( ! defined( 'ABSPATH' ) ) exit;

require_once plugin_dir_path(__FILE__) . './modules/docuchat_register_module.php';
require_once plugin_dir_path(__FILE__) . './modules/docuchat_activation_module.php';
require_once plugin_dir_path(__FILE__) . './modules/docuchat_document_module.php';
require_once plugin_dir_path(__FILE__) . './modules/docuchat_process_complete.php';
require_once plugin_dir_path(__FILE__) . './modules/docuchat_gofoundme_layout.php';
require_once plugin_dir_path(__FILE__) . '../utils/docuchat_get_image_from_name.php';


function docuchat_outputBackendDocuChat()
{
  try {
    $getOptions = unserialize(get_option(DOCUCHAT_ACTIVATION_SERIALIZACION));

  } catch (\Throwable $th) {
    wp_die(esc_html($th->getMessage(), 'docu-chat'));
  }

?>
  <section class="docuchatMain">
    <div class="docuchatMain_container">
      <div class="docuchatMain_container_header">
        
      </div>
      <div class="docuchatMain_container_header_body">
        <div class="docuchatMain_container_header_body_button">
          <ul class="docuchatMain_container_header_body_button_ul">
            <li class="docuchatMain_container_header_body_button_ul_li">
              <button style="border-bottom: <?php echo $getOptions[0] == "active" ? esc_attr("transparent") : esc_attr("solid 1px"); ?>" class="docuchatMain_container_header_body_button_ul_li_button <?php echo $getOptions[0] == "active" ? "active" : "disabled"; ?>">
                <?php echo esc_html__('Step 1, Registration', 'docu-chat'); ?>
              </button>
            </li>
            <li class="docuchatMain_container_header_body_button_ul_li">
              <button style="border-bottom: <?php echo $getOptions[1] == "active" ? esc_attr("transparent") : esc_attr("solid 1px"); ?>" class="docuchatMain_container_header_body_button_ul_li_button <?php echo $getOptions[1] == "active" ? "active" : "disabled"; ?>">
                <?php echo esc_html__('Step 2, Confirmation', 'docu-chat'); ?>
              </button>
            </li>
            <li class="docuchatMain_container_header_body_button_ul_li">
              <button style="border-bottom: <?php echo $getOptions[2] == "active" ? esc_attr("transparent") : esc_attr("solid 1px"); ?>" class="docuchatMain_container_header_body_button_ul_li_button <?php echo $getOptions[2] == "active" ? "active" : "disabled"; ?>">
                <?php echo esc_html__('Step 3, File Upload', 'docu-chat'); ?>
              </button>
            </li>
          </ul>
        </div>
      </div>
      <!-- containner  -->
      <div class="docuchatMain_container_body">
        <div class="docuchatMain_container_body_content">
          <?php
          if ($getOptions[0] == "active") {
            docuchat_register_module();
          }
          if ($getOptions[1] == "active") {
            docuchat_activation_module();
          }
          if ($getOptions[2] == "active") {
            docuchat_document_module();
          }
          if ( isset($getOptions[3]) && $getOptions[3] == "active") {
            docuchat_process_complete();
          }

          ?>
          <hr />
          <div class="docuchatMain_container_body_content_response">
          </div>
         <?php docuchat_gofoundme_layout(); ?>
        </div>
      </div>

    </div>
  </section>

<?php
}