setAuthConfig($serviceAccountKeyFile); $client->addScope(Google_Service_Drive::DRIVE); // Google Drive 서비스 초기화 $service = new Google_Service_Drive($client); // 특정 폴더 확인 함수 function getFolderId($service, $folderName, $parentFolderId = null) { $query = "name='$folderName' and mimeType='application/vnd.google-apps.folder' and trashed=false"; if ($parentFolderId) { $query .= " and '$parentFolderId' in parents"; } $response = $service->files->listFiles([ 'q' => $query, 'spaces' => 'drive', 'fields' => 'files(id, name)' ]); return count($response->files) > 0 ? $response->files[0]->id : null; } // Google Drive에서 파일 썸네일 검사 및 반환 function getThumbnail($fileId, $service) { try { $file = $service->files->get($fileId, ['fields' => 'thumbnailLink']); return $file->thumbnailLink ?? null; // 썸네일 URL이 있으면 반환, 없으면 null } catch (Exception $e) { error_log("썸네일 가져오기 실패: " . $e->getMessage()); return null; // 실패 시 null 반환 } } $title_message = '품의서'; $mode = $_REQUEST["mode"] ?? ''; $search = $_REQUEST["search"] ?? ''; ?> <?=$title_message?> table th, table td, h4, .form-control, span { font-size: 22px; } h4 { font-size: 40px; } .btn-sm { font-size: 30px; } '; } include $_SERVER['DOCUMENT_ROOT'] .'/eworks/_request.php'; $pdo = db_connect(); // 현재 날짜 $currentDate = date("Y-m-d"); $fromdate = $_REQUEST['fromdate'] ?? ''; $todate = $_REQUEST['todate'] ?? ''; // fromdate 또는 todate가 빈 문자열이거나 null인 경우 if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) { $fromdate = date("Y-m-d", strtotime("-3 months", strtotime($currentDate))); // 6개월 이전 날짜 $todate = $currentDate; // 현재 날짜 $Transtodate = $todate; } else { // fromdate와 todate가 모두 설정된 경우 (기존 로직 유지) $Transtodate = $todate; } $SettingDate = "indate"; $Andis_deleted = " AND (is_deleted IS NULL or is_deleted='0') AND eworks_item='품의서' AND al_company='경동' "; $Whereis_deleted = " WHERE (is_deleted IS NULL or is_deleted='0') AND eworks_item='품의서' AND al_company='경동' "; $common = " WHERE " . $SettingDate . " BETWEEN '$fromdate' AND '$Transtodate' " . $Andis_deleted . " ORDER BY "; $a = $common . " num DESC "; // 내림차순 전체 $sql="select * from ".$DB.".eworks " . $a; // 검색을 위해 모든 검색변수 공백제거 $search = str_replace(' ', '', $search); if($mode=="search"){ if($search==""){ $sql="select * from {$DB}.eworks " . $a; } elseif($search!="") { $sql ="select * from {$DB}.eworks where ((outdate like '%$search%') or (replace(outworkplace,' ','') like '%$search%' ) "; $sql .="or (steel_item like '%$search%') or (spec like '%$search%') or (company like '%$search%') or (first_writer like '%$search%') or (payment like '%$search%') or (supplier like '%$search%') or (request_comment like '%$search%') ) " . $Andis_deleted . " order by num desc "; } } if($mode=="") { $sql="select * from {$DB}.eworks " . $a; } $nowday=date("Y-m-d"); // 현재일자 변수지정 $dateCon =" AND between date('$fromdate') and date('$Transtodate') " ; try{ $stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh $total_row=$stmh->rowCount(); ?>

기간  
기간 설정
  ~       
 
 
    
fetch(PDO::FETCH_ASSOC)) { include $_SERVER['DOCUMENT_ROOT'] .'/eworks/_row.php'; echo ''; ?> getMessage(); } ?>
번호 작성일 결재집행일 구매처 결재일 작성 구매처 제목 품의 내역 품의 사유 예상 비용 금액 결재완료