Exemple #1
0
 function paging($frontUrl, $backUrl, $currentPage, $rowsPerPage, $allRows)
 {
     global $langArray;
     if ($allRows <= $rowsPerPage && !check_debug()) {
         return '';
     }
     $paging = '<div class="pagination clr"><div class="page_numbers clr">';
     $pages = ceil($allRows / $rowsPerPage);
     if ($currentPage > 1) {
         $paging .= '<a href="' . $frontUrl . '' . ($currentPage - 1) . '' . $backUrl . '" title="前一页" class="previous_page"><i class="fa fa-chevron-left"></i></a>';
     }
     if ($pages > 10) {
         if ($currentPage == 1) {
             for ($i = 1; $i <= 10; $i++) {
                 $paging .= '<a href="' . $frontUrl . '' . $i . '' . $backUrl . '" ' . ($i == $currentPage ? ' class="current"' : ' ') . '>' . $i . '</a>';
             }
         } elseif ($currentPage == $pages) {
             for ($i = $pages - 10; $i <= $pages; $i++) {
                 $paging .= '<a href="' . $frontUrl . '' . $i . '' . $backUrl . '" ' . ($i == $currentPage ? ' class="current"' : ' ') . '>' . $i . '</a>';
             }
         } else {
             $start = $currentPage - 5;
             if ($start < 1) {
                 $start_at = 1;
                 $end = -1 * $start + 5 + $currentPage;
             } else {
                 $start_at = $start;
                 $end = $start_at + 10;
                 if ($end > $pages) {
                     $start_at = $start_at - ($end - $pages);
                     $end = $pages;
                 }
             }
             for ($i = $start_at; $i <= $end; $i++) {
                 $paging .= '<a href="' . $frontUrl . '' . $i . '' . $backUrl . '" ' . ($i == $currentPage ? ' class="selected"' : ' ') . '>' . $i . '</a>';
             }
         }
     } else {
         for ($i = 1; $i <= $pages; $i++) {
             $paging .= '<a href="' . $frontUrl . '' . $i . '' . $backUrl . '" ' . ($i == $currentPage ? ' class="selected"' : ' ') . '>' . $i . '</a>';
         }
     }
     if ($currentPage < $pages) {
         $paging .= '<a href="' . $frontUrl . '' . ($currentPage + 1) . '' . $backUrl . '"  title="后一页" class="next_page"><i class="fa fa-chevron-right"></i></a>';
     }
     $toPages = $currentPage * $rowsPerPage;
     if ($toPages > $allRows) {
         $toPages = $allRows;
     }
     return $paging . '</div><div class="page_tips">' . (($currentPage - 1) * $rowsPerPage + 1) . ' - ' . $toPages . ' ' . $langArray['of'] . ' ' . $allRows . '</div></div>';
 }
Exemple #2
0
$config['admin_template_data'] = $config['data_server'] . 'admin/' . $meta['admin_template'] . '/';
//后台模板资源目录
abr('domain', DOMAIN);
abr("root_path", ROOT_PATH);
abr("data_server", $config['data_server']);
abr("template_data", $config['template_data']);
abr("template_data_path", $config['template_data_path']);
abr("template_path", $config['template_path']);
abr("admin_template_data", $config['admin_template_data']);
abr("admin_template_data_path", $config['admin_template_data_path']);
abr("admin_template_path", $config['admin_template_path']);
#END;
/**
 * 执行时间 php debug
 */
if (check_debug()) {
    $execute = new execute();
    $execute->start(1);
    /*
     * Debug container
     */
    $debug = '<B>Debug container:</B><BR />';
}
#END;
/*
 * CACHE
 */
$cache = new cache();
$cache->cacheDir = CACHE;
global $cache;
/*