Advertisement
Guest User

Untitled

a guest
Jan 9th, 2012
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.51 KB | None | 0 0
  1. <?php
  2. if($display_form) { ?>
  3.     <div class="grid_6 suffix_3 prefix_3">
  4.     <?php
  5.         echo $this->Form->create('Outlet', array('action' => 'search', $this->params['pass'], 'class' => 'formee'));
  6.         if($show_validation_msg){
  7.     ?>
  8.         <div class="formee-msg-error">
  9.         <ul>
  10.         <?php
  11.         echo $this->Form->error('Outlet.postcode', 'Please enter a valid postcode',  array('wrap' => 'li', 'class' => ''));
  12.         ?>
  13.         </ul>
  14.         </div> 
  15.     <?php
  16.         }
  17.     ?>
  18.    
  19.     <div class="grid-12-12">
  20.     <?php
  21.         echo $this->Form->input('name', array('label' => 'Name'));
  22.     ?>
  23.     </div>
  24.  
  25.     <div class="grid-12-12">
  26.     <?php
  27.         echo $this->Form->input('cuisine', array('label' => 'Cuisine', 'options' => array(
  28.             '' => 'Please select...',
  29.             'Indian' => 'Indian',
  30.             'Turkish' => 'Turkish',
  31.             'Fast Food' => 'Fast Food',
  32.             'Mediterranean' => 'Mediterranean',
  33.             'Cafe' => 'Cafe',
  34.             'Dessert Parlour' => 'Dessert Parlour',
  35.             'Steakhouse' => 'Steakhouse'
  36.             )));
  37.     ?>
  38.     </div>
  39.    
  40.     <div class="grid-12-12">
  41.     <?php
  42.         echo $this->Form->input('postcode', array('label' => 'Postcode', 'error' => false));
  43.     ?>
  44.     </div>
  45.    
  46.     <div class="grid-12-12">
  47.     <?php
  48.         echo $this->Form->end(array('label' => 'Go', 'div' => array('class' => 'search-outlet-submit-button')));
  49.     ?>
  50.     </div>
  51.     <?php
  52.     } else {
  53.     //  echo '<pre>';
  54.     //  print_r($outlets);
  55.     //  echo '</pre>';
  56.     ?>
  57.  
  58.     <div class="grid_3 prefix_1">
  59.         <h2>Search Results</h2>
  60.     </div>
  61.  
  62.     <div class="grid_5 prefix_2 suffix_1">
  63.         <h2 style="text-align:right;">Sorting Options: <?php echo $this->Paginator->sort('name'); ?>  <?php echo (!empty($outlets[0]['Outlet']['distance'])) ? $this->Paginator->sort('distance') : '' ?><!-- Sorting Options: By name By date By rating --></h2>
  64.     </div>
  65.     <div class="clear"></div>
  66.  
  67.     <?php foreach ($outlets as $outlet): ?>
  68.         <div class="grid_10 prefix_1 suffix_1">
  69.             <div style="float:left; margin-bottom:20px;">
  70.                 <?php echo $this->Html->image('thumbnail-placeholder.png', array('alt' => 'Outlet Image'))?>
  71.             </div>
  72.             <div style="float:left; margin-left:20px; width:620px;">
  73.                 <h3><?php echo $this->Html->link($outlet['Outlet']['name'], array('controller' => 'outlets', 'action' => 'view', $outlet['Outlet']['id'])); ?>
  74.                 <?php echo (!empty($outlet['Outlet']['distance'])) ? '('.sprintf("%0.2f", $outlet['Outlet']['distance']).' miles)' : '' ?></h3>
  75.                
  76.                 <p>
  77.                 <?php echo (!empty($outlet['Outlet']['number'])) ? $outlet['Outlet']['number'] : '' ;
  78.                 echo (!empty($outlet['Outlet']['building_name'])) ? $outlet['Outlet']['building_name'].',<br />' : '' ; ?>
  79.                 <?php echo $outlet['Outlet']['road']; ?><br />
  80.                 <?php echo $outlet['Outlet']['town']; ?><br />
  81.                 <?php echo $outlet['Outlet']['postcode']; ?><br />
  82.                 <?php echo (!empty($outlet['Outlet']['telephone'])) ? $outlet['Outlet']['telephone'] : ''; ?>
  83.                 </p>
  84.                 <h3 style="text-align: right;">Rating [TODO]: *****</h3>
  85.             </div>
  86.         </div>
  87.         <div class="clear"></div>
  88.     <?php endforeach; ?>
  89.  
  90.     <div class="grid_10 prefix_1 suffix_1">
  91.     <p>
  92.     <?php
  93.         echo $this->Paginator->counter(array(
  94.         'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%' , true)
  95.         ));
  96.     ?>
  97.     </p>
  98.     <p>
  99.     <?php
  100.         echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?> | <?php echo $this->Paginator->numbers();?> | <?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));
  101.         ?> 
  102.         <div class="clear"></div>
  103.     </p>
  104.         <?php } ?>
  105.     </div><!-- end grid_10 prefix_1 suffix_1 -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement