Server : Apache System : Linux host44.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64 User : vapecompany ( 2719) PHP Version : 7.4.33 Disable Function : NONE Directory : /home/vapecompany/demo.vapecompany.com.bd/resources/views/backend/setting/ |
Upload File : |
@extends('backend.layout.app') @section('content') <style type="text/css"> .btn-file { position: initial; overflow: hidden; } .btn-file input[type=file] { position: absolute; top: 0; right: 0; min-width: 100%; min-height: 100%; font-size: 100px; text-align: right; filter: alpha(opacity=0); opacity: 0; outline: none; background: white; cursor: inherit; display: block; } #img-upload{ width: 100%; height: 100% } #img-container{ width: 100px; height: 100px; margin: 10px 0; border: 1px solid; } #checkerr .text-danger{ position: absolute; top: 80px; } #imgerr label{ top: 32px; position: absolute; left: 105px; } </style> <!-- ============================================================== --> <!-- Page wrapper --> <!-- ============================================================== --> <div class="page-wrapper"> <!-- ============================================================== --> <!-- Bread crumb and right sidebar toggle --> <!-- ============================================================== --> <div class="page-breadcrumb"> <div class="row"> <div class="col-5 align-self-center"> <h4 class="page-title">Basic Setting</h4> <div class="d-flex align-items-center"> <nav aria-label="breadcrumb"> <ol class="breadcrumb"> <li class="breadcrumb-item"><a href="#">Home</a></li> <li class="breadcrumb-item active" aria-current="page">Setting</li> </ol> </nav> </div> </div> </div> </div> <!-- ============================================================== --> <!-- End Bread crumb and right sidebar toggle --> <!-- ============================================================== --> <!-- ============================================================== --> <!-- Container fluid --> <!-- ============================================================== --> <div class="container-fluid"> <!-- ============================================================== --> <!-- Start Page Content --> <!-- ============================================================== --> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-body"> <form id="setting"> @csrf <h4 class="card-title">Info</h4> <input type="hidden" name="form" value="edit">@include('backend.layout.verror_message') <div class="form-group row"> <label for="minimum_stock_qty" class="col-sm-3 text-right control-label col-form-label">Minimum Stock</label> <div class="col-sm-9"> <input value="{{$companyInfo->minimum_stock_qty}}" name="minimum_stock_qty" type="number" class="form-control" id="minimum_stock_qty"> </div> </div> <div class="form-group row"> <label for="rating_a" class="col-sm-3 text-right control-label col-form-label">Rating A</label> <div class="col-sm-9"> <input value="{{$companyInfo->rating_a}}" name="rating_a" type="number" class="form-control" id="rating_a"> </div> </div> <div class="form-group row"> <label for="rating_b" class="col-sm-3 text-right control-label col-form-label">Rating B</label> <div class="col-sm-9"> <input value="{{$companyInfo->rating_b}}" name="rating_b" type="number" class="form-control" id="rating_b"> </div> </div> <div class="form-group row"> <label for="rating_c" class="col-sm-3 text-right control-label col-form-label">Rating C</label> <div class="col-sm-9"> <input value="{{$companyInfo->rating_c}}" name="rating_c" type="number" class="form-control" id="rating_c"> </div> </div> <div class="form-group row"> <label for="rating_d" class="col-sm-3 text-right control-label col-form-label">Rating D</label> <div class="col-sm-9"> <input value="{{$companyInfo->rating_d}}" name="rating_d" type="number" class="form-control" id="rating_d"> </div> </div> <div class="form-group row"> <label for="rating_e" class="col-sm-3 text-right control-label col-form-label">Rating E</label> <div class="col-sm-9"> <input value="{{$companyInfo->rating_e}}" name="rating_e" type="number" class="form-control" id="rating_e"> </div> </div> <div class="form-group row"> <label for="rating_f" class="col-sm-3 text-right control-label col-form-label">Rating F</label> <div class="col-sm-9"> <input value="{{$companyInfo->rating_f}}" name="rating_f" type="number" class="form-control" id="rating_f"> </div> </div> <div class="form-group mb-0 text-right"> <button type="submit" class="btn btn-info waves-effect waves-light">Save</button> <!-- <button type="submit" class="btn btn-dark waves-effect waves-light">Cancel</button> --> </div> </form> </div> </div> </div> </div> </div> <!-- ============================================================== --> <!-- End Container fluid --> @endsection @section('script') <script src="{{url('/public/backend/js/jquery.validate.min.js')}}"></script> <script src="{{url('/public/backend/js/tinymce.min.js')}}"></script> <script src="{{url('public/backend/js/jquery.validate.min.js')}}"></script> <script> jQuery(document).ready(function(){ $("#setting").validate({ rules: { minimum_stock_qty: { maxlength: 100, }, }, submitHandler: submitForm }); function submitForm() { var data = new FormData(document.getElementById('setting')); event.preventDefault(); $.ajax({ type : 'POST', url : "{{url('admin/basic_setting')}}", data : data, cache:false, contentType: false, processData: false, //dataType : 'json', success : function (data) { console.log(data); if(data.errors=='0'){ $('.alert-success').show(); $('.alert-danger').hide(); $('.alert-success').html('<p>'+data.success+'</p>'); // $("#addSupplier").get(0).reset(); }else{ var val=""; $.each(data.errors, function(key, value){ $('.alert-danger').show(); $('.alert-success').hide(); val+= '<p>'+value+'</p>'; }); $('.alert-danger').html(val); } },error: function(response) { //console.log(response); } }); return false; } }); //image upload $(document).on('change', '.btn-file :file', function() { var input = $(this), label = input.val().replace(/\\/g, '/').replace(/.*\//, ''); input.trigger('fileselect', [label]); }); $('.btn-file :file').on('fileselect', function(event, label) { var input = $(this).parents('.input-group').find(':text'), log = label; if( input.length ) { input.val(log); } else { if( log ) alert(log); } }); function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#img-upload').attr('src', e.target.result); } reader.readAsDataURL(input.files[0]); } } $("#imgInp").change(function(){ readURL(this); }); // end image upload </script> @endsection