관리자 여분필드 검색
본문
<div class="adm-form-td td-r">
<div class="inline-group">
<?
if ($stx) {
if ($sfl && in_array($sfl, ['it_name', 'it_10_subj', 'it_id', 'it_maker', 'it_origin', 'it_sell_email', 'it_1', 'it_2'])) {
$sql_search .= " AND $sfl LIKE '%$stx%'";
}
}
?>
<span>
<label class="select" style="width:200px">
<select name="sfl" id="sfl">
<option value="it_name" <?php echo get_selected($sfl, 'it_name'); ?>>상품명</option>
<option value="it_10_subj" <?php echo get_selected($sfl, 'it_10_subj'); ?>>상품간략설명</option>
<option value="it_id" <?php echo get_selected($sfl, 'it_id'); ?>>상품코드</option>
<option value="it_maker" <?php echo get_selected($sfl, 'it_maker'); ?>>제조사</option>
<option value="it_origin" <?php echo get_selected($sfl, 'it_origin'); ?>>원산지</option>
<option value="it_sell_email" <?php echo get_selected($sfl, 'it_sell_email'); ?>>판매자 e-mail</option>
</select><i></i>
</label>
</span>
<span>
<label class="input max-width-250px">
<input type="text" name="stx" value="<?php echo $stx; ?>" id="stx" autocomplete="off">
</label>
</span>
</div>
</div>
이윰빌더를 쓰고 있는데요 상품마다 it_10_subj 여분필드를 써서 관리자에서 검색되도록 하려는데
잘안되네요~ 혹시 제가 뭘 잘 못 한 것일까요?
답변 1
if ($stx) {
if ($sfl && in_array($sfl, ['it_name', 'it_10_subj', 'it_id', 'it_maker', 'it_origin', 'it_sell_email', 'it_1', 'it_2'])) {
$sql_search .= " AND $sfl LIKE '%$stx%'";
}
}
해당 부분이 위치가 잘못된게 아닐까 싶네요 상단에 쿼리 구하는데 해당이 있어야 할거 같습니다.