PageRenderTime 725ms CodeModel.GetById 51ms RepoModel.GetById 18ms app.codeStats 0ms

/opensourcepos/application/views/products/product_details.php

https://bitbucket.org/jit_bec/shopifine
PHP | 315 lines | 239 code | 74 blank | 2 comment | 1 complexity | e2f7f6810cf9f117ce79fce1bf92349e MD5 | raw file
Possible License(s): LGPL-3.0
  1. <html><head>
  2. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  3. <title> Add product details and generate barcode</title>
  4. <!-- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  5. <script type="text/javascript" src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>
  6. <link rel="stylesheet" type="text/css" href="/css/normalize.css">
  7. <link rel="stylesheet" type="text/css" href="/css/result-light.css">
  8. <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/ui-lightness/jquery-ui.css">
  9. <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script>-->
  10. <?php $this->load->view("common/header"); ?>
  11. <link rel="stylesheet" rev="stylesheet" href="<?php echo base_url();?>css/shopifine.css" />
  12. <!-- <style type="text/css">
  13. body { font-size: 62.5%; }
  14. label, input { display:block; }
  15. input.text { margin-bottom:12px; width:95%; padding: .4em; }
  16. fieldset { padding:0; border:0; margin-top:25px; }
  17. h1 { font-size: 1.2em; margin: .6em 0; }
  18. div#users-contain { width: 350px; margin: 20px 0; }
  19. div#users-contain table { margin: 1em 0; border-collapse: collapse; width: 100%; }
  20. div#users-contain table td, div#users-contain table th { border: 1px solid #eee; padding: .6em 10px; text-align: left; }
  21. .ui-dialog .ui-state-error { padding: .3em; }
  22. .validateTips { border: 1px solid transparent; padding: 0.3em; }
  23. * { font-family: Verdana; font-size: 96%; }
  24. label { width: 10em; float: left; }
  25. label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
  26. p , .column{ clear: both; }
  27. .submit { margin-left: 12em; }
  28. em { font-weight: bold; padding-right: 1em; vertical-align: top; }
  29. </style>-->
  30. <script type="text/javascript">//<![CDATA[
  31. $(function() {
  32. // a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
  33. $( "#dialog:ui-dialog" ).dialog( "destroy" );
  34. $( "#productForm" ).validate();
  35. $( "#dialog-form" ).dialog({
  36. autoOpen: false,
  37. height: 300,
  38. width: 350,
  39. position:[300,200],
  40. modal: true,
  41. buttons: {
  42. "Create the Product": function() {
  43. bValid = $("#productForm").valid();
  44. if (bValid ){
  45. $.ajax({
  46. url:"/echo/html/",
  47. data: { html: "<tr>" +
  48. "<td>" + $( "#name" ).val() + "</td>" +
  49. "<td>" + $( "#email" ).val() + "</td>" +
  50. "<td>" + $( "#password" ).val() + "</td>" +
  51. "</tr>"},
  52. type:"POST",
  53. success:function(response)
  54. {
  55. console.log(response);
  56. $( "#users tbody" ).append(response);
  57. }
  58. });
  59. $( this ).dialog( "close" );
  60. }
  61. },
  62. Cancel: function() {
  63. $( this ).dialog( "close" );
  64. }
  65. },
  66. close: function() {
  67. }
  68. });
  69. $( "#create-product" )
  70. .button()
  71. .click(function() {
  72. $( "#dialog-form" ).dialog( "open" );
  73. });
  74. $("#mfr").autocomplete({
  75. source: <?php echo $mfrs ?>,
  76. focus: function( event, ui ) {
  77. $( "#mfr" ).val( ui.item.label );
  78. return false;
  79. },
  80. select: function( event, ui ) {
  81. $( "#mfr" ).val( ui.item.label );
  82. $( "#mfr-hidden" ).val( ui.item.value );
  83. return false;
  84. }
  85. });
  86. $("#model").autocomplete({
  87. source: "index.php/products/populateBarcodesForStock",
  88. focus: function( event, ui ) {
  89. $( "#model" ).val( ui.item.label );
  90. return false;
  91. },
  92. select: function( event, ui ) {
  93. $( "#model" ).val( ui.item.label );
  94. $( "#model-hidden" ).val( ui.item.value );
  95. return false;
  96. }
  97. });
  98. });
  99. //]]>
  100. </script>
  101. </head>
  102. <body>
  103. <?php $this->load->view("common/menubar"); ?>
  104. <div id ="dialog-form">
  105. <h1 id="formHeader">Add New Product Entity</h1>
  106. <form id="productForm">
  107. <fieldset>
  108. <div class="row">
  109. <div class="column">
  110. <div class="field">
  111. <label for="name">Name of Product Entity:</label>
  112. <input id="name" name ="name" type="text" class="required"/>
  113. </div>
  114. </div>
  115. <div class="column">
  116. <div class="field">
  117. <label for="desc">Description:</label>
  118. <input id="desc" name ="desc" type="text"/>
  119. </div>
  120. </div>
  121. </div>
  122. <div class="row">
  123. <div class="column">
  124. <div class="field">
  125. <label for="mfr">Manufacturer:</label>
  126. <input id="mfr" name ="mfr" type="text" class="required"/>
  127. </div>
  128. <input id="mfr-hidden" name ="mfr-hidden" type="hidden"/>
  129. </div>
  130. <div class="column">
  131. <div class="field">
  132. <label for="model">Model:</label>
  133. <input id="model" name ="model" type="text"/>
  134. </div>
  135. <input id="model-hidden" name ="model-hidden" type="hidden"/>
  136. </div>
  137. </div>
  138. <div class="row">
  139. <div class="column">
  140. <div class="field">
  141. <label for="categoryOp">Category:</label>
  142. <select name="categoryOp" id ="categoryOp" class="required">
  143. <option value=0>Choose
  144. <?=$categoryOptions?>
  145. </select>
  146. </div>
  147. </div>
  148. <div class="column">
  149. <div class="field">
  150. <label for="supplierOp">Supplier:</label>
  151. <select name="supplierOp" id ="supplierOp" class="opt required">
  152. <option value=0>Choose
  153. <?=$supplierOptions?>
  154. </select>
  155. </div>
  156. </div>
  157. </div>
  158. <div class="row">
  159. <div class="column">
  160. <div class="field">
  161. <label for="packageOp">Package:</label>
  162. <select name="packageOp" id ="packageOp" class="required">
  163. <option value=0>Choose
  164. <?=$pkgOptions?>
  165. </select>
  166. </div>
  167. </div>
  168. <div class="column">
  169. <div class="field">
  170. <label for="pkgType">Package Type:</label>
  171. <input id="pkgType" name ="pkgType" type="text"/>
  172. </div>
  173. </div>
  174. </div>
  175. <div class="row">
  176. <div class="column">
  177. <div class="field">
  178. <label for="uomOp">Unit Of Measurement:</label>
  179. <select name="uomOp" id ="uomOp" class="opt required">
  180. <option value=0>Choose
  181. </select>
  182. </div>
  183. </div>
  184. <div class="column">
  185. <div class="field">
  186. <label for="sizeOp">Measurement Denomination:</label>
  187. <select name="sizeOp" id ="sizeOp" class="opt required">
  188. <option value=0>Choose
  189. </select>
  190. </div>
  191. </div>
  192. </div>
  193. </fieldset>
  194. </form>
  195. </div>
  196. <div id="users-contain" class="ui-widget">
  197. <h1>Existing Users:</h1>
  198. <table id="products" class="ui-widget ui-widget-content">
  199. <thead>
  200. <tr class="ui-widget-header ">
  201. <th>Barcode</th>
  202. <th>Product</th>
  203. <th>Description</th>
  204. <th>Manufacturer</th>
  205. <th>Model</th>
  206. <th>Supplier</th>
  207. <th>Package</th>
  208. <th>Package Type</th>
  209. </tr>
  210. </thead>
  211. <tbody>
  212. </tbody>
  213. </table>
  214. </div>
  215. <button id="create-product">Create new Product</button>
  216. </body>
  217. </html>
  218. <script type="text/javascript">
  219. $("#packageOp").change(function(){
  220. var val = $(this).val();
  221. $.ajax({type:"post",
  222. url:"index.php/products/populateMeasurementDropDowns",
  223. data: {pkgId : val},
  224. success: function(uomHtml){
  225. $("#uomOp").children('option:not(:first)').remove();
  226. $("#uomOp").append(uomHtml);
  227. }
  228. });
  229. });
  230. $("#uomOp").change(function(){
  231. var val = $(this).val();
  232. $.ajax({type:"post",
  233. data:{uom:val},
  234. url:"index.php/products/populateDenomDropdown",
  235. success: function(sizeHtml){
  236. $("#sizeOp").children('option:not(:first)').remove();
  237. $("#sizeOp").append(sizeHtml);
  238. }}
  239. )
  240. });
  241. </script>