public static function browse_item() { $item = new Item(); $result = $item->get_all_items(); Engine::item_formating($result); }
<?php /* * Yes, I realize that this is hacky... */ namespace tatt; require_once 'tatt/webcommon.php'; $page->load_external_javascript_include("https://www.google.com/jsapi"); // This file displays the 25 most popular books (by checkout count) $items = Item::get_all_items(); $item_counts = array(); $item_array = array(); foreach($items as $item) { $item_array[$item->get_id()] = $item; $item_counts[$item->get_id()] = Item::checkout_count_by_id($item->get_id()); } // Sort the items so that the items with the most checkouts are on top // We use ASORT() to maintain the association to the indices arsort($item_counts, SORT_NUMERIC); // Build up an array of the top 25 items for use with Google Charts $itemcountjs = ''; $i = 0;