<?php
	defined('IN_TS') or die('Access Denied.');
	$cateapp = _get('cateapp');
	$subcateid = _get('subcateid');
	if($cateapp){
		$subcate = $db->fetch_all_assoc("select * from ".dbprefix."goods_cate where appname='".$cateapp."' and parent_id>0");
		$optionthtml = "<option value='0' >请选择分类</option>";
		foreach($subcate as $key=>$item){
			
			$optionthtml.= "<option value='".$item['cate_id']."' >".$item['cate_name']."</option>";
		}
		
		echo '<select class="J_cate_select mr10" name="subcate" id="subcateid" onchange="selectsubcate()">'.$optionthtml.'</select>';
	}
	
	
	if($subcateid){
		$subcate = $db->once_fetch_assoc("select tag from ".dbprefix."goods_subcate where cate_id='".$subcateid."'");
		
		foreach(explode('，',$subcate['tag']) as $key=>$item){
			
			$optionthtml.= "<option value='".$item."' >".$item."</option>";
		}
		
		echo '<select class="J_cate_select mr10" name="tag" >'.$optionthtml.'</select>';
	}
	
	