PageRenderTime 50ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/magehelp/application/views/products/products_grid_2.php

https://bitbucket.org/jit_bec/shopifine
PHP | 783 lines | 654 code | 94 blank | 35 comment | 36 complexity | 46222f2fb46dda9fbfeb2eaca3c5ba01 MD5 | raw file
Possible License(s): LGPL-3.0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Product Details</title>
  5. <?php $this->load->view("common/header"); ?>
  6. <!-- <script type="text/javascript" src="http://static.jstree.com/v.1.0pre/jquery.jstree.js"></script>-->
  7. <link rel="stylesheet" rev="stylesheet" href="<?php echo base_url();?>css/chosen.css" />
  8. <script src="<?php echo base_url();?>js/chosen.jquery.min.js" type="text/javascript" language="javascript" charset="UTF-8"></script>
  9. <script src="<?php echo base_url();?>js/jquery.jstree.js" type="text/javascript" language="javascript" charset="UTF-8"></script>
  10. <style type="text/css">
  11. #menubar_admin_navigation {
  12. top:49px;
  13. }
  14. #content_area{
  15. width:95%;
  16. }
  17. .column{width:40em;padding:1em;}
  18. html {
  19. overflow-x:hidden;
  20. }
  21. .chzn-container{
  22. font-size:inherit;
  23. }
  24. .chzn-container-multi .chzn-choices .search-field input {
  25. height:1em;
  26. }
  27. .field{
  28. width:100%;
  29. }
  30. .labeldiv{
  31. width:25%;
  32. }
  33. </style>
  34. <script type="text/javascript">
  35. $(function(){
  36. $.validator.addMethod('comboBoxrequired', function(value, element) {
  37. var selectId = element.id;
  38. var inputIdSelector = "#" + selectId + "-input";
  39. if (value == ""){
  40. inputVal = $(inputIdSelector).val();
  41. if (inputVal == "" || inputVal == null){
  42. return false;
  43. }
  44. }
  45. return true;
  46. }, 'Please select from the dropdown or add new element in box');
  47. $( "#dialog:ui-dialog" ).dialog( "destroy" );
  48. $( "#productForm" ).validate({
  49. ignore: [] ,
  50. errorPlacement: function(error, element) {
  51. error.appendTo( element.parent());
  52. }//,
  53. }
  54. );
  55. $( "#dialog-form" ).dialog({
  56. autoOpen: false,
  57. height: 'auto',
  58. width: '70%',
  59. position:[200,25],
  60. modal: true,
  61. buttons: {
  62. "Create the Product": {
  63. id:"create_product",
  64. text:"Create the Product",
  65. click:function() {
  66. var bValid = $("#productForm").valid();
  67. if (bValid ){
  68. var selectedIds = [];
  69. $('#treeViewDiv').jstree('get_selected').each(function(){
  70. selectedIds.push($(this).attr('id'));
  71. });
  72. $.ajax({
  73. url:"index.php/products/createBarcodeAndProduct",
  74. data: {barcodeData :{
  75. scannedBarcode : $("#productbarcode").val(),
  76. mfrOp : $("#mfrOp").val(),
  77. mfrIp: $("#mfrOp-input").val(),
  78. modelOp: $("#modelOp").val(),
  79. modelIp: $("#modelOp-input").val(),
  80. newModelIp: $("#newModelIp").val(),
  81. name: $("#name").val(),
  82. desc: $("#desc").val(),
  83. category:JSON.stringify(selectedIds),
  84. supplierOp: $("#supplierOp").val(),
  85. uomOp: $("#uomOp").val(),
  86. sizeOp: $("#sizeOp").val(),
  87. reorderLevel: $("#reorderLevel").val(),
  88. // costPrice: $("#costPrice").val(),
  89. // price: $("#price").val(),
  90. attributeSet:$("#attributeSetOp").val(),
  91. packageOp: $("#packageOp").val() }},
  92. type:"POST",
  93. success:function(serverresponse)
  94. {
  95. var response = JSON.parse(serverresponse);
  96. emptyMessages();
  97. if (response.status=='error'){
  98. showErrorMessage(response.message)
  99. }
  100. else {
  101. showSuccessMessage(response.message)
  102. $("#product").trigger("reloadGrid");
  103. }
  104. }
  105. });
  106. $( this ).dialog( "close" );
  107. }
  108. }
  109. }
  110. ,
  111. Cancel: function() {
  112. $( this ).dialog( "close" );
  113. }
  114. },
  115. close: function() {
  116. //allFields.val( "" ).removeClass( "ui-state-error" );
  117. $("#productbarcode").attr('disabled',false);
  118. $("#productForm").data('validator').resetForm();
  119. $('#productForm')[0].reset();
  120. }
  121. });
  122. $("#mfrOp").combobox({
  123. customChange: function () {
  124. if ($("#mfrOp").val()!="") {
  125. $.ajax({
  126. type:"post",
  127. data:{mfrName:$("#mfrOp-input").val(),mfr: $("#mfrOp").val()},
  128. url:"index.php/products/populateModel",
  129. success: function(data){
  130. $("#modelOp").children('option:not(:first)').remove();
  131. $("#modelOp").append(data);
  132. $("#modelOp").combobox();
  133. $("#modelCtnr").parent().slideDown(50);
  134. if (!$("#newModelCtnr").parent().is(':hidden')){
  135. $("#newModelCtnr").parent().slideUp(50);
  136. }
  137. }
  138. });
  139. }
  140. else {
  141. $("#newModelCtnr").parent().slideDown(50);
  142. if (!$("#modelCtnr").parent().is(':hidden')){
  143. $("#modelCtnr").parent().slideUp(50);
  144. }
  145. }
  146. }
  147. });
  148. $("#categoryOp").combobox();
  149. var myGrid = $("#product"),lastsel2,selectedMfrId,selectedModelId,selectedPkgId,selectUom,selectedDenom;
  150. myGrid.jqGrid({
  151. url:'index.php/products/populateProductsInGrid',
  152. datatype: 'json',
  153. mtype: 'GET',
  154. colNames:['Barcode',/*'System Name',*/'Product','Description','manufacturer_id','model_id','Manufacturer','Model',/*'Supplier',*/'package_id','Package Type',/*'Category',*/'Unit','Size/Quantity','Action'],
  155. colModel :[
  156. //{name:'id', index:'id', width:55},
  157. {name:'barcode',index:'barcode',width:120,align:'right',editable:false},
  158. // {name:'system_name',index:'system_name',width:90,align:'right',editable:false},
  159. {name:'product_name', index:'product_name', width:80, align:'right',editable:true,editoptions:{size:"20",maxlength:"30"}},
  160. {name:'description', index:'description', width:80, align:'right',editable:true,editoptions:{size:"20",maxlength:"30"}},
  161. {name:'manufacturer_id', index:'manufacturer_id', hidden:true},
  162. {name:'model_id', index:'model_id', hidden:true},
  163. {name:'manufacturer', index:'manufacturer', width:80, align:'right',editable:true,edittype:"select",editoptions:{dataEvents: [
  164. { type: 'change',
  165. fn: function(e) {
  166. var val = $("#manufacturer").val();
  167. $.ajax({type:'post',
  168. data:{mfr:val},
  169. url:'index.php/products/populateModel',
  170. success: function(modelHtml){
  171. //console.log ("change mfr");
  172. $("#model").children('option:not(:first)').remove();
  173. $("#model").append(modelHtml);
  174. }
  175. });
  176. }
  177. }
  178. ],dataUrl:"index.php/products/populateMfrs",buildSelect:function(response)
  179. {
  180. var select = "<select name=" + "mfrOpEdit" + "id =" +"mfrOpEdit" +">" +
  181. "<option value=" + ">Select one..." + response + "</select>";
  182. $.ajax({type:'post',
  183. data:{mfr:selectedMfrId},
  184. url:'index.php/products/populateModel',
  185. success: function(modelHtml){
  186. //console.log("ajax mfr" + selectedModelId );
  187. $("#model").children('option:not(:first)').remove();
  188. $("#model").append(modelHtml);
  189. $("#model").val(selectedModelId);
  190. }
  191. });
  192. return select;
  193. }}},
  194. {name:'model', index:'model', width:80, align:'right',editable:true,edittype:"select",editoptions:{dataUrl:"index.php/products/doNothing",buildSelect:function(response)
  195. {
  196. //console.log("build select");
  197. var select = "<select name=" + "modelOpEdit" + "id =" +"modelOpEdit" +">" +
  198. "<option value=" + ">Select one..." + "</select>";
  199. return select;
  200. }}},
  201. // {name:'supplier', index:'supplier', width:80, align:'right',editable:true,editoptions:{size:"20",maxlength:"30"}},
  202. {name:'package_id', index:'package_id', hidden:true},
  203. {name:'package_name', index:'package_name', width:80, align:'right',editable:true,edittype:"select",editoptions:{dataEvents: [
  204. { type: 'change',
  205. fn: function(e) {
  206. var val = $("#package_name").val();
  207. //console.log ("while changing" + val)
  208. $.ajax({type:"post",
  209. url:"index.php/products/populateMeasurementDropDowns",
  210. data: {pkgId : val},
  211. success: function(uomHtml){
  212. //console.log ("in success " + val);
  213. //console.log ("in success uomHtml " + uomHtml);
  214. $("#uom").children('option:not(:first)').remove();
  215. $("#uom").append(uomHtml);
  216. }
  217. });
  218. }
  219. }
  220. ],dataUrl:"index.php/products/populatePackages",buildSelect:function(response)
  221. {
  222. var select = "<select name=" + "mfrPkEdit" + "id =" +"mfrPkEdit" +">" +
  223. "<option value=" + ">Select one..." + response + "</select>";
  224. //console.log ("package type val " + selectedPkgId);
  225. $.ajax({type:"post",
  226. url:"index.php/products/populateMeasurementDropDowns",
  227. data: {pkgId : selectedPkgId},
  228. success: function(uomHtml){
  229. $("#uom").children('option:not(:first)').remove();
  230. $("#uom").append(uomHtml);
  231. //console.log ("before setting uom val " + selectUom);
  232. $("#uom").val(selectUom);
  233. }
  234. });
  235. return select;
  236. }}},
  237. // {name:'category', index:'category', width:100, align:'right',editable:false,editoptions:{size:"20",maxlength:"30"}},
  238. {name:'uom', index:'uom', width:40, align:'right',editable:true,edittype:"select",editoptions:{dataEvents: [
  239. { type: 'change',
  240. fn: function(e) {
  241. var val = $("#uom").val();
  242. //console.log ("while changing uom" + val)
  243. $.ajax({type:"post",
  244. url:"index.php/products/populateDenomDropdown",
  245. data: {uom : val},
  246. success: function(sizeHtml){
  247. if (sizeHtml!=null && sizeHtml!="") {
  248. if ($("#measurement_denomination").is(':disabled')){
  249. $("#measurement_denomination").attr('disabled','false');
  250. }
  251. $("#measurement_denomination").children('option:not(:first)').remove();
  252. $("#measurement_denomination").append(sizeHtml);
  253. }
  254. else {
  255. if (!$("#measurement_denomination").is(':disabled')){
  256. $("#measurement_denomination").attr('disabled','true');
  257. }
  258. }
  259. }
  260. });
  261. }
  262. }
  263. ],dataUrl:"index.php/products/populateMeasurementDropDowns",buildSelect:function(response)
  264. {
  265. var val = selectUom;
  266. //console.log("build uom" + val);
  267. var select = "<select name=" + "modelOpEdit" + "id =" +"modelOpEdit" +">" +
  268. "<option value=" + ">Select one..." + "</select>";
  269. return select;
  270. }}},
  271. {name:'measurement_denomination', index:'measurement_denomination', width:60, align:'right',editable:true,edittype:"select",editoptions:{dataUrl:"index.php/products/doNothing",buildSelect:function(response)
  272. {
  273. var val = selectUom;
  274. //console.log("build size" + val);
  275. var select = "<select name=" + "modelOpEdit" + "id =" +"modelOpEdit" +">" +
  276. "<option value=" + ">Select one..." + "</select>";
  277. $.ajax({type:"post",
  278. url:"index.php/products/populateDenomDropdown",
  279. data: {uom : val},
  280. success: function(sizeHtml){
  281. if (sizeHtml!=null && sizeHtml!="") {
  282. if ($("#measurement_denomination").is(':disabled')){
  283. $("#measurement_denomination").attr('disabled','false');
  284. }
  285. //console.log ("measurement denom " + sizeHtml);
  286. //console.log ("measurement denom sel " + selectedDenom);
  287. $("#measurement_denomination").children('option:not(:first)').remove();
  288. $("#measurement_denomination").append(sizeHtml);
  289. $("#measurement_denomination").val(selectedDenom);
  290. }
  291. else {
  292. if (!$("#measurement_denomination").is(':disabled')){
  293. $("#measurement_denomination").attr('disabled','true');
  294. }
  295. }
  296. }
  297. });
  298. return select;
  299. }}},
  300. //{name:'isactive', index:'isactive', width:30, align:'right',editable:true,edittype:"select", formatter:'select', editoptions:{value:"1:Yes;0:No"}}
  301. {name:'generate', index:'generate', width:80, align:'right',editable:false,search:false,formatter:'showlink', formatoptions:{baseLinkUrl:'index.php/products/printBarcode'},cellattr: function (rowId, val, rawObject, cm, rdata)
  302. {
  303. //console.log(rawObject[0]);
  304. return 'title="' + rawObject[0]+'"';
  305. }}
  306. ],
  307. pager: '#pager',
  308. rowNum:10,
  309. rowList:[5,10,20],
  310. sortname: 'id',
  311. sortorder: 'desc',
  312. viewrecords: true,
  313. gridview: true,
  314. ignoreCase:true,
  315. rownumbers:true,
  316. caption: 'Products',
  317. multiselect:true,
  318. height: '100%',
  319. width:'90%',
  320. jsonReader : {
  321. root:"productdata",
  322. page: "page",
  323. total: "total",
  324. records: "records",
  325. cell: "dprow",
  326. id: "id"
  327. },
  328. onSelectRow: function(id){
  329. lastsel2 = id;
  330. selectedMfrId = myGrid.jqGrid("getCell",id,"manufacturer_id");
  331. selectedModelId = myGrid.jqGrid("getCell",id,"model_id");
  332. selectedPkgId = myGrid.jqGrid("getCell",id,"package_id");
  333. selectUom = myGrid.jqGrid("getCell",id,"uom");
  334. selectedDenom = myGrid.jqGrid("getCell",id,"measurement_denomination");
  335. },
  336. editurl:'index.php/products/editProduct',
  337. postData:{"test":"val"}
  338. }).navGrid("#pager",{edit:true,add:false,del:false,search:false},{height:280,reloadAfterSubmit:false,closeAfterEdit:true,recreateForm:true,checkOnSubmit:true},{},{},{},{});
  339. myGrid.jqGrid('navButtonAdd','#pager',{
  340. caption:"",
  341. title:"Export as csv",
  342. id:"export_product",
  343. onClickButton : function () {
  344. myGrid.jqGrid('excelExport',{tag:"csv","url":"index.php/products/exportProductsInGrid"});
  345. }
  346. });
  347. myGrid.jqGrid('navButtonAdd','#pager',{
  348. caption:"",
  349. title:"Create Product",
  350. buttonicon:"ui-icon-plus",
  351. id:"add_product",
  352. onClickButton : function () {
  353. $("#newModelCtnr").parent().css("display","none");
  354. $("#modelCtnr").parent().css("display","none");
  355. $( "#dialog-form" ).dialog( "open" );
  356. }
  357. });
  358. myGrid.jqGrid('navButtonAdd','#pager',{
  359. caption:"",
  360. title:"Mark as inactive",
  361. id:"inactive_product",
  362. buttonicon:"ui-icon-locked",
  363. onClickButton : function (id) {
  364. var rowid = myGrid.jqGrid('getGridParam', 'selarrrow');
  365. $.ajax({type:"post",
  366. url:"index.php/products/deactivate",
  367. data: {ids : rowid},
  368. success: function(){
  369. $("#product").trigger("reloadGrid");
  370. }
  371. });
  372. }
  373. });
  374. myGrid.jqGrid('navButtonAdd','#pager',{
  375. caption:"",
  376. title:"Mark as active",
  377. id:"active_product",
  378. buttonicon:"ui-icon-unlocked",
  379. onClickButton : function (id) {
  380. var rowid = myGrid.jqGrid('getGridParam', 'selarrrow');
  381. $.ajax({type:"post",
  382. url:"index.php/products/activate",
  383. data: {ids : rowid},
  384. success: function(){
  385. $("#product").trigger("reloadGrid");
  386. }
  387. });
  388. }
  389. });
  390. myGrid.jqGrid('navButtonAdd','#pager',{
  391. caption:"",
  392. title:"Load all ",
  393. id:"load_product",
  394. buttonicon:"ui-icon-arrow-4-diag",
  395. onClickButton : function (id) {
  396. var rowid = myGrid.jqGrid('getGridParam', 'selarrrow');
  397. $.ajax({type:"post",
  398. url:"index.php/products/populateProductsInGrid",
  399. data: {loadall : true},
  400. success: function(response){
  401. //$("#product").trigger("reloadGrid");
  402. var grid = jQuery("#product")[0];
  403. var myjsongrid = eval("("+response+")");
  404. grid.addJSONData(myjsongrid);
  405. }
  406. });
  407. }
  408. });
  409. myGrid.jqGrid ('navButtonAdd', '#pager',
  410. { caption: "", buttonicon: "ui-icon-calculator",
  411. title: "Choose Columns",
  412. onClickButton: function() {
  413. myGrid.jqGrid('columnChooser');
  414. }
  415. });
  416. $("#add_product").insertBefore("#edit_product");
  417. myGrid.jqGrid('filterToolbar', {stringResult: true, searchOnEnter: true, defaultSearch : "cn"});
  418. $(".chzn-select").chosen();
  419. $("#treeViewDiv")
  420. .jstree({
  421. "plugins" : ["themes", "json_data", "ui"],
  422. "json_data" : {
  423. "ajax" : {
  424. "type": 'GET',
  425. "url": function (node) {
  426. var nodeId = "";
  427. var url = ""
  428. if (node == -1)
  429. {
  430. url = "index.php/utilities/renderParents";
  431. }
  432. else
  433. {
  434. nodeId = node.attr('id');
  435. url = "index.php/utilities/renderChildren";
  436. }
  437. return url;
  438. },
  439. data : function(node) {
  440. if (node != -1){
  441. return {
  442. "nodeid":$.trim(node.attr('id'))
  443. }
  444. }
  445. },
  446. "success": function (new_data) {
  447. return new_data;
  448. }
  449. }
  450. }})
  451. });
  452. </script>
  453. </head>
  454. <body>
  455. <?php $this->load->view("common/menubar"); ?>
  456. <!-- <button id="create-product">Create New Product</button> -->
  457. <!--<button id="inv-management" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"><span class="ui-button-text"> Manage Inventory</span></button>-->
  458. <div id ="dialog-form" title="Add New Product Entity">
  459. <!-- <h1 id="formHeader">Add New Product Entity</h1> -->
  460. <form id="productForm">
  461. <fieldset>
  462. <div class="row">
  463. <div class="column">
  464. <div class="field">
  465. <label for="hasBarcode" class="labeldiv">Product Do Not Have Barcode</label>
  466. <input id="hasBarcode" name ="hasBarcode" type="checkbox"/>
  467. </div>
  468. </div>
  469. <div class="column">
  470. <div class="field">
  471. <label for="productbarcode" class="labeldiv">Scan/ Type Barcode:</label>
  472. <input id="productbarcode" name ="productbarcode" type="text" class="required"/>
  473. </div>
  474. </div>
  475. </div>
  476. <div class="row inithide">
  477. <div class="column">
  478. <div class="field">
  479. <label for="name" class="labeldiv">Name of Product Entity:</label>
  480. <input id="name" name ="name" type="text" class="required"/>
  481. </div>
  482. </div>
  483. <div class="column">
  484. <div class="field">
  485. <label for="attributeSetOp" class="labeldiv">Attribute Set:</label>
  486. <select name="attributeSetOp" id ="attributeSetOp" class="required">
  487. <option value="">Choose
  488. <?= $attributeSetOptions ?>
  489. </select>
  490. </div>
  491. </div>
  492. </div>
  493. <div class="row inithide">
  494. <div class="column">
  495. <div class="field">
  496. <label for="desc" class="labeldiv">Description:</label>
  497. <textarea id="desc" name ="desc" rows="3" cols="30" class="required"></textarea>
  498. </div>
  499. </div>
  500. <div class="column">
  501. <div class="field">
  502. <label for="metadesc" class="labeldiv">Meta Description:</label>
  503. <textarea id="metadesc" name ="metadesc" rows="3" cols="30"></textarea>
  504. </div>
  505. </div>
  506. </div>
  507. <div class="row">
  508. <div class="column">
  509. <div id="mfrCtnr">
  510. <div class="ui-widget field">
  511. <label for="mfrOp" class="labeldiv">Manufacturer :</label>
  512. <select name="mfrOp" id ="mfrOp">
  513. <option value="">Select one...
  514. <?= $mfrOptions?>
  515. </select>
  516. <input id="reqBarcodeMfr" name ="reqBarcodeMfr" type="checkbox" class="reqBarcode reqBarcodeAC"/>
  517. </div>
  518. </div>
  519. </div>
  520. <div class="column" style="display:none">
  521. <div id="modelCtnr">
  522. <div class="ui-widget field">
  523. <label for="modelOp" class="labeldiv">Model :</label>
  524. <select name="modelOp" id ="modelOp" >
  525. <option value="">Select one...
  526. <?= $modelOptions?>
  527. </select>
  528. <input id="reqBarcodeModel" name ="reqBarcodeModel" type="checkbox" class="reqBarcode reqBarcodeAC"/>
  529. </div>
  530. </div>
  531. </div>
  532. <div class="column" style="display:none">
  533. <div id="newModelCtnr">
  534. <div class="field">
  535. <label for="newModelIp" class="labeldiv">Specify New Model Type :</label>
  536. <input id="newModelIp" name ="newModelIp" type="text"/>
  537. </div>
  538. </div>
  539. </div>
  540. </div>
  541. <div class="row">
  542. <div class="column">
  543. <div class="field">
  544. <label for="categoryOp" class="labeldiv">Category:</label>
  545. <!-- <select name="categoryOp" id ="categoryOp" >
  546. <option value="">Choose
  547. <?= $categoryOptions ?>
  548. </select>-->
  549. <div id="treeViewDiv" style="display:inline-block">
  550. </div>
  551. <!--<input id="categoryReq" name ="reqBarcodeCat" type="checkbox" class="reqBarcodeAC "/>-->
  552. </div>
  553. </div>
  554. <div class="column">
  555. <div class="field">
  556. <label for="supplierOp" class="labeldiv">Supplier:</label>
  557. <select name="supplierOp[]" id ="supplierOp" class="chzn-select" multiple="multiple" style="width:15em;;height:1em;">
  558. <?= $supplierOptions ?>
  559. </select>
  560. </div>
  561. </div>
  562. </div>
  563. <div class="row">
  564. <div class="column">
  565. <div class="field">
  566. <label for="packageOp" class="labeldiv">Package:</label>
  567. <select name="packageOp" id ="packageOp" class="required">
  568. <option value="">Choose
  569. <?= $pkgOptions ?>
  570. </select>
  571. </div>
  572. </div>
  573. <div class="column">
  574. <div class="field">
  575. <label for="reorderLevel" class="labeldiv">Reorder Level :</label>
  576. <input id="reorderLevel" name="reorderLevel" type="text"/>
  577. </div>
  578. </div>
  579. </div>
  580. <div class="row">
  581. <div class="column">
  582. <div class="field">
  583. <label for="uomOp" class="labeldiv">Unit Of Measurement:</label>
  584. <select name="uomOp" id ="uomOp" class="required">
  585. <option value="">Choose
  586. </select>
  587. </div>
  588. </div>
  589. <div class="column">
  590. <div class="field" style="display:none">
  591. <label for="sizeOp" class="labeldiv">Measurement Denomination:</label>
  592. <select name="sizeOp" id ="sizeOp" class="required">
  593. <option value="">Choose
  594. </select>
  595. </div>
  596. </div>
  597. </div>
  598. <!-- <div class="row">
  599. <div class="column">
  600. <div class="field">
  601. <label for="costPrice" class="labeldiv">Cost Price :</label>
  602. <input id="costPrice" name="costPrice" type="text"/>
  603. </div>
  604. </div>
  605. <div class="column">
  606. <div class="field">
  607. <label for="price" class="labeldiv">Final Price :</label>
  608. <input id="price" name="price" type="text"/>
  609. </div>
  610. </div>
  611. </div>-->
  612. </fieldset>
  613. </form>
  614. </div>
  615. <div style="display: block;height: 100%;width:90%;left:0em;" class="shopifine-ui-dialog ui-widget ui-widget-content ui-corner-all" tabindex="-1" role="dialog" aria-labelledby="ui-dialog-title-dialog-form">
  616. <?php $this->load->view("common/message"); ?>
  617. <table id="product"><tr><td/></tr></table>
  618. <div id="pager"></div>
  619. </div>
  620. <!-- <button id="create-product">Create New Product</button>-->
  621. <!-- <div id="feedback_bar"></div>-->
  622. <?php $this->load->view("partial/footer"); ?>
  623. </body>
  624. </html>
  625. <script type="text/javascript">
  626. $("#packageOp").change(function(){
  627. var val = $(this).val();
  628. $.ajax({type:"post",
  629. url:"index.php/products/populateMeasurementDropDowns",
  630. data: {pkgId : val},
  631. success: function(uomHtml){
  632. $("#uomOp").children('option:not(:first)').remove();
  633. $("#uomOp").append(uomHtml);
  634. }
  635. });
  636. });
  637. $("#uomOp").change(function(){
  638. var val = $(this).val();
  639. $.ajax({type:"post",
  640. url:"index.php/products/populateDenomDropdown",
  641. data: {uom : val},
  642. success: function(uomHtml){
  643. if (uomHtml!=null && uomHtml!="") {
  644. if ($("#sizeOp").parent().is(':hidden')){
  645. $("#sizeOp").parent().slideDown(50);
  646. }
  647. $("#sizeOp").children('option:not(:first)').remove();
  648. $("#sizeOp").append(uomHtml);
  649. }
  650. else {
  651. if (!$("#sizeOp").parent().is(':hidden')){
  652. $("#sizeOp").parent().slideUp(50);
  653. }
  654. }
  655. }
  656. });
  657. });
  658. $(".reqBarcodeAC").change(function (){
  659. var checked = $(this).is(':checked');
  660. if (checked){
  661. $(this).parent().find('select').addClass("comboBoxrequired");
  662. }
  663. else {
  664. $(this).parent().find('select').removeClass("comboBoxrequired");
  665. }
  666. })
  667. // $(".reqBarcodetree").change(function (){
  668. // var checked = $(this).is(':checked');
  669. // if (checked){
  670. // $(this).parent().find('select').addClass("comboBoxrequired");
  671. //
  672. // }
  673. // else {
  674. // $(this).parent().find('select').removeClass("comboBoxrequired");
  675. // }
  676. // })
  677. $("#hasBarcode").change(function (){
  678. var checked = $(this).is(':checked');
  679. if (checked){
  680. $("#productbarcode").attr('disabled',true);
  681. }
  682. else {
  683. $("#productbarcode").attr('disabled',false);
  684. }
  685. })
  686. $("#inv-management").click(function (){
  687. document.location.href="index.php/products/loadInventory";
  688. })
  689. </script>