' . "TREE" . ''; $params['toolbar'] []= '' . "SERVICE_TREE_TEST" . ''; // init columns if not set if (empty($_SESSION['USERS2_PRODUKT' . "_COLUMN"])) { SEF('USERS_COLUMN_INIT2'); USERS_COLUMN_INIT2('USERS2_PRODUKT', '', 'RWX'); // desc $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['DESC_TO_LANG']['P_ID']="Parent ID"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['DESC_TO_LANG']['A_STATUS']=""; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['DESC_TO_LANG']['A_STATUS_INFO']=""; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['DESC_TO_LANG']['P_NAME']="Nazwa produktu"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['DESC_TO_LANG']['S_OTHER_INFO']=""; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['DESC_TO_LANG']['SES_SERVICE']="Usługa"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['DESC_TO_LANG']['SES_SERVICE_PARENT']="Usługa nadrzędna"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['DESC_TO_LANG']['SES_OPTION_REQUIRED']="Czy opcja jest wymagana"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['DESC_TO_LANG']['SES_PARENT_REQUIRED']="Czy usługa nadrzędna jest wymagana"; //$_SESSION['USERS2_PRODUKT' . "_COLUMN"]['DESC_TO_LANG']['P_S_PARAM1']="";// TODO: tech //$_SESSION['USERS2_PRODUKT' . "_COLUMN"]['DESC_TO_LANG']['P_S_PARAM2']="";// TODO: tech //$_SESSION['USERS2_PRODUKT' . "_COLUMN"]['DESC_TO_LANG']['P_S_LIMIT']="";// TODO: tech //$_SESSION['USERS2_PRODUKT' . "_COLUMN"]['DESC_TO_LANG']['P_S_LAN']="";// TODO: tech $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['DESC_TO_LANG']['ID_COSTS_GROUPS']=""; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['DESC_TO_LANG']['A_ADM_COMPANY']=""; // perms $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['PERMEDIT']['P_ID']="RWXC"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['PERMEDIT']['A_STATUS']="RWX"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['PERMEDIT']['A_STATUS_INFO']="RWX"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['PERMEDIT']['P_NAME']="RWXC"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['PERMEDIT']['S_OTHER_INFO']="RWXC"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['PERMEDIT']['SES_SERVICE']="RWXC"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['PERMEDIT']['SES_SERVICE_PARENT']="RWXC"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['PERMEDIT']['SES_OPTION_REQUIRED']="RWXC"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['PERMEDIT']['SES_PARENT_REQUIRED']="RWXC"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['PERMEDIT']['P_S_PARAM1']="RWXC"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['PERMEDIT']['P_S_PARAM2']="RWXC"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['PERMEDIT']['P_S_LIMIT']="RWXC"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['PERMEDIT']['P_S_LAN']="RWXC"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['PERMEDIT']['ID_COSTS_GROUPS']="RWXC"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['PERMEDIT']['A_ADM_COMPANY']=""; // base functions $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['FUNCPERMEDIT']['NEW_RECORD']="RWX"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['FUNCPERMEDIT']['TABLE_INSERTDB']="RWX"; // additional functions $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['FUNCPERMEDIT']['ID_COSTS_GROUPS']="RWX"; $_SESSION['USERS2_PRODUKT' . "_COLUMN"]['TYPESPECIAL']['ID_COSTS_GROUPS']="ID_COSTS_GROUPS"; } // router global $ARG1, $ARG1_VAL; switch ($ARG1) { case 'TREE': USERS2_PRODUKT_TREE(); break; case 'SES_TREE': USERS2_PRODUKT_SES_TREE(); break; default: WIEVTABLE( $params ); echo ''; //echo ''; echo ''; echo ''; echo ''; echo ''; } } function USERS2_PRODUKT_EDIT() { EDIT_TABLE_RECORD(); } function USERS2_PRODUKT_HIST() { WIEVTABLE_HIST(); } function USERS2_PRODUKT_TREE() { global $thiss; echo '
items: ';print_r($items);echo''; $items_tree = array();// tree root // -- foreach ($items as $k_id => $r) { if ($r->P_ID == 0) { $items_tree [ $r->ID ] = array(); if (array_key_exists($r->P_ID, $items)) { $items[$r->P_ID]->sub [$r->ID] = true; } } else {// array if (array_key_exists($r->P_ID, $items)) { $items[$r->P_ID]->sub [$r->ID] = true; } } }//end foreach ksort($items_tree); // set up has_childrens foreach ($items as $k_id => $r) { $items[$k_id]->has_childrens = !empty($r->sub); }//end foreach foreach ($items_tree as $k_id => $v_childrens) { if (array_key_exists($k_id, $items)) { $items_tree[$k_id] = Tree_Helper__create_tree_rec( $k_id, $items ); } } function tree_callback__show_item_from_USERS2_PRODUKT( &$r, &$tree ) { $cls = array(); $cls = (!empty($cls))? ' class="'.implode(' ', $cls).'"' : ''; echo'
OPCJA wymagana";
}
echo " dla " . $r->SES_SERVICE_PARENT . "";
} else {
echo " " . $r->SES_SERVICE . "";
if ($r->SES_SERVICE_PARENT) {
echo " podrzędna pod " . $r->SES_SERVICE_PARENT . "";
}
}
echo'';
echo'items: ';print_r($items);echo''; $items_tree = array();// tree root // -- foreach ($items as $k_id => $r) { if ($r->P_ID == 0) { $items_tree [ $r->ID ] = array(); if (array_key_exists($r->P_ID, $items)) { $items[$r->P_ID]->sub [$r->ID] = true; } } else {// array if (array_key_exists($r->P_ID, $items)) { $items[$r->P_ID]->sub [$r->ID] = true; } } }//end foreach ksort($items_tree); // set up has_childrens foreach ($items as $k_id => $r) { $items[$k_id]->has_childrens = !empty($r->sub); }//end foreach foreach ($items_tree as $k_id => $v_childrens) { if (array_key_exists($k_id, $items)) { $items_tree[$k_id] = Tree_Helper__create_tree_rec( $k_id, $items ); } } $tree = new Tree( 'USERS2_PRODUKT' ); $tree->set_parent_id_col( 'P_ID' ); $tree->set_param('show_item_callback', "tree_callback__show_item_from_USERS2_PRODUKT"); $tree->set_param('ajax', "NIE"); $tree->set_param('rozwin', true); echo ''; $tree->show_css(); echo ''; echo ''; $tree->show_js(); echo '
| ';
echo "\n".' '."\n";
echo '' . "Usługi" . '';
$tree->show_rec_by_tree($items_tree, $items);
echo ' '."\n";
echo ' | ';
echo '';
echo ' ';
echo '' . "Dodatkowe opcje" . '';
foreach ($items_opcje as $k_service => $v_options_arr) {
echo '';
}//end foreach
echo ' ';
echo ' | ';
echo '