관리자 상품관리 검색기능활용 셀렉트 박스 적용 > 영카트5 스킨

영카트5 스킨

좋은 댓글과 좋아요는 제작자에게 큰힘이 됩니다.

관리자 상품관리 검색기능활용 셀렉트 박스 적용 정보

레이아웃 관리자 상품관리 검색기능활용 셀렉트 박스 적용

본문

아래 올린 아이템관리 버전 입니다...^^
링크 주소만 변경한 아이템관리 셀렉트박스 입니다.

adm/shop_admin/itemlist.php 에 적당한 위치에 복사하여 사용 하시면 됩니다.


<?php //카테고리 선택 시작 ?>
<style>
.comcose_acs {width:161px; padding:.5em;color:#222;}
</style>
<?php $he_size = '15'; ?>

<div style="padding:0 0 10px 20px;">

<?php //1차 카테고리 ?>
<select class="comcose_acs" size="<?php echo $he_size ?>" name="ca_id1" onChange="comcose_acs(this)">
<option style="color:#ff3100;font-weight:bold;" value="" >1차 카테고리</option>
<option>--------------------------------</option>

<?php 
$sql_ca_id1="SELECT ca_id, ca_name FROM g5_shop_category where length(ca_id) = '2' order by ca_id ";
$result_ca_id1 = sql_query($sql_ca_id1);
for($i=0; $row_ca_id1 = sql_fetch_array($result_ca_id1); $i++){
?>

<option value=<?php echo $row_ca_id1[ca_id]; ?> <?php if($row_ca_id1[ca_id] == substr($sca, 0, 2)) echo 'selected'?>><?php echo $row_ca_id1[ca_name]; ?></option>

<?php } ?>

</select>

<?php //2차 카테고리 ?>
<select class="comcose_acs" size="<?php echo $he_size ?>"  name="ca_id2" onChange="comcose_acs(this)">  
<option style="color:#ff3100;font-weight:bold;" value="<?php echo substr($sca, 0, 2); ?>" >2차 카테고리</option>
<option>--------------------------------</option>

<?php 
$sql_ca_id2="SELECT ca_id, ca_name FROM g5_shop_category where length(ca_id) = '4' and substring(ca_id,1,2) = substring('$sca',1,2) order by ca_id ";
$result_ca_id2 = sql_query($sql_ca_id2);
for($i=0; $row_ca_id2 = sql_fetch_array($result_ca_id2); $i++){
?>

<option value=<?php echo $row_ca_id2[ca_id]; ?> <?php if($row_ca_id2[ca_id] == substr($sca, 0, 4)) echo 'selected'?>><?php echo $row_ca_id2[ca_name]; ?></option>

<?php } ?>

</select>

<?php //3차 카테고리 ?>
<select class="comcose_acs" size="<?php echo $he_size ?>" name="ca_id3" onChange="comcose_acs(this)">  
<option style="color:#ff3100;font-weight:bold;" value="<?php echo substr($sca, 0, 4); ?>" >3차 카테고리</option>
<option>--------------------------------</option>  

<?php 
$sql_ca_id3="SELECT ca_id, ca_name FROM g5_shop_category where length(ca_id) = '6' and substring(ca_id,1,4) = substring('$sca',1,4) order by ca_id ";
$result_ca_id3 = sql_query($sql_ca_id3);
for($i=0; $row_ca_id3 = sql_fetch_array($result_ca_id3); $i++){
?>

<option value=<?php echo $row_ca_id3[ca_id]; ?> <?php if($row_ca_id3[ca_id] == substr($sca, 0, 6)) echo 'selected'?>><?php echo $row_ca_id3[ca_name]; ?></option>

<?php } ?>

</select>

<?php //4차 카테고리 ?>
<select class="comcose_acs" size="<?php echo $he_size ?>" name="ca_id4" onChange="comcose_acs(this)">  
<option style="color:#ff3100;font-weight:bold;" value="<?php echo substr($sca, 0, 6); ?>" >4차 카테고리</option>
<option>--------------------------------</option>

<?php 
$sql_ca_id4="SELECT ca_id, ca_name FROM g5_shop_category where length(ca_id) = '8' and substring(ca_id,1,6) = substring('$sca',1,6) order by ca_id ";
$result_ca_id4 = sql_query($sql_ca_id4);
for($i=0; $row_ca_id4 = sql_fetch_array($result_ca_id4); $i++){
?>

<option value=<?php echo $row_ca_id4[ca_id]; ?> <?php if($row_ca_id4[ca_id] == substr($sca, 0, 8)) echo 'selected'?>><?php echo $row_ca_id4[ca_name]; ?></option>

<?php } ?>

</select>

<?php //5차 카테고리 ?>
<select class="comcose_acs" size="<?php echo $he_size ?>" name="ca_id5" onChange="comcose_acs(this)">  
<option style="color:#ff3100;font-weight:bold;" value="<?php echo substr($sca, 0, 8); ?>" >5차 카테고리</option>
<option>--------------------------------</option>

<?php 
$sql_ca_id5="SELECT ca_id, ca_name FROM g5_shop_category where length(ca_id) = '10' and substring(ca_id,1,8) = substring('$sca',1,8) order by ca_id ";
$result_ca_id5 = sql_query($sql_ca_id5);
for($i=0; $row_ca_id5 = sql_fetch_array($result_ca_id5); $i++){
?>

<option value=<?php echo $row_ca_id5[ca_id]; ?> <?php if($row_ca_id5[ca_id] == substr($sca, 0, 10)) echo 'selected'?>><?php echo $row_ca_id5[ca_name]; ?></option>

<?php } ?>

</select>

<?php //6차 카테고리 ?>
<select class="comcose_acs" size="<?php echo $he_size ?>" name="ca_id6" onChange="comcose_acs(this)">  
<option style="color:#ff3100;font-weight:bold;" value="<?php echo substr($sca, 0, 10); ?>" >6차 카테고리</option>
<option>--------------------------------</option>

<?php 
$sql_ca_id6="SELECT ca_id, ca_name FROM g5_shop_category where length(ca_id) = '12' and substring(ca_id,1,10) = substring('$sca',1,10) order by ca_id ";
$result_ca_id6 = sql_query($sql_ca_id6);
for($i=0; $row_ca_id6 = sql_fetch_array($result_ca_id6); $i++){
?>

<option value=<?php echo $row_ca_id6[ca_id]; ?> <?php if($row_ca_id6[ca_id] == substr($sca, 0, 12)) echo 'selected'?>><?php echo $row_ca_id6[ca_name]; ?></option>

<?php } ?>

</select>

<script type="text/javascript">
function comcose_acs(sel_ca){ 
sel_ca= sel_ca.options[sel_ca.selectedIndex].value; 
location.replace("itemlist.php?sca="+sel_ca+"&sfl=it_name&stx=");
}
</script>

</div>
<?php //카테고리 선택 끝 ?>
추천
9

댓글 전체

전체 113
영카트5 스킨 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIR SOFT