prefix . $quotes_table_name; $products_table = $wpdb->prefix . $products_table_name; $profiles_table = $wpdb->prefix . $profiles_table_name; $items_table = $wpdb->prefix . $items_table_name; // Define the available profile types $profile_types = [ 'all', 'client', 'contact', 'executive', 'designer', ]; // Sanitize and validate the limit and page parameter for pagination $pagination_limit = isset($_GET["limit"]) && is_numeric($_GET["limit"]) ? $_GET["limit"] : 10; $pagination = isset($_GET["pagination"]) && is_numeric($_GET["pagination"]) ? $_GET["pagination"] * $pagination_limit : 0; // Define the path to the directory containing function files. $functions_url = $path . "/functions/"; // Get the list of function files $files_functions = array_diff(scandir($functions_url), array('..', '.')); // Include each function file foreach ($files_functions as $item) { $item_path = $functions_url . $item; // Check if it's a directory if (is_dir($item_path)) { // Get the list of files inside the directory $files_inside_folder = array_diff(scandir($item_path), array('..', '.')); // Loop through each file inside the directory foreach ($files_inside_folder as $file) { $file_path = $item_path . '/' . $file; // Include the file if it's a PHP file if (is_file($file_path) && pathinfo($file_path, PATHINFO_EXTENSION) == 'php') { include_once($file_path); } } } else { // Include the file if it's a PHP file directly within the directory if (is_file($item_path) && pathinfo($item_path, PATHINFO_EXTENSION) == 'php') { include_once($item_path); } } } // Get categories $categories_ = get_terms(array( 'taxonomy' => 'category', 'hide_empty' => false, )); // Create an array to store the categories foreach ($categories_ as $category) { if ($category->parent) { $category_parent = get_term($category->parent, 'category'); $parent_name = $category_parent ? $category_parent->name : ''; $categories[$category->term_id]= $parent_name. ": ". $category->name; }else{ $categories[$category->term_id]= $category->name; } } asort($categories); function enqueue_quoter_assets() { // Enqueue jQuery from CDN wp_enqueue_script('jquery', 'https://code.jquery.com/jquery-3.6.4.min.js', array(), '3.6.4', true); // Enqueue the custom script with jQuery as a dependency wp_enqueue_script('quoter-script-functions', plugin_dir_url(__FILE__) . 'files/js/functions.min.js', array('jquery'), '1.0', true); // Enqueue the custom style wp_enqueue_style('quoter-css-styles', plugin_dir_url(__FILE__) . 'files/css/styles.css', array(), '1.0'); } add_action('admin_enqueue_scripts', 'enqueue_quoter_assets'); // Include the file containing translated strings include($path . 'strings.php'); $quote_states = array( 'pending' => tran('status_pending'), 'draft' => tran('status_draft'), 'active' => tran('status_active'), 'expired' => tran('status_expired'), 'approved' => tran('status_approved'), 'paid' => tran('status_paid'), 'hold' => tran('status_hold'), 'disapproved' => tran('status_disapproved') ); // Load quote page data include($path . 'contents/quote/quote.php'); include($path . 'contents/quote/create.php'); include($path . 'contents/quote/preview.php'); include($path . 'contents/quote/summary.php'); // Load profile page data include($path . 'contents/profile/profile.php'); include($path . 'contents/profile/create.php'); // Load product page data include($path . 'contents/product/product.php'); include($path . 'contents/product/create.php'); // Load product page data include($path . 'contents/item/item.php'); include($path . 'contents/item/create.php'); function load_media_files() { wp_enqueue_media(); } add_action('admin_enqueue_scripts', 'load_media_files'); // Enqueue the custom _assets ?>.hidden{position:fixed;top:0;left:0;width:0;height:0;opacity:0;display:none!important;visibility:hidden}.elementor-editor-active .elementor-section-wrap .hidden{--red-color:rgba(255, 0, 0, 0.1);display:block!important;opacity:1;border:2px dashed red;background-image:linear-gradient(45deg,var(--red-color) 25%,transparent 25%,transparent 50%,var(--red-color) 50%,var(--red-color) 75%,transparent 75%,transparent);background-size:50px 50px;visibility:visible;position:relative;top:unset;left:unset;width:auto;height:auto}.wp-block-video{width:100%;background-color:#000}.wp-block-video video{max-height:75vh;width:100%;background-color:#000;object-fit:contain}.wp-block-video [poster]{object-fit:contain}html,body{overflow-x:hidden}img,a{color:inherit;transition:all .5s ease-in-out}img,figure{user-select:none;image-rendering:unset}em,em *{font-style:italic}ul,ol,p,h1,h2,h3,h4,h5,h6{margin-top:40px;margin-bottom:40px}ul li,ol li{margin-top:10px;margin-bottom:10px}.elementor-lightbox .elementor-lightbox-image{box-shadow:none}.no-mouse{pointer-events:none;user-select:none;-webkit-user-drag:none;user-drag:none}#wpadminbar,.no-select{user-select:none;-webkit-user-drag:none;user-drag:none}::selection{color:var(--e-global-color-secondary);background:var(--e-global-color-primary)}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-button{width:0;height:0}::-webkit-scrollbar-thumb{background:var(--e-global-color-primary);border:0 none var(--e-global-color-secondary);border-radius:50px}::-webkit-scrollbar-thumb:hover{background:var(--e-global-color-text)}::-webkit-scrollbar-thumb:active{background:var(--e-global-color-text)}::-webkit-scrollbar-track{background:transparent;border:0 none var(--e-global-color-primary);border-radius:50px}::-webkit-scrollbar-track:hover{background:var(--e-global-color-secondary)}::-webkit-scrollbar-track:active{background:var(--e-global-color-048b08c)}::-webkit-scrollbar-corner{background:transparent}