<?php echo Form::open(['action'=>['Modules\InventoryDashboardController@storeAddNewInventoryItems'], 'files'=>true,'method'=>'POST', 'id'=>'add-new-inventory-item']); ?>

<div class="error" style="text-align: center;">On this Window, You can add a New Inventory Item</div>
<div class="guestDetails_inputDivider"></div>
<button type="submit" disabled style="display: none" aria-hidden="true"></button>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        <?php echo Form::label('item-name', 'Enter Name of the Item'); ?> <span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        <?php echo Form::text('name[]', '', ['class'=>'input-text-height', 'size'=>50]); ?>

    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        <?php echo Form::label('buying-price', 'Buying Price'); ?> <span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        <?php echo Form::text('buying-price[]', '', ['class'=>'input-text-height', 'size'=>15]); ?>

    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        <?php echo Form::label('min-selling-price', 'Min. Selling Price'); ?> <span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        <?php echo Form::text('min-selling-price[]', '', ['class'=>'input-text-height', 'size'=>15]); ?>

    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        <?php echo Form::label('max-selling-price', 'Max Selling Price'); ?> <span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        <?php echo Form::text('max-selling-price[]', '', ['class'=>'input-text-height', 'size'=>15]); ?>

    </div>
</div>

<div class="guestDetails_inputDivider"></div>
<div class="added-fields"></div>
<button type="button" id="add-field" style="height: 25px">+Add Another Field</button><br><br>
<?php echo Form::close(); ?>


<script>
    $(document).ready(function () {
        //add and remove vehicle fields
        var addButton = $('#add-field'); //Add button selector
        var wrapper = $('.added-fields'); //Input field wrapper
        var x = 1;
        var fieldHTML = '<div class="">' +
            '<button type="button" id="remove-button"> <i class="fa fa-trash"></i> </button>' +
            '<div class="guestDetails_input">\n' +
            '  <div class="guestDetails_inputLabel">Enter Name of the Item <span class="error">*</span></div>\n' +
            '    <div class="guestDetails_input">\n' +
            '       <input type="text" name="name[]" class="input-text-height" size="50" placeholder="Enter Age From">\n' +
            '    </div>\n' +
            '</div>\n' +
            '<div class="guestDetails_input">\n' +
            '  <div class="guestDetails_inputLabel">Buying Price <span class="error">*</span></div>\n' +
            '    <div class="guestDetails_input">\n' +
            '       <input type="text" name="buying-price[]" class="input-text-height" size="15" placeholder="Buying Price">\n' +
            '    </div>\n' +
            '</div>\n' +
            '<div class="guestDetails_input">\n' +
            '  <div class="guestDetails_inputLabel">Min Selling Price <span class="error">*</span></div>\n' +
            '    <div class="guestDetails_input">\n' +
            '       <input type="text" name="min-selling-price[]" class="input-text-height" size="15" placeholder="Min Selling Price">\n' +
            '    </div>\n' +
            '</div>\n' +
            '<div class="guestDetails_input">\n' +
            '  <div class="guestDetails_inputLabel">Max Selling Price <span class="error">*</span></div>\n' +
            '    <div class="guestDetails_input">\n' +
            '       <input type="text" name="max-selling-price[]" class="input-text-height" size="15" placeholder="Max Selling Price">\n' +
            '    </div>\n' +
            '</div>\n' +
            '    <div class="guestDetails_inputDivider input_divider1"></div>';

        //Once add button is clicked
        $(addButton).click(function(){
            x++; //Increment field counter

            $(wrapper).append(fieldHTML); //Add field html

        });
        //Once remove button is clicked
        $(wrapper).on('click', '#remove-button', function(e){
            e.preventDefault();
            $(this).parent('div').remove(); //Remove field html
            x--; //Decrement field counter
        });

    });
</script>
<?php /**PATH /home/zedarroot/public_html/edwulp/resources/views/inventory/add-new-inventory-items.blade.php ENDPATH**/ ?>