Ejemplo n.º 1
0
            echo str_repeat('&nbsp;', 6 * $item['section_level']) . '<a href="dbtree.php?mode=ajar&section_id=' . $item['section_id'] . '">' . $item['section_name'] . '</a><br>';
        } else {
            echo str_repeat('&nbsp;', 6 * $item['section_level']) . '<strong>' . $item['section_name'] . '</strong><br>';
        }
    }
    ?>
                </td>
            </tr>
        </table>

        <?php 
}
/* ------------------------ MAP ------------------------ */
if (!empty($_GET['mode']) && 'map' == $_GET['mode']) {
    // Prepare data to view all tree
    $full = $dbtree->Full();
    ?>
        <h3>Manage tree (MAP):</h3>
        <table border="1" cellpadding="5" width="100%">
            <tr>
                <td>

                    <?php 
    echo $navigator . '<br><br>';
    foreach ($full as $item) {
        if (@$_GET['section_id'] != $item['section_id']) {
            echo str_repeat('&nbsp;', 6 * $item['section_level']) . '<a href="dbtree.php?mode=map&section_id=' . $item['section_id'] . '">' . $item['section_name'] . '</a><br>';
        } else {
            echo str_repeat('&nbsp;', 6 * $item['section_level']) . '<strong>' . $item['section_name'] . '</strong><br>';
        }
    }
Ejemplo n.º 2
0
                            <option value="before">Before</option>
                        </select><br>
                        <center><input type="submit" value="Apply"></center>
                        <br>
                    </form>
                    <form action="dbtree_demo.php?action=move_2&section_id=<?php 
    echo $_GET['section_id'];
    ?>
" method="POST">
                        <strong>2) Assigns a node with all its children to another parent.</strong><br>
                        Choose second section:
                        <select name="section2_id">
                            <?php 
    // Prepare the data for the second method:
    // Assigns a node with all its children to another parent
    $full = $dbtree->Full(array('section_id', 'section_level', 'section_name'), array('or' => array('section_left <= ' . $current_section['section_left'], 'section_right >= ' . $current_section['section_right'])));
    foreach ($full as $item) {
        ?>
                                <option
                                    value="<?php 
        echo $item['section_id'];
        ?>
"><?php 
        echo str_repeat('&nbsp;', 6 * $item['section_level']);
        echo $item['section_name'];
        ?>
 <?php 
        echo $item['section_id'] == (int) $_GET['section_id'] ? '<<<' : '';
        ?>
</option>
                                <?php