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 :  /proc/thread-self/root/home/vapecompany/demo.vapecompany.com.bd/resources/views/backend/setting/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/thread-self/root/home/vapecompany/demo.vapecompany.com.bd/resources/views/backend/setting/edit.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> 
                                     <input type="hidden" name="form" value="edit">@include('backend.layout.verror_message')
                                    <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 value="{{$companyInfo->company_name}}" name="company_name" type="text" class="form-control" id="company_name" placeholder="Company Name Here">
                                        </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 value="{{$companyInfo->company_address}}" name="company_address" type="text" class="form-control" id="company_address" placeholder="Company Address Here">
                                        </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 value="{{$companyInfo->company_phone}}" name="company_phone" type="text" class="form-control" id="company_phone" placeholder="Company phone Here">
                                        </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 value="{{$companyInfo->company_email}}" name="company_email" type="text" class="form-control" id="company_email" placeholder="Email">
                                        </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 value="{{$companyInfo->facebook}}" name="company_facebook" type="text" class="form-control" id="company_facebook" placeholder="Facebook">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label for="twitter" class="col-sm-3 text-right control-label col-form-label">Twitter</label>
                                        <div class="col-sm-9">
                                            <input value="{{$companyInfo->twitter}}" name="twitter" type="text" class="form-control" id="twitter" placeholder="Twitter">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label for="instagram" class="col-sm-3 text-right control-label col-form-label">Instagram</label>
                                        <div class="col-sm-9">
                                            <input value="{{$companyInfo->instagram}}" name="instagram" type="text" class="form-control" id="instagram" placeholder="Instagram">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label for="linkedin" class="col-sm-3 text-right control-label col-form-label">LinkedIn</label>
                                        <div class="col-sm-9">
                                            <input value="{{$companyInfo->linkedin}}" name="linkedin" type="text" class="form-control" id="linkedin" placeholder="LinkedIn">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label for="youtube" class="col-sm-3 text-right control-label col-form-label">YouTube</label>
                                        <div class="col-sm-9">
                                            <input value="{{$companyInfo->youtube}}" name="youtube" type="text" class="form-control" id="youtube" placeholder="YouTube">
                                        </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">
                                                <input type="hidden" name="oldfile" value="{{$companyInfo->company_logo}}">
                                                 <img id='img-upload' @if(empty($companyInfo->company_logo)) src="https://webdevtrick.com/wp-content/uploads/preview-img.jpg" @else src="{{ url('public/images/company/').'/'.$companyInfo->company_logo }}"  @endif />
                                            </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/backend/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: 14,
                            }, 
                             company_mobile: {
                                required: true,
                                maxlength: 14,
                            },                  
                           
                       },
                        submitHandler: submitForm
                      });
                      
                      
                       function submitForm()
                        {
                           
                            
                            var data = new FormData(document.getElementById('setting')); 
                                 event.preventDefault();
                            $.ajax({
                    
                                type : 'POST',
                                url  : "{{url('admin/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