Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- views/customers/index.ctp
- <?php
- //search form
- echo $form->create('Customer'); ?>
- <h3>Find customers with :</h3>
- <?php
- echo $form->input('q', array( 'label' => false ));
- echo $form->submit('Search');
- echo $form->end();
- ?>
- <div class="actions">
- <ul>
- <li><?php echo $html->link(__('home', true), array('controller'=>'pages','action'=>'index')); ?></li>
- <li><?php echo $html->link(__('New', true), array('action'=>'add')); ?></li>
- </ul>
- </div>
- <div class="customers index">
- <p>
- <?php
- echo $paginator->counter(array(
- 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
- ));
- ?></p>
- <table cellpadding="0" cellspacing="0">
- <tr>
- <th><?php echo $paginator->sort('number');?></th>
- <th><?php echo $paginator->sort('name');?></th>
- <th><?php echo $paginator->sort('address');?></th>
- <th><?php echo $paginator->sort('marked');?></th>
- <th class="actions"><?php __('Actions');?></th>
- </tr>
- <?php
- $i = 0;
- foreach ($customers as $customer):
- $class = null;
- if ($i++ % 2 == 0) {
- $class = ' class="altrow"';
- }
- ?>
- <tr<?php echo $class;?>>
- <td>
- <?php echo $html->link(__($customer['Customer']['number'], true), array('action'=>'view', $customer['Customer']['id'])); ?>
- </td>
- <td>
- <?php echo $customer['Customer']['name']; ?>
- </td>
- <td>
- <?php echo $customer['Customer']['address']; ?>
- </td>
- <td>
- <?php echo $customer['Customer']['marked']; ?>
- </td>
- <td class="actions">
- <?php echo $html->link(__('View', true), array('action'=>'view', $customer['Customer']['id'])); ?>
- <?php echo $html->link(__('Edit', true), array('action'=>'edit', $customer['Customer']['id'])); ?>
- <?php echo $html->link(__('Delete', true), array('action'=>'delete', $customer['Customer']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $customer['Customer']['id'])); ?>
- </td>
- </tr>
- <?php endforeach; ?>
- </table>
- </div>
- <div class="paging">
- <?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
- | <?php echo $paginator->numbers();?>
- <?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?>
- </div>
- <div class="debug">
- <pre>
- <?php
- echo "\nMyCust:\n";
- print_r($mycust);
- echo "--------------------------------------------------------------------------------\n";
- echo "\nCustMy:\n";
- print_r($custmy);
- echo "--------------------------------------------------------------------------------\n";
- print_r($paginator);
- ?></pre>
- </div>
Add Comment
Please, Sign In to add comment