?
Current Path : /home1/savoy/public_html/savoyglobal.net/ccnerp/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/ccnerp/application/views/inventory/edit_sale.php |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); $this->load->view('documentreadyfunctions'); ?> <script type="text/javascript"> function check_qty(qty,divid) { var qtnty=parseInt(qty) var tr_index= $('#'+divid).closest('tr').index(); var inventory_type= $('#inventory_id'+tr_index).val(); if(inventory_type!='') { $.ajax({ type: "POST", url: "<?= site_url() ?>/inventory/check_qty/"+inventory_type, success: function(msg) { var qty1= parseInt(msg) if(qty1<qtnty) { alert("Stock is not available") $('#inventory_qty'+tr_index).val(''); $('#inventory_total'+tr_index).val('0') } }}); } } function get_sale_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=='' || discount=='') { flag=0; } if(flag==1) { var qtnty=parseInt(qty); var prize1=parseFloat(prize); var discount1=parseFloat(discount); 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_sale','view_sale','<?= $_SESSION['pagenum']; ?>')" alt="Back" align = "center" width="32" height="32" /> </div> <div class="icons_caption"> <h4>Updating Stock Utilization</h4> </div> </div> <?php $batch = $this->mastermodel->get_data_srow('batch', $viewinfo->sale_batch_id, 'batch_id'); $student_list = $this->mastermodel->get_data_joined('sale_inventory', 'student', 'student_id', 'student_id', $viewinfo->sale_id, 'sale_id'); $course_id = $batch->course_id; $student = $this->studentmodel->get_batch_student_details($viewinfo->sale_batch_id, $course_id); $inventory = $this->mastermodel->getdatas('inventory', 'inventory_id'); $inventory_alloted_details=$this->inventorymodel->inventory_alloted_details($viewinfo->sale_id); $inventodry_alloted=$inventory_alloted_details['inventodry_alloted']; $inventory_type=$viewinfo->sale_inventory_type_id; $attributes = array('id' => 'validateform', 'class' => 'validate'); echo form_open('inventory/addininventory/update_sale/view_sale/1', $attributes); ?> <div class="grid_12" > <div class="box"style="width: 60%;float: none;margin: 0 auto;"> <div class="header main">Stock Utilization Details </div> <div class="content no-padding"> <div class="section _100"> <label>Batch</label> <div> <input type="text" readonly="readonly" name="batch" id="batch" value='<?= $batch->batch_no ?>' class="required " /> <input type="hidden" name="batch_id" id="batch_id" value="<?= $viewinfo->sale_batch_id ?>" /> </div> </div> <div class="section _100"> <label>Inventory Type</label> <div> <?php foreach ($inventory as $list) { if ($viewinfo->sale_inventory_type_id == $list['inventory_id']) { echo $list['inventory_type']; ?> <input type="hidden" name="inventory_id" id="inventory_id" readonly="readonly" value="<?=$viewinfo->sale_inventory_type_id?>" /> <?php } } ?> </div> </div> <div class="section _100"> <label>Stock Utilization Date</label> <div> <input name="sale_date" id="sale_date" class="required calfocus" type="text" value="<?= $this->mastermodel->convertdatenormalformat($viewinfo->sale_date) ?>"/> </div> </div> <div class="section _100"> <label>Remarks </label> <div> <textarea name="sale_remarks" id="sale_remarks" type="text"><?= $viewinfo->sale_remarks ?></textarea> </div> </div> </div> </div> </div> <div class="grid_12" > <div class="box"> <div class="content no-padding"> <div class="header main"> Student Details</div> <table class="table" id="stud_sub"> <thead id="stud_sub_head"> <tr> <th>Sl No</th> <th>Student</th> <th>Reg No</th> <th>Gender</th> <th>Nationality</th> <th>Alloted Qty</th> <th>To be Allotted</th> </tr> </thead> <tbody> <?php $i = 1; $stud = array(); $inventory_student=array(); foreach ($student_list as $list) { $inventory_student[$list['student_id']]=$list['inventory_qty']; } foreach ($student as $list) { $qty=0; if(isset($inventory_student[$list['student_id']])) $qty=$inventory_student[$list['student_id']]; $stud[] = $list['student_id']; ?> <tr> <td><?= $i++ ?></td> <td> <?= $list['first_name'] . " " . $list['last_name'] ?> <input type="hidden" value="<?= $list['student_id'] ?>" name="student_id<?= $list['student_id'] ?>" id="student_id<?= $list['student_id'] ?>"/> </td> <td><?= $list['reg_no'] ?></td> <td><?= $list['gender'] ?></td> <td><?= $list['nationality'] ?></td> <td><?php if(isset($inventodry_alloted[$inventory_type][$list['student_id']])) echo $inventodry_alloted[$inventory_type][$list['student_id']]; else echo 0; ?></td> <td> <input class="num_only" type="hidden" value="<?= $qty ?>" name="inventory_qty_prev<?= $list['student_id'] ?>" id="inventory_qty_prev<?= $list['student_id'] ?>" style="width: 150px;"/> <input class="num_only" type="text" value="<?= $qty ?>" name="inventory_qty<?= $list['student_id'] ?>" id="inventory_qty<?= $list['student_id'] ?>" style="width: 150px;"/> </td> </tr> <?php } ?> </tbody> </table> <input type="hidden" name="student_id_list" id="student_id_list" value="<?= implode(',', $stud) ?>"/> </div> </div> </div> <div class="grid_12" > <div class="box"> <div class="actions"> <div class="actions-left"> <input type="reset" /> <input type="hidden" name="sale_id" id="sale_id" value="<?= $viewinfo->sale_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(); ?>