display(); } /** * @see SugarView::display() */ public function display() { if (!empty($_REQUEST['portal_name'])) { $portalUsername = $this->bean->db->quote($_REQUEST['portal_name']); $result = $this->bean->db->query("Select count(id) as total from contacts where portal_name = '$portalUsername' and deleted='0'"); $total = 0; while($row = $this->bean->db->fetchByAssoc($result)) $total = $row['total']; echo $total; } else echo '0'; } }