stage #1
@@ -12,7 +12,7 @@ require_once "includes/inc_all_admin.php";
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<label>AI Provider</label>
|
||||
<label>AI Provider <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-robot"></i></span>
|
||||
|
||||
+47
-3
@@ -3705,10 +3705,54 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.2.2'");
|
||||
}
|
||||
|
||||
// if (CURRENT_DATABASE_VERSION == '2.2.2') {
|
||||
// // Insert queries here required to update to DB version 2.2.3
|
||||
if (CURRENT_DATABASE_VERSION == '2.2.2') {
|
||||
mysqli_query($mysqli, "CREATE TABLE `payment_methods` (
|
||||
`payment_method_id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`payment_method_name` VARCHAR(200) NOT NULL,
|
||||
`payment_method_description` VARCHAR(250) DEFAULT NULL,
|
||||
`payment_method_provider_id` INT(1) DEFAULT 0,
|
||||
`payment_method_created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`payment_method_updated_at` DATETIME NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`payment_method_id`)
|
||||
)");
|
||||
|
||||
mysqli_query($mysqli, "CREATE TABLE `payment_providers` (
|
||||
`payment_provider_id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`payment_provider_name` VARCHAR(200) NOT NULL,
|
||||
`payment_provider_description` VARCHAR(250) DEFAULT NULL,
|
||||
`payment_provider_public_key` VARCHAR(250) DEFAULT NULL,
|
||||
`payment_provider_private_key` VARCHAR(250) DEFAULT NULL,
|
||||
`payment_provider_threshold` DECIMAL(15,2) DEFAULT NULL,
|
||||
`payment_provider_active` TINYINT(1) NOT NULL DEFAULT 1,
|
||||
`payment_provider_account` INT(11) NOT NULL,
|
||||
`payment_provider_expense_vendor` INT(11) NOT NULL DEFAULT 0,
|
||||
`payment_provider_expense_category` INT(11) NOT NULL DEFAULT 0,
|
||||
`payment_provider_expense_percentage_fee` DECIMAL(4,4) DEFAULT NULL,
|
||||
`payment_provider_expense_flat_fee` DECIMAL(15,2) DEFAULT NULL,
|
||||
`payment_provider_created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`payment_provider_updated_at` DATETIME NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`payment_provider_id`)
|
||||
)");
|
||||
|
||||
mysqli_query($mysqli, "CREATE TABLE `cient_saved_payment_methods` (
|
||||
`saved_payment_id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`saved_payment_provider_client` VARCHAR(200) NOT NULL,
|
||||
`saved_payment_provider_method` VARCHAR(200) NOT NULL,
|
||||
`saved_payment_details` VARCHAR(200) DEFAULT NULL,
|
||||
`saved_payment_client_id` INT(11) NOT NULL,
|
||||
`saved_payment_provider_id` INT(11) NOT NULL,
|
||||
`saved_payment_created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`saved_payment_updated_at` DATETIME NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`saved_payment_id`)
|
||||
)");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.2.3'");
|
||||
}
|
||||
|
||||
// if (CURRENT_DATABASE_VERSION == '2.2.3') {
|
||||
// // Insert queries here required to update to DB version 2.2.4
|
||||
// // Then, update the database to the next sequential version
|
||||
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.2.3'");
|
||||
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.2.4'");
|
||||
// }
|
||||
|
||||
} else {
|
||||
|
||||
@@ -486,6 +486,26 @@ CREATE TABLE `certificates` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `cient_saved_payment_methods`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `cient_saved_payment_methods`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `cient_saved_payment_methods` (
|
||||
`saved_payment_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`saved_payment_provider_client` varchar(200) NOT NULL,
|
||||
`saved_payment_provider_method` varchar(200) NOT NULL,
|
||||
`saved_payment_details` varchar(200) DEFAULT NULL,
|
||||
`saved_payment_client_id` int(11) NOT NULL,
|
||||
`saved_payment_provider_id` int(11) NOT NULL,
|
||||
`saved_payment_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`saved_payment_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
PRIMARY KEY (`saved_payment_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `client_notes`
|
||||
--
|
||||
@@ -1300,6 +1320,50 @@ CREATE TABLE `notifications` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `payment_methods`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `payment_methods`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `payment_methods` (
|
||||
`payment_method_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`payment_method_name` varchar(200) NOT NULL,
|
||||
`payment_method_description` varchar(250) DEFAULT NULL,
|
||||
`payment_method_provider_id` int(1) DEFAULT 0,
|
||||
`payment_method_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`payment_method_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
PRIMARY KEY (`payment_method_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `payment_providers`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `payment_providers`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `payment_providers` (
|
||||
`payment_provider_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`payment_provider_name` varchar(200) NOT NULL,
|
||||
`payment_provider_description` varchar(250) DEFAULT NULL,
|
||||
`payment_provider_public_key` varchar(250) DEFAULT NULL,
|
||||
`payment_provider_private_key` varchar(250) DEFAULT NULL,
|
||||
`payment_provider_threshold` decimal(15,2) DEFAULT NULL,
|
||||
`payment_provider_active` tinyint(1) NOT NULL DEFAULT 1,
|
||||
`payment_provider_account` int(11) NOT NULL,
|
||||
`payment_provider_expense_vendor` int(11) NOT NULL DEFAULT 0,
|
||||
`payment_provider_expense_category` int(11) NOT NULL DEFAULT 0,
|
||||
`payment_provider_expense_percentage_fee` decimal(4,4) DEFAULT NULL,
|
||||
`payment_provider_expense_flat_fee` decimal(15,2) DEFAULT NULL,
|
||||
`payment_provider_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`payment_provider_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
PRIMARY KEY (`payment_provider_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `payments`
|
||||
--
|
||||
@@ -2628,4 +2692,4 @@ CREATE TABLE `vendors` (
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2025-07-04 15:39:35
|
||||
-- Dump completed on 2025-07-04 16:50:41
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
* It is used in conjunction with database_updates.php
|
||||
*/
|
||||
|
||||
DEFINE("LATEST_DATABASE_VERSION", "2.2.2");
|
||||
DEFINE("LATEST_DATABASE_VERSION", "2.2.3");
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<div class="form-group">
|
||||
<div class="modal" id="addAIModelModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-robot mr-2"></i>New AI Provider</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
||||
<input type="hidden" name="provider" value="<?php echo $provider_id; ?>">
|
||||
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Model Name <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-robot"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="model" placeholder="ex gpt-4">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Use Case <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-th-list"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="use_case">
|
||||
<option>Tickets</option>
|
||||
<option>Documentation</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Prompt</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-robot"></i></span>
|
||||
</div>
|
||||
<textarea class="form-control" name="prompt" placeholder="Enter a model prompt:"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="add_ai_model" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Create</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,69 @@
|
||||
<div class="form-group">
|
||||
<div class="modal" id="addAIProviderModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-robot mr-2"></i>New AI Provider</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
||||
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Provider Name <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-robot"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="provider" placeholder="ex OpenAI">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>URL <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-globe"></i></span>
|
||||
</div>
|
||||
<input type="url" class="form-control" name="url" placeholder="ex https://ai.company.ext/api">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>API Key</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="api_key" placeholder="Enter API key here">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="form-group">
|
||||
<label>AI Model</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-robot"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="model" placeholder="ex gpt-4">
|
||||
</div>
|
||||
<small class="text-muted">
|
||||
More AI models can be added after adding the provider.
|
||||
</small>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="add_ai_provider" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Create</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user