Current File : /home/tradevaly/www/resources/views/user/pages/product/editPrice.blade.php
@extends('user.ayaan.master')
@push('title','Add New Product')

@push('style')
 <link href="{{ asset('/assets/libs/select2/select2.min.css') }}" rel="stylesheet" type="text/css" />
    <style>
    .price-table tr td {
        padding-right: 30px;
    }
    </style>
@endpush

@section('content')
<div class="container-fluid">
    <div class="row">
        <div class="col-md-12">
            <div class="card">
                
                <div class="card-header card-header-icon card-header-info">
                  <h4 class="card-title">Edit Price for{{$product->title}}
                  </h4>
                </div>
                <div class="card-body">
                    
                @if($product->price_type == "negotiable")
                    @foreach($ProductPrices as $ProductPrice)
                    <form action="{{route("user.saveEditPrice",$ProductPrice->id)}}" method="POST">
                        @csrf 
                        <input type="hidden" name="price_type" value="{{$product->price_type}}">
                        
                        <div id="div1"> 
                                <div id="price_input">
                                    <div class="row" >  
                                        <div class="col-lg-3">  
                                            <div class="mb-3">  
                                                <label for="min" class="form-label">Min</label>  
                                                <input type="text" name="min" value="{{$ProductPrice->min}}" class="form-control" placeholder="Enter Minimum">  
                                            </div>  
                                        </div>                                      
                                        <div class="col-lg-3">  
                                            <div class="mb-3">  
                                                <label for="max" class="form-label">Max</label>  
                                                <input type="text" name="max" value="{{$ProductPrice->max}}" class="form-control" id="max" placeholder="Enter Maximum">  
                                            </div>  
                                        </div>  
                                        <div class="col-lg-3">  
                                            <div class="mb-3">  
                                                <label for="formrow-inputCity" class="form-label">Unit</label>  
                                                <select class="form-control select2" name="unit">
                                                    <option value="{{$ProductPrice->unit}}">{{$ProductPrice->unit}}</option>  
                                                    <option value="" selected="selected">-- Select Unit --</option>  
                                                    <option value="Acre">Acre</option>  
                                                    <option value="Ampere">Ampere</option>  
                                                    <option value="Bag">Bag</option>  
                                                    <option value="Barrel">Barrel</option>  
                                                    <option value="Box">Box</option>  
                                                    <option value="Bushel">Bushel</option>  
                                                    <option value="Carton">Carton</option>  
                                                    <option value="Case">Case</option>  
                                                    <option value="Centimeter">Centimeter</option>  
                                                    <option value="Chain">Chain</option>  
                                                    <option value="Cubic Centimeter">Cubic Centimeter</option>  
                                                    <option value="Cubic Foot">Cubic Foot</option>  
                                                    <option value="Cubic Inch">Cubic Inch</option>  
                                                    <option value="Cubic Meter">Cubic Meter</option>  
                                                    <option value="Cubic Yard">Cubic Yard</option>  
                                                    <option value="DEGREES Celsius">DEGREES Celsius</option>  
                                                    <option value="Degrees Fahrenheit">Degrees Fahrenheit</option>  
                                                    <option value="Dozen">Dozen</option>  
                                                    <option value="Dram">Dram</option>  
                                                    <option value="Fluid Ounce">Fluid Ounce</option>  
                                                    <option value="Foot">Foot</option>  
                                                    <option value="Forty-Foot Container ">Forty-Foot Container </option>  
                                                    <option value="Furlong">Furlong</option>  
                                                    <option value="Gallon">Gallon</option>  
                                                    <option value="Gill">Gill</option>  
                                                    <option value="Grain">Grain</option>  
                                                    <option value="Gram">Gram</option>  
                                                    <option value="Gross">Gross</option>  
                                                    <option value="Hectare">Hectare</option>  
                                                    <option value="Hertz">Hertz</option>  
                                                    <option value="Inch">Inch</option>  
                                                    <option value="Kiloampere">Kiloampere</option>  
                                                    <option value="Kilogram">Kilogram</option>  
                                                    <option value="Kilohertz">Kilohertz</option>  
                                                    <option value="Kilometer">Kilometer</option>  
                                                    <option value="Kiloohm">Kiloohm</option>  
                                                    <option value="Kilovolt">Kilovolt</option>  
                                                    <option value="Kilowatt">Kilowatt</option>  
                                                    <option value="Liter">Liter</option>  
                                                    <option value="Long Ton">Long Ton</option>  
                                                    <option value="Megahertz">Megahertz</option>  
                                                    <option value="Meter">Meter</option>  
                                                    <option value="Metric Ton">Metric Ton</option>  
                                                    <option value="Mile">Mile</option>  
                                                    <option value="Milliampere">Milliampere</option>  
                                                    <option value="Milligram">Milligram</option>  
                                                    <option value="Millihertz">Millihertz</option>  
                                                    <option value="Milliliter">Milliliter</option>  
                                                    <option value="Millimeter">Millimeter</option>  
                                                    <option value="Milliohm">Milliohm</option>  
                                                    <option value="Millivolt">Millivolt</option>  
                                                    <option value="Milliwatt">Milliwatt</option>  
                                                    <option value="Nautical Mile">Nautical Mile</option>  
                                                    <option value="Ohm">Ohm</option>  
                                                    <option value="Ounce">Ounce</option>  
                                                    <option value="Pack">Pack</option>  
                                                    <option value="Pallet">Pallet</option>  
                                                    <option value="Pair">Pair</option>  
                                                    <option value="Parcel">Parcel</option>  
                                                    <option value="Perch">Perch</option>  
                                                    <option value="Piece">Piece</option>  
                                                    <option value="Pint">Pint</option>  
                                                    <option value="Plant">Plant</option>  
                                                    <option value="Pole">Pole</option>  
                                                    <option value="Pound">Pound</option>  
                                                    <option value="Quart">Quart</option>  
                                                    <option value="Quarter">Quarter</option>  
                                                    <option value="Rod">Rod</option>  
                                                    <option value="Roll">Roll</option>  
                                                    <option value="Set">Set</option>  
                                                    <option value="Sheet">Sheet</option>  
                                                    <option value="Short Ton">Short Ton</option>  
                                                    <option value="Square Centimeter">Square Centimeter</option>  
                                                    <option value="Square Foot">Square Foot</option>  
                                                    <option value="Square Inch">Square Inch</option>  
                                                    <option value="Square Meter">Square Meter</option>  
                                                    <option value="Square Mile">Square Mile</option>  
                                                    <option value="Square Yard">Square Yard</option>  
                                                    <option value="Stone">Stone</option>  
                                                    <option value="Strand">Strand</option>  
                                                    <option value="Ton">Ton</option>  
                                                    <option value="Tonne">Tonne</option>  
                                                    <option value="Tray">Tray</option>  
                                                    <option value="Twenty-Foot Container">Twenty-Foot Container</option>  
                                                    <option value="Unit">Unit</option>  
                                                    <option value="Volt">Volt</option>  
                                                    <option value="Watt">Watt</option>  
                                                    <option value="Wp">Wp</option>  
                                                    <option value="Yard">Yard</option>  
                                                </select>  
                                            </div>  
                                        </div>
                                        <div class="col-lg-3 d-flex justify-content-around">
                                            <a href="{{route('user.delete.price',$ProductPrice->id)}}" class="btn btn-warning" onclick="return confirm('Are you sure to delete this?')" >
                                                Delete
                                            </a>
                                            <input type="submit" class="btn btn-success " value="submit">
                                        </div>
                                    </div>
                                </div>
                            </div>
                    </form>
                    @endforeach
                    @elseif($product->price_type == "qbp")
                        @foreach($ProductPrices as $ProductPrice)
                        <form action="{{route("user.saveEditPrice",$ProductPrice->id)}}" method="POST">
                            @csrf 
                            <input type="hidden" name="price_type" value="{{$product->price_type}}">
                            <div id="div2" class="price-hide">
                                <div id="main">
                                    <table id="qbp" class="data-table data-table-horizontal data-table-highlight">
                                        <tbody class="price-table">
                                            <tr>
                                                <td >
                                                    <input type="text" name="min" value="{{$ProductPrice->min}}"  class="inner form-control" placeholder="Qty From" /> 
                                                </td>
                                                <td>
                                                    <input type="text" name="max" value="{{$ProductPrice->max}}" class="inner form-control" placeholder="Qty To"/> 
                                                </td>
                                                <td>
                                                    <input type="text" name="unit" value="{{$ProductPrice->unit}}" class="inner form-control" placeholder="Price"/>
                                                </td>
                                                <td>
                                                    <input type="submit" class="btn btn-success " value="submit">    
                                                </td>
                                                <td>
                                                    <a href="{{route('user.delete.price',$ProductPrice->id)}}" class="btn btn-warning" onclick="return confirm('Are you sure to delete this?')">
                                                        Delete
                                                    </a>    
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    <!--<div class="pull-right">-->
                                    <!--    <input type="button" value="Add" class="btn btn-success mt-3" onclick="addRow('qbp')" />-->
                                    <!--</div>-->
                                </div>
                            </div>
                        </form>
                        @endforeach
                    @elseif($product->price_type == "pbq")
                        @foreach($ProductPrices as $ProductPrice)
                        <form action="{{route("user.saveEditPrice",$ProductPrice->id)}}" method="POST">
                            @csrf 
                            <input type="hidden" name="price_type" value="{{$product->price_type}}">
                            <div id="div3" class="price-hide">
                                <div id="main">
                                    <table id="pbq" class="data-table data-table-horizontal data-table-highlight">
                                        <tbody class="price-table">
                                            <tr>
                                                <td >
                                                    <input type="text" name="min" value="{{$ProductPrice->min}}" class="inner form-control" placeholder="Price From" /> 
                                                </td>
                                                <td>
                                                    <input type="text" name="max" value="{{$ProductPrice->max}}" class="inner form-control" placeholder="Price To"/> 
                                                </td>
                                                <td>
                                                    <input type="text" name="unit" value="{{$ProductPrice->unit}}" class="inner form-control" placeholder="Quantity"/>
                                                </td>
                                                <td>
                                                    <input type="submit" class="btn btn-success " value="submit">
                                                </td>
                                                <td>
                                                    <a href="{{route('user.delete.price',$ProductPrice->id)}}" class="btn btn-warning" onclick="return confirm('Are you sure to delete this?')">
                                                        Delete
                                                    </a>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    <!--<div class="pull-right">-->
                                    <!--    <input type="button" value="Add" class="btn btn-success mt-3" onclick="addRow('pbq')" />-->
                                    <!--</div>-->
                                </div>
                            </div>
                        </form>
                        @endforeach
                    @endif
                        
                        
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
        
@endsection