123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- @component('panel.layouts.component', ['title' => 'ثبت دسته جدید'])
- @slot('style')
- <style>
- </style>
- @endslot
- @slot('subject')
- <h1><i class="fa fa-users"></i> ثبت دسته جدید </h1>
- @endslot
- @slot('breadcrumb')
- <li class="breadcrumb-item">دسته بندی محصولات</li>
- @endslot
- @slot('content')
- <div class="auth-background h-auto py-5">
- <div class="container py-5">
- <div class="row align-items-center">
- <div class="col-lg-12 col-md-12 mx-auto">
- <div class="card">
- <div class="card-header"><strong>{{ __('ثبت دسته بندی جدید') }}</strong></div>
- <div class="card-body mx-lg-5 px-lg-3">
- <form method="POST" action="{{ route('categories.store') }}" id="form">
- @csrf
- <div class="form-group">
- <label for="title">{{ __('category.title') }}</label><i class="required">
- *</i>
- <input id="form" type="text"
- class="form-control @error('title') is-invalid @enderror" name="title"
- value="{{ old('title') }}" autocomplete="title" autofocus>
- @error('title')
- <span class="invalid-feedback" role="alert">
- <strong>{{ $message }}</strong>
- </span>
- @enderror
- </div>
- <div class="form-row ">
- <div class="form-group col-lg-4">
- <label for="slug">{{ __('category.slug') }}</label>
- <input id="slug" type="text"
- class="form-control @error('slug') is-invalid @enderror"
- name="slug" value="{{ old('slug') }}"
- autocomplete="slug" autofocus>
- @error('slug')
- <span class="invalid-feedback" role="alert">
- <strong>{{ $message }}</strong>
- </span>
- @enderror
- </div>
- <div class="form-group col-lg-4">
- <div class="col mb-2">
- <label>دسته بندی والد:</label>
- <select name="parent_id"
- class="form-control select2 @error('parent_id') is-invalid @enderror">
- <option value="0">--</option>
- {!! category_select_options( $categories, old( 'parent_id' ) ) !!}
- </select>
- @error('parent_id')
- <span class="invalid-feedback" role="alert">
- <strong>{{ $message }}</strong>
- </span>
- @enderror
- </div>
- </div>
- <div class="form-group col-lg-4">
- <label for="category_type">{{ __('category.category_type') }}</label><i
- class="required">
- *</i>
- <select id="category_type" type="text"
- class="form-control @error('category_type') is-invalid @enderror"
- name="category_type"
- autocomplete="category_type">
- <option value="">انتخاب کنید</option>
- <option value="0" {{ (old('category_type') == '0') ? 'selected' : '' }}>محصولات</option>
- <option value="1" {{ (old('category_type') == '1') ? 'selected' : '' }}>اخبار</option>
- <option value="2" {{ (old('category_type') == '2') ? 'selected' : '' }}>مطالب</option>
- </select>
- @error('category_type')
- <span class="invalid-feedback" role="alert">
- <strong>{{ $message }}</strong>
- </span>
- @enderror
- </div>
- </div>
- <div class="form-group" style="direction: rtl !important;">
- <label for="discription">{{ __('category.discription') }}</label><i
- class="required"> *</i>
- <textarea id="discription" type="text"
- class="form-control editor @error('discription') is-invalid @enderror"
- name="discription"
- autocomplete="discription" >{{ old('discription') }}</textarea>
- @error('discription')
- <span class="invalid-feedback" role="alert">
- <strong>{{ $message }}</strong>
- </span>
- @enderror
- </div>
- <div class="form-group mb-0">
- <div class="">
- <button type="submit" class="btn btn-primary ">
- {{ __('ثبت دسته بندی') }}
- </button>
- <a href={{ route('categories.index') }} type="button"
- class="btn btn-warning">
- انصراف</a>
- </div>
- </div>
- </form>
- </div>
- <div class="card-footer">
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- @endslot
- @slot('script')
- <script>
- {{--$(document).ready(function() {--}}
- {{-- $(".sendForme").click(function(e){--}}
- {{-- e.preventDefault();--}}
- {{-- var title = $("input[name='title']").val();--}}
- {{-- var price = $("input[name='price']").val();--}}
- {{-- var slug = $("input[name='slug']").val();--}}
- {{-- var type = $("input[name='type']").val();--}}
- {{-- var status = $("input[name='status']").val();--}}
- {{-- var discription = $("textarea[name='discription']").val();--}}
- {{-- $.ajax({--}}
- {{-- url: {{route('product.myformProduct')}},--}}
- {{-- method:'POST',--}}
- {{-- data: {title:title, price:price, slug:slug, type:type, status:status, discription:discription},--}}
- {{-- dataType:'json',--}}
- {{-- success: function(data) {--}}
- {{-- if($.isEmptyObject(data.error)){--}}
- {{-- alert(data.success);--}}
- {{-- }else{--}}
- {{-- printErrorMsg(data.error);--}}
- {{-- }--}}
- {{-- }--}}
- {{-- });--}}
- {{-- });--}}
- {{-- function printErrorMsg (msg) {--}}
- {{-- $(".print-error-msg").find("ul").html('');--}}
- {{-- $(".print-error-msg").css('display','block');--}}
- {{-- $.each( msg, function( key, value ) {--}}
- {{-- $(".print-error-msg").find("ul").append('<li>'+value+'</li>');--}}
- {{-- });--}}
- {{-- }--}}
- {{--});--}}
- </script>
- @endslot
- @endcomponent
|