diff --git a/PHPExcel_1.8.0/Classes/PHPExcel/Shared/PDF/fonts/utils/pfm2afm.exe b/PHPExcel_1.8.0/Classes/PHPExcel/Shared/PDF/fonts/utils/pfm2afm.exe deleted file mode 100644 index 25c21fa1..00000000 Binary files a/PHPExcel_1.8.0/Classes/PHPExcel/Shared/PDF/fonts/utils/pfm2afm.exe and /dev/null differ diff --git a/geoattendance/fix_geo_db.php b/geoattendance/fix_geo_db.php new file mode 100644 index 00000000..97f5c1cf --- /dev/null +++ b/geoattendance/fix_geo_db.php @@ -0,0 +1,37 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + // 1. Check for ID 0 and move it if exists + // We use a subquery to find a safe new ID + echo "Checking for ID 0...\n"; + $stmt = $pdo->query("SELECT count(*) FROM geo_attendance WHERE id = 0"); + if ($stmt->fetchColumn() > 0) { + echo " - Found row with ID 0. Moving it to a new ID...\n"; + // Calculate max id + 1 + $stmt = $pdo->query("SELECT MAX(id) FROM geo_attendance"); + $maxId = $stmt->fetchColumn(); + $newId = ($maxId > 0 ? $maxId : 0) + 1; + + $pdo->exec("UPDATE geo_attendance SET id = $newId WHERE id = 0"); + echo " - ID 0 moved to $newId.\n"; + } + + // 2. Apply AUTO_INCREMENT + echo "Applying AUTO_INCREMENT to 'id' column...\n"; + $sql = "ALTER TABLE geo_attendance MODIFY id INT NOT NULL AUTO_INCREMENT"; + $pdo->exec($sql); + echo " - Success! 'geo_attendance.id' is now AUTO_INCREMENT.\n"; + +} catch (Exception $e) { + echo "Error: " . $e->getMessage() . "\n"; +} +?> diff --git a/geoattendance/index.php b/geoattendance/index.php index ada992fb..8d9bc59c 100644 --- a/geoattendance/index.php +++ b/geoattendance/index.php @@ -3,7 +3,7 @@
-+ 주의: HTTPS가 아니면 최신 브라우저에서 GPS가 차단됩니다. +
+ )}거리: {distance ? distance.toFixed(1) : '알 수 없음'} 미터
반경 제한: {office.allowedRadiusMeters} 미터
GPS 정확도: {currentLocation?.accuracy ? currentLocation.accuracy.toFixed(1) + 'm' : '알 수 없음'}
diff --git a/holiday/list.php b/holiday/list.php index 09a4916d..d1bfec65 100644 --- a/holiday/list.php +++ b/holiday/list.php @@ -41,13 +41,14 @@ function checkNull($strtmp) { $search = isset($_REQUEST['search']) ? $_REQUEST['search'] : ''; $mode = isset($_REQUEST["mode"]) ? $_REQUEST["mode"] : ''; +$sort_order = isset($_REQUEST['sort_order']) ? $_REQUEST['sort_order'] : 'DESC'; $tablename = 'holiday'; require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php"); $pdo = db_connect(); -$order = " ORDER BY registedate DESC, num desc "; +$order = " ORDER BY startdate " . ($sort_order === 'ASC' ? 'ASC' : 'DESC') . ", num desc "; if (checkNull($search)) { $sql = "SELECT * FROM ".$DB.".".$tablename." @@ -65,7 +66,8 @@ try { - + +| 번호 | -휴일시작 | +휴일시작 + + | 휴일종료 | 기간체크 | 내용 | @@ -179,6 +183,15 @@ $(document).ready(function() { $("#searchBtn").on("click", function() { $("#board_form").submit(); }); + + // 휴일시작 헤더 클릭 시 정렬 토글 + $("#sortStartDate").on("click", function(e) { + e.stopPropagation(); + var currentOrder = $("#sort_order").val(); + var newOrder = (currentOrder === 'DESC') ? 'ASC' : 'DESC'; + $("#sort_order").val(newOrder); + $("#board_form").submit(); + }); }); function loadForm(mode, num = null) { diff --git a/img/uploads/2019_11_15_15_31_48_.JPG b/img/uploads/2019_11_15_15_31_48_.JPG new file mode 100644 index 00000000..c95ae672 Binary files /dev/null and b/img/uploads/2019_11_15_15_31_48_.JPG differ diff --git a/img/uploads/2019_11_15_15_38_20_.JPG b/img/uploads/2019_11_15_15_38_20_.JPG new file mode 100644 index 00000000..3b1d3728 Binary files /dev/null and b/img/uploads/2019_11_15_15_38_20_.JPG differ diff --git a/img/uploads/2019_11_15_15_42_26_.JPG b/img/uploads/2019_11_15_15_42_26_.JPG new file mode 100644 index 00000000..9ad0d29c Binary files /dev/null and b/img/uploads/2019_11_15_15_42_26_.JPG differ diff --git a/img/uploads/2019_11_15_15_43_33_.JPG b/img/uploads/2019_11_15_15_43_33_.JPG new file mode 100644 index 00000000..d3f945e6 Binary files /dev/null and b/img/uploads/2019_11_15_15_43_33_.JPG differ diff --git a/img/uploads/2019_11_15_15_48_30_.JPG b/img/uploads/2019_11_15_15_48_30_.JPG new file mode 100644 index 00000000..1655ee95 Binary files /dev/null and b/img/uploads/2019_11_15_15_48_30_.JPG differ diff --git a/img/uploads/2019_11_15_15_50_51_.JPG b/img/uploads/2019_11_15_15_50_51_.JPG new file mode 100644 index 00000000..61aa82ce Binary files /dev/null and b/img/uploads/2019_11_15_15_50_51_.JPG differ diff --git a/output/debug_schema.php b/output/debug_schema.php new file mode 100644 index 00000000..e6e9c19e --- /dev/null +++ b/output/debug_schema.php @@ -0,0 +1,12 @@ +query("SHOW COLUMNS FROM output LIKE 'num'"); + $row = $stmt->fetch(PDO::FETCH_ASSOC); + print_r($row); +} catch (Exception $e) { + echo "Error: " . $e->getMessage(); +} +?> diff --git a/output/fix_db_autoincrement.php b/output/fix_db_autoincrement.php new file mode 100644 index 00000000..c17ccf12 --- /dev/null +++ b/output/fix_db_autoincrement.php @@ -0,0 +1,54 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + $DB = 'chandj'; + + // 1. Fix output table + echo "Fixing 'output' table...\n"; + // Check if auto_increment exists or just try to apply it + // Usually 'MODIFY num INT AUTO_INCREMENT' works. Assuming 'num' is int. + // We also need to make sure we don't break existing keys. + // Safest is "MODIFY num INT NOT NULL AUTO_INCREMENT" + $sql = "ALTER TABLE {$DB}.output MODIFY num INT NOT NULL AUTO_INCREMENT"; + $pdo->exec($sql); + echo " - 'output.num' set to AUTO_INCREMENT successfully.\n"; + +} catch (Exception $e) { + echo " - Error fixing 'output': " . $e->getMessage() . "\n"; +} + +try { + // 2. Fix geo_attendance table + // First, find the primary key column name + echo "Fixing 'geo_attendance' table...\n"; + $stmt = $pdo->query("SHOW KEYS FROM {$DB}.geo_attendance WHERE Key_name = 'PRIMARY'"); + $pk = $stmt->fetch(PDO::FETCH_ASSOC); + + if ($pk) { + $pkColumn = $pk['Column_name']; + echo " - Found Primary Key column: $pkColumn\n"; + + $sql = "ALTER TABLE {$DB}.geo_attendance MODIFY $pkColumn INT NOT NULL AUTO_INCREMENT"; + $pdo->exec($sql); + echo " - 'geo_attendance.$pkColumn' set to AUTO_INCREMENT successfully.\n"; + } else { + echo " - Could not find Primary Key for geo_attendance.\n"; + } + +} catch (Exception $e) { + echo " - Error fixing 'geo_attendance': " . $e->getMessage() . "\n"; +} + +echo "Done.\n"; +?> diff --git a/output/insert.php b/output/insert.php index e5ad42b1..dcbfc304 100644 --- a/output/insert.php +++ b/output/insert.php @@ -1,12 +1,12 @@ - beginTransaction(); @@ -178,6 +181,7 @@ try { ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; $stmh = $pdo->prepare($sql); + $stmh->execute([ $outdate, $indate, $orderman, $outworkplace, $outputplace, $receiver, $phone, $comment, $con_num, $root, @@ -291,7 +295,8 @@ try { $pdo->commit(); } catch (Exception $ex) { $pdo->rollBack(); - print "오류: ".$Exception->getMessage(); + // print "오류: ".$Exception->getMessage(); + throw new Exception($ex->getMessage()); } } @@ -317,7 +322,8 @@ try { $pdo->commit(); } catch (PDOException $Exception) { $pdo->rollBack(); - print "오류: ".$Exception->getMessage(); + // print "오류: ".$Exception->getMessage(); + throw new Exception($Exception->getMessage()); } } diff --git a/output/lotnum.txt b/output/lotnum.txt index 961636ae..d3c36ef4 100644 --- a/output/lotnum.txt +++ b/output/lotnum.txt @@ -1 +1 @@ -250717-02 \ No newline at end of file +251214-03 \ No newline at end of file diff --git a/session.php b/session.php index db8fc068..96935153 100644 --- a/session.php +++ b/session.php @@ -31,6 +31,9 @@ $first_approval_id = $_SESSION["first_approval_id"] ?? ''; $first_approval_name = $_SESSION["first_approval_name"] ?? ''; // APP_URL 기반 동적 URL 설정 -$root_dir = rtrim($_ENV['APP_URL'] ?? 'https://5130.co.kr', '/'); +// APP_URL 기반 동적 URL 설정 +// $root_dir = rtrim($_ENV['APP_URL'] ?? 'https://5130.co.kr', '/'); +$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') ? "https://" : "http://"; +$root_dir = $protocol . $_SERVER['HTTP_HOST']; $WebSite = $root_dir . '/'; ?> \ No newline at end of file
|---|