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


PHP Pagination::parse方法代码示例

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


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

示例1: getOrderData

 public static function getOrderData()
 {
     self::initDB();
     //设置当前页及limit
     $page = isset($_GET['page']) ? (int) $_GET['page'] : 1;
     $limit = ' limit ' . ($page - 1) * 30 . ', 30';
     $where = array();
     if (isset($_REQUEST['state']) && $_REQUEST['state'] !== 'ALL') {
         $where[] = ' state="' . $_REQUEST['state'] . '"';
     }
     if (isset($_REQUEST['sku']) && !empty(trim($_REQUEST['sku']))) {
         $where[] = ' trueSku="' . trim($_REQUEST['sku']) . '"';
     }
     if (isset($_REQUEST['spu']) && !empty(trim($_REQUEST['spu']))) {
         $where[] = ' trueSpu="' . trim($_REQUEST['spu']) . '"';
     }
     if (isset($_COOKIE['account'])) {
         $where[] = ' account="' . $_COOKIE['account'] . '"';
     }
     $where = count($where) > 0 ? ' where ' . implode(' and ', $where) : '';
     $order = ' order by order_time desc, sku ASC';
     //读取表的记录数量
     $sql = 'SELECT count(*) as counts FROM `ws_order`' . $where;
     $query = self::$dbConn->query($sql);
     $countRet = self::$dbConn->fetch_array_all($query);
     //初使化分页类
     $pagination = new Pagination($page, $countRet[0]['counts'], 30);
     $pageHtml = $pagination->parse();
     //分页读取记录
     $sql = 'SELECT * FROM `ws_order`' . $where . $order . $limit;
     $query = self::$dbConn->query($sql);
     $ret = self::$dbConn->fetch_array_all($query);
     $orderStat = C('ORDERSTAT');
     foreach ($ret as $k => $v) {
         $ret[$k]['stateZH'] = $orderStat[$v['state']];
     }
     return array('data' => $ret, 'pageHtml' => $pageHtml);
 }
开发者ID:ulpyuxa,项目名称:wishorder.wishtool.com,代码行数:38,代码来源:wishOrder.model.php

示例2: getWaitSpu

 /**
  * 功能:获取待刊登的料号
  *
  */
 public function getWaitSpu()
 {
     self::initDB();
     $page = isset($_REQUEST['page']) ? (int) $_REQUEST['page'] : 1;
     $account = isset($_COOKIE['account']) ? $_COOKIE['account'] : 'geshan0728';
     $where = 'where ' . $account . '_upload="N" and isDelete="No"';
     if (isset($_REQUEST['spuSn']) && !empty($_REQUEST['spuSn'])) {
         $where = $where . ' and spuSn like "%' . mysqli_real_escape_string(self::$dbConn->link, $_REQUEST['spuSn']) . '%"';
     }
     $order = ' order by id DESC';
     $sql = 'select count(*) as count from ws_wait_publish ' . $where . $order;
     $query = self::$dbConn->query($sql);
     $count = self::$dbConn->fetch_array_all($query);
     $limit = ' limit ' . ($page - 1) * 30 . ', 30';
     $sql = 'select * from ws_wait_publish ' . $where . $order . $limit;
     $query = self::$dbConn->query($sql);
     $ret = self::$dbConn->fetch_array_all($query);
     foreach ($ret as $k => $v) {
         $tags = explode(',', $v['tags']);
         $ret[$k]['tags'] = implode(', ', $tags);
     }
     //数据分页
     $pagination = new Pagination($page, $count[0]['count'], 30);
     $pageHtml = $pagination->parse();
     return array('data' => $ret, 'pagination' => $pageHtml);
 }
开发者ID:ulpyuxa,项目名称:wishorder.wishtool.com,代码行数:30,代码来源:wishProduct.model.php

示例3: array

     // Is there a label?
     if ($topics[$n]->label != 0) {
         // yes
         // Get label
         $label = $queries->getWhere('forums_topic_labels', array('id', '=', $topics[$n]->label));
         $label = '<span class="label label-' . htmlspecialchars($label[0]->label) . '">' . htmlspecialchars($label[0]->name) . '</span>';
     } else {
         // no
         $label = '';
     }
     // Add to array
     $template_array[] = array('topic_title' => htmlspecialchars($topics[$n]->topic_title), 'topic_id' => $topics[$n]->id, 'topic_created_rough' => $timeago->inWords(date('d M Y, H:i', $topics[$n]->topic_date), $time_language), 'topic_created' => date('d M Y, H:i', $topics[$n]->topic_date), 'topic_created_username' => htmlspecialchars($user->IdToName($topics[$n]->topic_last_user)), 'topic_created_mcname' => htmlspecialchars($user->IdToMCName($topics[$n]->topic_last_user)), 'locked' => $topics[$n]->locked, 'views' => $topics[$n]->topic_views, 'posts' => $replies, 'last_reply_avatar' => $last_reply_avatar, 'last_reply_rough' => $timeago->inWords(date('d M Y, H:i', $topics[$n]->topic_reply_date), $time_language), 'last_reply' => date('d M Y, H:i', $topics[$n]->topic_reply_date), 'last_reply_username' => htmlspecialchars($user->IdToName($topics[$n]->topic_last_user)), 'last_reply_mcname' => htmlspecialchars($user->IdToMCName($topics[$n]->topic_last_user)), 'label' => $label);
     $n++;
 }
 // Assign pagination
 $smarty->assign('PAGINATION', $pagination->parse());
 // Assign forum title to variable
 $smarty->assign('FORUM_TITLE', htmlspecialchars($forum_query->forum_title));
 // Assign to Smarty variable
 $smarty->assign('STICKY_DISCUSSIONS', $sticky_array);
 $smarty->assign('LATEST_DISCUSSIONS', $template_array);
 // Assign language variables
 $smarty->assign('FORUMS', $forum_language['forums']);
 $smarty->assign('DISCUSSION', $forum_language['discussion']);
 $smarty->assign('STATS', $forum_language['stats']);
 $smarty->assign('LAST_REPLY', $forum_language['last_reply']);
 $smarty->assign('AGO', '');
 // to be removed
 $smarty->assign('BY', $forum_language['by']);
 $smarty->assign('VIEWS', $forum_language['views']);
 $smarty->assign('POSTS', $forum_language['posts']);
开发者ID:MistriHD,项目名称:Nameless,代码行数:31,代码来源:view_forum.php

示例4: date

		<div class="panel-body">
		  <?php 
            echo $purifier->purify(htmlspecialchars_decode($merged_results[$n][$post]['post_content']));
            ?>
		  <span class="pull-right">
		    <span class="label label-info"><?php 
            echo date('d M Y, H:i', strtotime($merged_results[$n][$post]['post_date']));
            ?>
</span>
		  </span>
		</div>
	  </div>
			<?php 
            $n++;
        }
        echo $pagination->parse();
        // Print pagination
    } else {
        ?>
	  <form class="form-horizontal" role="form" method="post" action="">
	    <div class="input-group">
	      <input type="text" class="form-control" name="forum_search" placeholder="Search">
		  <input type="hidden" name="token" value="<?php 
        echo Token::generate();
        ?>
">
	      <span class="input-group-btn">
		    <button type="submit" class="btn btn-default">
              <i class="fa fa-search"></i>
            </button>
	      </span>
开发者ID:saucequan,项目名称:Nameless,代码行数:31,代码来源:search.php

示例5: formatPagination

function formatPagination($current_page, $result_count)
{
    global $search_results_per_page;
    $pagination = new Pagination();
    $pagination->setCurrent($current_page);
    $pagination->setTotal($result_count);
    $pagination->setRPP($search_results_per_page);
    $pagination->setClasses(array("pagination", "pagination-right"));
    return $pagination->parse();
}
开发者ID:KevinMGranger,项目名称:opsweekly,代码行数:10,代码来源:base.php

示例6: autop

                                        </p>
                                    </div>
                                </header>
                                <div class="comment-post">
                                    <?php 
        echo autop($comment->comment);
        ?>
                                </div>            
                            </div>
                        </div>   
                    </article>
                    <?php 
    }
    ?>
                    <div class="pull-right"><?php 
    echo $pagi->parse();
    ?>
</div>
                    <div class="clearfix"></div>
                    <?php 
} else {
    echo '<p>No ratings and comments yet, be the first to do so';
}
?>
                </section>
                <hr>
                <?php 
if (isset($loggedInUser) && !empty($loggedInUser)) {
    $useractormovieq = $db->sql_query("SELECT * FROM " . $db_prefix . "ratings WHERE user_id=" . $loggedInUser->user_id . " AND actor_id='{$actorid}' AND movie_id='{$movieid}' LIMIT 1");
    $useractormovie = !empty($useractormovieq) ? $useractormovieq->fetch_object() : '';
    ?>
开发者ID:davidvdtak,项目名称:AIRdb,代码行数:31,代码来源:rate.php

示例7: while

        <div class="row">
            <div class="col-sm-9">
                <h2>Search Results for '<?php 
echo $srch;
?>
'</h2>
                <?php 
if ($query->num_rows > 0) {
    echo '<div class="type_top"><table class="table table-fixed table-striped">';
    $count = $start_from;
    while ($row = $query->fetch_object()) {
        $count++;
        echo '<tr><td>' . $count . '.</td><td><a href="' . ($row->source == 'movies' ? $websiteUrl . 'movies/mv' . sprintf("%07s", $row->id) . '/' : $websiteUrl . 'actors/ac' . sprintf("%07s", $row->id) . '/') . '"><img src="' . $websiteUrl . (empty($row->image) ? 'images/no-poster.gif' : $row->image) . '" alt="' . $row->title . '" style="width: 35px;"> ' . $row->title . '</a></td><td>' . ($row->source == 'movies' ? 'Movie' : 'Actor') . '</td></tr>';
    }
    echo '</table></div>';
    echo '<div class="pull-right">' . $pagi->parse() . '</div><div class="clearfix"></div>';
} else {
    echo '<p>No results found</p>';
}
?>
            </div>
            <div class="col-sm-3">  
                <?php 
get_part_template('sidebar');
?>
                
            </div>
        </div>        
    </div>       
</main>
<?php 
开发者ID:davidvdtak,项目名称:AIRdb,代码行数:31,代码来源:search.php

示例8: isset

    $number2 = isset($_GET['number2']) ? (int) $_GET['number2'] : 0;
    if ($fundRaising != null) {
        $startups = $Startup->searchByFundraisingDetails($fundRaising, $number, $number2, array('filter' => 'raising'));
    } else {
        $startups = $Startup->startupsWithRaising(array('query' => $query, 'type' => 'Startup', 'filter' => 'raising', 'page' => $page, 'per_page' => '3'));
    }
} else {
    $startups = $Startup->raising($page)['startups'];
}
$pagination_markup = "";
if ($raising['total'] > 3) {
    require 'libs/Pagination.class';
    $pagination = new Pagination();
    $pagination->setCurrent($page);
    $pagination->setTotal($raising['total']);
    $pagination_markup = $pagination->parse();
}
if (isset($_GET['vd'])) {
    vd($startups);
}
?>

<?php 
include 'header.php';
?>

<div class="container">


 <div class="row">
  <div class="col-lg-6" align="center">
开发者ID:RedTroops-Revolt,项目名称:AngelList-PHP-API,代码行数:31,代码来源:index.php

示例9: displayMerchant


//.........这里部分代码省略.........
                    if ($merchant_preorder) {
                        $tag_open = '<div class="uk-badge uk-badge-success">' . t("Pre-Order") . '</div>';
                    } else {
                        $tag_open = '<div class="uk-badge uk-badge-danger">' . t("Closed") . '</div>';
                    }
                }
                $rating = "<div class=\"rate-wrap\">\n\t\t\t<h6 class=\"rounded2\" data-uk-tooltip=\"{pos:'bottom-left'}\" title=\"{$rating_meanings}\" >" . number_format($ratings['ratings'], 1) . "</h6>\n\t\t\t<span>" . $ratings['votes'] . " " . Yii::t("default", "Votes") . "</span>\t\t\t\n\t\t\t</div>";
                $merchant_id = $val['merchant_id'];
                $lat = Yii::app()->functions->getOption("merchant_latitude", $merchant_id);
                $long = Yii::app()->functions->getOption("merchant_longtitude", $merchant_id);
                ?>
		   <div class="links" data-id="<?php 
                echo $address;
                ?>
" >
		   <div class="uk-grid" id="restaurant-mini-list">
		     <div class="uk-width-3-10">		     
		      <a href="<?php 
                echo baseUrl() . "{$ccCon}/menu/merchant/" . $val['restaurant_slug'];
                ?>
">
		      <?php 
                if (!empty($val['merchant_logo'])) {
                    ?>
		      <img class="uk-thumbnail uk-thumbnail-mini" src="<?php 
                    echo Yii::app()->request->baseUrl . "/upload/" . $val['merchant_logo'];
                    ?>
">
		      <?php 
                } else {
                    ?>
		      <img class="uk-thumbnail uk-thumbnail-mini" src="<?php 
                    echo Yii::app()->request->baseUrl . "/assets/images/thumbnail-medium.png";
                    ?>
">
		      <?php 
                }
                ?>
		      </a>
		     </div>
		     <div class="uk-width-7-10">
		        <h5><a href="<?php 
                echo baseUrl() . "{$ccCon}/menu/merchant/" . $val['restaurant_slug'];
                ?>
">
		        <?php 
                echo $val['restaurant_name'];
                ?>
</a>
		       </h5>
		        <p class="uk-text-muted"><?php 
                echo $address;
                ?>
</p>
		        <a class="view-map" href="javascript:;" data-id="<?php 
                echo $address;
                ?>
" data-lat="<?php 
                echo $lat;
                ?>
" data-long="<?php 
                echo $long;
                ?>
" data-merchantname="<?php 
                echo ucwords($val['restaurant_name']);
                ?>
" >
		        <i class="fa fa-map-marker"></i>
 <?php 
                echo Yii::t("default", "View Map");
                ?>
</a>
                <?php 
                echo $tag_open;
                ?>
		        <?php 
                echo $rating;
                ?>
		        		       
		     </div>
		   </div>
		   </div>
		   <?php 
            }
            $path = Yii::getPathOfAlias('webroot') . "/protected/vendor";
            require_once $path . "/Pagination/Pagination.class.php";
            $page = isset($_GET['page']) ? (int) $_GET['page'] : 1;
            $pagination = new Pagination();
            $pagination->setCurrent($page);
            $pagination->setRPP(10);
            $pagination->setTotal($total_records);
            echo $pagination->parse();
        } else {
            ?>
<p class="uk-text-muted"><?php 
            echo Yii::t("default", "No data available");
            ?>
</p><?php 
        }
    }
开发者ID:ashishvazirani,项目名称:food,代码行数:101,代码来源:Widgets.php

示例10: isset


//.........这里部分代码省略.........
        $paid_props_query = new WP_Query($paid_props_args);
        if ($paid_props_query->have_posts()) {
            $total_found_posts = $paid_props_query->found_posts;
            while ($paid_props_query->have_posts()) {
                $paid_props_query->the_post();
                global $post;
                $values = get_post_custom($post->ID);
                $not_available = __('Not Available', 'framework');
                $txn_id = isset($values['txn_id']) ? esc_attr($values['txn_id'][0]) : $not_available;
                $payment_date = isset($values['payment_date']) ? esc_attr($values['payment_date'][0]) : $not_available;
                $payer_email = isset($values['payer_email']) ? esc_attr($values['payer_email'][0]) : $not_available;
                $first_name = isset($values['first_name']) ? esc_attr($values['first_name'][0]) : $not_available;
                $last_name = isset($values['last_name']) ? esc_attr($values['last_name'][0]) : $not_available;
                $payment_status = isset($values['payment_status']) ? esc_attr($values['payment_status'][0]) : $not_available;
                $payment_gross = isset($values['payment_gross']) ? esc_attr($values['payment_gross'][0]) : $not_available;
                $payment_currency = isset($values['mc_currency']) ? esc_attr($values['mc_currency'][0]) : $not_available;
                ?>
                    <tr>
                        <td><?php 
                echo $txn_id;
                ?>
</td>
                        <td><?php 
                echo $payment_date;
                ?>
</td>
                        <td><?php 
                echo $first_name;
                ?>
</td>
                        <td><?php 
                echo $last_name;
                ?>
</td>
                        <td><?php 
                echo $payer_email;
                ?>
</td>
                        <td><?php 
                echo $payment_status;
                ?>
</td>
                        <td><?php 
                echo $payment_gross;
                ?>
</td>
                        <td><?php 
                echo $payment_currency;
                ?>
</td>
                        <td><?php 
                echo $post->ID;
                ?>
</td>
                        <td><?php 
                echo $post->post_status;
                ?>
</td>
                        <td><a href="<?php 
                echo get_edit_post_link($post->ID);
                ?>
"><?php 
                _e('Edit Property', 'framework');
                ?>
</a></td>
                    </tr>
                    <?php 
            }
            if ($total_found_posts > $number_of_properties) {
                ?>
                    <tr>
                        <td colspan="11">
                            <?php 
                require_once get_template_directory() . '/framework/functions/Pagination.class.php';
                // instantiate; set current page; set number of records
                $pagination = new Pagination();
                $pagination->setCurrent($page_number);
                $pagination->setTotal($total_found_posts);
                // grab rendered/parsed pagination markup
                echo $pagination->parse();
                ?>
                        </td>
                    </tr>
                    <?php 
            }
            wp_reset_query();
        } else {
            ?>
                <tr>
                    <td colspan="11"><?php 
            _e('No Completed Payment Found!', 'framework');
            ?>
</td>
                </tr>
                <?php 
        }
        ?>
        </table>
        <?php 
    }
开发者ID:ahmedelhadi,项目名称:TestProject,代码行数:101,代码来源:functions.php


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