VaKeR CYBER ARMY
Logo of a company 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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/vapecompany/demo.vapecompany.com.bd/resources/views/backend/setting/create.blade.php
@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">Company Information</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> @include('backend.layout.verror_message')
                                    <input type="hidden" name="form" value="new">
                                    <div class="form-group row">
                                        <label for="company_name" class="col-sm-3 text-right control-label col-form-label">Company Name</label>
                                        <div class="col-sm-9">
                                            <input name="company_name" type="text" class="form-control" id="company_name" placeholder="Company Name ">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label for="company_address" class="col-sm-3 text-right control-label col-form-label">Company Address</label>
                                        <div class="col-sm-9">
                                            <input name="company_address" type="text" class="form-control" id="company_address" placeholder="Company Address">
                                        </div>
                                    </div>
                                     <div class="form-group row">
                                        <label for="company_phone" class="col-sm-3 text-right control-label col-form-label">Phone</label>
                                        <div class="col-sm-9">
                                            <input name="company_phone" type="text" class="form-control" id="company_phone" placeholder="Phone">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label for="company_mobile" class="col-sm-3 text-right control-label col-form-label">Mobile No.</label>
                                        <div class="col-sm-9">
                                            <input name="company_mobile" type="text" class="form-control" id="company_mobile" placeholder="Mobile No.">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label for="company_email" class="col-sm-3 text-right control-label col-form-label">Email</label>
                                        <div class="col-sm-9">
                                            <input name="company_email" type="text" class="form-control" id="company_email" placeholder="Email">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label for="company_website" class="col-sm-3 text-right control-label col-form-label">Website</label>
                                        <div class="col-sm-9">
                                            <input name="company_website" type="text" class="form-control" id="company_website" placeholder="Website">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label for="company_facebook" class="col-sm-3 text-right control-label col-form-label">Facebook</label>
                                        <div class="col-sm-9">
                                            <input name="company_facebook" type="text" class="form-control" id="company_facebook" placeholder="Facebook">
                                        </div>
                                    </div>

                                    <div class="form-group row">
                                        <label class="col-sm-3 text-right control-label col-form-label">Logo</label>
                                        <div class="col-sm-9">
                                            <div class="input-group">
                                                <span class="input-group-btn">
                                                    <span class="btn btn-default btn-file" id="imgerr">
                                                        Browse… <input name="logo" type="file" id="imgInp">
                                                    </span>
                                                </span>
                                                <input type="text" class="form-control" readonly>
                                            </div>
                                            <div id="img-container">
                                                 <img id='img-upload' src="https://webdevtrick.com/wp-content/uploads/preview-img.jpg" />
                                            </div>

                                        </div>
                                    </div>
                                    <!-- <div class="form-group row">
                                        <label class="col-sm-3 text-right control-label col-form-label">Logo Text</label>
                                        <div class="col-sm-9">
                                            <div class="input-group mb-3">
                                              <div class="input-group-prepend">
                                                    <span class="input-group-text">Upload</span>
                                                </div> -->
                                                <!--   <div class="custom-file">
                                                    <input name="company_logo_text" type="file" class="custom-file-input" id="company_logo_text">
                                                    <label class="custom-file-label" for="company_logo_text">Choose file</label>
                                                </div>
                                            </div>
                                        </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/js/jquery.validate.min.js')}}"></script>
                <script>
                    jQuery(document).ready(function(){


                      $("#setting").validate({

                        rules:
                       {
                            company_name: {
                                required: true,
                                maxlength: 150,
                            },
                            company_address: {
                                required: true,
                                maxlength: 150,
                            },
                            company_phone: {
                                required: true,
                                maxlength: 20,
                            },
                             company_mobile: {
                                required: true,
                                maxlength: 20,
                            },

                       },
                        submitHandler: submitForm
                      });


                       function submitForm()
                        {


                            var data = new FormData(document.getElementById('setting'));
                            event.preventDefault();

                            $.ajax({

                                type : 'POST',
                                url  : "{{url('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').append('<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

VaKeR 2022