Guest User

Untitled

a guest
Jun 21st, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. <?php
  2. if(isset($printer)){
  3. $tpl->set('title', 'Consumable installation reports for ' . $printer->getName());
  4. } else {
  5. $tpl->set('title', 'Consumable installation reports');
  6. }
  7. $tpl->place('header');
  8.  
  9. $colour = '<span style="color:#%s;">&bull;</span>';
  10. ?>
  11.  
  12. <div class="grid_12">
  13.  
  14. <p class="noprint">
  15. <label for="search"><strong>Find:</strong></label>
  16. <input type="text" name="search" id="search" size="30" autocomplete="off" />
  17. </p>
  18.  
  19. <table class="list" id="events">
  20. <thead>
  21. <tr class="heading">
  22. <th filter="false">Colour</th>
  23. <th><?php echo fCRUD::printSortableColumn('consumables.name', 'Consumable') ?></th>
  24. <th><?php echo fCRUD::printSortableColumn('printers.name', 'Printer') ?></th>
  25. <th><?php echo fCRUD::printSortableColumn('models.name', 'Model') ?></th>
  26. <th><?php echo fCRUD::printSortableColumn('printers.location', 'Location') ?></th>
  27. <th filter="false"><?php echo fCRUD::printSortableColumn('events.date', 'Date') ?></th>
  28. </tr>
  29. </thead>
  30.  
  31. <tbody>
  32. <?php
  33. foreach($events as $e){
  34.  
  35. echo '<tr>';
  36.  
  37. /* $img = ($p->colour == 1) ? 'colour.png' : 'mono.png';
  38. $txt = ($p->colour == 1) ? 'C' : 'M';
  39. echo '<td style="width:48px;text-align:center;">';
  40. echo '<span style="display:none;">' . $txt . '</span>';
  41. echo '<img src="web/img/' . $img . '" width="16" height="16" />';
  42. echo '</td>'; */
  43.  
  44. echo '<td class="col" width="80">';
  45. if($e->col_c){ printf($colour, '0066B3'); }
  46. if($e->col_y){ printf($colour, 'FFCC00'); }
  47. if($e->col_m){ printf($colour, 'CC0099'); }
  48. if($e->col_k){ printf($colour, '000'); }
  49. echo '</td>';
  50.  
  51. printf('<td><strong><a href="consumables.php?action=edit&id=%d">%s</a></strong>',
  52. $e->consumable_id, $e->consumable_name
  53. );
  54.  
  55. printf('<td><strong><a href="%s">%s</a></strong></td>',
  56. 'printers.php?action=edit&id=' . $e->printer_id,
  57. $e->printer_name
  58. );
  59.  
  60. echo '<td>' . $e->model . '</td>';
  61. echo '<td>' . $e->location . '</td>';
  62.  
  63. $date = date('D jS F Y, H:i', strtotime($e->date));
  64. $date = preg_replace('/(\d+)(st|nd|rd|th)/', '$1<sup>$2</sup>', $date);
  65. echo '<td>' . $date . '</td>';
  66.  
  67. echo '</tr>';
  68. }
  69. ?>
  70. </tbody>
  71.  
  72. </table>
  73.  
  74. </div>
  75.  
  76. <script type="text/javascript">
  77. $(document).ready(function(){
  78. var options = {
  79. additionalFilterTriggers: [$('#search')],
  80. filterDelay: 1
  81. };
  82. $('#events').tableFilter(options);
  83. $('#search').focus();
  84. });
  85. </script>
  86.  
  87. <?php
  88. $tpl->place('footer')
  89. ?>
Add Comment
Please, Sign In to add comment