db_select($query); $smarty->assign("alphabet", $alphabet); // setup current letter if(isset($_GET['asset_letter'])) { $asset_letter = sanitize($_GET['asset_letter']); } else { $asset_letter = $alphabet[0]['asset_letter']; } $query = "SELECT a.asset_id, IF(LENGTH(a.asset_name)>0, a.asset_name, '...') AS asset_name, a.asset_info, c.assetclass_id, c.assetclass_name FROM asset AS a LEFT OUTER JOIN assetclass AS c USING (assetclass_id) WHERE SUBSTRING(a.asset_name,1,1) = '" . $asset_letter . "' ORDER BY a.asset_name"; $assets = $db->db_select($query); $smarty->assign("assets", $assets); $smarty->display("asset.tpl"); include("footer.php"); ?>