![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mcoil.corals.io/resources/views/admin/orders/ |
@extends('layouts.admin.app') @section('content') <div class="row"> <div class="col-md-12"> <section class="content"> @include('layouts.errors-and-messages') <div class="box"> <form action="{{ route('admin.orders.saveorder') }}" method="post" class="form" name="frm_product_order" id="frm_product_order"> <div class="box-body"> {{ csrf_field() }} <div class="col-md-12"> <h3 class="bold">New Product Order <small>- for creating an order for a customer</small></h3> <div class="row"> <div class="col-md-4"> <div class="form-group"> <label for="customer">Customer <span class="text-danger">*</span></label> <select name="customer" id="status" class="form-control custom-select input-lg"> <option value="">Select</option> @if( $customers ) @foreach($customers as $customer) @if( $customer->is_driver == '0' ) <option value="{{ $customer->id }}">{{ $customer->name }}</option> @endif @endforeach @endif </select> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="payment_option">Payment Option <span class="text-danger">*</span></label> <select name="payment_option" id="payment_option" class="form-control custom-select input-lg"> <option value="Cash">Cash</option> <option value="Cheque">Cheque</option> <option value="Credit Account">Credit Account</option> <option value="Credit Card" selected="">Credit Card</option> </select> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="customer">Discount </label> <select name="discount" class="form-control custom-select input-lg"> <option value="">Select</option> @if( $discountCoupons ) @foreach($discountCoupons as $discountCoupon) <option value="{{ $discountCoupon->id }}">{{ $discountCoupon->coupon_code }}</option> @endforeach @endif </select> </div> </div> </div> <div class="row"> <div class="col-md-12"> <h4 class="bold">Add Products</h4> </div> </div> <div class="row product_row"> <div class="col-md-6"> <div class="form-group"> <label for="product">Product <span class="text-danger">*</span></label> <select name="product[]" class="form-control custom-select input-lg product"> @if($products) @foreach($products as $product) <option value="{{ $product->id }}" @if($product->quantity <= 0) disabled="disabled" @endif>{{ $product->name }}</option> @endforeach @endif </select> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="quantity">Quantity <span class="text-danger">*</span></label> <select name="quantity[]" class="form-control custom-select input-lg quantity"> @for($qty=1; $qty<=10; $qty++) <option value="{{ $qty }}">{{ $qty }}</option> @endfor </select> </div> </div> <div class="col-md-2"> <div class="form-group" style="margin-top: 35px;"> <button type="button" class="btn btn-dark btn-sm btn_add_product_row"><i class="fa fa-plus"></i></button> <button type="button" class="btn btn-danger btn-sm btn_delete_product_row" style="display: none;"><i class="fa fa-minus"></i></button> </div> </div> </div> <div class="row"> <div class="col-md-6"> <button type="submit" class="btn btn-lg btn-block btn-success">Create</button> </div> <div class="col-md-6"> <a href="{{ route('admin.orders.index') }}" class="btn btn-lg btn-block btn-danger">Back</a> </div> </div> </div> </div> </form> </div> </section> </div> </div> @endsection @section('js') <script src="{{ asset('https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.1/jquery.validate.min.js') }}"></script> <script type="text/javascript"> $(document).ready(function () { $('#frm_product_order').validate({ rules: { customer: { required: true } }, messages: { customer: { required: 'Please select customer' } } }); $(document).on('click', '.btn_add_product_row', function(){ var productRow = $('.product_row').last().clone(); $(productRow).find('.btn_delete_product_row').show(); $('.product_row').last().after(productRow); }); $(document).on('click', '.btn_delete_product_row', function(){ $(this).closest('.product_row').remove(); }); }); </script> @endsection