This commit is contained in:
2025-12-16 20:05:46 +09:00
parent 1d79a2989b
commit 7a0f031eba
14 changed files with 291 additions and 102 deletions

View File

@@ -1,4 +1,8 @@
<?php
// load .env file
require_once __DIR__ . '/lib/DotEnv.php';
(new DotEnv(__DIR__ . '/.env'))->load();
function specialDate($inputDate) {
// 날짜 형식을 DateTime 객체로 변환
$date = new DateTime($inputDate);
@@ -132,7 +136,7 @@ function calculateAnnualLeave($hireDate, $fiscalYearEnd) {
* @return array 해당 단계의 카테고리 name 배열
*/
function getCategoryByName(...$names) {
require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php");
require_once(getenv('DOCUMENT_ROOT') . "/lib/mydb.php");
$pdo = db_connect();
global $DB;
@@ -219,7 +223,7 @@ function selectModel($selectName, $selectedValue) {
// $modelsList가 전역에서 아직 설정되지 않았거나, 배열이 아니거나 비어있으면 JSON 파일에서 로드합니다.
if (!isset($modelsList) || !is_array($modelsList) || empty($modelsList)) {
$jsonFile = $_SERVER['DOCUMENT_ROOT'].'/models/models.json';
$jsonFile = getenv('DOCUMENT_ROOT').'/models/models.json';
if(file_exists($jsonFile)) {
$jsonContent = file_get_contents($jsonFile);
$modelsList = json_decode($jsonContent, true);