query("SELECT id,owner,status,cname,ctype,regno,regdate,address,csize FROM companies where id='$id'")->fetch(PDO::FETCH_ASSOC); // Determine if the logged-in user can edit this business $can_edit = can_edit($user, $row['owner']); // Determine if this business should be displayed. $disable_flag = 0; if ($can_edit == FALSE && $user['level'] < 3 && $row['status'] == '0') { unset($row); $disable_flag = 1; } if (empty($row['id']) && $disable_flag == 1) { $page['meta_title'] = 'Not Available'; $page['page_title'] = 'Not Available'; $page['content'] = '
The company you requested is currently unavailable.
'; $page['lastsearch'] = $_SESSION['lastsearch']; show_page($page); exit; } elseif (empty($row['id'])) { $page['meta_title'] = 'Not Found'; $page['page_title'] = 'Not Found'; $page['content'] = 'The company you requested could not be found.
'; $page['lastsearch'] = $_SESSION['lastsearch']; show_page($page); exit; } // General company info $edit = ''; if ($can_edit == TRUE) { $edit = "\n"; } $address = 'n/a'; if (!empty($row['address'])) { $address = $row['address']; } $type = 'n/a'; if (!empty($row['ctype'])) { $type = $company_types[$row['ctype']]; } $csize = 'n/a'; if (!empty($row['csize'])) { $csize = $company_sizes[$row['csize']]; } $page['meta_title'] = $page['page_title'] = $row['cname']; if ($can_edit == TRUE) { $page['page_title'] = "" . $page['page_title'] . ''; } $details = "$editReg. No. | " . $row['regno'] . " |
Status | " . $status_text . " |
Managing User | " . $owner_text . " |
No categories assigned.
"; } $categories = "No core services available.
"; } $services = "${label} | $row[$fieldname] |
No contacts available.
\n"; } $contacts = "${label} | $row[$fieldname] |
No partners available.
\n"; } $partners = "