<?php

use Bookingor\Backend\Controller\Category\CategoryControl;

// Exit if accessed directly
if (! defined('ABSPATH')) exit; ?>
<div class="bookingor">
    <div class="modal fade" id="editModal" tabindex="-1" aria-labelledby="editModalLabel" aria-hidden="true">
        <div class="modal-dialog  modal-md modal-dialog-centered ">
            <div class="modal-content bkings_pro-model">
                <div class="modal-header bookingor-popup-title">
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                    <h3 class="modal-title" id="editModalLabel"><?php esc_html_e("Update Category", "bookingor"); ?></h3>
                    <div class="bookingor-popup-text">
                        <span><?php esc_html_e("Update category details and information.", "bookingor"); ?></span>
                    </div>
                </div>
                <form id="bp-update-category">
                    <div class="modal-body">
                        <div class="row">
                            <div class="form-group row align-items-center bookingor-col-xl-12">
                                <div class="bookingor-col-12 bookingor-col-sm-12 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 id="bkinz-category-icon-update" class="del-icon" src="<?php echo esc_attr(!empty(CategoryControl::$default_img) ? CategoryControl::$default_img : wp_get_attachment_url()); ?>" alt="">
                                            <input type="hidden" name="tcn_category_icon_id_update" id="category-icon-update-id">
                                        </div>
                                        <div class="p-image">
                                            <button type="button" class="bookingor-btn  bookingor-btn-primary" id="tcn_category_icon_update"><?php esc_html_e("Upload", "bookingor"); ?></button>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group row align-items-center bookingor-col-xl-12 mb-4">
                                    <div class="bookingor-col-12 bookingor-col-sm-12 bookingor-col-md-4  bookingor-col-lg-4 bookingor-col-xl-4 pd-1">
                                        <label class="h-l-n" for="category-name"><?php esc_html_e("Category Name", "bookingor"); ?></label>
                                    </div>
                                    <div class="bookingor-col-12 bookingor-col-sm-12 bookingor-col-md-8 bookingor-col-lg-8 bookingor-col-xl-8">
                                        <input name="tcn_category_name" type="text" class="form-control align-self-start tcn_category_change" id="category-name-update" placeholder="Add Category Name eg: Healthcare">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <?php
                        if (class_exists('Bookingor\Frontend\Controller\ServiceSubcategory\ServiceSubcategoryControl')) {
                            $file_path = WP_PLUGIN_DIR . '/bookingor-subcategory-addon/admin/partials/subcategory/subcategory-edit.php';
                            include_once  $file_path;
                        ?>
                        <?php } ?>
                    </div>
                    <div class="modal-footer">
                        <input type="hidden" name="category_id" id="category-update-ids">
                        <input type="hidden" name="category_get_id" id="subcategory-update-id">
                        <input type="hidden" name="subcate_id[]" id="subcategory-id">
                        <input type="hidden" name="tcn_category_status">
                        <button type="submit" name="tcn_category_draft" id="bp-category-draft" class="bookingor-btn  bkinz-status"><?php esc_html_e("Draft", "bookingor"); ?></button>
                        <button type="submit" class="bookingor-btn bookingor-btn-primary bkinz-status category-inserted"><?php esc_html_e("update Category", "bookingor"); ?></button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>