?
Current Path : /home1/savoy/public_html/savoyglobal.net/koaladraft/application/views/inventory/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/public_html/savoyglobal.net/koaladraft/application/views/inventory/edit_purchase.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $this->load->view('documentreadyfunctions'); ?> <script type="text/javascript"> function get_purcahse_total_prize(divid) { var tr_index= $('#'+divid).closest('tr').index(); var qty= $('#inventory_qty'+tr_index).val(); var prize= $('#inventory_amount'+tr_index).val(); var discount= $('#inventory_discount'+tr_index).val(); var flag=1; if(qty=='' || prize=='') { flag=0; } if(flag==1) { var qtnty=parseInt(qty); var prize1=parseFloat(prize); if(discount!='') var discount1=parseFloat(discount); else discount1=0; var total=prize1*qtnty-discount1; $('#inventory_total'+tr_index).val(total); } else $('#inventory_total'+tr_index).val('0'); } </script> <div class="icons_main"> <div class="icons"> <img src="<?=base_url()?>assets/images/back.png" title="Back" class="clickimage" onclick="viewdata('inventory','viewininventorysearch','search_purchase','view_purchase','<?=$_SESSION['pagenum'];?>')" alt="Back" align = "center" width="32" height="32" /> </div> <div class="icons_caption"> <h4>Updating Purchase Details</h4> </div> </div> <?php $franchisee = $this->mastermodel->getdatas('franchisee', 'franchisee_id'); $inventory = $this->mastermodel->getdatas('inventory', 'inventory_id'); $attributes = array('id' => 'validateform', 'class' => 'validate'); echo form_open('inventory/addininventory/update_purchase/view_purchase/1',$attributes); ?> <div class="grid_6"> <div class="box"> <div class="header main">Purchase Details </div> <div class="content no-padding"> <div class="section _100"> <label>Franchisee Name</label> <div> <select name="franchisee_id" id="franchisee_id" class="required chzn-done" > <option value=''>Select</option> <?php foreach($franchisee as $list) { ?> <option value="<?=$list['franchisee_id']?>" <?php if($list['franchisee_id']==$viewinfo->purchase_franchisee_id) { echo 'selected'; } ?>><?=$list['franchisee_name']?></option> <?php } ?> </select> </div> </div> <div class="section _100"> <label>Purchase Date</label> <div> <input name="purchase_date" id="purchase_date" class="required calfocus" type="text" value="<?=$this->mastermodel->convertdatenormalformat($viewinfo->purchase_date)?>" /> </div> </div> <div class="section _100"> <label>Remarks </label> <div> <textarea name="purchase_remarks" id="purchase_remarks" type="text"><?=$viewinfo->purchase_remarks?></textarea> </div> </div> </div> </div> </div> <div class="grid_12"> <div class="box"> <div class="content no-padding"> <div class="header main"> Purchase Inventory Details</div> <table class="table"> <tr> <th>Inventory Type</th> <th>Quantity</th> <th>Amount</th> <th>Discount</th> <th>Total</th> <th><input type="button" id="button2" value="Add More" class="addRow" title="Add Row" style="width:75px;"/></th> </tr> <?php $inventry=$this->mastermodel->get_data('purchase_inventory',$viewinfo->purchase_id,'purchase_id'); foreach ($inventry as $row) { $qty=intval($row['inventory_qty']); $amount=floatval($row['inventory_amount']); $discount=floatval($row['inventory_discount']); $total=$qty*$amount-$discount; ?> <tr> <td> <select name="inventory_id" id="inventory_id" class="chzn-done" > <option value=''>Select</option> <?php foreach($inventory as $list) { ?> <option value="<?=$list['inventory_id']?>" <?php if($list['inventory_id']==$row['inventory_type_id']) { echo 'selected'; } ?>><?=$list['inventory_type']?></option> <?php } ?> </select> </td> <td> <input name="inventory_qty" id="inventory_qty" class=" number" type="text" value="<?=$row['inventory_qty']?>" onchange="get_purcahse_total_prize(this.id)"/> <input name="inventory_qty_old" id="inventory_qty_old" type="hidden" value="<?=$row['inventory_qty']?>"/> </td> <td><input name="inventory_amount" id="inventory_amount" class=" number auto" type="text" value="<?=$row['inventory_amount']?>" onchange="get_purcahse_total_prize(this.id)"/></td> <td><input name="inventory_discount" id="inventory_discount" class=" number auto" type="text" value="<?=$row['inventory_discount']?>" onchange="get_purcahse_total_prize(this.id)"/></td> <td><input name="inventory_total" id="inventory_total" type="text" readonly value="<?=$total?>" class="auto" /></td> <td> <img style="float: right; vertical-align: top;"src="<?=base_url()?>assets/images/icons/close.png" alt="Delete Row" class="delRow clickimage" title="Delete Row"/> </td> </tr> <?php } ?> <tr> <td> <select name="inventory_id" id="inventory_id" class="chzn-done" > <option value=''>Select</option> <?php foreach($inventory as $list) { ?> <option value="<?=$list['inventory_id']?>"><?=$list['inventory_type']?></option> <?php } ?> </select></td> <td><input name="inventory_qty" id="inventory_qty" class="number" type="text" onchange="get_purcahse_total_prize(this.id)"/></td> <td><input name="inventory_amount" id="inventory_amount" class="number auto" type="text" onchange="get_purcahse_total_prize(this.id)"/></td> <td><input name="inventory_discount" id="inventory_discount" class="number auto" type="text" onchange="get_purcahse_total_prize(this.id)" value="0"/></td> <td><input name="inventory_total" id="inventory_total" type="text" readonly class="auto" /></td> <td> <img style="float: right; vertical-align: top;"src="<?=base_url()?>assets/images/icons/close.png" alt="Delete Row" class="delRow clickimage" title="Delete Row"/> </td> </tr> </table> </div> </div> </div> <div class="grid_12" > <div class="box"> <div class="actions"> <div class="actions-left"> <input type="reset" /> <input type="hidden" name="purchase_id" id="purchase_id" value="<?=$viewinfo->purchase_id?>"/> </div> <div class="actions-right"> <button type="submit" id="submit" class="clickimage" onclick="addformdata('validateform')">Save</button> </div> </div> </div> </div> <?php echo form_close();?>