list.php 와 list.skin.php 검색 옵션....
본문
list.php
if($bo_table == "cscenter") {
if(isset($stx1) || isset($stx2) || isset($stx3)) {
if((isset($stx1)) && (empty($stx2))){
// $sql_search=" wr_9 like '%{$stx}%' ";
$sql_search=" {$sfl} like '%{$stx}%' ";
} else {
// $sql_search=" wr_29 between '{$stx1}' and '{$stx2}' and wr_9 like '%{$stx}%' ";
$sql_search=" wr_29 between '{$stx1}' and '{$stx2}' and {$sfl} like '%{$stx}%' ";
}
} else
$sql_search = get_sql_search($sca, $sfl, $stx, $sop);
} else
list.skin.php
<form name="fsearch" method="get">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="sop" value="and">
<input type="text" name="stx1" value="<?php echo stripslashes($stx1) ?>" id="stx1" class="frm_input redate search_box" placeholder="날짜검색">
~
<input type="text" name="stx2" value="<?php echo stripslashes($stx2) ?>" id="stx2" class="frm_input redate search_box" placeholder="날짜검색">
--- 셀렉트 ---
<select name="sfl" id="sfl" class="frm_input">
<option value="'wr_41"<?php echo get_selected($sfl, 'wr_41'); ?>>총판장</option>
<option value="'wr_9"<?php echo get_selected($sfl, 'wr_9'); ?>>고객명</option>
<option value="'wr_5"<?php echo get_selected($sfl, 'wr_5'); ?>>전화번호</option>
</select>
--- 셀렉트 ---
<input type="text" name="stx3" value="<?php echo stripslashes($stx3) ?>" id="stx3" class="frm_input search_box" placeholder="성함">
<button type="submit" value="검색" class="sch_btn">검색</button>
</form>
이 값에서 wr_9값을 어떻게 유동적으로 바꾸고 싶습니다.
--- 셀렉트 --- 에서 wr_9값을 바꿔서 다른것도 검색할 수 있게 하고 싶은데
셀렉트 값을 어떻게 넣어야 할까요?
!-->!-->답변 2
지금 하신 방법으로 될 듯한데
한번 테스트 해 보세요.
--- 셀렉트 ---
<select name="sfl" id="sfl" class="frm_input">
<option value="'wr_41"<?php echo get_selected($sfl, 'wr_41'); ?>>총판장</option>
<option value="'wr_5"<?php echo get_selected($sfl, 'wr_5'); ?>>전화번호</option>
<?
if (wr_9 말고 사용되어야 조건인경우) {
?>
<option value="'wr_10"<?php echo get_selected($sfl, 'wr_10'); ?>>wr_10</option>
<?
} else {
?>
<option value="'wr_9"<?php echo get_selected($sfl, 'wr_9'); ?>>고객명</option>
<?
}
?>
</select>
--- 셀렉트 ---
if 나 switch 를 사용한다면 더 추가하거나 뺄수도있을거 같아요
!-->
답변을 작성하시기 전에 로그인 해주세요.