PageRenderTime 54ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/opensourcepos/application/views/procurement/quote/create/quote_create_grid.php

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