Ejemplo n.º 1
0
function wizard_elements($option)
{
    global $mainframe;
    $limit = JRequest::getVar('limit', $mainframe->getCfg('list_limit'));
    $limitstart = JRequest::getVar('limitstart', 0);
    // count entries
    $database =& JFactory::getDBO();
    $database->setQuery("SELECT count(*) FROM #__chrono_contact_elements");
    $total = $database->loadResult();
    echo $database->getErrorMsg();
    jimport('joomla.html.pagination');
    $pageNav = new JPagination($total, $limitstart, $limit);
    # main database query
    $database->setQuery("SELECT * FROM #__chrono_contact_elements ORDER BY id LIMIT {$pageNav->limitstart},{$pageNav->limit}");
    $rows = $database->loadObjectList();
    if ($database->getErrorNum()) {
        JError::raiseWarning(100, $database->stderr());
        $mainframe->redirect("index2.php?option={$option}");
    }
    HTML_ChronoContact::wizard_elements($rows, $pageNav, $option);
}