<?php

class DadosPaginas
{
    const PG_TOPO_SISTEMA = 'sistema/temas/topoSistema';
    const PG_TOPO_RELATORIO = 'sistema/temas/topoRelatorios';
    const LOGIN_SISTEMA = 'principal/loginSistema';
    const LOGIN_SITE = 'principal/loginSite';
    const LOGIN_SITE_MOBILE = 'principal/loginSiteMobile';

    const PG_LOGIN_SITE = 'site/temas/loginSite';
    const FORM_VALIDATION = 'form_validation';

    public static function layoutPaginacao($page, $totalRegistros, $objeto,$registrosPorPagina = 9 ) {

        $objeto->load->library('pagination');

        $config['base_url'] = base_url() . '' . $page;
        $config['total_rows'] = $totalRegistros;
        $config['per_page'] = $registrosPorPagina;
        $config['use_page_numbers'] = TRUE;
        $config['page_query_string'] = FALSE;

        $start = (int)$objeto->uri->segment(3) * $config['per_page'] + 1;
        $end = ($objeto->uri->segment(3) == floor($config['total_rows'] / $config['per_page'])) ? $config['total_rows'] : (int)$objeto->uri->segment(3) * $config['per_page'] + $config['per_page'];

        $objeto->data['result_count'] = " <li class='prev page'> Mostrar " . $start . " - " . $end . " de " . $config['total_rows'] . " Registros </li>";

        $config['next_link'] = 'próximo <i class="fa fa-forward"></i>';
        $config['prev_link'] = '<i class="fa fa-backward"></i> Anterior';
        $config['first_link'] = '<i class="fa fa-step-backward"></i> Primeiro';

        $config['full_tag_open'] = '<ul class="pagination">';
        $config['first_tag_open'] = '<li class="prev page">';
        $config['first_tag_close'] = '</li>' . "\n";
        $config['last_link'] = 'Ultimo  <i class="fa fa-step-forward"></i>';
        $config['last_tag_open'] = '<li class="next page">';
        $config['last_tag_close'] = '</li>' . "\n";
        $config['next_tag_open'] = '<li class="next page">';
        $config['next_tag_close'] = '</li>' . "\n";
        $config['prev_tag_open'] = '<li class="prev page">';
        $config['prev_tag_close'] = '</li>' . "\n";
        $config['cur_tag_open'] = '<li class="active"><a href="">';
        $config['cur_tag_close'] = '</a></li>';
        $config['num_tag_open'] = '<li class="page">';
        $config['num_tag_close'] = '</li>' . "\n";
        $config['full_tag_close'] = '</ul>';


        return $config;

    }

    public static function serverRoot() {
        return $_SERVER["DOCUMENT_ROOT"] . "/lider/";
    }
}

?>