/**
* Cotizador
* @wordpress-plugin
* @author Julibe
* @license GPL-3.0-or-later
* Plugin Name: Cotizador Inventium
* Plugin URI: https://think.inventium.com.co/
* Description: Simplify quoting and campaign management. Generate quick estimates, facilitate campaign management, and offer detailed historical records.
* Version: 1.0
* Author: Julibe
* Author URI: https://julibe.com/
* License URI: https://www.gnu.org/licenses/gpl-3.0.txt
* License: GPL v3 or later
* Requires PHP: 7.0
* Requires at least: 5.9
* Copyright: (c) 2024 Julibe - All rights reserved.
* Text Domain: inventium-quoter
* Domain Path: /
*/
// Define the path to the plugin
$path = plugin_dir_path(__FILE__);
// Define tables
$quotes_table_name = 'quoter__quotes';
$products_table_name = 'quoter__products';
$profiles_table_name = 'quoter__profiles';
$items_table_name = 'quoter__items';
$quotes_table = $wpdb->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
?>
Cotizador Inventm
Skip to content
A commitment to innovation and sustainability
Études is a pioneering firm that seamlessly merges creativity and functionality to redefine architectural excellence.
A passion for creating spaces
Our comprehensive suite of professional services caters to a diverse clientele, ranging from homeowners to commercial developers.
Renovation and restoration
Experience the fusion of imagination and expertise with Études Architectural Solutions.
Continuous Support
Experience the fusion of imagination and expertise with Études Architectural Solutions.
App Access
Experience the fusion of imagination and expertise with Études Architectural Solutions.
Consulting
Experience the fusion of imagination and expertise with Études Architectural Solutions.
Project Management
Experience the fusion of imagination and expertise with Études Architectural Solutions.
Architectural Solutions
Experience the fusion of imagination and expertise with Études Architectural Solutions.
An array of resources
Our comprehensive suite of professional services caters to a diverse clientele, ranging from homeowners to commercial developers.
Études Architect App
- Collaborate with fellow architects.
- Showcase your projects.
- Experience the world of architecture.
Études Newsletter
- A world of thought-provoking articles.
- Case studies that celebrate architecture.
- Exclusive access to design insights.
“Études has saved us thousands of hours of work and has unlocked insights we never thought possible.”
Annie Steiner
CEO, Greenprint
Join 900+ subscribers
Stay in the loop with everything you need to know.