Guest User

Untitled

a guest
Jun 19th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. views/customers/index.ctp
  2.  
  3. <?php
  4. //search form
  5. echo $form->create('Customer'); ?>
  6. <h3>Find customers with :</h3>
  7. <?php
  8. echo $form->input('q', array( 'label' => false ));
  9. echo $form->submit('Search');
  10. echo $form->end();
  11. ?>
  12. <div class="actions">
  13. <ul>
  14. <li><?php echo $html->link(__('home', true), array('controller'=>'pages','action'=>'index')); ?></li>
  15. <li><?php echo $html->link(__('New', true), array('action'=>'add')); ?></li>
  16. </ul>
  17. </div>
  18. <div class="customers index">
  19. <p>
  20. <?php
  21. echo $paginator->counter(array(
  22. 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
  23. ));
  24. ?></p>
  25. <table cellpadding="0" cellspacing="0">
  26. <tr>
  27. <th><?php echo $paginator->sort('number');?></th>
  28. <th><?php echo $paginator->sort('name');?></th>
  29. <th><?php echo $paginator->sort('address');?></th>
  30. <th><?php echo $paginator->sort('marked');?></th>
  31. <th class="actions"><?php __('Actions');?></th>
  32. </tr>
  33. <?php
  34. $i = 0;
  35. foreach ($customers as $customer):
  36. $class = null;
  37. if ($i++ % 2 == 0) {
  38. $class = ' class="altrow"';
  39. }
  40. ?>
  41. <tr<?php echo $class;?>>
  42. <td>
  43. <?php echo $html->link(__($customer['Customer']['number'], true), array('action'=>'view', $customer['Customer']['id'])); ?>
  44. </td>
  45. <td>
  46. <?php echo $customer['Customer']['name']; ?>
  47. </td>
  48. <td>
  49. <?php echo $customer['Customer']['address']; ?>
  50. </td>
  51. <td>
  52. <?php echo $customer['Customer']['marked']; ?>
  53. </td>
  54. <td class="actions">
  55. <?php echo $html->link(__('View', true), array('action'=>'view', $customer['Customer']['id'])); ?>
  56. <?php echo $html->link(__('Edit', true), array('action'=>'edit', $customer['Customer']['id'])); ?>
  57. <?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'])); ?>
  58. </td>
  59. </tr>
  60. <?php endforeach; ?>
  61. </table>
  62. </div>
  63. <div class="paging">
  64. <?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
  65. | <?php echo $paginator->numbers();?>
  66. <?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?>
  67. </div>
  68.  
  69. <div class="debug">
  70. <pre>
  71. <?php
  72. echo "\nMyCust:\n";
  73. print_r($mycust);
  74. echo "--------------------------------------------------------------------------------\n";
  75. echo "\nCustMy:\n";
  76. print_r($custmy);
  77. echo "--------------------------------------------------------------------------------\n";
  78. print_r($paginator);
  79.  
  80. ?></pre>
  81. </div>
Add Comment
Please, Sign In to add comment