Example #1
0
    <div class="table-responsive">
        <table class="table table-striped table-hover">
            <thead>
            <tr>
                <th>#</th>
                <th>Title</th>
                <th>Edit</th>
                <th>Delete</th>
            </tr>
            </thead>
            <tbody>
            <?php 
$pagination = new Paginator();
$pagination_limit = 10;
$pages = $pagination->pagination($pagination_limit, 'page');
foreach ($pages as $page) {
    echo '<tr>';
    echo '<td>' . $page['id'] . '</td>';
    echo '<td>' . $page['title'] . '</td>';
    echo '<td><a class="btn btn-warning" href="' . BASE_URL . '/admin/pages/edit?id=' . $page['id'] . '">Edit</a></td>';
    echo '<td><a class="delete btn btn-danger" href="' . BASE_URL . '/admin/pages/delete?id=' . $page['id'] . '">Delete</a></td>';
    echo '</tr>';
}
?>
            </tbody>
        </table>
        <?php 
$pagination->pagination_links($pagination_limit, 'page');
?>
    </div>
</div>
Example #2
0
    <div class="table-responsive">
        <table class="table table-striped table-hover">
            <thead>
            <tr>
                <th>#</th>
                <th>Email</th>
                <th>Edit</th>
                <th>Delete</th>
            </tr>
            </thead>
            <tbody>
            <?php 
$pagination = new Paginator();
$pagination_limit = 10;
$users = $pagination->pagination($pagination_limit, 'user');
foreach ($users as $user) {
    echo '<tr>';
    echo '<td>' . $user['id'] . '</td>';
    echo '<td>' . $user['email'] . '</td>';
    echo '<td><a class="btn btn-warning" href="' . BASE_URL . '/admin/users/edit?id=' . $user['id'] . '">Edit</a></td>';
    echo '<td><a class="delete btn btn-danger" href="' . BASE_URL . '/admin/users/delete?id=' . $user['id'] . '">Delete</a></td>';
    echo '</tr>';
}
?>
            </tbody>
        </table>
        <?php 
$pagination->pagination_links($pagination_limit, 'user');
?>
    </div>
</div>
Example #3
0
    <div class="table-responsive">
        <table class="table table-striped table-hover">
            <thead>
            <tr>
                <th>#</th>
                <th>Title</th>
                <th>Edit</th>
                <th>Delete</th>
            </tr>
            </thead>
            <tbody>
            <?php 
$pagination = new Paginator();
$pagination_limit = 10;
$categories = $pagination->pagination($pagination_limit, 'category');
foreach ($categories as $category) {
    echo '<tr>';
    echo '<td>' . $category['id'] . '</td>';
    echo '<td>' . $category['title'] . '</td>';
    echo '<td><a class="btn btn-warning" href="' . BASE_URL . '/admin/categories/edit?id=' . $category['id'] . '">Edit</a></td>';
    echo '<td><a class="delete btn btn-danger" href="' . BASE_URL . '/admin/categories/delete?id=' . $category['id'] . '">Delete</a></td>';
    echo '</tr>';
}
?>
            </tbody>
        </table>
        <?php 
$pagination->pagination_links($pagination_limit, 'category');
?>
    </div>
</div>
Example #4
0
    <h1 class="page-header">Welcome</h1>
    <br/>

    <?php 
$pagination = new Paginator();
$pagination_limit = 3;
$posts = $pagination->pagination($pagination_limit, 'post', ' WHERE status = 1');
foreach ($posts as $post) {
    if (!empty($post['featured'])) {
        echo '<a href="' . BASE_URL . '/blog/' . $post['id'] . '/' . $post['slug'] . '"><img class="img-responsive" src="' . BASE_URL . '/gw-content/uploads/' . $post['featured'] . '" alt="' . $post['title'] . '" /></a>';
    }
    echo '<h2><a href="' . BASE_URL . '/blog/' . $post['id'] . '/' . $post['slug'] . '">' . $post['title'] . '</a></h2>';
    $categories = db_select("SELECT * FROM category WHERE id in (" . $post['category_id'] . ")");
    echo '<div class="small">';
    $created_date = $post['created_date'];
    $posted_date = date("F jS, Y", strtotime($created_date));
    echo '<span class="glyphicon glyphicon-calendar"></span>&nbsp;' . $posted_date;
    echo '&nbsp;&nbsp;';
    echo '<span class="glyphicon glyphicon-folder-open"></span>&nbsp;&nbsp;';
    foreach ($categories as $category) {
        echo '<a href="' . BASE_URL . '/blog/category/' . $category['id'] . '/' . $category['slug'] . '">' . $category['title'] . '</a>&nbsp;';
    }
    echo '</div>';
    $body = Post::read_more($post['body'], 50);
    echo $body;
    echo '<hr class="featurette-divider">';
}
//Pagination links
$pagination->pagination_links($pagination_limit, 'post', ' WHERE status = 1');
?>
</div>
Example #5
0
    <div class="table-responsive">
        <table class="table table-striped table-hover">
            <thead>
            <tr>
                <th>#</th>
                <th>Title</th>
                <th>Edit</th>
                <th>Delete</th>
            </tr>
            </thead>
            <tbody>
            <?php 
$pagination = new Paginator();
$pagination_limit = 10;
$posts = $pagination->pagination($pagination_limit, 'post');
foreach ($posts as $post) {
    echo '<tr>';
    echo '<td>' . $post['id'] . '</td>';
    echo '<td>' . $post['title'] . '</td>';
    echo '<td><a class="btn btn-warning" href="' . BASE_URL . '/admin/posts/edit?id=' . $post['id'] . '">Edit</a></td>';
    echo '<td><a class="delete btn btn-danger" href="' . BASE_URL . '/admin/posts/delete?id=' . $post['id'] . '">Delete</a></td>';
    echo '</tr>';
}
?>
            </tbody>
        </table>
        <?php 
$pagination->pagination_links($pagination_limit, 'post');
?>
    </div>
</div>
Example #6
0
?>
</p>
    <?php 
$searched_id = $category_lookup->category_id_search($category['id'], $id);
$pagination = new Paginator();
$pagination_limit = 3;
$posts = $pagination->pagination($pagination_limit, 'post', ' WHERE category_id = ' . $searched_id . ' AND status = 1');
foreach ($posts as $post) {
    if (!empty($post['featured'])) {
        echo '<a href="' . BASE_URL . '/blog/' . $post['id'] . '/' . $post['slug'] . '"><img class="img-responsive" src="' . BASE_URL . '/gw-content/uploads/' . $post['featured'] . '" alt="' . $post['title'] . '" /></a>';
    }
    echo '<h2><a href="' . BASE_URL . '/blog/' . $post['id'] . '/' . $post['slug'] . '">' . $post['title'] . '</a></h2>';
    $categories = db_select("SELECT * FROM category WHERE id in (" . $post['category_id'] . ")");
    echo '<div class="small">';
    $created_date = $post['created_date'];
    $posted_date = date("F jS, Y", strtotime($created_date));
    echo '<span class="glyphicon glyphicon-calendar"></span>&nbsp;' . $posted_date;
    echo '&nbsp;&nbsp;';
    echo '<span class="glyphicon glyphicon-folder-open"></span>&nbsp;&nbsp;';
    foreach ($categories as $category) {
        echo '<a href="' . BASE_URL . '/blog/category/' . $category['id'] . '/' . $category['slug'] . '">' . $category['title'] . '</a>&nbsp;';
    }
    echo '</div>';
    $body = Post::read_more($post['body'], 50);
    echo '' . $body . '';
    echo '<hr class="featurette-divider">';
}
//Pagination links
$pagination->pagination_links($pagination_limit, 'post', ' WHERE status = 1 AND category_id = ' . $category['id'] . '');
?>
</div>