?
Current Path : /home1/savoy/www/savoyglobal.net/eldertree/application/views/hr/ |
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/www/savoyglobal.net/eldertree/application/views/hr/return_box.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $des=$this->mastermodel->get_single_field_value('tool_allocation','tool_allocation_id','employee_id',$employee_id); $tool_name=$this->mastermodel->get_data_joined('tool_allocation_details','tool_kit_details','tool_allocation_kit_id','id',$des,'tool_allocation_id'); ?> <script> $(document).ready(function() { $('#table-example').dataTable(); $(window).resize(); }); function check_availability(name) { var val=parseInt(document.getElementById(name).value); var end=name.slice(-1); var id='tool_availability_'+end; var available=parseInt(document.getElementById(id).value); // alert(available); // alert(val); if(val>available) { alert("exceeds the available stock"); document.getElementById(name).value=""; } } </script> <script defer src="<?=base_url()?>assets/js/script.js"></script> <div class="icons_main"> <div class="icons"> </div> <div class="icons_caption"> </div> </div> <div class="clean"></div> <div class="grid_12"> <div class="box"> <div class="content no-padding"> <div class="header main"></div> <table class="table"> <tr> <th>Select</th> <th>Tool Name</th> <th>Tool Availabilty</th> <th>Tool Quantity</th> <th>Remarks</th> </tr> <?php $i=1; foreach($tool_name as $tool) { ?> <tr> <td> <input style="width:15px;" type="checkbox" name="select_tool_<?=$i;?>" /></td> <td> <input type="hidden" name="tool_id<?=$i;?>" value="<?=$tool['id'];?>"/> <?=$tool['tool_name'];?> </td> <td> <input style="width:75px;" type="text" name="tool_vailability_<?=$i?>" id="tool_availability_<?=$i?>" readonly="readonly" value="<?=$tool['tool_allocation_kit_qty']?>"> </td> <td> <input style="width:75px;" type="text" name="tool_return_qty<?=$i;?>" id="tool_return_qty_<?=$i;?>" class="" onchange="check_availability(this.name)"/> </td> <td> <input type="text" name="tool_return_remarks<?=$i;?>" class="" /> </td> </tr> <?php $i++; } ?> </table> </div> </div> </div> <div class="grid_12"> <div class="box"> <div class="actions"> <div class="actions-left"> <input type="reset"> </div> <div class="actions-right"> <button style="margin-left: 130px;" type="submit" id="submit" class="clickimage" onclick="addformdata('validateform')">save</button> </div> </div> </div> </div>