Location: PHPKode > projects > cPassMan > cpassman_1.55/find.php
<?php
####################################################################################################
## File : find.php
## Author : Nils Laumaillé
## Description : Find page
##
## DON'T CHANGE !!!
##
####################################################################################################

//load the full Items tree
require_once ("sources/NestedTree.class.php");
$tree = new NestedTree($pre.'nested_tree', 'id', 'parent_id', 'title');

//Show the Items in a table view
echo '
    <div class="title ui-widget-content ui-corner-all">'.$txt['find'].'</div>
<div style="margin:10px auto 25px auto;min-height:250px;" id="find_page">
<table id="t_items" cellspacing="0" cellpadding="5" width="100%">
    <thead><tr>
        <th style="width:16px;"></th>
        <th style="width:20%;">'.$txt['label'].'</th>
        <th style="width:40%;">'.$txt['description'].'</th>
        <th style="width:15%;">'.$txt['tags'].'</th>
        <th style="width:25%;">'.$txt['group'].'</th>
    </tr></thead>
    <tbody>';
    //get list of personal folders
   /* $list_pf = array();
    $rows = $db->fetch_all_array("SELECT id FROM ".$pre."nested_tree WHERE personal_folder=1");
    foreach( $rows as $reccord ){
        if ( !in_array($reccord['id'],$list_pf) ) array_push($list_pf,$reccord['id']);
    }

    $cpt= 0 ;
    $rows = $db->fetch_all_array("SELECT * FROM ".$pre."items WHERE inactif=0 ORDER BY label ASC");
    foreach( $rows as $reccord ){
        //Check if user can see the ITEM
        if ( in_array($reccord['id_tree'],$_SESSION['groupes_visibles']) ||( $_SESSION['is_admin'] == 1 && !in_array($reccord['id_tree'],$list_pf) ) ) $affich_elem = true;
        else $affich_elem = false;

        //Display the Item
        if ( $affich_elem == true ){
            echo '<tr>
            <td><img src="includes/images/key__arrow.png" onClick="javascript:window.location.href = \'index.php?page=items&amp;group='.$reccord['id_tree'].'&amp;id='.$reccord['id'].'\';" style="cursor:pointer;" /></td>
            <td>'.stripslashes($reccord['label']).'</td>
            <td>', $reccord['perso']==1 || !empty($reccord['restricted_to']) || !in_array($_SESSION['user_id'],explode(';',$reccord['restricted_to'])) != $_SESSION['user_id'] ? "<img src='includes/images/lock.png' />" : stripslashes($reccord['description']) ,'</td>
            <td>';
            //get tags
                $item_tags = $db->fetch_all_array("SELECT tag FROM ".$pre."tags WHERE item_id=".$reccord['id']);
                foreach( $item_tags as $item_tag )
                    echo $item_tag['tag']." ";
            echo '</td>
            <td>';
            //Prepare the Treegrid
            $arbo = $tree->getPath($reccord['id_tree'], true);
            $arbo_elem = "";
            foreach($arbo as $elem){
                if ( $elem->title == $_SESSION['user_id'] && $elem->nlevel == 1 ) $elem->title = $_SESSION['login'];
                $arbo_elem .= $elem->title." > ";
            }
            echo $arbo_elem.'</td>
            </tr>';
            $cpt++;
        }
    }*/
    echo '
    </tbody>
</table>
</div>';
?>
Return current item: cPassMan