Managing View, Edit & Update Profile Details
This commit is contained in:
@ -154,9 +154,9 @@
|
||||
<li>Total <span>Nrs {{ $total }}</span></li>
|
||||
</ul>
|
||||
<form action=" {{ url::to('checkout') }} ">
|
||||
{{-- <form action=" {{ url::to('stripe') }} "> --}}
|
||||
<input type="text" name="name" class="form-control mt-2" placeholder="Enter Name"
|
||||
id="" required>
|
||||
|
||||
<input type="text" name="phone" class="form-control mt-2"
|
||||
placeholder
|
||||
="Enter Phone" id="" required>
|
||||
|
@ -22,6 +22,8 @@
|
||||
<link rel="stylesheet" href="{{ URL::asset('css/owl.carousel.min.css') }}"type="text/css">
|
||||
<link rel="stylesheet" href="{{ URL::asset('css/slicknav.min.css') }}" type="text/css">
|
||||
<link rel="stylesheet" href="{{ URL::asset('css/style.css') }}" type="text/css">
|
||||
<!-- Include the Stripe.js library -->
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -115,16 +117,10 @@
|
||||
{{-- <li><a href="{{ URL::to('singleProduct') }}">Single Product</a></li> --}}
|
||||
<li><a href="{{ URL::to('cart') }}">Shopping Cart</a></li>
|
||||
<li><a href="{{ URL::to('checkout') }}">Check Out</a></li>
|
||||
{{-- <li><a href="{{ URL::to('blogDetails') }}">Blog Details</a></li> --}}
|
||||
<li><a href="{{ URL::to('profile') }}">Profile</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{{--
|
||||
@if (session()->has('id'))
|
||||
<li><a href="{{ URL::to('/logout') }}">Logout</a></li>
|
||||
@else
|
||||
<li><a href="{{ URL::to('/login') }}">Login</a></li>
|
||||
<li><a href="{{ URL::to('/register') }}">Register</a></li>
|
||||
@endif --}}
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
72
resources/views/profile.blade.php
Normal file
72
resources/views/profile.blade.php
Normal file
@ -0,0 +1,72 @@
|
||||
<x-header />
|
||||
|
||||
|
||||
<!-- Contact Section Begin -->
|
||||
<section class="contact spad">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-6 col-md-6 mx-auto">
|
||||
<div class="section-title">
|
||||
<h2>Update Account</h2>
|
||||
</div>
|
||||
<div class="contact__form">
|
||||
|
||||
@if (session('success'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('error') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<img src="{{ 'uploads/profiles/' . $user->picture }}" class=" mx-auto d-block mb-2 rounded-circle"
|
||||
alt="profile picture" width="100px" height="100px">
|
||||
|
||||
<form action="{{ URL::to('updateUser') }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<input type="text" name="name" value="{{ $user->name }}" id="name"
|
||||
placeholder="Name" required>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<input type="email" name="email" value="{{ $user->email }}" id="email"
|
||||
placeholder="Email" readonly required>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<input type="file" name="file">
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<input type="password" name="password" value="{{ $user->password }}" id="password"
|
||||
placeholder="Password">
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
|
||||
<button type="submit" class="site-btn">Save Changes</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- Contact Section End -->
|
||||
|
||||
<!-- Footer Section Begin -->
|
||||
<x-footer />
|
||||
<!-- Footer Section End -->
|
@ -34,7 +34,7 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form action="{{ URL::to('registerUser') }}" method="POST" enctype="multipart/form-data">
|
||||
{{-- <form action="{{ URL::to('registerUser') }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
@ -50,11 +50,39 @@
|
||||
<input type="password" name="password" id="password" placeholder="Password">
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<input type="password" name="password_confirmation" id="password_confirmation"
|
||||
placeholder="Confirm Password" required>
|
||||
<button type="submit" class="site-btn">Sign Up</button>
|
||||
</div>
|
||||
</div>
|
||||
</form> --}}
|
||||
|
||||
<form action="{{ route('registerUser') }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<input type="text" name="name" id="name" placeholder="Name">
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<input type="email" name="email" id="email" placeholder="Email">
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<input type="file" name="file">
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<input type="password" name="password" id="password" placeholder="Password">
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<input type="password" name="password_confirmation" id="password_confirmation"
|
||||
placeholder="Confirm Password">
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<button type="submit" class="site-btn">Sign Up</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
139
resources/views/stripe.blade.php
Normal file
139
resources/views/stripe.blade.php
Normal file
@ -0,0 +1,139 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Laravel - Stripe Payment Gateway Integration Example - ItSolutionStuff.com</title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" />
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="text-center">Stripe Payment Gateway </h1>
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<div class="panel panel-default credit-card-box">
|
||||
<div class="panel-heading display-table">
|
||||
<h3 class="panel-title">Payment Details</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
@if (Session::has('success'))
|
||||
<div class="alert alert-success text-center">
|
||||
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
|
||||
<p>{{ Session::get('success') }}</p>
|
||||
</div>
|
||||
@endif
|
||||
<form role="form" action="{{ route('stripe.post') }}" method="post"
|
||||
class="require-validation" data-cc-on-file="false"
|
||||
data-stripe-publishable-key="{{ env('STRIPE_KEY') }}" id="payment-form">
|
||||
@csrf
|
||||
<div class='form-row row'>
|
||||
<div class='col-xs-12 form-group required'>
|
||||
<label class='control-label'>Name on Card</label> <input class='form-control'
|
||||
size='4' type='text'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='form-row row'>
|
||||
<div class='col-xs-12 form-group card required'>
|
||||
<label class='control-label'>Card Number</label> <input autocomplete='off'
|
||||
class='form-control card-number' size='20' type='text'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='form-row row'>
|
||||
<div class='col-xs-12 col-md-4 form-group cvc required'>
|
||||
<label class='control-label'>CVC</label> <input autocomplete='off'
|
||||
class='form-control card-cvc' placeholder='ex. 311' size='4'
|
||||
type='text'>
|
||||
</div>
|
||||
|
||||
<div class='col-xs-12 col-md-4 form-group expiration required'> <label
|
||||
class='control-label'>Expiration Month</label> <input
|
||||
class='form-control card-expiry-month' placeholder='MM' size='2'
|
||||
type='text'> </div>
|
||||
<div class='col-xs-12 col-md-4 form-group expiration required'> <label
|
||||
class='control-label'>Expiration Year</label> <input
|
||||
class='form-control card-expiry-year' placeholder='YYYY' size='4'
|
||||
type='text'> </div>
|
||||
</div>
|
||||
<div class='form-row row'>
|
||||
<div class='col-md-12 error form-group hide'>
|
||||
<div class='alert-danger alert'>Please correct the errors and try again.</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<input type="hidden" value="{{ $name }}" name="name"
|
||||
class="form-control mt-2" placeholder="Enter Name" id="" required>
|
||||
<input type="hidden" value="{{ $phone }}" name="phone"
|
||||
class="form-control mt-2" placeholder="Enter Phone" id="" required>
|
||||
<input type="hidden" value="{{ $address }}" name="address"
|
||||
class="form-control mt-2" placeholder="Enter Address" id="" required>
|
||||
<input type="hidden" name="bill" class="form-control mt-2"
|
||||
value="{{ $bill }}" id="" required>
|
||||
<button class="btn btn-primary btn-lg btn-block" type="submit">Pay
|
||||
Now(Nrs{{ $bill }})</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
/*------------------------------------------ -------------------------------------------- Stripe Payment Code -------------------------------------------- --------------------------------------------*/
|
||||
var $form = $(".require-validation");
|
||||
$('form.require-validation').bind('submit', function(e) {
|
||||
var $form = $(".require-validation"),
|
||||
inputSelector = ['input[type=email]', 'input[type=password]',
|
||||
'input[type=text]', 'input[type=file]',
|
||||
'textarea'
|
||||
].join(', '),
|
||||
$inputs = $form.find('.required').find(inputSelector),
|
||||
$errorMessage = $form.find('div.error'),
|
||||
valid = true;
|
||||
|
||||
$errorMessage.addClass('hide');
|
||||
$('.has-error').removeClass('has-error');
|
||||
$inputs.each(function(i, el) {
|
||||
var $input = $(el);
|
||||
if ($input.val() === '') {
|
||||
$input.parent().addClass('has-error');
|
||||
$errorMessage.removeClass('hide');
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
if (!$form.data('cc-on-file')) {
|
||||
e.preventDefault();
|
||||
Stripe.setPublishableKey($form.data('stripe-publishable-key'));
|
||||
Stripe.createToken({
|
||||
number: $('.card-number').val(),
|
||||
cvc: $('.card-cvc').val(),
|
||||
exp_month: $('.card-expiry-month').val(),
|
||||
exp_year: $('.card-expiry-year').val()
|
||||
}, stripeResponseHandler);
|
||||
}
|
||||
});
|
||||
/*------------------------------------------ -------------------------------------------- Stripe Response Handler --------------------------------------------
|
||||
|
||||
--------------------------------------------*/
|
||||
function stripeResponseHandler(status, response) {
|
||||
if (response.error) {
|
||||
$('.error')
|
||||
.removeClass('hide').find('.alert').text(response.error.message);
|
||||
} else {
|
||||
/* token contains id, last4, and card type */
|
||||
var token = response['id'];
|
||||
$form.find('input[type=text]').empty();
|
||||
$form.append("<input type='hidden' name='stripeToken' value='" + token + "'/>");
|
||||
$form.get(0).submit();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</html>
|
Reference in New Issue
Block a user