Esempio n. 1
0
function dailyattendance()
{
    global $mainframe;
    $db =& JFactory::getDBO();
    $filter_order = $mainframe->getUserStateFromRequest($option . 'filter_order', 'filter_order', 'id', 'cmd');
    $filter_order_Dir = $mainframe->getUserStateFromRequest($option . 'filter_order_Dir', 'filter_order_Dir', '', 'word');
    $filter_state = $mainframe->getUserStateFromRequest($option . 'filter_state', 'filter_state', '', 'word');
    $users = $mainframe->getUserStateFromRequest($option . 'users', 'users', '', 'int');
    $month = $mainframe->getUserStateFromRequest($option . 'month', 'month', '', 'int');
    $year = $mainframe->getUserStateFromRequest($option . 'year', 'year', '', 'int');
    $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
    $limitstart = $mainframe->getUserStateFromRequest($option . '.limitstart', 'limitstart', 0, 'int');
    $where = array();
    if ($users) {
        $where[] = 'users_id="' . $users . '"';
    }
    if ($month) {
        $where[] = 'month="' . $month . '"';
    }
    if ($year) {
        $where[] = 'year="' . $year . '"';
    }
    $where = count($where) ? ' WHERE ' . implode(' AND ', $where) : '';
    if ($filter_order == 'id') {
        $orderby = ' ORDER BY id';
    } else {
        $orderby = ' ORDER BY ' . $filter_order . ' ' . $filter_order_Dir . ', id';
    }
    // get the total number of records
    $query = 'SELECT COUNT(*)' . ' FROM #__intranet_dailyattendance' . $where;
    $db->setQuery($query);
    $total = $db->loadResult();
    jimport('joomla.html.pagination');
    $pageNav = new JPagination($total, $limitstart, $limit);
    $query = "SELECT * FROM #__intranet_dailyattendance" . $where . $orderby;
    $db->setQuery($query, $pageNav->limitstart, $pageNav->limit);
    $rows = $db->loadObjectList();
    if ($db->getErrorNum()) {
        echo $db->stderr();
        return false;
    }
    // table ordering
    $lists['order_Dir'] = $filter_order_Dir;
    $lists['order'] = $filter_order;
    // search filter
    $lists['users'] = $users;
    $lists['month'] = $month;
    $lists['year'] = $year;
    IntranetHTML::dailyattendance(&$rows, &$pageNav, &$lists);
}
Esempio n. 2
0
     IntranetHTML::calendar();
     break;
 case 'newattendance':
     newattendance();
     break;
 case 'oldattendance':
     oldattendance();
     break;
 case 'attendance':
     IntranetHTML::attendance();
     break;
 case 'weeklyattendance':
     IntranetHTML::weeklyattendance();
     break;
 case 'dailyattendance':
     IntranetHTML::dailyattendance();
     break;
 case 'leaverequest':
     IntranetHTML::leaverequest();
     break;
 case 'leaves':
     IntranetHTML::leaves();
     break;
 case 'newrequest':
     IntranetHTML::newrequest();
     break;
 case 'requestsave':
     requestsave();
     break;
 case 'payslip':
     IntranetHTML::payslip();