5) {
sleep(1);
header("Location:" . $WebSite . "login/login_form.php");
exit;
}
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include $_SERVER['DOCUMENT_ROOT'] . '/load_header.php';
$title_message = '견적 List';
?>
=$title_message?>
query("SHOW COLUMNS FROM `$DB`.`$tablename`");
$columns = array();
while ($row = $columnQuery->fetch(PDO::FETCH_ASSOC)) {
$columns[] = $row['Field'];
}
$searchConditions = array();
foreach ($columns as $i => $column) {
$paramName = ":search" . $i;
$searchConditions[] = "`$column` LIKE $paramName";
$bindParams[$paramName] = "%$search%";
}
if (!empty($searchConditions)) {
$conditions[] = "(" . implode(" OR ", $searchConditions) . ")";
}
}
// 최종 WHERE 조건 조립
$sqlWhere = implode(" AND ", $conditions);
$sql = "SELECT * FROM `$DB`.`$tablename` WHERE $sqlWhere $order_by";
// 실행 및 데이터 가져오기
try {
$stmh = $pdo->prepare($sql);
$stmh->execute($bindParams);
$total_row = $stmh->rowCount();
?>