function get_goods_type($fatherid = 0, $selid = 0, $layer = 0) { $str = ""; global $db; $query = $db->query("SELECT * FROM " . DB_TABLEPRE . "goods_type where father='{$fatherid}' ORDER BY id Asc "); if (count($query) > 0) { for ($i = 0; $i < $layer; $i++) { $str .= "├"; } while ($row = $db->fetch_array($query)) { $selstr = $row['id'] == $selid ? 'selected="selected"' : ''; $htmlstr = '<option value="' . $row['id'] . '" ' . $selstr . '>' . $str . $row['title'] . '</option>'; echo $htmlstr; get_goods_type($row['id'], $selid, $layer + 1, $type); } } return; }
" name="number" class="ui-input search-keyword" id="J-keyword"> </div> <label class="ui-form-label" for="J-start">名称:</label> <div class="ui-form-content"> <input type="text" value="<?php echo urldecode($title); ?> " name="title" class="ui-input search-keyword" id="J-keyword"> </div> <label class="ui-form-label" for="J-start">类别:</label> <div class="ui-form-content"> <select class="BigStatic" name="type"> <option value="" selected></option> <?php get_goods_type(0, $type); ?> </select> </div> <div class="submit-time-container "> <div class="submit-time ui-button ui-button-sorange"> <input type="submit" class="ui-button-text"id="J-submit-time" value="查 找"/> </div> </div> </div> </div> </div> </div><!-- .record-search -->