<?php

use Bookingor\Backend\Controller\Category\CategoryControl;

// Exit if accessed directly
if (!defined('ABSPATH')) {
  exit;
} ?>
<div class="bookingor">
  <div class="modal fade" id="categoryModal" tabindex="-1" aria-labelledby="categoryModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-md modal-dialog-centered">
      <div class="modal-content bkings_pro-model">
        <div class="modal-header flex-column">
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
          <div class="boookingor-popup-text">
            <h3 class="modal-title" id="categoryModalLabel"><?php echo esc_html('Add Category'); ?></h3>
            <div class="boookingor-popup-text">
              <span><?php esc_html_e('Add New category details and information.', 'bookingor'); ?></span>
            </div>
          </div>
        </div>
        <form id="bp-add-category">
          <div class="modal-body">
            <div>
              <div class="form-group bookingor-flex">
                <div class="bookingor-col-12 bookingor-col-sm-10 bookingor-col-md-12 bookingor-col-lg-12 bookingor-col-xl-12 mb-4">
                  <div class="bookingor-c-set">
                    <div class="bookingor-circle mb-3">
                      <img data-src="<?php echo esc_attr(categoryControl::$default_img); ?>" id="bkinz-category-icon" class="del-icon" src="<?php echo esc_attr(categoryControl::$default_img); ?>" alt="" />
                      <input type="hidden" name="tcn_category_icon_id" id="category-icon-id" class="check_validation" value="" />
                      <div class="ad-valid"></div>
                    </div>
                    <div class="p-image">
                      <button type="button" class="bookingor-btn bookingor-btn-primary" id="tcn_category_icon">
                        <?php esc_html_e('Upload', 'bookingor'); ?>
                      </button>
                    </div>
                  </div>
                </div>
              </div>
              <div class="form-group row align-items-center bookingor-col-xl-12">
                <div class="bookingor-col-12 bookingor-col-sm-12 bookingor-col-md-4 bookingor-col-lg-4 bookingor-col-xl-4 pd-1 mb-4">
                  <label class="h-l-n" for="category-name">
                    <?php echo esc_html('Category Name'); ?>
                  </label>
                </div>
                <div class="bookingor-col-12 bookingor-col-sm-12 bookingor-col-md-8 bookingor-col-lg-8 bookingor-col-xl-8 mb-4">
                  <input name="tcn_category_name" type="text" class="form-control align-self-start check_validation" id="category-name" data-id="vali_cateogry" placeholder="Add Category Name eg: Healthcare" required />
                </div>
              </div>
            </div>
            <?php
            if (class_exists('Bookingor\Frontend\Controller\ServiceSubcategory\ServiceSubcategoryControl')) {
              $file_path = WP_PLUGIN_DIR . '/bookingor-subcategory-addon/admin/partials/subcategory/subcategory-create.php';
              include_once $file_path; ?>
            <?php
            } ?>
          </div>
          <div class="modal-footer">
            <input type="hidden" name="tcn_category_status" id="category-status" value="0" />
            <button type="submit" name="tcn_category_draft" class="bookingor-btn bkinz-status category-inserted">
              <?php esc_html_e('Draft', 'bookingor'); ?>
            </button>
            <button type="submit" class="bookingor-btn bookingor-btn-primary bkinz-status category-inserted">
              <?php esc_html_e('Save Category', 'bookingor'); ?>
            </button>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>