// Obtain the infinitus category of the SELECT statement $ all data of Data $ PID parent level ID. The third is the default value. The fourth is the interval.
Public Function gettree_select ($ data, $ PID, $ default, $ space) {$ html = ''; $ space_nbsp =''; $ nbsp = "& nbsp; & nbsp; "; if ($ space) {for ($ I = 0; $ I <$ space; $ I ++) {$ space_nbsp. = $ nbsp;} $ space_nbsp. = 'privacy-';} else {$ space_nbsp = '';} $ space ++; foreach ($ data as $ k => $ V) {if ($ V ['adpid '] = $ PID) {if ($ default = $ V ['adsortid']) {$ selected = 'selected = "selected" ';} else {$ selected = '';} $ HTML. = "<option $ Sel Ected> ". $ space_nbsp. $ V ['subobject']. "</option>"; $ HTML. = $ this-> gettree_select ($ data, $ V ['adsortid'], $ default, $ space) ;}return $ HTML;} public function is_sub ($ data, $ PID) {$ bean = 0; foreach ($ data as $ k => $ v) {if ($ V ['adpid '] = $ PID) {$ bean = 1 ;}}return $ bean;} // use the tr class_one in the obtained table to indicate that class_two with an expanded graph is the public function gettree_tr without an expanded graph ($ data, $ PID, $ space) {$ html = ''; $ class_one = 'class =" t Dbg "'; $ class_two = 'class =" tdbg1 "'; $ class = $ class_one; $ padding = 15; $ space_nbsp =''; $ nbsp = "& nbsp; & nbsp; "; if ($ space) {$ class = $ class_two; if ($ space> 1) {$ p_left = $ padding * $ space; $ p_left. = 'px '; $ space_nbsp = "style = 'margin-left: $ p_left'";} else {$ space_nbsp = "style = 'margin-left: 15px '";}} else {$ space_nbsp ='';} $ space ++; foreach ($ data as $ K =>$ V) {if ($ V ['adpid '] ==$ PID) {if ($ this-> is_s UB ($ data, $ V ['adsortid']) | $ pid = 0) {$ class = $ class_one;} else {$ class = $ class_two ;} $ HTML. = '<tr> <TD> '. $ V ['adsortid']. '</TD> <TD align = "Left"> <strong> <span '. $ class. ''. $ space_nbsp. '> '. $ V ['subobject']. '</span> </strong> </TD> <a href = "/Goods/AD/adcat_add.html? Adsortid = '. $ V ['adsortid'].' "> modify </a> | <a href ="/Goods/AD/adcat_delete.html? Adsortid = '. $ V ['adsortid'].' "onclick =" Return confirm (\ 'Are you sure you want to delete it? \ ') "> Delete </a> </TD> </tr>'; $ HTML. = $ this-> gettree_tr ($ data, $ V ['adsortid'], $ space) ;}} return $ HTML ;}
Form output and table output for unlimited Classification