Файловый менеджер - Редактировать - /home/clickysoft/public_html/securebeans.clickysoft.net/resources/views/admin/license/create.blade.php
Назад
@extends('layouts.admin') @section('styles') {{-- <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.min.css" rel="stylesheet" media="screeen"> --}} @endsection @section('content') <div class="content"> @if (\Session::has('success')) <p class="alert alert-success"> {!! \Session::get('success') !!} </p> @endif @if (\Session::has('error')) <p class="alert alert-danger"> {!! \Session::get('error') !!} </p> @endif <form method="POST" action="{{ route('admin.license.store') }}" enctype="multipart/form-data" class="from-prevent-multiple-submits"> @csrf <div class="card"> <div class="card-header ui-sortable-handle"> <div class="row"> <h5 class="ml-2">Create License</h5> <ul class="nav nav-pills ml-auto"> <li class="nav-item"> <button class="btn btn-success from-prevent-multiple-submits" type="submit">Submit</button> </li> <li class="nav-item ml-2"> <button type="button" onclick="window.location.href='{{ route('admin.license.index') }}'" class="btn btn-warning text-white">Cancel</button> </li> </ul> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="card"> <div class="card-body"> <div class="row"> <div class="col-sm-12"> <div class="card"> <div class="card-body"> <div class="row"> <div class="col-sm-3"> <div class="form-group {{ $errors->has('customer_id') ? 'has-error' : '' }}"> <label class="required" for="customer_id">Customer Name</label> <div style="padding-bottom: 4px"> </div> <select class="form-control select2" name="customer_id" id="customer_id"> <option value="">Select</option> @foreach ($customers as $id => $customer) <option value="{{ $customer->id }}" {{ old('customer_id') == $customer->id ? 'selected' : '' }}> {{ $customer->name }}</option> @endforeach </select> @if ($errors->has('customer_id')) <span class="help-block" role="alert">The customer name field is required.</span> @endif <span class="help-block">{{ trans('cruds.user.fields.roles_helper') }}</span> </div> </div> <div class="col-sm-3"> <div class="form-group {{ $errors->has('contract_number') ? 'has-error' : '' }}"> <label class="required" for="name">Contract Number</label> <input autocomplete="off" class="form-control" type="text" name="contract_number" id="contract_number" value="{{ old('contract_number', '') }}"> @if ($errors->has('contract_number')) <span class="help-block" role="alert">{{ $errors->first('contract_number') }}</span> @endif <span class="help-block">{{ trans('cruds.user.fields.name_helper') }}</span> </div> </div> <div class="col-sm-3"> <div class="form-group {{ $errors->has('support_site_id') ? 'has-error' : '' }}"> <label class="required" for="name">Support Site Id</label> <input class="form-control" type="text" name="support_site_id" id="support_site_id" value="{{ old('support_site_id', '') }}"> @if ($errors->has('support_site_id')) <span class="help-block" role="alert">{{ $errors->first('support_site_id') }}</span> @endif <span class="help-block">{{ trans('cruds.user.fields.name_helper') }}</span> </div> </div> <div class="col-sm-3"> <div class=""> <label>Upload File</label> <input class="" type="file" name="file" value="{{ old('file', '') }}" id="file" accept=".jpg, .jpeg, .png,.pdf"> @if ($errors->has('file')) <span class="help-block" role="alert" style="color: red"> {{ $errors->first('file') }}</span> @endif <span class="help-block">{{ trans('cruds.user.fields.name_helper') }}</span> </div> </div> </div> <div class="row"> <div class="col-sm-6 col-md-6 form-group {{ $errors->has('reseller2') ? 'has-error' : '' }}"> <label for="reseller2">Reseller 2</label> <select class="form-control select2 product" name="reseller2" id="reseller2"> @foreach ($resellers as $reseller) <option value="{{ $reseller->id }}" {{ old('reseller2') == $reseller->id ? 'selected' : '' }}> {{ $reseller->name }}</option> @endforeach </select> @if ($errors->has('reseller2')) <span class="help-block" role="alert">{{ $errors->first('reseller2') }}</span> @endif </div> <div class="col-sm-6 col-md-6 form-group {{ $errors->has('reseller1') ? 'has-error' : '' }}"> <label for="reseller1">Reseller 1</label> <select class="form-control select2 product" name="reseller1" id="reseller1"> @foreach ($resellers as $reseller) <option value="{{ $reseller->id }}" {{ old('reseller1') == $reseller->id ? 'selected' : '' }}> {{ $reseller->name }}</option> @endforeach </select> @if ($errors->has('reseller1')) <span class="help-block" role="alert">{{ $errors->first('reseller1') }}</span> @endif </div> </div> </div> </div> </div> </div> </div> </div> </div> <div class="col-sm-12"> <div class="card"> <div class="card-body another" id="parent-div"> @for ($key = 0; $key < count(old('product_id', $licenseProducts)); $key++) <div class="row selector" id="child-div{{ $key }}"> <div class="col-sm-3"> <div class="form-group {{ $errors->has('product_id.' . $key) ? 'has-error' : '' }}"> <label class="required" for="product_id{{ $key }}">Product SKU</label> <select class="form-control select2 product" name="product_id[]" id="product_id{{ $key }}"> <option value="">Select</option> @foreach ($products as $id => $product) <option value="{{ $product['id'] }}" {{ old('product_id.' . $key) == $product['id'] ? 'selected' : '' }}> {{ $product['product_sku'] }}</option> @endforeach </select> @if ($errors->has('product_id.' . $key)) <span class="help-block" role="alert">{{ $errors->first('product_id.' . $key) }}.</span> @endif <span class="help-block">{{ trans('cruds.user.fields.roles_helper') }}</span> </div> </div> <div class="col-sm-2"> <div class="form-group {{ $errors->has('start_date.' . $key) ? 'has-error' : '' }}"> <label class="required" for="start_date">Start Date</label> <input class="form-control dat" id="start-date" type="text" autocomplete="off" name="start_date[]" placeholder="dd-mm-yyyy" id="start_date" value="{{ old('start_date.' . $key) }}"> <span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span> @if ($errors->has('start_date.' . $key)) <span class="help-block" role="alert">{{ $errors->first('start_date.' . $key) }}</span> @endif <span class="help-block">{{ trans('cruds.user.fields.name_helper') }}</span> </div> </div> <div class="col-sm-2"> <div class="form-group {{ $errors->has('end_date.' . $key) ? 'has-error' : '' }}"> <label class="required" for="end_date">End Date</label> <input class="form-control dat" type="text" name="end_date[]" placeholder="dd-mm-yyyy" autocomplete="off" id="end_date" value="{{ old('end_date.' . $key, '') }}"> @if ($errors->has('end_date.' . $key)) <span class="help-block" role="alert">{{ $errors->first('end_date.' . $key) }}</span> @endif <span class="help-block">{{ trans('cruds.user.fields.name_helper') }}</span> </div> </div> <div class="col-sm-3"> <div class="form-group {{ $errors->has('quantity.' . $key) ? 'has-error' : '' }}"> <label class="required" for="quantity{{ $key }}">Quantity</label><br> <input type="button" onclick="decrementValue('quantity{{ $key }}')" value="-" class="inc-dec" /> <input type="text" name="quantity[]" value="{{ old('quantity.' . $key, 0) }}" maxlength="5" max="10000" id="quantity{{ $key }}" class="quantity" /> <input type="button" onclick="incrementValue('quantity{{ $key }}')" value="+" class="inc-dec" /> @if ($errors->has('quantity.' . $key)) <span class="help-block" role="alert">{{ $errors->first('quantity.' . $key) }}</span> @endif </div> </div> <div class="col-sm-2"> @if ($key != 0) <a href="" class="btn btn-danger btn-sm mt-4 remove-btn" id="{{ $key }}">remove</a> @endif </div> </div> @endfor </div> <div class="row add-more"> <div class="col-sm-2 mt-2 mb-2 p-0"> <a class="btn btn-primary " href="" id="add-more">Add More</a> </div> </div> </div> </div> </div> <input name="row-counter" value="{{ old('row-counter', '1') }}" id="row-counter" type="hidden" /> </form> </div> @endsection @section('scripts') {{-- <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> --}} <script> $(document).ready(function(){ $('.from-prevent-multiple-submits').on('submit', function() { $('.from-prevent-multiple-submits').attr('disabled', 'true'); }); }); var license_id = ''; $('.dat').datepicker({ format: "d-M-yyyy", }); // var count={{ count($licenseProducts) }}; var count = 1; var products = {!! json_encode($products) !!}; $(document).on('click', '#add-more', function(e) { count++; e.preventDefault(); var newRow = '<div class="row selector" id="child-div' + count + '" data-attr="1"><div class="col-sm-3"><div class="form-group first-form-g"><label class="required" for="product_id' + count + '">Product SKU</label><select class="form-control select2 product" name="product_id[]" id="product_id' + count + '"><option value="">Select</option>'; for (i = 0; i < products.length; i++) { newRow += '<option value="' + products[i].id + '">' + products[i].product_sku + '</option>'; } newRow += '</select></div></div><div class="col-sm-2"><div class="form-group"><label class="required" for="start_date' + count + '">Start Date</label><input class="dat form-control" id="start-date" type="text" name="start_date[]" autocomplete="off" placeholder="dd-mm-yyyy" id="start_date" value=""></div></div><div class="col-sm-2"><div class="form-group"><label class="required" for="end_date' + count + '">End Date</label><input class="dat form-control" autocomplete="off" type="text" name="end_date[]" placeholder="dd-mm-yyyy"id="end_date" value=""></div></div><div class="col-sm-3"><div class="form-group"><label class="required" for="quantity' + count + '">Quantity</label><br><input type="button" class="inc-dec" onclick="decrementValue(\'quantity' + count + '\')" value="-" /><input type="text" name="quantity[]" value="0" maxlength="5" max="10000" id="quantity' + count + '" class="quantity"/><input type="button" class="inc-dec" onclick="incrementValue(\'quantity' + count + '\')" value="+" /></div></div><div class="col-sm-2"><a href="" class="btn btn-danger btn-sm mt-4 remove-btn" id=' + count + '>remove</a></div></div>'; $('#parent-div').append(newRow); $('.select2').select2(); $(".dat").datepicker("destroy"); $('.dat').datepicker({ format: "d-M-yyyy", }); $('#row-counter').val(parseInt($('#row-counter').val()) + 1); }); function incrementValue(elementId) { var value = parseInt(document.getElementById(elementId).value); value = isNaN(value) ? 0 : value; ++value; document.getElementById(elementId).value = value; } function decrementValue(elementId) { var value = parseInt(document.getElementById(elementId).value); value = isNaN(value) ? 0 : value; --value; document.getElementById(elementId).value = value; } $(document).on('click', '#save-product', function(e) { e.preventDefault(); if (license_id == '') { alert("Please create license first") } // else{ var start_date = $("input[name='start_date[]']").map(function() { return $(this).val(); }).get(); var end_date = $("input[name='end_date[]']").map(function() { return $(this).val(); }).get(); var quantity = $("input[name='quantity[]']").map(function() { return $(this).val(); }).get(); var product_sku = $("select[name=\'product_id[]\']").map(function() { return $(this).val(); }).get(); console.log(product_sku) $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } }); $.ajax({ type: "post", url: "", data: { start_date: start_date, end_date: end_date, quantity: quantity, product_sku: product_sku, licernse_id: license_id }, }).done(function(data) { if (data.status) { console.log(data) } }) // } }) $(document).on('click', '.remove-btn', function(e) { e.preventDefault(); var id = $(this).attr("id"); $('#child-div' + id).remove(); count--; // $('#row-counter').val(parseInt($('#row-counter').val())-1); }) </script> @endsection
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка