Add An Item
8 |{{ config.sitetitle }} Settings
8 |{{ config.siteTitle }}
8 |Edit Item
8 |No Stock Items
8 || ITEM | 33 |TYPE | 34 |||||
|---|---|---|---|---|---|
| 42 | {{ item[3] }} 43 | create 44 | | 45 | {% else %} 46 |{{ item[3] }} create | 47 | {% endif %} 48 | 49 | {% include 'inc/types.html' %} 50 | 51 | 52 | {% if editMode %} 53 |
54 |
55 |
56 | remove
57 |
58 |
59 | |
60 |
61 |
62 |
63 |
64 | add
65 |
66 |
67 | |
68 |
69 |
70 | {% else %}
71 |
72 |
73 | remove
74 |
75 | |
76 |
77 |
78 |
79 | add
80 |
81 | |
82 |
83 | {% endif %}
84 |
Reloading page...", classes: 'green'}) 52 | setTimeout(function(){window.location.reload()},1500); 53 | }, 54 | error: function(error) { 55 | $("body").load("/error/" + error); 56 | } 57 | }); 58 | }); 59 | 60 | // Edit item page form submission 61 | $('#updateItem').click(function() { 62 | 63 | if ($.trim($("#item_name").val()) === "" || $.trim($("#barcode").val()) === "" || $.trim($("#amount").val()) === "") { 64 | fillFormError(); 65 | return false; 66 | } 67 | 68 | $.ajax({ 69 | url: '/updateitem', 70 | data: $('form').serialize(), 71 | type: 'POST', 72 | success: function(response) { 73 | window.location.href = "/"; 74 | }, 75 | error: function(error) { 76 | $("body").load("/error/" + error); 77 | } 78 | }); 79 | }); 80 | }); 81 | 82 | // Table search function 83 | function tableSearch(inputID, tableID) { 84 | // Declare variables 85 | var input, filter, table, tr, td, i; 86 | input = document.getElementById(inputID); 87 | filter = input.value.toUpperCase(); 88 | table = document.getElementById(tableID); 89 | tr = table.getElementsByTagName("tr"); 90 | 91 | // Loop through all table rows, and hide those that don't match the search query 92 | for (i = 0; i < tr.length; i++) { 93 | td = tr[i].getElementsByTagName("td")[0]; 94 | if (td) { 95 | if (td.innerHTML.toUpperCase().indexOf(filter) > -1) { 96 | $(tr[i]).fadeIn('fast'); 97 | //tr[i].style.display = ""; 98 | } else { 99 | $(tr[i]).fadeOut('fast'); 100 | //tr[i].style.display = "none"; 101 | } 102 | } 103 | } 104 | } 105 | /* 106 | // Tooltips 107 | $(document).ready(function(){ 108 | $('.tooltipped').tooltip(); 109 | }); 110 | */ -------------------------------------------------------------------------------- /templates/viewall.html: -------------------------------------------------------------------------------- 1 | {% include 'inc/header.html' %} 2 | 3 |
{{ config.siteTitle }}
8 || ITEM | 33 |AMOUNT | 34 |TYPE | 35 ||||||
|---|---|---|---|---|---|---|---|
| delete_forever | 43 | 44 |45 | {{ item[3] }} 46 | create 47 | | 48 | {% else %} 49 |{{ item[3] }} create | 50 | {% endif %} 51 |{{ item[2] }} | 52 | 53 | {% include 'inc/types.html' %} 54 | 55 | {% if editMode %} 56 |
57 |
58 |
59 | remove
60 |
61 |
62 | |
63 |
64 |
65 |
66 |
67 | add
68 |
69 |
70 | |
71 |
72 |
73 | {% else %}
74 |
75 |
76 | remove
77 |
78 | |
79 |
80 |
81 |
82 | add
83 |
84 | |
85 |
86 | {% endif %}
87 |