?
Current Path : /home1/savoy/www/savoyglobal.net/sgms/application/views/Administration/ |
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/sgms/application/views/Administration/item_box.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $this->load->view('documentreadyfunctions'); ?> <script type="text/javascript"> function calc_expiry_date(slno,item_type,status) { if(status.checked== true) { var item_date = $("#item_allotment_date").val(); var shelf_life = $("#"+item_type+"_shelf_life_"+slno).val(); $.ajax({ type: "POST", url: "<?= site_url('onboarding/calculate_expiry_date/') ?>/"+item_date+"/"+shelf_life, success: function(msg){ $("#"+item_type+"_expiry_date_"+slno).val(msg); } }) } else { $("#"+item_type+"_expiry_date_"+slno).val(""); } } </script> <?php $emp_info = $this->onboardingmodel->get_emp_info($employee_no); if($_SESSION['modename']!="Administration") { $item_list = $this->onboardingmodel->get_joined_info('alert_item',$alert_id,'alert_id','general_item','item_id',$order_field=""); $tool_list = $this->onboardingmodel->get_joined_info('alert_tool',$alert_id,'alert_id','tool_list','tool_id',$order_field=""); } else { $tool_list = $this->mastermodel->get_data('tool_list',$emp_info->emp_non_trade_id,'trade_id'); $item_list = $this->mastermodel->getdatas('general_item','item_name'); } ?> <li> <label for="data">Employee No</label> <div class="record_entry"> <?php echo $emp_info->emp_non_no; ?> </div> </li> <li> <label for="data">Joining Date</label> <div class="record_entry"> <?php echo $this->mastermodel->convertdatenormalformat($emp_info->emp_non_date_joining); ?> </div> </li> <li> <label for="data">Trade</label> <div class="record_entry"> <?php echo $emp_info->trade_name; ?> </div> <li> <?php if($_SESSION['modename']!="Administration") { ?> <li> <table class="sort"> <caption>Tools last issuance details</caption> <tr> <th align="center">Trade Tool</th> <th align="center">Last Issued Date</th> <th align="center">Expiry Date</th> <th align="center">Remind before</th> </tr> <?php $i=1; foreach($tool_list as $tool) { $last_item=$this->administrationmodel->get_last_item_detail($emp_info->emp_non_id,$tool['tool_id']); ?> <tr> <td> <?=$tool['tool_name'];?> </td> <td> <?=$this->mastermodel->convertdatenormalformat($last_tool->item_tool_allotment_date);?> </td> <td> <?=$this->mastermodel->convertdatenormalformat($last_tool->tool_allotment_expiry);?> </td> <td> <?=$last_tool->tool_remind_before;?> </td> <td> </td> </tr> <?php $i++; } ?> </table> </li> <li> <table class="sort"> <caption>Items last issuance details</caption> <tr> <th align="center">Item Name</th> <th align="center">Last Issued Date</th> <th align="center">Expiry Date</th> <th align="center">Remind before</th> </tr> <?php $i=1; foreach($item_list as $item) { $last_item=$this->administrationmodel->get_last_item_detail($emp_info->emp_non_id,$item['item_id']); ?> <tr> <td> <?=$item['item_name'];?> </td> <td> <?=$this->mastermodel->convertdatenormalformat($last_item->item_tool_allotment_date);?> </td> <td> <?=$this->mastermodel->convertdatenormalformat($last_item->item_allotment_expiry);?> </td> <td> <?=$last_item->item_remind_before;?> </td> </tr> <?php $i++; } ?> </table> </li> <li> <input type="hidden" name="employee_id" value="<?=$emp_info->emp_non_id;?>"/> <table class="sort"> <caption>Trade Tools to be reissued</caption> <tr> <th align="center">Select</th> <th align="center">Trade Tools</th> <th align="center">Shelf Life (in Days)</th> <th align="center">Expiry Date</th> <th align="center">Remind before (in Days)</th> </tr> <?php $i=1; foreach($tool_list as $tool) { ?> <tr> <td><input style="width:15px;" type="checkbox" name="select_tool_<?=$i;?>" onclick="calc_expiry_date('<?=$i;?>','tool',this)"/></td> <td> <input type="hidden" name="tool_id_<?=$i;?>" value="<?=$tool['tool_id'];?>"/> <?=$tool['tool_name'];?> </td> <td> <?=$tool['tool_shelf_life'];?> <input type="hidden" value="<?=$tool['tool_shelf_life'];?>" id="tool_shelf_life_<?=$i;?>"/> </td> <td> <div id="multi"> <input style="width:65px;" type="text" name="tool_expiry_date_<?=$i;?>" id="tool_expiry_date_<?=$i;?>"/> <img src="<?=base_url()?>assets/images/icons/calendar.png" alt="Click to popup the clendar!" /> </div> </td> <td> <input style="width:65px;" type="text" value="<?=$tool['tool_remind_before'];?>" name="tool_remind_before_<?=$i;?>" id="tool_remind_before_<?=$i;?>"/> </td> </tr> <?php $i++; } ?> </table> </li> <li> <label for="data">Tool Remarks</label> <?php $data = array( 'name' => 'tool_remarks', 'id' => 'tool_remarks' ); echo form_textarea($data).form_error($data); ?> </li> <li> <table class="sort"> <caption>General Items to be reissued</caption> <tr> <th align="center">Select</th> <th align="center">General Items</th> <th align="center">Size</th> <th align="center">Shelf Life (in Days)</th> <th align="center">Expiry Date</th> <th align="center">Remind before (in Days)</th> </tr> <?php $i=1; foreach($item_list as $item) { ?> <tr> <td><input style="width:15px;" type="checkbox" name="select_item_<?=$i;?>" onclick="calc_expiry_date('<?=$i;?>','item',this)"/></td> <td> <input type="hidden" name="item_id_<?=$i;?>" value="<?=$item['item_id'];?>"/> <?=$item['item_name'];?> </td> <td> <?php $size_list=$this->mastermodel->get_data('general_item_size',$item['item_id'],'item_id'); if(!empty ($size_list)) { ?> <select name="item_size_<?=$i;?>" id="item_size_<?=$i;?>"> <option value="">Select</option> <?php foreach ($size_list as $size) { ?> <option value="<?=$size['size'];?>"><?=$size['size'];?></option> <?php } ?> </select> <?php } ?> </td> <td> <?=$item['item_shelf_life'];?> <input type="hidden" value="<?=$item['item_shelf_life'];?>" id="item_shelf_life_<?=$i;?>"/> </td> <td> <div id="multi"> <input style="width:65px;" type="text" name="item_expiry_date_<?=$i;?>" id="item_expiry_date_<?=$i;?>"/> <img src="<?=base_url()?>assets/images/icons/calendar.png" alt="Click to popup the clendar!" /> </div> </td> <td> <input style="width:65px;" type="text" value="<?=$item['item_remind_before'];?>" name="item_remind_before_<?=$i;?>" id="item_remind_before_<?=$i;?>"/> </td> </tr> <?php $i++; } ?> </table> </li> <li> <label for="data">Item Remarks</label> <?php $data = array( 'name' => 'item_remarks', 'id' => 'item_remarks' ); echo form_textarea($data).form_error($data); ?> </li> <?php } else { ?> <li> <input type="hidden" name="employee_id" value="<?=$emp_info->emp_non_id;?>"/> <table class="sort"> <caption>Available Trade Tools</caption> <tr> <th align="center">Select</th> <th align="center">Trade Tools</th> <th align="center">Shelf Life (in Days)</th> <th align="center">Expiry Date</th> <th align="center">Remind before (in Days)</th> </tr> <?php $i=1; foreach($tool_list as $tool) { ?> <tr> <td><input style="width:15px;" type="checkbox" name="select_tool_<?=$i;?>" onclick="calc_expiry_date('<?=$i;?>','tool',this)"/></td> <td> <input type="hidden" name="tool_id_<?=$i;?>" value="<?=$tool['tool_id'];?>"/> <?=$tool['tool_name'];?> </td> <td> <?=$tool['tool_shelf_life'];?> <input type="hidden" value="<?=$tool['tool_shelf_life'];?>" id="tool_shelf_life_<?=$i;?>"/> </td> <td> <div id="multi"> <input style="width:65px;" type="text" name="tool_expiry_date_<?=$i;?>" id="tool_expiry_date_<?=$i;?>"/> <img src="<?=base_url()?>assets/images/icons/calendar.png" alt="Click to popup the clendar!" /> </div> </td> <td> <input style="width:65px;" type="text" value="<?=$tool['tool_remind_before'];?>" name="tool_remind_before_<?=$i;?>" id="tool_remind_before_<?=$i;?>"/> </td> </tr> <?php $i++; } ?> </table> </li> <li> <label for="data">Tool Remarks</label> <?php $data = array( 'name' => 'tool_remarks', 'id' => 'tool_remarks' ); echo form_textarea($data).form_error($data); ?> </li> <li> <table class="sort"> <caption>Available General Items</caption> <tr> <th align="center">Select</th> <th align="center">General Items</th> <th align="center">Size</th> <th align="center">Shelf Life (in Days)</th> <th align="center">Expiry Date</th> <th align="center">Remind before (in Days)</th> </tr> <?php $i=1; foreach($item_list as $item) { ?> <tr> <td><input style="width:15px;" type="checkbox" name="select_item_<?=$i;?>" onclick="calc_expiry_date('<?=$i;?>','item',this)"/></td> <td> <input type="hidden" name="item_id_<?=$i;?>" value="<?=$item['item_id'];?>"/> <?=$item['item_name'];?> </td> <td> <?php $size_list=$this->mastermodel->get_data('general_item_size',$item['item_id'],'item_id'); if(!empty ($size_list)) { ?> <select name="item_size_<?=$i;?>" id="item_size_<?=$i;?>"> <option value="">Select</option> <?php foreach ($size_list as $size) { ?> <option value="<?=$size['size'];?>"><?=$size['size'];?></option> <?php } ?> </select> <?php } ?> </td> <td> <?=$item['item_shelf_life'];?> <input type="hidden" value="<?=$item['item_shelf_life'];?>" id="item_shelf_life_<?=$i;?>"/> </td> <td> <div id="multi"> <input style="width:65px;" type="text" name="item_expiry_date_<?=$i;?>" id="item_expiry_date_<?=$i;?>"/> <img src="<?=base_url()?>assets/images/icons/calendar.png" alt="Click to popup the clendar!" /> </div> </td> <td> <input style="width:65px;" type="text" value="<?=$item['item_remind_before'];?>" name="item_remind_before_<?=$i;?>" id="item_remind_before_<?=$i;?>"/> </td> </tr> <?php $i++; } ?> </table> </li> <li> <label for="data">Item Remarks</label> <?php $data = array( 'name' => 'item_remarks', 'id' => 'item_remarks' ); echo form_textarea($data).form_error($data); ?> </li> <?php } ?> <li> <input type="hidden" name="tab_name" value="item_allotment"/> <input type="hidden" name="resfunction" value="search_item_reissue"/> </li> <li> <label for="submit"> </label> <button type="submit" class="clickimage" onclick="addformdata('validateform')">Save</button> </li>