5) { sleep(1); header("Location:" . $WebSite . "login/login_form.php"); exit; } include $_SERVER['DOCUMENT_ROOT'] . '/load_header.php'; ?> <?=$title_message?> prepare($sql); $stmh->execute(); $row = $stmh->fetch(PDO::FETCH_ASSOC); // $row 배열로 DB 정보를 불러온다. $item_bend = $row['itemList']; $bendingFeeDate = $row['registedate']; } catch (PDOException $Exception) { print "오류: ".$Exception->getMessage(); } $tablename = 'bendingfee'; $search = isset($_REQUEST['search']) ? $_REQUEST['search'] : ''; $fromdate = isset($_REQUEST['fromdate']) ? $_REQUEST['fromdate'] : ''; $todate = isset($_REQUEST['todate']) ? $_REQUEST['todate'] : ''; $mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : ''; require_once($_SERVER['DOCUMENT_ROOT'] . "/lib/mydb.php"); $pdo = db_connect(); // 현재 날짜 $currentDate = date("Y-m-d"); // fromdate 또는 todate가 빈 문자열이거나 null인 경우 if ($fromdate === "" || $fromdate === null || $todate === "" || $todate === null) { $fromdate = date("Y-m-d", strtotime("2024-01-01")); $todate = $currentDate; // 현재 날짜 $Transtodate = $todate; } else { // fromdate와 todate가 모두 설정된 경우 (기존 로직 유지) $Transtodate = $todate; } $sql=" select * from " . $DB . "." . $tablename ; $sum=array(); $now = date("Y-m-d"); // 현재 날짜와 크거나 같으면 출고예정으로 구분 $orderby="order by num desc "; $attached=''; $whereattached = ''; $SettingDate=" basicdate "; $common= $SettingDate . " between '$fromdate' and '$Transtodate' and is_deleted IS NULL "; $andPhrase= " and " . $common . $orderby ; $wherePhrase= " where " . $common . $orderby ; $firstitem = isset($_POST['firstitem']) ? $_POST['firstitem'] : ''; $seconditem = isset($_POST['seconditem']) ? $_POST['seconditem'] : ''; $prodcode = isset($_POST['prodcode']) ? $_POST['prodcode'] : ''; // 필터링 조건 추가 $whereClause = []; $search = str_replace(' ', '', $search); // 기존 검색어 처리 if ($firstitem !== '') { $whereClause[] = "firstitem = '$firstitem' "; } if ($seconditem !== '') { $whereClause[] = "seconditem = '$seconditem' "; } if ($prodcode !== '') { $whereClause[] = "prodcode = '$prodcode' "; } if ($search !== '') { $whereClause[] = "(replace(searchtag, ' ', '') LIKE '%$search%')"; } // where 조건을 조합 $whereQuery = implode(' AND ', $whereClause); // 최종 SQL 쿼리 $sql = "SELECT * FROM " . $DB . "." . $tablename . " WHERE " . $common; if (!empty($whereQuery)) { $sql .= " AND " . $whereQuery; } $sql .= $orderby; try { $stmh = $pdo->query($sql); $rows = $stmh->fetchAll(PDO::FETCH_ASSOC); // 모든 데이터를 한 번에 가져오기 $total_row = count($rows); // 가져온 데이터의 행 수 계산 // var_dump($total_row); $start_num = $total_row; } catch (PDOException $Exception) { echo "오류: " . $Exception->getMessage(); } // print $sql; ?>
    ~      
     
절곡 ㎡ 단가표 (기준일: )
품목 규격 두께(T) 비중 ㎡ / 단가
query($sql); $rows = $stmh->fetchAll(PDO::FETCH_ASSOC); // 모든 데이터를 한 번에 가져오기 $total_row = count($rows); // 가져온 데이터의 행 수 계산 $start_num = $total_row; foreach ($rows as $row) { ?> getMessage(); } ?>
번호 기준일 대분류 중분류 제품코드 품목/규격 마감 재질 단위 수량 산출단가/M 메모