<%@ $Language=JScript /* PARA COLORES PHP */ %><% function dame_hijos($nodo) { global $conn; $sql = "select rubID from prodRubros where rubPadre = '$nodo'"; $qry = $conn->execute($sql); $cant = $qry->numrows; $i=0; while (!$qry->eof) { $array[$i]=$qry->field(rubID); $qry->movenext(); $i++; } return $array; } function arbol($nodo=0) { global $conn,$rubActivo; $hijos = dame_hijos($nodo); if(count($hijos)) { $h = 0; while($hijos[$h]) { $sql = "select A.rubNombre,A.rubRuta from prodRubros A,prodRubros B where A.rubID=B.rubPadre and B.rubID='$hijos[$h]'"; $qry = $conn->execute($sql); $ruta = $qry->field(rubRuta)."/". $qry->field(rubNombre); $squpdate = "update prodRubros set rubRuta='$ruta',rubActivo='$rubActivo' where rubID = $hijos[$h] "; $qryupdate = $conn->execute($squpdate); //echo "$squpdate
"; arbol($hijos[$h]); $h++; } } } %>