. */ /** * @brief Show the tree * * @file * @author Laurent Giovannoni * @date $date$ * @version $Revision$ * @ingroup admin */ require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_request.php"); $core_tools = new core_tools(); $core_tools->load_lang(); $func = new functions(); $db = new Database(); $nb_trees = 0; if(isset($_SESSION['doctypes_chosen_tree'])) { $nb_trees = count($_SESSION['doctypes_chosen_tree']); } $core_tools->load_html(); $core_tools->load_header('', true, false); $f_level = array(); $folder_module = $core_tools->is_module_loaded('folder'); ?> query($query, array($_SESSION['doctypes_chosen_tree'])); } else { $query="SELECT d.doctypes_first_level_id, d.doctypes_first_level_label FROM ".$_SESSION['tablename']['doctypes_first_level']." d WHERE d.enabled = 'Y' order by d.doctypes_first_level_label"; $stmt = $db->query($query); } while($res1 = $stmt->fetchObject()) { $s_level = array(); $stmt2 = $db->query("SELECT doctypes_second_level_id, doctypes_second_level_label FROM ".$_SESSION['tablename']['doctypes_second_level']." WHERE doctypes_first_level_id = ? and enabled = 'Y'", array($res1->doctypes_first_level_id)); while($res2 = $stmt2->fetchObject()) { $doctypes = array(); $stmt3 = $db->query("SELECT type_id, description FROM ".$_SESSION['tablename']['doctypes']." WHERE doctypes_first_level_id = ? and doctypes_second_level_id = ? and enabled = 'Y' ", array($res1->doctypes_first_level_id, $res2->doctypes_second_level_id)); while($res3 = $stmt3->fetchObject()) { $results = array(); array_push($doctypes, array('type_id' => $res3->type_id, 'description' => $func->show_string($res3->description), "results" => $results)); } array_push($s_level, array('doctypes_second_level_id' => $res2->doctypes_second_level_id, 'doctypes_second_level_label' => $func->show_string($res2->doctypes_second_level_label, true), 'doctypes' => $doctypes)); } array_push($f_level, array('doctypes_first_level_id' => $res1->doctypes_first_level_id, 'doctypes_first_level_label' => $func->show_string($res1->doctypes_first_level_label, true), 'second_level' => $s_level)); } if($folder_module) { for($i=0;$i $fLabel, 'content' => $f_level)); } else { array_push($search_customer_results, array('folder_id' => _TREE_ROOT, 'content' => $f_level)); } //$core_tools->show_array($search_customer_results); ?>
load_js(); ?>