/oneraimol-client/application/views/cms/inventory/stock/grid.php

https://github.com/scias23/OneRaimol · PHP · 101 lines · 90 code · 11 blank · 0 comment · 11 complexity · 4997f3aa6a0f928bd4e9005af7029f8b MD5 · raw file

  1. <script src="<?php echo $base_url . $config['js'] ?>/jquery.validate.js" type="text/javascript"></script>
  2. <script src="<?php echo $base_url . $config['js'] ?>/cms/inventory/stock.js" type="text/javascript"></script>
  3. <script src="<?php echo $base_url . $config['js'] ?>/bootstrap/bootstrap-modal.js" type="text/javascript"></script>
  4. <?php if(isset($pageSelectionLabel)) : ?>
  5. <p><?php echo $pageSelectionLabel ?></p>
  6. <?php endif ?>
  7. <div id="msg"></div>
  8. <?php echo isset($success) ? '<span class="success"><p>Material Stock successfully ' . $success . '</p></span>' : ''; ?>
  9. <?php
  10. $accessflag = FALSE;
  11. $stockaccesslevel = array (
  12. Constants_UserType::ADMIN,
  13. Constants_UserType::HEAD_CHEMIST
  14. );
  15. foreach($stockaccesslevel as $position) {
  16. $accessflag = Helper_Helper::check_access_right($_SESSION['roles'], $position);
  17. if($accessflag == TRUE) break;
  18. }
  19. if($accessflag) :
  20. ?>
  21. <div class="span-24 last pull-right" id="formMenu">
  22. <div class="pull-right">
  23. <li class="dividier"></li>
  24. </div>
  25. </div>
  26. <?php endif ?>
  27. <div class="span-24 last pull-right" id="formMenu">
  28. <div class=" pull-right">
  29. <?php if($accessflag) : ?>
  30. <a href="<?php echo $base_url ?>cms/inventory/stock/add">add</a> |
  31. <!-- <a data-keyboard="true" data-controls-modal="delete-modal" data-backdrop="true">delete</a> |-->
  32. <?php endif ?>
  33. <a href="<?php echo $base_url ?>cms/inventory/stock/viewreport">View List</a>
  34. </div>
  35. </div>
  36. <table class="fullWidth condensed-table zebra-striped">
  37. <thead>
  38. <tr>
  39. <?php if($accessflag) : ?>
  40. <th style="width:2%"><input type="checkbox" onclick="check_all(this);"/></th>
  41. <?php endif ?>
  42. <th>ID</th>
  43. <th>Material Name</th>
  44. <th>Price</th>
  45. <th>Supplier</th>
  46. <th>Liters</th>
  47. <th>Date Stock</th>
  48. <th>Expiration Date</th>
  49. <th>&nbsp;</th>
  50. </tr>
  51. </thead>
  52. <tbody>
  53. <?php $record_count = 0;?>
  54. <?php foreach($materialstocklevel as $result) :?>
  55. <?php $record_count++;?>
  56. <tr>
  57. <?php if($accessflag) : ?>
  58. <td><input class="id" name="id[]" type="checkbox" value ="<?php echo Helper_Helper::encrypt($result->stock_id); ?>" id="chk<?php echo $result->stock_id ?>"/></td>
  59. <?php endif ?>
  60. <td><?php echo $result->get_pk() ?></td>
  61. <td><?php echo $result->materialsupply->materials->description ?></td>
  62. <td>PhP <?php echo number_format($result->materialsupply->price, 2) ?></td>
  63. <td><?php echo $result->materialsupply->suppliers->company_name ?></td>
  64. <td><?php echo $result->liters ?></td>
  65. <td><?php echo $result->stock_taking_date ?></td>
  66. <td><?php echo $result->expiration_date ?></td>
  67. <td><a href="<?php echo $base_url ?>cms/inventory/stockusage/view/<?php echo Helper_Helper::encrypt($result->stock_id)?>">Sales</a></td>
  68. <td><a href="<?php echo $base_url ?>cms/inventory/stock/edit/<?php echo Helper_Helper::encrypt($result->stock_id)?>">Edit</a></td>
  69. </tr>
  70. <?php endforeach ?>
  71. <?php if($record_count == 0) : ?>
  72. <tr><td colspan="<?php echo ($accessflag == true) ? '9' : '8'?>" style="text-align: center; font-style: italic">No records found.</td></tr>
  73. <?php endif ?>
  74. </tbody>
  75. </table>
  76. <?php if(isset($pageselector)) echo $pageselector ?>
  77. <!-- MODALS-->
  78. <div class="modal hide fade in" id="delete-modal">
  79. <div class="modal-header">
  80. <a class="close" href="#">×</a>
  81. <h2>Delete Stock Record</h2>
  82. </div>
  83. <div class="modal-body">
  84. <p>Do you really want to delete? This operation is irreversible.</p>
  85. </div>
  86. <div class="modal-footer">
  87. <a class="btn secondary" href="javascript:void(0)" onclick="close_deletemodal()">Cancel</a>
  88. <a class="btn primary" href="javascript:void(0)" onclick="delete_stock()">Yes</a>
  89. </div>
  90. </div>