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