=$title_prefix?> =$title_message?>
'1' or devMode IS NULL) and motor='1' " . $orderby;
$searchwhere = " where " . $SettingDate . " between date('$fromdate') and date('$Transtodate') and is_deleted = '0' AND (devMode <> '1' or devMode IS NULL) and motor='1' and searchtag like '%$search%' " . $orderby;
}
else
{
$where= " where " . $SettingDate . " between date('$fromdate') and date('$Transtodate') and is_deleted = '0' AND (devMode <> '1' or devMode IS NULL) and motor='1' and motor_state = '$existing_status' " . $orderby;
$searchwhere = " where " . $SettingDate . " between date('$fromdate') and date('$Transtodate') and is_deleted = '0' AND (devMode <> '1' AND devMode IS NULL) and motor='1' and motor_state = '$existing_status' and searchtag like '%$search%' " . $orderby;
}
if($search==""){
$sql="select * from $DB.$tablename " . $where;
}
else if($search!="") { // 각 필드별로 검색어가 있는지 쿼리주는 부분
$sql ="select * from $DB.$tablename " . $searchwhere ;
}
$today=date("Y-m-d"); // 현재일자 변수지정
// print $sql;
// print ' existing_status : ' . $existing_status;
try {
$stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh
$total_row = $stmh->rowCount();
$total_sum=0;
$total_m2=0;
?>