function display() { $lists = array(); $lists['parent'] = BidsHelperHtml::selectCategory('parent', array('name' => 'parent')); //var_dump($lists);exit; $this->assign('lists', $lists); parent::display(); }
function display() { $db = JFactory::getDBO(); $app = JFactory::getApplication(); $cfg = BidsHelperTools::getConfig(); $where = array(); $context = 'com_bids.bidsadminview.users'; $filter_order = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', '', 'cmd'); $filter_order_Dir = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '', 'word'); $search = $app->getUserStateFromRequest($context . 'search', 'search', '', 'string'); $limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'int'); $limitstart = $app->getUserStateFromRequest($context . 'limitstart', 'limitstart', 0, 'int'); // In case limit has been changed, adjust limitstart accordingly $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0; if (!$filter_order) { $filter_order = 'u.name'; } $order = ' ORDER BY ' . $filter_order . ' ' . $filter_order_Dir . ''; if ($search) { $where[] = " username LIKE '%" . $db->getEscaped($search) . "%' "; } // Build the where clause of the content record query $where = count($where) ? ' WHERE ' . implode(' AND ', $where) : ''; // Get the total number of records $query = "SELECT COUNT(*) " . "FROM #__users" . $where; $db->setQuery($query); $total = $db->loadResult(); // Create the pagination object jimport('joomla.html.pagination'); $page = new JPagination($total, $limitstart, $limit); $profileObject = BidsHelperTools::getUserProfileObject(); $profileTable = $profileObject->getIntegrationTable(); $profileKey = $profileObject->getIntegrationKey(); $profileFields = array('verified', 'powerseller'); if ($cfg->bid_opt_enable_acl) { $profileFields = array_merge($profileFields, array('isBidder', 'isSeller')); } $sqlFields = array(); foreach ($profileFields as $pf) { $field = $profileObject->getFilterField($pf); if ($field) { $sqlFields[] = 'p.' . $field . ' AS ' . $pf; } } // Get the users $query = "SELECT\r\n u.id as userid1, u.username as username,u.name as name, u.email AS email,\r\n p.id as profid, " . (count($sqlFields) ? implode(',', $sqlFields) . ',' : '') . "\r\n \t\t\t COUNT(DISTINCT a.id) AS nr_auctions,\r\n\r\n \t\t\t COUNT(DISTINCT btbl.id) as nr_closed_bids,\r\n\r\n \t\t\t COUNT(DISTINCT IF(a.close_offer,a.id,NULL)) AS nr_closed_offers,\r\n \t\t\t GROUP_CONCAT(DISTINCT IF(a.close_offer,a.id,NULL)) AS closed_offers,\r\n\r\n \t\t\t COUNT(DISTINCT IF(a.close_offer,NULL,a.id)) AS nr_open_offers,\r\n \t\t\t GROUP_CONCAT(DISTINCT IF(a.close_offer,NULL,a.id)) AS open_offers,\r\n\r\n \t\t\t COUNT(DISTINCT IF(a.featured='none',NULL,a.id)) AS nr_featured_offers,\r\n \t\t\t GROUP_CONCAT(DISTINCT IF(a.featured='none',NULL,a.id)) AS featured_offers,\r\n\r\n \t\t\t AVG(urate.rating) AS rating_user,\r\n \t\t\t u.block\r\n FROM #__users AS u\r\n LEFT JOIN " . $profileTable . " AS p ON u.id=p." . $profileKey . "\r\n LEFT JOIN #__bid_auctions AS a ON u.id=a.userid\r\n LEFT JOIN #__bid_rate AS urate ON u.id=urate.user_rated_id\r\n LEFT JOIN #__bids AS btbl ON u.id=btbl.userid AND btbl.accept=1 " . $where . " GROUP BY u.id " . $order; $db->setQuery($query, $page->limitstart, $page->limit); $rows = $db->loadObjectList(); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; $lists['search'] = $search; JHTML::_('behavior.tooltip'); $this->assignRef('lists', $lists); $this->assignRef('page', $page); $this->assignRef('rows', $rows); parent::display(); }
function display() { $app = JFactory::getApplication(); $db = JFactory::getDBO(); $id = JRequest::getInt('id', 0, 'default', 'int'); if (!$id) { $cid = JRequest::getVar('cid', array()); $id = $cid[0]; } $profile = BidsHelperTools::getUserProfileObject($id); $lists = array(); $db->setQuery("SELECT\r\n rating,count(*) as nr,\r\n auction_id, a.title as auction,\r\n voter_id, u.username\r\n FROM #__bid_rate\r\n LEFT JOIN #__bid_auctions AS a on auction_id = a.id\r\n LEFT JOIN #__users AS u on voter_id = u.id\r\n WHERE user_rated_id=" . $db->quote($id) . "\r\n GROUP BY rating\r\n ORDER BY rating"); $lists['ratings'] = $db->loadObjectList(); $db->setQuery("SELECT\r\n m.id,\r\n auction_id, a.title as auction,\r\n u.id as from_id, u.username as fromuser,\r\n u2.id as to_id, u2.username as touser,\r\n m.modified,\r\n m.message,\r\n m.published\r\n\r\n FROM #__bid_messages as m\r\n LEFT JOIN #__bid_auctions AS a on m.auction_id = a.id\r\n LEFT JOIN #__users AS u on m.userid1 = u.id\r\n LEFT JOIN #__users AS u2 on m.userid2 = u2.id\r\n WHERE userid1=" . $db->quote($id) . " OR userid2 = " . $db->quote($id)); $lists['messages'] = $db->loadObjectList(); $query = "SELECT COUNT(*) AS nr_auctions,MAX(modified) AS last_auction_date FROM #__bid_auctions WHERE userid='{$id}'"; $db->setQuery($query); $res = $db->loadAssocList(); $lists['nr_auctions'] = $res[0]['nr_auctions']; $lists['last_auction_placed'] = $res[0]['last_auction_date']; $query = "select count(*) as nr_bids_won from #__bids where userid='{$id}' and accept=1 "; $db->setQuery($query); $res = $db->loadAssocList(); $lists['nr_won_bids'] = $res[0]['nr_bids_won']; $query = "select count(*) as nr_bids, max(modified) as last_date from #__bids where userid='{$id}' "; $db->setQuery($query); $res = $db->loadAssocList(); $lists['nr_bids'] = $res[0]['nr_bids']; $lists['last_bid_placed'] = $res[0]['last_date']; $query = "select c.*, a.title, a.BIN_price, cr.name as currency\r\n\t\tFROM #__bids as c\r\n\t\tLEFT join #__bid_auctions as a on c.auction_id = a.id\r\n\t\tLEFT join #__bid_currency as cr on a.currency = cr.id\r\n\t\tWHERE c.userid = '{$id}'"; $db->setQuery($query); $lists['bids'] = $db->loadObjectList(); $query = "SELECT * FROM #__bid_payment_balance WHERE userid=" . $db->quote($id); $db->setQuery($query); $r = $db->loadObject(); $lists['balance'] = new stdClass(); $lists['balance']->balance = isset($r->balance) ? $r->balance : 0; $lists['balance']->currency = isset($r->currency) ? $r->currency : ''; $u = JTable::getInstance('user'); $u->load($profile->id); jimport('joomla.html.pane'); $pane = JPane::getInstance('sliders', array('allowAllClose' => true)); JHTML::_('behavior.tooltip'); $this->assignRef('lists', $lists); $this->assignRef('pane', $pane); $this->assignRef('u', $u); $this->assignRef('user', $profile); parent::display(); }
function display($tpl = null) { $db = JFactory::getDBO(); $db->setQuery("select * from #__bid_paysystems where enabled=1"); $gateways = $db->loadObjectList(); $db->setQuery("select * from #__bid_pricing where enabled=1"); $items = $db->loadObjectList(); $db->setQuery("select * from #__bid_cronlog where event='cron' order by logtime desc limit 1"); $log = $db->loadObject(); $cfg = JTheFactoryHelper::getConfig(); $this->assignref('gateways', $gateways); $this->assignref('items', $items); if ($log) { $this->assignref('latest_cron_time', $log->logtime); } else { $this->assign('latest_cron_time', JText::_('COM_BIDS_NEVER')); } $this->assignref('cfg', $cfg); parent::display($tpl); }
function display() { $database = JFactory::getDBO(); $app = JFactory::getApplication(); $limit = JRequest::getInt('limit', $app->getCfg('list_limit')); $limitstart = JRequest::getInt('limitstart', 0); $query = "SELECT COUNT(*)" . "\n FROM #__users a where a.usertype!='Super Administrator' and a.usertype!='Administrator'"; $database->setQuery($query); $total = $database->loadResult(); jimport('joomla.html.pagination'); $pageNav = new JPagination($total, $limitstart, $limit); $query = "select d.*\r\n\t\t\t from #__users d\r\n\t\t\t where d.usertype!='Super Administrator' and d.usertype!='Administrator' and d.block!=1\r\n\t\t\t "; $database->setQuery($query, $pageNav->limitstart, $pageNav->limit); $userlist = $database->loadObjectList(); $totals = array(); $query = "select count(distinct userid) from #__bid_auctions"; $database->setQuery($query); $totals['a_users'] = $database->loadResult(); $query = "select count(*) from #__users"; $database->setQuery($query); $totals['r_users'] = $database->loadResult(); $query = "select count(*) from #__bid_auctions where close_offer !=1 and close_by_admin !=1 and published !=0"; $database->setQuery($query); $totals['a_auctions'] = $database->loadResult(); $query = "select count(*) from #__bid_auctions where close_offer =1 or close_by_admin =1"; $database->setQuery($query); $totals['c_auctions'] = $database->loadResult(); $query = "select count(*) from #__bids b\r\n\t left join #__bid_auctions a on b.auction_id=a.id\r\n\t where a.close_offer <>1 and a.close_by_admin <>1"; $database->setQuery($query); $totals['a_bids'] = $database->loadResult(); $query = "select count(*) from #__bids where accept=1"; $database->setQuery($query); $totals['ac_bids'] = $database->loadResult(); JHTML::_('behavior.tooltip'); $this->assignRef('userlist', $userlist); $this->assignRef('totals', $totals); $this->assignRef('pageNav', $pageNav); parent::display(); }
function display($tpl = null) { parent::display($tpl); }
function display($tpl = null) { JHtml::_('behavior.framework'); parent::display($tpl); }
function display($id) { $database = JFactory::getDBO(); $my = JFactory::getUser(); $modelAuction = $this->getModel('auction'); $auction = $modelAuction->get('auction'); $lists = array(); $lang = JFactory::getLanguage(); $lang->load('com_bids', JPATH_SITE); $bidCfg = BidsHelperTools::getConfig(); $lists = array(); $lists['title'] = JHTML::_('editauction.inputTitle', $auction, 1); $lists['cats'] = JHTML::_('editauction.selectCategory', $auction, 1); //$lists['cats'] = JHTML::_('factorycategory.select','cat','',$auction->cat,false,false,true); $lists['published'] = JHTML::_('editauction.selectPublished', $auction, 1); $lists['tags'] = JHTML::_('editauction.inputTags', $auction, 1); $lists['shortDescription'] = JHTML::_('editauction.inputShortDescription', $auction, 1); $lists['description'] = JHTML::_('editauction.inputDescription', $auction, 1); $lists['auctiontype'] = JHTML::_('editauction.selectAuctionType', $auction, 1); $lists['automatic'] = JHTML::_('editauction.inputAutomatic', $auction, 1); $lists['binType'] = JHTML::_('editauction.selectBINType', $auction, 1); $lists['binPrice'] = JHTML::_('editauction.inputBINPrice', $auction, 1); $lists['autoAcceptBIN'] = JHTML::_('editauction.selectAutoAcceptBIN', $auction, 1); $lists['quantity'] = JHTML::_('editauction.inputQuantity', $auction, 1); $lists['enableSuggestions'] = JHTML::_('editAuction.selectEnableSuggestions', $auction, 1); $lists['minNumberSuggestions'] = JHTML::_('editAuction.inputMinNumberSuggestions', $auction, 1); $lists['currency'] = JHTML::_('editauction.selectCurrency', $auction, 1); $lists['initialPrice'] = JHTML::_('editauction.inputInitialPrice', $auction, 1); $lists['showMaxPrice'] = JHTML::_('editauction.selectShowMaxPrice', $auction, 1); $lists['showNumberBids'] = JHTML::_('editauction.selectShowNumberBids', $auction, 1); $lists['reservePrice'] = JHTML::_('editauction.inputReservePrice', $auction, 1); $lists['showReservePrice'] = JHTML::_('editauction.selectShowReservePrice', $auction, 1); $lists['minIncrease'] = JHTML::_('editauction.inputMinIncrease', $auction, 1); $lists['shippingPrice'] = JHTML::_('editAuction.inputShipmentPrice', $auction, 1); $lists['uploadImages'] = JHTML::_('editauction.uploadImages', $auction, 1); $lists['paymentInfo'] = JHTML::_('editauction.textPaymentInfo', $auction, 1); $lists['shipmentInfo'] = JHTML::_('editauction.textShipmentInfo', $auction, 1); //$lists[''] = JHTML::_('editauction.',$auction); $lists['currentLocalTime_field'] = JHTML::_('editAuction.currentLocalTime', $auction); $lists['startDate_field'] = JHTML::_('editAuction.editStartDate', $auction, 1); $lists['endDate_field'] = JHTML::_('editAuction.editEndDate', $auction, 1); $lists['editFormTitle'] = JHTML::_('editAuction.formTitle', $auction); $auction->links = JHTML::_('auctiondetails.createLinks', $auction); $fields = CustomFieldsFactory::getFieldsList("auctions"); $fields_html = JHtml::_('listauctions.displayfieldshtml', $auction, $fields); $custom_fields_with_cat = $modelAuction->getNrFieldsWithFilters(); $this->assign("custom_fields", $fields); $this->assign("custom_fields_html", $fields_html); $this->assign("custom_fields_with_cat", $custom_fields_with_cat ? 1 : 0); $this->assign('lists', $lists); $this->assign('auction', $auction); $this->assign('bidCfg', $bidCfg); JHtml::_('behavior.framework'); JHtml::_('behavior.tooltip'); JHtml::_('behavior.calendar'); JHTML::_('behavior.formvalidation'); JHtml::script(JURI::root() . 'components/com_bids/js/auctions.js'); JHtml::script(JURI::root() . 'components/com_bids/js/date.js'); JHtml::script(JURI::root() . 'components/com_bids/js/multifile.js'); JHtml::script(JURI::root() . 'components/com_bids/js/auction_edit.js'); JHtml::script(JURI::root() . 'components/com_bids/js/jquery/jquery.js'); JHtml::script(JURI::root() . 'components/com_bids/js/jquery/jquery.noconflict.js'); JHTML::script(JURI::root() . 'components/com_bids/js/jquery/clock/jquery.clock.js'); JHtml::script(JURI::base() . 'index.php?option=com_bids&task=jsgen&view=editauction&format=raw'); JHtml::stylesheet(JURI::root() . 'components/com_bids/templates/default/bid_template.css'); $user = BidsHelperTools::getUserProfileObject($auction->userid); $auction->userdetails = $user; $query = "update #__bid_messages set wasread=1 where userid2='{$my->id}' and auction_id='{$id}'"; $database->setQuery($query); $database->query(); $query = "update #__bid_auctions set newmessages=0 where id='{$id}'"; $database->setQuery($query); $database->query(); $feat[] = JHTML::_('select.option', 'none', JText::_('COM_BIDS_NONE')); $feat[] = JHTML::_('select.option', 'featured', JText::_('COM_BIDS_PAYMENT_FEATURED')); $lists['featured'] = JHTML::_('select.genericlist', $feat, 'featured', 'class="inputbox" id="featured" style="width:120px;"', 'value', 'text', $auction->featured); $database = JFactory::getDBO(); $my = JFactory::getUser(); $database->setQuery("select max(bid_price) from #__bids where auction_id='{$auction->id}'"); $auction->max_bid = $database->loadResult(); $database->setQuery("select * from #__bid_pictures where auction_id='{$auction->id}'"); $photos = $database->loadObjectList(); $query = "select m.*,u1.username as fromuser, u2.username as touser from #__bid_messages m\r\n left join #__users u1 on u1.id = m.userid1\r\n left join #__users u2 on u2.id = m.userid2\r\n where m.auction_id='{$auction->id}'\r\n\r\n "; // and (m.userid1 = '$my->id' or m.userid2 = '$my->id') */ $database->setQuery($query); $adminMessages = $database->loadObjectList(); $query = "\r\n SELECT a.*,b.username, bp.max_proxy_price\r\n FROM `#__bids` AS a\r\n LEFT JOIN `#__users` b\r\n ON a.userid=b.id\r\n LEFT JOIN `#__bid_proxy` AS bp\r\n ON a.id_proxy=bp.id AND bp.active=1\r\n WHERE a.auction_id=" . intval($auction->id); $database->setQuery($query); $bids = $database->loadObjectList(); JHTML::_('behavior.modal'); JHTML::_('behavior.tooltip'); jimport('joomla.filesystem.file'); $this->assignRef('lists', $lists); $this->assignRef('bids', $bids); $this->assignRef('adminMessages', $adminMessages); $this->assignRef('photos', $photos); $this->assignRef('user', $user); $this->assignRef('auction', $auction); parent::display(); }
function display() { parent::display(); }
function display($tpl = null) { $lang = JFactory::getLanguage(); $lang->load('com_bids', JPATH_SITE); $model = $this->getModel('auction'); $auction = $model->get('auction'); $bidCfg = BidsHelperTools::getConfig(); $lists = array(); $lists['title'] = JHTML::_('editauction.inputTitle', $auction, 1); $lists['cats'] = JHTML::_('editauction.selectCategory', $auction, 1); //$lists['cats'] = JHTML::_('factorycategory.select','cat','',$auction->cat,false,false,true); $lists['published'] = JHTML::_('editauction.selectPublished', $auction, 1); $lists['tags'] = JHTML::_('editauction.inputTags', $auction, 1); $lists['shortDescription'] = JHTML::_('editauction.inputShortDescription', $auction, 1); $lists['description'] = JHTML::_('editauction.inputDescription', $auction, 1); $lists['auctiontype'] = JHTML::_('editauction.selectAuctionType', $auction, 1); $lists['automatic'] = JHTML::_('editauction.inputAutomatic', $auction, 1); $lists['binType'] = JHTML::_('editauction.selectBINType', $auction, 1); $lists['binPrice'] = JHTML::_('editauction.inputBINPrice', $auction, 1); $lists['autoAcceptBIN'] = JHTML::_('editauction.selectAutoAcceptBIN', $auction, 1); $lists['quantity'] = JHTML::_('editauction.inputQuantity', $auction, 1); $lists['enableSuggestions'] = JHTML::_('editAuction.selectEnableSuggestions', $auction, 1); $lists['minNumberSuggestions'] = JHTML::_('editAuction.inputMinNumberSuggestions', $auction, 1); $lists['currency'] = JHTML::_('editauction.selectCurrency', $auction, 1); $lists['initialPrice'] = JHTML::_('editauction.inputInitialPrice', $auction, 1); $lists['showMaxPrice'] = JHTML::_('editauction.selectShowMaxPrice', $auction, 1); $lists['showNumberBids'] = JHTML::_('editauction.selectShowNumberBids', $auction, 1); $lists['reservePrice'] = JHTML::_('editauction.inputReservePrice', $auction, 1); $lists['showReservePrice'] = JHTML::_('editauction.selectShowReservePrice', $auction, 1); $lists['minIncrease'] = JHTML::_('editauction.inputMinIncrease', $auction, 1); $lists['shippingPrice'] = JHTML::_('editAuction.inputShipmentPrice', $auction, 1); $lists['uploadImages'] = JHTML::_('editauction.uploadImages', $auction, 1); $lists['paymentInfo'] = JHTML::_('editauction.textPaymentInfo', $auction, 1); $lists['shipmentInfo'] = JHTML::_('editauction.textShipmentInfo', $auction, 1); //$lists[''] = JHTML::_('editauction.',$auction); $lists['currentLocalTime_field'] = JHTML::_('editAuction.currentLocalTime', $auction); $lists['startDate_field'] = JHTML::_('editAuction.editStartDate', $auction, 1); $lists['endDate_field'] = JHTML::_('editAuction.editEndDate', $auction, 1); $lists['editFormTitle'] = JHTML::_('editAuction.formTitle', $auction); $auction->links = JHTML::_('auctiondetails.createLinks', $auction); $fields = CustomFieldsFactory::getFieldsList("auctions"); $fields_html = JHtml::_('listauctions.displayfieldshtml', $auction, $fields); $custom_fields_with_cat = $model->getNrFieldsWithFilters(); $this->assign("custom_fields", $fields); $this->assign("custom_fields_html", $fields_html); $this->assign("custom_fields_with_cat", $custom_fields_with_cat ? 1 : 0); $this->assign('lists', $lists); $this->assign('auction', $auction); $this->assign('bidCfg', $bidCfg); JHtml::_('behavior.framework'); JHtml::_('behavior.tooltip'); JHtml::_('behavior.calendar'); JHTML::_('behavior.formvalidation'); JHtml::script(JURI::root() . 'components/com_bids/js/auctions.js'); JHtml::script(JURI::root() . 'components/com_bids/js/date.js'); JHtml::script(JURI::root() . 'components/com_bids/js/multifile.js'); JHtml::script(JURI::root() . 'components/com_bids/js/auction_edit.js'); JHtml::script(JURI::root() . 'components/com_bids/js/jquery/jquery.js'); JHtml::script(JURI::root() . 'components/com_bids/js/jquery/jquery.noconflict.js'); JHTML::script(JURI::root() . 'components/com_bids/js/jquery/clock/jquery.clock.js'); JHtml::script(JURI::base() . 'index.php?option=com_bids&task=jsgen&view=editauction&format=raw'); JHtml::stylesheet(JURI::root() . 'components/com_bids/templates/default/bid_template.css'); parent::display($tpl); }
function display($tpl = null) { $app = JFactory::getApplication(); $db = JFactory::getDBO(); $my = JFactory::getUser(); $where = array(); $context = 'com_bids.jbidsdminview.offers.'; $keyword = $app->getUserStateFromRequest($context . 'keyword', 'keyword', '', 'string'); $category = $app->getUserStateFromRequest($context . 'category', 'category', '', 'string'); $filter_authorid = $app->getUserStateFromRequest($context . 'filter_authorid', 'filter_authorid', '', 'string'); $filter_bidtype = $app->getUserStateFromRequest($context . 'filter_bidtype', 'filter_bidtype', 0, 'int'); $filter_order = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'start_date', 'cmd'); $filter_order_Dir = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', 'DESC', 'word'); $limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'int'); $limitstart = $app->getUserStateFromRequest($context . 'limitstart', 'limitstart', 0, 'int'); // In case limit has been changed, adjust limitstart accordingly $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0; if (!$filter_order) { $filter_order = 'a.title'; } // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; $order = ' ORDER BY ' . $filter_order . ' ' . $filter_order_Dir . ''; if ($keyword) { $where[] = " a.title LIKE '%" . $db->escape($keyword) . "%' OR a.shortdescription LIKE '%" . $db->escape($keyword) . "%' OR a.description LIKE '%" . $db->escape($keyword) . "%' "; } if ($filter_authorid) { $where[] = " u.username LIKE '%" . $db->escape($filter_authorid) . "%' "; } if ($category) { $where[] = 'a.cat=' . $db->quote($category); } switch ($filter_bidtype) { case 1: $where[] = " a.published=1 AND a.close_offer=0 AND a.close_by_admin=0 AND a.end_date>=UTC_TIMESTAMP() "; break; case 2: $where[] = " a.published=1 AND a.close_offer=0 AND a.close_by_admin=0 AND a.end_date<UTC_TIMESTAMP() "; break; case 3: $where[] = " a.published=1 AND a.close_offer=1 AND a.close_by_admin=0 "; break; case 4: $where[] = " a.published=0 AND a.close_by_admin=0 "; break; case 5: $where[] = " a.close_by_admin=1 "; break; } // Build the where clause of the content record query $where = count($where) ? ' WHERE ' . implode(' AND ', $where) : ''; // Get the total number of records $query = 'SELECT COUNT(1)' . ' FROM #__bid_auctions AS a' . ' LEFT JOIN #__categories AS cc ON cc.id = a.cat ' . $where; $db->setQuery($query); $total = $db->loadResult(); // Create the pagination object jimport('joomla.html.pagination'); $pageNav = new JPagination($total, $limitstart, $limit); // Get the auctions $query = 'SELECT a.*, cc.title AS name, u.username AS username, count(bids.id) as nr_bids, max(bids.bid_price) as min_bid, COUNT(DISTINCT bids.userid) as nr_bidders, COUNT(DISTINCT pix.id ) as nr_pix, 1-MIN(msg.wasread) AS newmessages FROM #__bid_auctions AS a LEFT JOIN `#__bids` AS bids ON `bids`.`auction_id`=`a`.`id` LEFT JOIN #__users AS bu ON bu.id = bids.userid LEFT JOIN #__categories AS cc ON cc.id = a.cat LEFT JOIN #__users AS u ON u.id = a.userid LEFT JOIN #__bid_pictures AS pix ON pix.auction_id = a.id LEFT JOIN #__bid_messages AS msg ON msg.auction_id = a.id AND msg.userid2 = \'' . $my->id . '\' ' . $where . ' GROUP BY a.id ' . $order; $db->setQuery($query, $pageNav->limitstart, $pageNav->limit); $rows = $db->loadObjectList(); $filters = array(); $filters['keyword'] = '<input type="text" name="keyword" value="' . $keyword . '" />'; $filters['filter_authorid'] = '<input type="text" name="filter_authorid" value="' . $filter_authorid . '" />'; $filters['category'] = BidsHelperHtml::selectCategory('category', array('name' => 'category', 'select' => $category)); $closeid[] = JHTML::_('select.option', '0', JText::_('COM_BIDS_ALL_OFFERS')); $closeid[] = JHTML::_('select.option', '1', JText::_('COM_BIDS_ACTIVE')); $closeid[] = JHTML::_('select.option', '2', JText::_('COM_BIDS_NR_EXPIRED')); $closeid[] = JHTML::_('select.option', '3', JText::_('COM_BIDS_CLOSED')); $closeid[] = JHTML::_('select.option', '4', "Cancelled (Unpublished)"); $closeid[] = JHTML::_('select.option', '5', "Blocked (Unpublished)"); $lists['filter_bidtype'] = JHTML::_('select.genericlist', $closeid, 'filter_bidtype', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'value', 'text', $filter_bidtype); JHTML::_('behavior.tooltip'); $this->assignRef('lists', $lists); $this->assignRef('filters', $filters); $this->assignRef('rows', $rows); $this->assignRef('pageNav', $pageNav); parent::display($tpl); }