Вход Регистрация
Файл: Source/admin/pages.php
Строк: 68
<?php
/*
 * Script name: Points4Prize
 * Author: Soft Projects
 * Date created: 15/07/2015
 */
 
include "common.php";
head();
?>
<div class="body content rows scroll-y">
    <!-- Page header -->
    <div class="page-heading">
        <h1><b>Pages</b> </h1>
    </div>
    <!-- End page header -->
    <!-- Begin info box -->
    <div class="row">
        <div class="col-md-12">
            <div class="box-info">
                <h2>Pages</h2>
                <a href="add_page.php" class="btn btn-success"><i class="fa fa-plus"></i> Add page</a>
                <hr />
                <?php
                
include("Classes/Easy_Pagination.php");

// how many records should be displayed on a page?
                
$records_per_page 10;

// instantiate the pagination object
                
$pagination = new Easy_Pagination();

// the MySQL statement to fetch the rows

                
$MySQL 'SELECT SQL_CALC_FOUND_ROWS * FROM pages LIMIT
. (($pagination->get_page() - 1) * $records_per_page) . ', ' $records_per_page '
'
;

// if query could not be executed
                
if (!($result = @mysql_query($MySQL))) {

// stop execution and display error message
                    
die(mysql_error());
                }

// fetch the total number of records in the table
                
$rows mysql_fetch_assoc(mysql_query('SELECT FOUND_ROWS() AS rows'));

// pass the total number of records to the pagination class
                
$pagination->records($rows['rows']);

// records per page
                
$pagination->records_per_page($records_per_page);

                
$page $pagination->get_page();
                
?>
                <!-- Table -->
                <table class="table">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>Title</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php
                        $index 
1;
                        
$begin = ($page $records_per_page) - $records_per_page;
                        for (
$i 0$i mysql_num_rows($result); ++$i) {
                            
$info mysql_fetch_array($result);
                            
$rank $i $begin;
                            
?>
                            <tr <?php echo $index++ % ' class="active"' '' ?>>
                                <td><?php echo $info['id'?></td> 
                                <td style="width:50%;"><?php echo $info['title'?></td>
                                <td><a href="edit_page.php?id=<?php echo $info['id']; ?>" class="btn btn-success">Edit page</a> 
                                    <a href="delete_page.php?id=<?php echo $info['id']; ?>" class="btn btn-danger">Delete page</a></td> 
                            </tr>
                            <?php
                        
}
                        
?>
                    </tbody>
                </table> 

                <?php
// show the pagination links
                
$pagination->render();
                
?>    

            </div>
            <?php
            footer
();
            
?>
        </div> 
    </div>
Онлайн: 1
Реклама