getLinkColumn (); $linkView = $field->getLinkView (); $fatherColumn = $field->getFatherColumn (); $columns = implode (", ", $field->getColumnsView ()); $array [0] = array (); $sth = $db->prepare ("SELECT ". $columns .", ". $field->getLinkColumn () ." FROM ". $field->getLink () ." WHERE ". $field->getFatherColumn () ." IS NULL". ($field->getWhere () != "" ? " AND ". $field->getWhere () : "") ." ORDER BY ". $columns); $sth->execute (); while ($item = $sth->fetch (PDO::FETCH_OBJ)) $array [0][$item->$linkColumn] = array ($item->$linkColumn, $field->makeView ($item)); $id = $field->getValue (); $aux = array (); while (!is_null ($id)) { $aux [$id] = array (); $sth = $db->prepare ("SELECT ". $columns .", ". $field->getLinkColumn () ." FROM ". $field->getLink () ." WHERE ". $field->getFatherColumn () ." = '". $id ."'". ($field->getWhere () != "" ? " AND ". $field->getWhere () : "") ." ORDER BY ". $columns); $sth->execute (); while ($item = $sth->fetch (PDO::FETCH_OBJ)) $aux [$id][$item->$linkColumn] = array ($item->$linkColumn, $field->makeView ($item)); $query = $db->query ("SELECT ". $field->getFatherColumn () ." FROM ". $field->getLink () ." WHERE ". $field->getLinkColumn () ." = '". $id ."'"); $id = $query->fetchColumn (); } $array = $array + array_reverse ($aux, TRUE); ob_start (); ?>
$opts) { if (!sizeof ($opts)) continue; ?>
getTip () != '' ? '
'. $field->getTip () .'
' : '' ?>