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/cnf/ |
Upload File : |
@extends('backend.layout.app') @section('content') <!-- ============================================================== --> <!-- 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">C&F Edit</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">C&F</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="addcourier"> @csrf <h4 class="card-title">Edit C&F</h4> @include('backend.layout.verror_message') <div class="form-group row"> <label for="name" class="col-sm-3 text-right control-label col-form-label">C&F Name</label> <div class="col-sm-9"> <input type="text" name="cnf_name" class="form-control" id="name" value="{{$cnf->cnf_name}}" placeholder="C&F Name "> <input type="hidden" name="cnf_id" value="{{$cnf->cnf_id}}"> </div> </div> <div class="form-group row"> <label for="address" class="col-sm-3 text-right control-label col-form-label">Address</label> <div class="col-sm-9"> <input value="{{$cnf->cnf_address}}" name="cnf_address" type="text" class="form-control" id="address" placeholder="Address"> </div> </div> <div class="form-group row"> <label for="email" class="col-sm-3 text-right control-label col-form-label">Email</label> <div class="col-sm-9"> <input value="{{$cnf->cnf_email}}" name="cnf_email" id="email" type="text" class="form-control" id="com1" placeholder="email"> </div> </div> <div class="form-group row"> <label for="phone" class="col-sm-3 text-right control-label col-form-label">Phone</label> <div class="col-sm-9"> <input value="{{$cnf->cnf_phone}}" name="cnf_phone" type="text" class="form-control" id="phone" placeholder="phone"> </div> </div> <div class="form-group row"> <label for="phone" class="col-sm-3 text-right control-label col-form-label">Mobile</label> <div class="col-sm-9"> <input value="{{$cnf->cnf_mobile}}" name="cnf_mobile" type="text" class="form-control" id="courier_mobile" placeholder="phone"> </div> </div> <div class="form-group row"> <label for="phone" class="col-sm-3 text-right control-label col-form-label">Website</label> <div class="col-sm-9"> <input value="{{$cnf->cnf_website}}" name="cnf_website" type="text" class="form-control" id="courier_website" placeholder="phone"> </div> </div> <div class="form-group row"> <label for="product_price" class="col-sm-3 text-right control-label col-form-label"></label> <div class="col-sm-9"> <div class="custom-control custom-checkbox" id=""> <input value="1" name="status" @if($cnf->status == 1) checked="" @endif type="checkbox" class="custom-control-input" id="status" > <label class="custom-control-label" for="status">Staus</label> </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> <!-- ============================================================== --> <!-- End PAge Content --> <!-- ============================================================== --> <!-- ============================================================== --> <!-- Right sidebar --> <!-- ============================================================== --> <!-- .right-sidebar --> <!-- ============================================================== --> <!-- End Right sidebar --> <!-- ============================================================== --> </div> <!-- ============================================================== --> <!-- End Container fluid --> @endsection @section('script') <script src="{{url('public/backend/js/jquery.validate.min.js')}}"></script> <script> jQuery(document).ready(function(){ $("#addcourier").validate({ rules: { cnf_name: { required: true, maxlength: 150, }, cnf_email: { required: true, email:true, maxlength: 150, }, cnf_phone: { maxlength: 20, }, cnf_address: { required: true, }, cnf_mobile: { maxlength: 20, }, }, submitHandler: submitForm }); function submitForm() { var data = $("#addcourier").serialize(); $.ajax({ type : 'POST', url : "{{url('edit_cnf')}}", data : data, 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>'); //$("#addcourier").get(0).reset(); window.location="{{url('all_cnf')}}"; }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; } }); </script> @endsection