diff --git a/dbbackup/auth_chart_order.sql b/dbbackup/auth_chart_order.sql new file mode 100644 index 0000000..10bcc8d --- /dev/null +++ b/dbbackup/auth_chart_order.sql @@ -0,0 +1,32 @@ +/* + Navicat Premium Dump SQL + + Source Server : local + Source Server Type : MySQL + Source Server Version : 100432 (10.4.32-MariaDB) + Source Host : localhost:3306 + Source Schema : reportifynew + + Target Server Type : MySQL + Target Server Version : 100432 (10.4.32-MariaDB) + File Encoding : 65001 + + Date: 25/09/2024 01:08:34 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for auth_chart_order +-- ---------------------------- +DROP TABLE IF EXISTS `auth_chart_order`; +CREATE TABLE `auth_chart_order` ( + `id` int NOT NULL, + `user_id` int NULL DEFAULT NULL, + `order` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `insert_date` datetime NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/public/userarea/statkpi/chartorder.php b/public/userarea/statkpi/chartorder.php new file mode 100644 index 0000000..8b87f3d --- /dev/null +++ b/public/userarea/statkpi/chartorder.php @@ -0,0 +1,38 @@ +connect_error) { + die("Connection failed: " . $conn->connect_error); +} + +// two methods save and load data +if ($_POST['method'] == 'save') { + $order = $_POST['order']; + $user_id = $iduserlogin; + // check if user already have order + $sql = "SELECT * FROM auth_chart_order WHERE user_id = $user_id"; + $result = $conn->query($sql); + $order = implode(',', $order); + if ($result->num_rows > 0) { + $sql = "UPDATE auth_chart_order SET `order` = '$order' WHERE user_id = $user_id"; + } else { + $sql = "INSERT INTO auth_chart_order (user_id, `order`) VALUES ($user_id, '$order')"; + } + $conn->query($sql); + echo 'Data saved'; +} else if($_POST['method'] == 'load') { + $sql = "SELECT `order` FROM auth_chart_order WHERE user_id = $iduserlogin ORDER BY insert_date DESC LIMIT 1"; + $result = $conn->query($sql); + if($result->num_rows == 0) { + echo json_encode([]); + return; + }else{ + $row = $result->fetch_assoc(); + $order_list = explode(',', $row['order']); + echo json_encode($order_list); + } +} \ No newline at end of file diff --git a/public/userarea/statkpi/statkpi.php b/public/userarea/statkpi/statkpi.php index 9d2c9bd..bd32615 100644 --- a/public/userarea/statkpi/statkpi.php +++ b/public/userarea/statkpi/statkpi.php @@ -193,6 +193,17 @@ include('parsedatachart.php'); font-weight: bold; margin-top: 10px; } + + .chart-container { + width: 100%; + margin: 20px; + } + .chart-box { + display: flex; + justify-content: center; + align-items: center; + } + @@ -429,56 +440,59 @@ include('parsedatachart.php'); -
-
-
-
+
+ +
+
+
+
- -
-
-
-
-
Products
-

0

-
-
-
-
-
-
-
Reports
-

0

-
-
-
-
-
-
-
Failed Reports
-
-

0

- (0%) + +
+
+
+
+
Products
+

0

-
-
-
-
-
Total Tests
-

0

+
+
+
+
Reports
+

0

+
-
-
-
-
-
Failed Tests
-
-

0

- (0%) +
+
+
+
Failed Reports
+
+

0

+ (0%) +
+
+
+
+
+
+
+
Total Tests
+

0

+
+
+
+
+
+
+
Failed Tests
+
+

0

+ (0%) +
@@ -487,64 +501,63 @@ include('parsedatachart.php');
-
- + -
-
-
-
-
Reports Overview
-
+
+
+
+
+
Reports Overview
+
+
+
+
+
+
+
+
Worst Analysis
+
+
-
-
-
-
Worst Analysis
-
+ +
+
+
+
+
Worst Suppliers by Failed Report Percentage
+
+
-
-
-
-
-
-
Worst Suppliers by Failed Report Percentage
-
+
+
+
+
+
Number of Products by Supplier
+
+
-
-
-
-
-
-
Number of Products by Supplier
-
+
+
+
+
+
Analysis Distribution
+
+
+ + +
- -
-
-
-
-
Analysis Distribution
-
-
-
-
-
- - - -
@@ -558,7 +571,73 @@ include('parsedatachart.php');
+