From 53fd11eb452ed78072e05cbe67fd20518592a5c2 Mon Sep 17 00:00:00 2001 From: mahdahar <89adham@gmail.com> Date: Mon, 3 Feb 2025 12:47:54 +0700 Subject: [PATCH] include file on result send --- app/Config/Routes.php | 2 +- app/Controllers/API_Results.php | 5 ++--- app/Controllers/Auths.php | 8 -------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index bb3c3ea..73e8d1a 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -7,7 +7,7 @@ use CodeIgniter\Router\RouteCollection; */ $routes->get('/', 'Pages::home'); $routes->get('/login', 'Auths::login'); -$routes->get('/tests', 'Auths::tests'); +//$routes->get('/tests', 'Auths::tests'); $routes->post('/api/requests/', 'API_Requests::requests'); $routes->get('/api/requests/orm/(:any)', 'API_Requests::orm/$1'); $routes->get('/api/results/(:any)', 'API_Results::results_send/$1'); diff --git a/app/Controllers/API_Results.php b/app/Controllers/API_Results.php index 45ae580..c7f9c9e 100644 --- a/app/Controllers/API_Results.php +++ b/app/Controllers/API_Results.php @@ -142,15 +142,14 @@ where r.ACCESSNUMBER='$accessnumber' ORDER BY t.TESTORDER"; $d3=-1; $json['test_results'][$d0]['subtest_results'][$d1]['subtest_results'][] = $data; } - } return $json; } public function results_send($accessnumber) { $TM_url = "https://api-transmedic1.transmedic.co.id/api/webhook/lis"; - $TMBali_bearerToken = "4418|eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOm51bGwsImF1ZCI6ImFwaS10cmFuc21lZGljMS50cmFuc21lZGljLmNvLmlkIiwiaWF0IjoxNzM4MzE0NjU5LCJleHAiOjE3Mzg0MDEwNTksInN1YiI6bnVsbCwianRpIjoiMDBhNmUzN2ItNTA1Zi00ZDA0LWE1MjktMjU0NjE4ZGQ1ODE1IiwiZGF0YSI6eyJ1c2VybmFtZSI6InBibWNfYmFsaSIsInBhc3N3b3JkIjoiSjhlMjlYakxtRENGdVFuayJ9fQ.Zu5Ph4nbuJb9ySH4nv_7qABAzKLJxVspMM7PuzVda0k"; - $TMSby_bearerToken = "4417|eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOm51bGwsImF1ZCI6ImFwaS10cmFuc21lZGljMS50cmFuc21lZGljLmNvLmlkIiwiaWF0IjoxNzM4MzE0NTYwLCJleHAiOjE3Mzg0MDA5NjAsInN1YiI6bnVsbCwianRpIjoiNWI5NDM4OGItOThlOC00ZTZkLTg3YzMtMGVjNTgzNDUzYWM3IiwiZGF0YSI6eyJ1c2VybmFtZSI6InBibWNfc3VyYWJheWEiLCJwYXNzd29yZCI6InBnY1dmZHdYM3FFdDl6YUMifX0.eXX5EDqyusZ3xNey20L5A6dKGgKmf73Bk7-UBLJu45o"; + $TMBali_bearerToken = file_get_contents('tokens/pbmc_sby.txt'); + $TMSby_bearerToken = file_get_contents('tokens/pbmc_dps.txt'); $client = \Config\Services::curlrequest(); diff --git a/app/Controllers/Auths.php b/app/Controllers/Auths.php index b1fb5de..b819b62 100644 --- a/app/Controllers/Auths.php +++ b/app/Controllers/Auths.php @@ -87,13 +87,5 @@ class Auths extends BaseController { token2file($TM_url, $jwtDPS, $fileDPS); } - - public function tests() { - // $token = "4469|eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOm51bGwsImF1ZCI6ImFwaS10cmFuc21lZGljMS50cmFuc21lZGljLmNvLmlkIiwiaWF0IjoxNzM4NTU2MTkxLCJleHAiOjE3Mzg2NDI1OTEsInN1YiI6bnVsbCwianRpIjoiMzRlOTk0MzctMTNmZC00OGUzLTg1NzEtMDYwYmJlMTUxNjM1IiwiZGF0YSI6eyJ1c2VybmFtZSI6InBibWNfc3VyYWJheWEiLCJwYXNzd29yZCI6InBnY1dmZHdYM3FFdDl6YUMifX0.hSrs1fkdwi0d7IAsCRiD20QqeQsFUxGd_06NKcjxcWw"; - $filePath = 'tokens/pbmc_sby.txt'; - $fileContents = file_get_contents($filePath); - echo $fileContents; - } - } \ No newline at end of file