Ejemplo n.º 1
0
<?php

$page = isset($_GET['page']) ? $_GET['page'] : 1;
if (!preg_match('/^\\d+$/', $page)) {
    dispatch('core/backend/404');
    exit;
}
$objects = Testimonial::findAll();
$html = new HTML();
$html->renderOut('core/backend/html_header', array('title' => i18n(array('en' => 'Testimonial', 'zh' => '客户评语'))), true);
$html->output('<div id="wrapper">');
$html->renderOut('core/backend/header');
$perpage = 50;
$total = Testimonial::countAll();
$total_page = ceil($total / $perpage);
$html->renderOut('testimonial/backend/testimonial_list', array('objects' => Testimonial::findAllWithPage($page, $perpage), 'current_page' => $page, 'total_page' => $total_page, 'total' => $total, 'pager' => $html->render('core/components/pagination', array('total' => $total_page, 'page' => $page)), 'start_entry' => ($page - 1) * $perpage + 1, 'end_entry' => min(array($total, $page * $perpage))), true);
$html->output('</div>');
$html->renderOut('core/backend/html_footer');
exit;
Ejemplo n.º 2
0
<section style="background-color:#f5f5f5;" class="section-content section-bg">
  <div class="container clearfix">
    <div class="entry-content">
      <div class="title1 clearfix">
        <div class="text">
          <h2>What our clients say about us</h2>
        </div> 
        <div class="sub-title">At <?php 
echo $settings['sitename'];
?>
, we put our clients at the centre of everything. Your needs is what we care the most.</div>
      </div>
      <div class="lecturers-grid clearfix">
<?php 
$i = 0;
foreach (Testimonial::findAll() as $testimonial) {
    ?>
        <div class="lecturer column-<?php 
    echo ($i + 1) % 2 == 0 ? 2 : 1;
    ?>
" <?php 
    if ($i > 3) {
        ?>
style="display:none"<?php 
    }
    ?>
>
          <div class="author-photo">
            <img width="150" height="150" src="<?php 
    echo uri($testimonial->getImage());
    ?>