Create($crm_db,$crm_user,$crm_host,$crm_pass); $gc_sql = $crm; $cdc = new MySQL_class; $cdc->Create($cdc_db,$cdc_user,$cdc_host,$cdc_pass); $tmp = new MySQL_class; $tmp->Create($template_db,$template_user,$template_host,$template_pass); $dir = new MySQL_class; $dir->Create($directory_db,$directory_user,$directory_host,$directory_pass); $brnd = new MySQL_class; $brnd->Create($db,$user,$host2,$pass); // foil hackers unset($u_type,$u_id,$session_email); // start session start_session($php_sessid); // log it app_log('directory',$PHP_SELF,$search_word,$id,'view',$code,$array); // start template engine $tpl = new rFastTemplate("."); $tpl->no_strict(); $tpl->quiet(); if(page_auth(3,$u_type,$cdc) == "yes") { $staging = "yes"; } unset($u_id); start_session($sessid); // getting the header and other needed pages $main = get_template('2',$TEMPLATE,$tmp,$code,$staging); $body = get_template('4',$TEMPLATE,$tmp,$code,$staging); $tpl->define_raw( array( main => $main, body => $body )); $tpl = show_login($u_id,$tpl); $tpl->assign( array( SELF => $PHP_SELF, CATEGORY_ID => $id )); // list directory categories $tpl = list_dir_cats($tpl,'COMPANY',$code,$dir); // building the location .... $id = strip_tags(ass($id)); $query = "select name, level, extra_text_1, extra_text_1, order_by from $DIR_CATEGORY_NAME where category_id = '$id' and brand = '$code' "; $data = $dir->mydata($query); $location_name = stripslashes($data[name][0]); $prepend = " : $location_name"; $location_id = $id; $order_by = $data[order_by][0]; $tpl->assign(array( CATEGORY_NAME => $location_name, EXTRA_TEXT_1 => ss($data[extra_text_1][0]), EXTRA_TEXT_2 => ss($data[extra_text_2][0]) )); // now loop through till I get to zero $level = $data[level][0]; for($a=0;$a<$level;$a++) { $query = "select $DIR_CATEGORY_NAME.name, $DIR_CATEGORY_NAME.category_id from $DIR_CATEGORY_NAME, $DIR_CAT_TO_CAT_ORGANIZATION where $DIR_CAT_TO_CAT_ORGANIZATION.category_id = $DIR_CATEGORY_NAME.category_id and $DIR_CAT_TO_CAT_ORGANIZATION.lesser_category_id = '$location_id' and $DIR_CAT_TO_CAT_ORGANIZATION.brand = '$code' "; $location_data = $dir->mydata($query); if($a!=0) { $prepend = " : $location_name$prepend"; } $location_id = $location_data[category_id][0]; $location_name = $location_data[name][0]; } $tpl->assign(array( LOCATION => $prepend )); // lets get a list of categories beneath this category $query = "select $DIR_CATEGORY_NAME.name, $DIR_CATEGORY_NAME.category_id from $DIR_CATEGORY_NAME, $DIR_CAT_TO_CAT_ORGANIZATION where $DIR_CATEGORY_NAME.category_id = $DIR_CAT_TO_CAT_ORGANIZATION.lesser_category_id and $DIR_CAT_TO_CAT_ORGANIZATION.category_id = '$id' and $DIR_CATEGORY_NAME.hide != 'Y' and $DIR_CAT_TO_CAT_ORGANIZATION.brand = '$code' and $DIR_CATEGORY_NAME.brand = '$code' order by $DIR_CATEGORY_NAME.name "; $data = $dir->mydata($query); // lets print a list of sub categories in this category for($a=0;$a