%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/silvzytp/dsr_code/resources/views/backend/member/manager/pages/target/
Upload File :
Create Path :
Current File : //home/silvzytp/dsr_code/resources/views/backend/member/manager/pages/target/form.blade.php

@extends('layouts.backend')
@section('title', $siteTitle)
@section('action')
    <button type="button" class="btn btn-sm btn-success submit-form-btn">
        @isset($target)
        Update
        @else
        Submit
        @endisset
    </button>
@endsection
@push('styles')

@endpush

@section('content')

    <div class="row">
        <div class="col-12">
            <form action="{{ isset($target) ? route('app.targets.update', $target->id) : route('app.targets.store') }}" method="POST" id="form">
                @csrf
                @isset($target)
                    @method('PUT')
                @endisset
                <div class="row">
                    <div class="col-md-12">
                        <div class="ibox">
                            <div class="ibox-body">
                                <div class="row">
                                    <div class="col-md-4">
                                        <x-form.inputbox name="date" class="date" labelName="Date" value="{{ isset($target) ? date_formats($target->date,'m/d/Y') : old('date') }}" error="date"/>
                                    </div>
                                    <div class="col-md-8">
                                        <x-form.inputbox type="number" name="sale_target" labelName="Sale Target" value="{{ $target->s_target ?? 0 }}" error="sale_target"/>
                                    </div>
                                </div>
                                {{-- <div class="row mb-3">
                                    <div class="col-md-4 mb-3 mb-md-0">
                                        <x-form.inputbox type="number" name="sale_achieved" labelName="Sale Achieved" value="{{ $target->s_achived ?? 0 }}" error="sale_achieved"/>
                                    </div>
                                    <div class="col-md-4 mb-3 mb-md-0">
                                        <label for="">Sale Deficit</label>
                                        <input type="number" name="sale_deficit" class="form-control" disabled readonly value="{{ $target->s_deifict ?? 0 }}">
                                    </div>
                                </div> --}}
                                {{-- <div class="row">
                                    <div class="col-md-4 mb-3 mb-md-0">
                                        <x-form.inputbox type="number" name="revenue_target" labelName="Revenue Target" value="{{ $target->a_target ?? 0 }}" error="revenue_target"/>
                                    </div>
                                    <div class="col-md-4 mb-3 mb-md-0">
                                        <x-form.inputbox type="number" name="revenue_achieved" labelName="Revenue Achieved" value="{{ $target->a_achived ?? 0 }}" error="revenue_achieved"/>
                                    </div>
                                    <div class="col-md-4 mb-3 mb-md-0">
                                        <label for="">Revenue Deficit</label>
                                        <input type="number" name="revenue_deficit" class="form-control" disabled readonly value="{{ $target->a_deifict ?? 0 }}">
                                    </div>
                                </div> --}}
                                <div class="text-right">
                                    <button class="btn btn-sm btn-success" type="submit">
                                        @isset($target)
                                        Update
                                        @else
                                        Submit
                                        @endisset
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>

@endsection

@push('scripts')
    <script>
        $(document).on('keyup keypress', 'input[name="sale_achieved"]', function(){
            let sale_achieved = $('input[name="sale_target"]').val() || 0;
            let sale_target = $(this).val() || 0;
            let total_sale = (parseFloat(sale_achieved) - parseFloat(sale_target));
            $('input[name="sale_deficit"]').val(total_sale);
        });

        $(document).on('keyup keypress', 'input[name="revenue_achieved"]', function(){
            let revenue_achieved = $('input[name="revenue_target"]').val() || 0;
            let revenue_target = $(this).val() || 0;
            let total_revenue = (parseFloat(revenue_achieved) - parseFloat(revenue_target));
            $('input[name="revenue_deficit"]').val(total_revenue);
        });

        $('input.date').datepicker({
            todayBtn: "linked",
            keyboardNavigation: false,
            forceParse: false,
            calendarWeeks: true,
            autoclose: true
        });
    </script>
@endpush


Zerion Mini Shell 1.0