PageRenderTime 53ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 1ms

/opensourcepos/application/views/procurement/quote/purchase_quote_grid_1.php

https://bitbucket.org/jit_bec/shopifine
PHP | 781 lines | 662 code | 80 blank | 39 comment | 23 complexity | 74bfb3f44dc4d757bdd37163314cc37b MD5 | raw file
Possible License(s): LGPL-3.0
  1. <html>
  2. <head>
  3. <?php $this->load->view("common/header"); ?>
  4. <!-- <script type="text/javascript" src="http://jzaefferer.github.com/jquery-validation/jquery.validate.js"></script>-->
  5. <style>
  6. .column {
  7. float: left;
  8. padding: 1em 1em 3em;
  9. width: 100%;
  10. }
  11. .base-column{
  12. padding: 1em 1em 1em;
  13. }
  14. .field{
  15. width:100%;
  16. }
  17. .ui-widget-header {height:12px;}
  18. .quote-column {
  19. float: left;
  20. padding-bottom: 0.5em;
  21. width: 45em;
  22. }
  23. .ui-combobox-input{
  24. width:23em;
  25. }
  26. #supplierOp-input{
  27. width:10em;
  28. }
  29. #warehouseOp-input{
  30. width:10em;
  31. }
  32. .shopifine-ui-dialog{
  33. height:auto;
  34. }
  35. .ui-tabs {
  36. height: 20em;
  37. margin: 0 auto;
  38. width: 45%;
  39. left:0;
  40. }
  41. .calculated {
  42. color: green;
  43. font-size: 90%;
  44. }
  45. .ui-tabs-nav{
  46. height:22px;
  47. }
  48. </style>
  49. <script type="text/javascript">
  50. $(function() {
  51. $.validator.addMethod('minStrict', function (value, el, param) {
  52. return value > param;
  53. },"Price must be more than 0");
  54. $.validator.addMethod('hasItems', function (value, el, param) {
  55. if($("#quoteId").val()!=""){
  56. var noOfRows = $("#lineItems").getGridParam("records");
  57. //alert(noOfRows);
  58. if (noOfRows<1){
  59. return false;
  60. }
  61. }
  62. return true;
  63. },"Items must be added for Quote");
  64. //form validation
  65. $("#quoteForm").validate({
  66. rules:{
  67. quoteId:{
  68. hasItems:true
  69. }
  70. }
  71. }
  72. );
  73. $("#itemForm").validate({rules:{
  74. quantity:{
  75. required:true,
  76. digits:true,
  77. min:1
  78. },
  79. exPrice:{
  80. number:true
  81. }
  82. }}
  83. );
  84. // datepicker for Add Form
  85. $( "#reqdate" ).datepicker({
  86. showOn: "button",
  87. buttonImage: "images/calendar.gif",
  88. buttonImageOnly: true,
  89. dateFormat:"dd/mm/yy",
  90. minDate:0
  91. });
  92. $( "#neededdate" ).datepicker({
  93. showOn: "button",
  94. buttonImage: "images/calendar.gif",
  95. buttonImageOnly: true,
  96. dateFormat:"dd/mm/yy",
  97. minDate:0
  98. });
  99. function quotegriddates(id){
  100. jQuery("#"+id+"_needed_by_date","#quotes").datepicker({dateFormat:"yy-mm-dd",minDate:0});
  101. }
  102. function quoteitemgriddates(id){
  103. jQuery("#"+id+"_needed_by_date","#lineItems").datepicker({dateFormat:"yy-mm-dd",minDate:0});
  104. }
  105. //end datepicker
  106. //com bo boxes
  107. // $("#warehouseOp").combobox();
  108. // $("#supplierOp").combobox();
  109. $("#productOp").combobox({customChange:function(){
  110. console.log("product id = " + $("#productOp").val());
  111. $.ajax({
  112. type:"GET",
  113. url:'index.php/procurement/getCostPrice',
  114. data:{productid:$("#productOp").val()},
  115. success:function (response){
  116. $("#curPrice").text(" The Current Average Cost Price Is " +response );
  117. }
  118. })
  119. }}
  120. );
  121. //end combox
  122. var lastsel;
  123. var editparametersitems = {
  124. "keys" : true,
  125. "oneditfunc" : quoteitemgriddates,
  126. "successfunc" : function(){
  127. lastsel=undefined;
  128. $("#lineItems").trigger("reloadGrid");
  129. },
  130. "aftersavefunc" : null,
  131. "errorfunc": function(){
  132. lastsel=undefined;
  133. },
  134. "afterrestorefunc" : null,
  135. "restoreAfterError" : true,
  136. "mtype" : "POST"
  137. };
  138. $( "#dialog-form" ).dialog({
  139. autoOpen: false,
  140. height: 'auto',
  141. width: '60%',
  142. modal: true,
  143. buttons: {
  144. "DoneButton": {
  145. id:"doneBtn",
  146. text:"Create Quote",
  147. click:function() {
  148. var isValid = $("#quoteForm").valid();
  149. if (isValid){
  150. $.ajax({url:"index.php/procurement/createRFQ",
  151. type:"POST",
  152. data:{ quoteId:$("#quoteId").val(),
  153. supplierId:$("#supplierOp").val(),
  154. warehouseId:$("#warehouseOp").val(),
  155. reqdate:$("#reqdate").val(),
  156. notes:$("#desc").val()
  157. },
  158. success:function(response)
  159. {
  160. console.log($("#quoteId").val());
  161. if ($("#quoteId").val()==""){
  162. console.log("if");
  163. if (response !='error'){
  164. $("#quoteId").val(response);
  165. $("#pkdheader").show();
  166. $("#doneBtn > span").text("Done");
  167. $("#lineItems").jqGrid({
  168. url:'index.php/procurement/populateQuoteItems',
  169. datatype: 'json',
  170. mtype: 'POST',
  171. postData:{quoteId: $("#quoteId").val()},
  172. colNames:['Product','Quantity','Need By Date','Expected Price','Estimated Value','Notes'],
  173. colModel :[
  174. {name:'name', index:'name',editable:false, width:80, align:'right'},
  175. {name:'quoted_quantity', index:'quoted_quantity', editable:true,width:140, align:'right'},
  176. {name:'needed_by_date',index:'needed_by_date',editable:true, width:80, align:'right'},
  177. {name:'expected_price',index:'expected_price',editable:true, width:80, align:'right'},
  178. {name:'estimated_value', index:'estimated_value',editable:false, width:80, align:'right'},
  179. {name:'comments', index:'comments',editable:true, width:180, align:'right'}
  180. ],
  181. pager: '#pagerPk',
  182. rowNum:10,
  183. rowList:[5,10,20],
  184. sortname: 'id',
  185. sortorder: 'desc',
  186. viewrecords: true,
  187. gridview: true,
  188. ignoreCase:true,
  189. rownumbers:true,
  190. height:'auto',
  191. width:680,
  192. caption: 'Line Items',
  193. jsonReader : {
  194. root:"quoteitemdata",
  195. page: "page",
  196. total: "total",
  197. records: "records",
  198. cell: "dprow",
  199. id: "id"
  200. },
  201. onSelectRow: function(id){if(id && id!==lastsel){
  202. $("#lineItems").restoreRow(lastsel);
  203. $("#lineItems").editRow(id,editparametersitems);
  204. lastsel=id;
  205. }
  206. },
  207. editurl:'index.php/procurement/modifyQuoteItem'
  208. }).navGrid("#pagerPk",{edit:false,add:false,del:true,search:false},{},{},{},{},{});
  209. $("#lineItems").jqGrid('navButtonAdd','#pagerPk',{
  210. caption:"",
  211. title:"Add Line Items",
  212. buttonicon:"ui-icon-plus",
  213. id:"add_lineItems",
  214. onClickButton : function () {
  215. //need to pass grid id for dynamic reload;
  216. $( "#dialog-form-item" ).data('grid_id','lineItems').dialog( "open" );
  217. }
  218. });
  219. $("#del_lineItems").insertAfter("#add_lineItems");
  220. }
  221. }
  222. else {
  223. console.log("else");
  224. $("#quoteId").val("");
  225. }
  226. } //end success of Ajax
  227. }) //end ajax
  228. if ($("#quoteId").val()!=""){
  229. $( this ).dialog( "close" );
  230. }
  231. } //end ifvalid
  232. }}, //end of Create button
  233. Cancel: function() {
  234. $.ajax({
  235. method:"POST",
  236. data:{id:$("#quoteId").val(),oper:'del'},
  237. url:'index.php/procurement/modifyQuote'
  238. })
  239. $("#quoteId").val("");
  240. $( this ).dialog( "close" );
  241. }
  242. },//end buttons
  243. open:function(event,ui){
  244. // reset everything . hack for close funcion bug
  245. $("#pkdheader").hide();
  246. $("#lineItems").jqGrid("GridUnload");
  247. $("#quoteId").val("");//this was also getting set during subgrid exapand, So resetting it.
  248. $("#reqdateval").val("");
  249. $("#warehouseval").val("");
  250. $("#supval").val("");
  251. $("#notesval").val("")
  252. $("#tabs").tabs({
  253. load: function(event,ui){
  254. //console.log( ui);
  255. $( "#reqdate" ).datepicker({
  256. showOn: "button",
  257. buttonImage: "images/calendar.gif",
  258. buttonImageOnly: true,
  259. dateFormat:"dd/mm/yy",
  260. minDate:0
  261. });
  262. if (ui.tab.id=="base"){
  263. $("#supplierOp").val($("#supval").val());
  264. $("#warehouseOp").val($("#warehouseval").val());
  265. $("#reqdate").val($("#reqdateval").val());
  266. // reset
  267. $("#reqdateval").val("");
  268. $("#warehouseval").val("");
  269. $("#supval").val("");
  270. }
  271. else if (ui.tab.id=="notes"){
  272. $("#approveNotes").val($("#notesval").val());
  273. // reset
  274. $("#notesval").val("");
  275. }
  276. },
  277. beforeActivate: function (event,ui){
  278. console.log(ui.newTab[0].id);
  279. console.log(ui.oldTab[0].id);
  280. if (ui.newTab[0].id=="notesLink"){
  281. // save old values
  282. $("#reqdateval").val($("#reqdate").val());
  283. $("#warehouseval").val($("#warehouseOp").val());
  284. $("#supval").val($("#supplierOp").val());
  285. }
  286. else if (ui.newTab[0].id=="baseLink"){
  287. $("#notesval").val($("#approveNotes").val());
  288. }
  289. }
  290. });
  291. },
  292. close: function(event,ui) {
  293. //allFields.val( "" ).removeClass( "ui-state-error" );
  294. $("#quoteForm").data('validator').resetForm();
  295. $("#quoteForm")[0].reset();
  296. $("#lineItems").jqGrid("GridUnload");
  297. $("pkdheader").hide();
  298. $("#doneBtn > span").text("Create Quote");
  299. $("#quotes").trigger("reloadGrid");
  300. var noOfRec =$("#lineItems").getGridParam("records");
  301. if (noOfRec<1){
  302. $.ajax({
  303. method:"POST",
  304. data:{id:$("#quoteId").val()},
  305. url:'index.php/procurement/closeValidate'
  306. })
  307. }
  308. }
  309. });
  310. //Line Item Dialog
  311. $( "#dialog-form-item" ).dialog({
  312. autoOpen: false,
  313. height: 'auto',
  314. width: '40%',
  315. position:[350,25],
  316. modal: true,
  317. buttons: {
  318. "Add Item": function() {
  319. var isvalid = $("#itemForm").valid();
  320. var grid = $(this).data('grid_id');
  321. if (isvalid){
  322. $.ajax({
  323. url:"index.php/procurement/addQuoteItem",
  324. type:"POST",
  325. data:{
  326. quoteid:$("#quoteId").val(),
  327. productid:$("#productOp").val(),
  328. needeedByDate:$("#neededdate").val(),
  329. quantity:$("#quantity").val(),
  330. exprice:$("#exPrice").val(),
  331. descItem:$("#descItem").val()
  332. },
  333. success:function (response){
  334. // $("#lineItems").trigger("reloadGrid");
  335. console.log("grid " + grid);
  336. $("#"+grid).trigger("reloadGrid");
  337. }
  338. })
  339. $( this ).dialog( "close" );
  340. }
  341. },
  342. Cancel: function() {
  343. $( this ).dialog( "close" );
  344. }
  345. },
  346. open: function(event,ui){
  347. },
  348. close: function(event,ui) {
  349. //allFields.val( "" ).removeClass( "ui-state-error" );
  350. $("#itemForm").data('validator').resetForm();
  351. $('#itemForm')[0].reset();
  352. $("#estValue").text("");
  353. $("#curPrice").text("");
  354. }
  355. });
  356. // Main Request For Quotation Grid
  357. var myGrid = $("#quotes"),lastsel2;
  358. var editparameters = {
  359. "keys" : true,
  360. "oneditfunc" : quotegriddates,
  361. "successfunc" : function(){
  362. lastsel2=undefined;
  363. myGrid.trigger("reloadGrid");
  364. return true;
  365. },
  366. "aftersavefunc" : null,
  367. "errorfunc": function(){
  368. lastsel2=undefined;
  369. //myGrid.trigger("reloadGrid");
  370. },
  371. "afterrestorefunc" : null,
  372. "restoreAfterError" : true,
  373. "mtype" : "POST"
  374. };
  375. myGrid.jqGrid({
  376. url:'index.php/procurement/populateRFQ?status='+'open',
  377. datatype: 'json',
  378. mtype: 'GET',
  379. // postData:{status:'open'},//not working with reload Grid
  380. colNames:['Actions','Reference','Supplier','Estimated Value',/*'Owner',*/'Status','Raised By','Owner','Needed By Date'],
  381. colModel :[
  382. {name:'act',index:'act',width:70,search:false,align:'center',sortable:false,formatter:'actions',
  383. formatoptions:{
  384. keys: true, // we want use [Enter] key to save the row and [Esc] to cancel editing.
  385. onEdit:quotegriddates,
  386. onSuccess:function(jqXHR) {
  387. myGrid.trigger("reloadGrid");
  388. return true;
  389. }
  390. }},
  391. {name:'reference', index:'reference', width:80, align:'right',editable:false},
  392. {name:'supplier_name', index:'supplier_name', width:140, align:'right',editable:true,edittype:"select",editoptions:{dataUrl:"index.php/procurement/populateSuppliers",buildSelect:function(response)
  393. {
  394. var select = "<select name=" + "mfrPkEdit" + "id =" +"mfrPkEdit" +">" +
  395. "<option value=" + ">Select one..." + response + "</select>";
  396. return select;
  397. }}},
  398. {name:'estimated_value', index:'estimated_value', width:100, align:'right',editable:false,editoptions:{size:"20",maxlength:"30"}},
  399. // {name:'owner', index:'owner', width:140, align:'right',editable:true,editoptions:{size:"20",maxlength:"30"}},
  400. {name:'status', index:'status', width:60, align:'right',editable:false,editoptions:{size:"20",maxlength:"30"}},
  401. {name:'raised_by_name', index:'raised_by_name',editable:false, width:80, align:'right'},
  402. {name:'owner_name', index:'owner_name',editable:false, width:80, align:'right'},
  403. {name:'needed_by_date', index:'needed_by_date',editable:true, width:120, sorttype:'date'}
  404. ],
  405. pager: '#pager',
  406. rowNum:10,
  407. rowList:[5,10,20],
  408. sortname: 'id',
  409. sortorder: 'desc',
  410. viewrecords: true,
  411. gridview: true,
  412. multiselect:true,
  413. ignoreCase:true,
  414. rownumbers:true,
  415. height:'auto',
  416. width:680,
  417. caption: 'Request For Quote',
  418. jsonReader : {
  419. root:"quotedata",
  420. page: "page",
  421. total: "total",
  422. records: "records",
  423. cell: "dprow",
  424. id: "id"
  425. },
  426. editurl:'index.php/procurement/modifyQuote',
  427. subGrid:true,
  428. subGridRowExpanded: function(subgrid_id, row_id) {
  429. // we pass two parameters
  430. // subgrid_id is a id of the div tag created whitin a table data
  431. // the id of this elemenet is a combination of the "sg_" + id of the row
  432. // the row_id is the id of the row
  433. // If we wan to pass additinal parameters to the url we can use
  434. // a method getRowData(row_id) - which returns associative array in type name-value
  435. // here we can easy construct the flowing
  436. var subgrid_table_id, pager_id;
  437. subgrid_table_id = subgrid_id+"_t";
  438. var editparametersitemssubgrid = {
  439. "keys" : true,
  440. "oneditfunc" : null,
  441. "successfunc" : function(){
  442. lastsel=undefined;
  443. myGrid.trigger("reloadGrid");
  444. //$("#"+subgrid_id).trigger("reloadGrid");
  445. return true;
  446. },
  447. "aftersavefunc" : null,
  448. "errorfunc": function(){
  449. lastsel=undefined;
  450. //myGrid.trigger("reloadGrid");
  451. },
  452. "afterrestorefunc" : null,
  453. "restoreAfterError" : true,
  454. "mtype" : "POST"
  455. };
  456. pager_id = "p_"+subgrid_table_id;
  457. $("#quoteId").val(row_id);
  458. $("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table><div id='"+pager_id+"' class='scroll'></div>");
  459. jQuery("#"+subgrid_table_id).jqGrid({
  460. url:'index.php/procurement/populateQuoteItems?q=2&quoteId='+row_id,
  461. datatype: 'json',
  462. colNames:['Product','Quantity','Need By Date','Unit Price','Estimated Value','Notes'],
  463. colModel :[
  464. {name:'name', index:'name',editable:false, width:120, align:'right'},
  465. {name:'quoted_quantity', index:'quoted_quantity', editable:true,width:50, align:'right'},
  466. {name:'needed_by_date',index:'needed_by_date',editable:true, width:80, align:'right'},
  467. {name:'expected_price',index:'expected_price',editable:true, width:50, align:'right'},
  468. {name:'estimated_value', index:'estimated_value',editable:false, width:60, align:'right'},
  469. {name:'comments', index:'comments',editable:true, width:180, align:'right'}
  470. ],
  471. rowNum:20,
  472. pager: pager_id,
  473. sortname: 'id',
  474. sortorder: "asc",
  475. height: '100%',
  476. jsonReader : {
  477. root:"quoteitemdata",
  478. page: "page",
  479. total: "total",
  480. records: "records",
  481. cell: "dprow",
  482. id: "id"
  483. },
  484. editurl:'index.php/procurement/modifyQuoteItem',
  485. onSelectRow: function(id){if(id && id!==lastsel){
  486. $("#"+subgrid_table_id).restoreRow(lastsel);
  487. $("#"+subgrid_table_id).editRow(id,editparametersitemssubgrid);
  488. lastsel=id;
  489. }
  490. }
  491. });
  492. jQuery("#"+subgrid_table_id).jqGrid('navGrid',"#"+pager_id,{edit:false,add:false,del:true,search:false});
  493. jQuery("#"+subgrid_table_id).jqGrid('navButtonAdd',"#"+pager_id,{
  494. caption:"",
  495. title:"Add Line Items",
  496. buttonicon:"ui-icon-plus",
  497. id:"add_lineItems",
  498. onClickButton : function () {
  499. //pass the grid id to dialog very important
  500. $( "#dialog-form-item" ).data('grid_id',subgrid_table_id).dialog( "open" );
  501. }
  502. });
  503. },
  504. subGridRowColapsed: function(subgrid_id, row_id) {
  505. // this function is called before removing the data
  506. //var subgrid_table_id;
  507. //subgrid_table_id = subgrid_id+"_t";
  508. //jQuery("#"+subgrid_table_id).remove();
  509. $("#quoteId").val("");
  510. }
  511. }).navGrid("#pager",{edit:false,add:false,del:true,search:false},{height:280,reloadAfterSubmit:false,closeAfterEdit:true,recreateForm:true,checkOnSubmit:true},{},{},{},{});
  512. myGrid.jqGrid('navButtonAdd','#pager',{
  513. caption:"",
  514. title:"Create Product",
  515. buttonicon:"ui-icon-plus",
  516. id:"add_quotes",
  517. onClickButton : function () {
  518. $( "#dialog-form" ).dialog( "open" );
  519. }
  520. });
  521. myGrid.jqGrid('navButtonAdd','#pager',{
  522. caption:"",
  523. title:"Generate Purchase Order",
  524. buttonicon:"ui-icon-cart",
  525. id:"po_quotes",
  526. onClickButton : function () {
  527. var selectedRows = myGrid.jqGrid('getGridParam', 'selarrrow');
  528. var noOfRows = selectedRows.length;
  529. var error = false;
  530. if (noOfRows == 0){
  531. $( "#dialog-modal-warning" ).dialog("open");
  532. }
  533. else{
  534. $.each(selectedRows, function(index,value){
  535. var val = myGrid.getCell(value,'estimated_value');
  536. if (val ==0){
  537. $("#refIds").text(myGrid.getCell(value,'reference')+" ")
  538. error=true;
  539. }
  540. })
  541. if (error){
  542. $( "#dialog-modal" ).dialog("open");
  543. }
  544. else{
  545. var rowid = myGrid.jqGrid('getGridParam', 'selarrrow');
  546. $.ajax({
  547. method:"POST",
  548. url:"index.php/procurement/generatePOFromRFQ",
  549. data: {ids : rowid},
  550. success: function(){
  551. myGrid.trigger("reloadGrid");
  552. showSuccessMessage("success");
  553. }
  554. })
  555. }
  556. }
  557. //
  558. }
  559. });
  560. myGrid.jqGrid('navButtonAdd','#pager',{
  561. caption:"",
  562. title:"Submit for Approval",
  563. buttonicon:"ui-icon-flag",
  564. id:"approve_quotes",
  565. onClickButton : function () {
  566. var rowid = myGrid.jqGrid('getGridParam', 'selarrrow');
  567. $.ajax({
  568. method:"POST",
  569. url:"index.php/procurement/submitForApproval",
  570. data: {ids : rowid},
  571. success: function(){
  572. myGrid.trigger("reloadGrid");
  573. showSuccessMessage("success");
  574. }
  575. })
  576. }
  577. });
  578. myGrid.jqGrid('filterToolbar', {stringResult: true, searchOnEnter: true, defaultSearch : "cn"});
  579. $("#del_quotes").insertAfter("#add_quotes");
  580. $( "#dialog-modal" ).dialog({
  581. autoOpen:false,
  582. height: 140,
  583. modal: true
  584. });
  585. $( "#dialog-modal-warning" ).dialog({
  586. autoOpen:false,
  587. height: 80,
  588. modal: true
  589. });
  590. });
  591. </script>
  592. </head>
  593. <body>
  594. <?php $this->load->view("common/menubar"); ?>
  595. <div id="dialog-modal" title="Error">
  596. <p>Reference Number(s) <span id="refIds" style="font-weight:bold;"></span> Does Not Have Estimated Value. Please Check The Quantity Or Price Of Line Items</p>
  597. </div>
  598. <div id="dialog-modal-warning" title="Warning">
  599. <p>Please Select At Least A Row</p>
  600. </div>
  601. <div id ="dialog-form">
  602. <h1 id="formHeader">Quote # <span id="quoteRef"></span> Details</h1>
  603. <form id="quoteForm">
  604. <fieldset>
  605. <div id="tabs">
  606. <ul>
  607. <li id="baseLink"><a id="base" href="<?php echo site_url('procurement/loadCreateQuoteFormFragment') ?>">Basic Details</a></li>
  608. <li id="notesLink"><a id ="notes" href="<?php echo site_url('procurement/loadCreateQuoteNotesFragment') ?>">Notes</a></li>
  609. </ul>
  610. </div>
  611. <input id="quoteId" name ="quoteId" type="hidden" value=""/>
  612. <div class="table-grid" style="padding-top:2em;">
  613. <h1 id="pkdheader">Add Line Items</h1>
  614. <table id="lineItems"><tr><td/></tr></table>
  615. <div id="pagerPk"></div>
  616. </div>
  617. <input id="supval" type="hidden" value=""/>
  618. <input id="warehouseval" type="hidden" value=""/>
  619. <input id="reqdateval" type="hidden" value=""/>
  620. <input id="notesval" type="hidden" value=""/>
  621. </fieldset>
  622. </form>
  623. </div>
  624. <div id ="dialog-form-item">
  625. <h1 id="formHeader">Add New Line Item</h1>
  626. <form id="itemForm">
  627. <fieldset>
  628. <div class="row single-column-row">
  629. <div class="column quote-column single-column">
  630. <div class="field">
  631. <label for="productOp">Products:</label>
  632. <select name="productOp" id ="productOp" class="required">
  633. <option value="">Choose
  634. <?= $productOptions ?>
  635. </select>
  636. </div>
  637. </div>
  638. </div>
  639. <div class="row single-column-row">
  640. <div class="column quote-column single-column">
  641. <div class="field">
  642. <label for="neededdate">Needed By Date:</label>
  643. <input id="neededdate" name ="neededdate" type="text"/>
  644. </div>
  645. </div>
  646. </div>
  647. <div class="row single-column-row">
  648. <div class="column quote-column single-column">
  649. <div class="field">
  650. <label for="quantity">Quantity:</label>
  651. <input id="quantity" name="quantity" class="calinput"/>
  652. </div>
  653. </div>
  654. </div>
  655. <div class="row single-column-row">
  656. <div class="column quote-column single-column">
  657. <div class="field">
  658. <label for="exPrice">Expected Price:</label>
  659. <input id="exPrice" name="exPrice" class="calinput"/>
  660. </div>
  661. <div class="field">
  662. <label style="width:100%;" id="curPrice" name="curPrice" class="calculated"/>
  663. </div>
  664. </div>
  665. </div>
  666. <div class="row single-column-row">
  667. <div class="column quote-column single-column">
  668. <div class="field">
  669. <label for="estValue">Estimated Value:</label>
  670. <label id="estValue" name="estValue" class="calculated"/>
  671. </div>
  672. </div>
  673. </div>
  674. <div class="row single-column-row">
  675. <div class="column quote-column single-column">
  676. <div class="field">
  677. <label for="descItem">Notes:</label>
  678. <input id="descItem" name="descItem" size="40" maxlength="60"/>
  679. </div>
  680. </div>
  681. </div>
  682. </fieldset>
  683. </form>
  684. </div>
  685. <div style="display: block;height: 100%;" class="shopifine-ui-dialog ui-widget ui-widget-content ui-corner-all" tabindex="-1" role="dialog" aria-labelledby="ui-dialog-title-dialog-form">
  686. <?php $this->load->view("common/message"); ?>
  687. <div class="table-grid">
  688. <h1 id="table header">Request For Quotations</h1>
  689. <table id="quotes"><tr><td/></tr></table>
  690. <div id="pager"></div>
  691. </div>
  692. </div>
  693. <?php $this->load->view("partial/footer"); ?>
  694. </body>
  695. </html>
  696. <script>
  697. $(".calinput").change(function(){
  698. var exprice =$("#quantity").val()*$("#exPrice").val();
  699. $("#estValue").text(exprice);
  700. });
  701. </script>