Files
tsd_test/www/first.loc/api/mysql_api/pushCollect.php
adminps_pv 4df494767b
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 6m48s
c4
2026-03-25 14:11:55 +00:00

29 lines
906 B
PHP
Executable File

<?php
header('Access-Control-Allow-Origin:*');
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Methods: POST");
header("Access-Control-Max-Age: 3600");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
// Получаем данные
$data = json_decode(file_get_contents("php://input"));
include_once "Class/function.php";
include_once "Class/Database.php";
//include_once "Class/DatabasePGSQL.php";
include_once "Class/MainClass.php";
$arr= json_decode($data -> data,true);
$database = new Database();
//$database = new Database();//PGSQL
$db = $database->getConnection();
$main_class = new MainClass($db);
$result=$main_class->pushCollect($arr);
$result['data_collect']=$main_class->DataCollect($arr); //результаты сканирования актов
echo json_encode($result);