当前位置: 首页>>代码示例>>PHP>>正文


PHP Paginator::createLinks方法代码示例

本文整理汇总了PHP中Paginator::createLinks方法的典型用法代码示例。如果您正苦于以下问题:PHP Paginator::createLinks方法的具体用法?PHP Paginator::createLinks怎么用?PHP Paginator::createLinks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Paginator的用法示例。


在下文中一共展示了Paginator::createLinks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: substr

    ?>
</strong></h3>
					<p><?php 
    echo substr($results->data[$i]['r_text'], 0, 100);
    ?>
</p>
					<?php 
    echo ' <a href="conferenceReview.php?id=' . $results->data[$i]['cr_id'] . '" style=""
					class="pull-right btn btn-success">Continue</a> ';
    ?>
				</div>
			<?php 
}
?>
			<?php 
echo $Paginator->createLinks($links, 'pagination pagination-sm', $id);
?>
 
		</div>
	</div>
</div>
<?php 
require_once 'includes/footer.php';
?>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/cbpFWTabs.js"></script>
<!-- <script type="text/javascript" src="js/modernizr.custom.js"></script> -->
</body>
</html>
<script>
(function() {
开发者ID:mostafa-abdullah,项目名称:game-reviews,代码行数:31,代码来源:conference.php

示例2: Search

 public static function Search($workType, $experience, $education, $salary, $zip, $distance, $page)
 {
     if (($tmp = Client::getZipCodes($zip, $distance)) !== false) {
         $i = 0;
         $query = "SELECT * FROM staff WHERE (";
         foreach ($tmp as $data) {
             if ($i === 0) {
                 $query .= "zip='" . $data[code] . "'";
             } else {
                 $query .= " OR zip='" . $data[code] . "'";
             }
             $i++;
         }
         $query .= ") AND experience >= '{$experience}' AND workType='{$workType}' AND education>='{$education}' AND salary<='{$salary}' AND available=1";
         $paginator = new Paginator($query);
         if (!($results = $paginator->getData($page))) {
             $GLOBALS['message'] = "No potential candidates fit that criteria.";
             return false;
         } else {
             $results->links = $paginator->createLinks(2, 'pages');
             return $results;
         }
     } else {
         return false;
     }
 }
开发者ID:jlt1288,项目名称:CIS470_TPSWS,代码行数:26,代码来源:classes.php

示例3: imageResults

    function imageResults()
    {
        require 'template/header.php';
        echo '
				<header>
		<nav class="navbar navbar-default">
		  <div class="container-fluid">
			<div class="navbar-header inline-block">
			  <a class="navbar-brand" href="index.php">
				<img alt="FBpp logo" src="images/logo.png">
			  </a>
			</div>
			<form action="search.php" method="POST" class="form-inline reset-margin" enctype="multipart/form-data">
		<div class="form-group">
		<input type="file" name="image" class="form-control">
		<button type="submit" name="submit" class="btn btn-primary form-control"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></button>
	</div>
	</form>
		  </div>
		</nav>
		</header>
		';
        echo '<div class="container"><!--container-->';
        require 'config.php';
        require 'classes/paginator.class.php';
        $limit = isset($_GET['limit']) ? $_GET['limit'] : 10;
        $page = isset($_GET['page']) ? $_GET['page'] : 1;
        $links = isset($_GET['links']) ? $_GET['links'] : 7;
        $starttime = microtime(true);
        $queryResults = mysqli_query($con, Search::imageHashing());
        $checkRows = mysqli_num_rows($queryResults);
        if ($checkRows > 0) {
            $numRows = mysqli_num_rows($queryResults);
            $endtime = microtime(true);
            echo "<p>About " . $numRows . " results (" . ($duration = $endtime - $starttime . " seconds)</p>");
            $Paginator = new Paginator($con, Search::imageHashing());
            $results = $Paginator->getData($limit, $page);
            echo '<div class="col-md-10 col-md-offset-1">
		<table class="table table-striped table-condensed table-bordered table-rounded"><tbody>';
            for ($i = 0; $i < count($results->data); $i++) {
                echo '<tr>';
                $fid = $results->data[$i]['fid'];
                echo '<td>';
                echo "<a href='https://www.facebook.com/{$fid}/' target='_blank'>https://www.facebook.com/{$fid}/</a>";
                echo "<a href='https://www.facebook.com/{$fid}/' target='_blank'><img src='https://graph.facebook.com/{$fid}/picture?type=large' alt='' class='img-responsive'></a>";
                $name = 'https://graph.facebook.com/' . $fid . '?fields=name&access_token=748352698603001|94fc98094ca42f974879c56f3229c5e4';
                $response = file_get_contents($name);
                $user = json_decode($response, true);
                echo $user['name'];
                echo '</td>';
                echo '</tr>';
            }
            if ($numRows <= 10) {
                echo '</tbody></table>';
                echo "</div>";
                echo "</div>";
                require 'template/search_footer.php';
            } else {
                echo '</tbody></table>';
                echo $Paginator->createLinks($links, 'pagination pagination-sm');
                echo "</div>";
                echo "</div>";
                require 'template/search_footer.php';
            }
        } else {
            echo "<br />We found 0 results for the uploaded image please upload another one or try later when we scrap more pictures.";
            echo "</div>";
            require 'template/footer.php';
        }
    }
开发者ID:godera,项目名称:facebook-profile-picture-scraper,代码行数:70,代码来源:search.php


注:本文中的Paginator::createLinks方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。