ok

Mini Shell

Direktori : /proc/self/root/home2/selectio/www/mm-tailor-billing/themes/default/views/purchases/
Upload File :
Current File : //proc/self/root/home2/selectio/www/mm-tailor-billing/themes/default/views/purchases/edit.php

<?php (defined('BASEPATH')) OR exit('No direct script access allowed'); ?>

<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box box-primary">
                <div class="box-header">
                    <h3 class="box-title"><?= lang('update_info'); ?></h3>
                </div>
                <div class="box-body">
                    <div class="col-lg-12">
                        <?php echo form_open_multipart("purchases/edit/".$purchase->id, 'class="validation edit-po-form"'); ?>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <?= lang('date', 'date'); ?>
                                    <input type="date" name="date" value="<?=$purchase->date?>" class="form-control" id="date"  required="required" />
                                    <?//= form_input('date', set_value('date', $purchase->date), 'class="form-control tip" id="date"  required="required"'); ?>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <?= lang('reference', 'reference'); ?>
                                    <?= form_input('reference', $purchase->reference, 'class="form-control tip" id="reference"'); ?>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <input type="text" placeholder="<?= lang('search_product_by_name_code'); ?>" id="add_item" class="form-control">
                        </div>

                        <div class="row">
                            <div class="col-md-12">
                                <div class="table-responsive">
                                    <table id="poTable" class="table table-striped table-bordered">
                                        <thead>
                                            <tr class="active">
                                                <th><?= lang('product'); ?></th>
                                                <th class="col-xs-2"><?= lang('quantity'); ?></th>
                                                <th class="col-xs-2"><?= lang('unit_cost'); ?></th>
                                                <th class="col-xs-2"><?= lang('subtotal'); ?></th>
                                                <th style="width:25px;"><i class="fa fa-trash-o"></i></th>
                                            </tr>
                                        </thead>
                                        <tbody></tbody>
                                        <tfoot>
                                            <tr class="active">
                                                <th><?= lang('total'); ?></th>
                                                <th class="col-xs-2"></th>
                                                <th class="col-xs-2"></th>
                                                <th class="col-xs-2 text-right"><span id="gtotal">0.00</span></th>
                                                <th style="width:25px;"></th>
                                            </tr>
                                        </tfoot>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <?= lang('supplier', 'supplier'); ?>
                                    <?php
                                    $sp[''] = lang("select")." ".lang("supplier");
                                    foreach($suppliers as $supplier) {
                                        $sp[$supplier->id] = $supplier->name;
                                    }
                                    ?>
                                    <?= form_dropdown('supplier', $sp, set_value('supplier', $purchase->supplier_id), 'class="form-control select2 tip" id="supplier"  required="required" style="width:100%;"'); ?>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <?= lang('received', 'received'); ?>
                                    <?php $sts = array(1 => lang('received'), 0 => lang('not_received_yet')); ?>
                                    <?= form_dropdown('received', $sts, set_value('received', $purchase->received), 'class="form-control select2 tip" id="received"  required="required" style="width:100%;"'); ?>
                                </div>
                            </div>
                        </div>
                        
                        <div class="row">
                            <div class="col-md-3">
                                <div class="form-group">
                                    <label>Paid Amount</label>&nbsp;&nbsp;<b style="color: red; float:right;">Balance Amount: <span id="balance_amount"></b></span>
                                    <input type="hidden" id="product_total" name="product_total" class="form-control">
                                    <input type="text" name="paid_amount" id="paid_amount" value="<?=$purchase->paid?>" class="form-control">
                                    <input type="hidden" name="balance_amount" id="balance" value="" class="form-control tip">
                                </div>
                            </div>
                            <div class="col-md-3">
                                <div class="form-group">
                                    <label>Payment Type</label>
                                    <select name="payment_type" id="payment_type" class="form-control select2">
                                        <option value="">Select Payment Type</option>
                                        <option value="1" <?php if($purchase->payment_type==1){echo "selected";}?>>Cash</option>
                                        <option value="2" <?php if($purchase->payment_type==2){echo "selected";}?>>Acc Transfer</option>
                                        <option value="3" <?php if($purchase->payment_type==3){echo "selected";}?>>Online</option>
                                        <option value="4" <?php if($purchase->payment_type==4){echo "selected";}?>>UPI</option>
                                        <option value="5" <?php if($purchase->payment_type==5){echo "selected";}?>>Debit Card</option>
                                        <option value="6" <?php if($purchase->payment_type==6){echo "selected";}?>>Credit Card</option>
                                    </select>
                                </div>
                            </div>
                            
                            <div class="col-md-3">
                                <div class="form-group">
                                    <label>Payment Status</label>
                                    <select name="payment_status" id="payment_status" class="form-control">
                                        <option value="">Select Payment Status</option>
                                        <option value="Not Paid" <?php if($purchase->payment_status=="Not Paid"){echo "selected";}?>>Not Paid</option>
                                        <option value="Partial" <?php if($purchase->payment_status=="Partial"){echo "selected";}?>>Partial</option>
                                        <option value="Fully Paid" <?php if($purchase->payment_status=="Fully Paid"){echo "selected";}?>>Fully Paid</option>
                                    </select>
                                </div>
                            </div>
                            
                            <div class="col-md-3">
                                <div class="form-group">
                                    <label>Payment Done Date</label>
                                    <input type="date" name="payment_done_date" value="<?=$purchase->payment_done_date?>" id="payment_done_date" class="form-control">
                                </div>
                            </div>
                        </div>
                        
                        <div class="form-group">
                            <?= lang('attachment', 'attachment'); ?>
                            <input type="file" name="userfile" class="form-control tip" id="attachment">
                        </div>
                        <div class="form-group">
                            <?= lang("note", 'note'); ?>
                            <?= form_textarea('note', $purchase->note, 'class="form-control redactor" id="note"'); ?>
                        </div>
                        <div class="form-group">
                            <?= form_submit('edit_purchase', lang('edit_purchase'), 'class="btn btn-primary" id="edit_purchase"'); ?>
                            <button type="button" id="reset" class="btn btn-danger"><?= lang('reset'); ?></button>
                        </div>

                        <?php echo form_close();?>
                    </div>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>
</section>
<script type="text/javascript">
    var spoitems = {};

    $(document).ready(function() {
       store('spoitems', JSON.stringify(<?= $items; ?>));
    });
    $(window).bind('beforeunload', function (e) {
        localStorage.setItem('remove_spo', true);
        $('.animsition').removeClass('fade-out');
        var message = "You will loss data!";
        return message;
    });
    $('#reset').click(function (e) {
        $(window).unbind('beforeunload');
    });
    $('#edit_purchase').click(function () {
        $(window).unbind('beforeunload');
        $('form.edit-po-form').submit();
    });
</script>
<script>
    $(document).ready(function(){
        
        supplier_calculate();
        /*$("body").mouseover(function(){
          var grand_total=$("#gtotal").text();
          var paid_amount=$("#paid_amount").val();
          calculate=grand_total-paid_amount;
          $("#balance_amount").text(grand_total-paid_amount);
          $("#balance").val(grand_total-paid_amount);
          if(calculate==0){
             $("#payment_status").val('paid');  
          }else{
             $("#payment_status").val('partial'); 
          }
        });*/
        
        $("body").mouseover(function(){
            supplier_calculate();
        });
    });
    
    function supplier_calculate(){
        var grand_total = $("#product_total").val();
        var paid_amount = $("#paid_amount").val();
        calculate=parseFloat(grand_total)-parseFloat(paid_amount);
        console.log("Product Total: "+grand_total);
        console.log("Paid Amount: "+grand_total);
        console.log("Calculate: "+calculate);
        console.log("Balance Amount" +(grand_total-paid_amount));
          $("#balance_amount").text(grand_total-paid_amount);
          $("#balance").val(grand_total-paid_amount);
    }
</script>
<script src="<?= $assets ?>dist/js/purchasess.min.js" type="text/javascript"></script>

Zerion Mini Shell 1.0