Skip to content

Instantly share code, notes, and snippets.

@shanerbaner82
Created April 17, 2021 00:56
Show Gist options
  • Save shanerbaner82/6f3bd6ebe236e1248a87bbfa0aac2337 to your computer and use it in GitHub Desktop.
Save shanerbaner82/6f3bd6ebe236e1248a87bbfa0aac2337 to your computer and use it in GitHub Desktop.
omg
<!DOCTYPE html>
<html lang="en" class="h-100">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-177388097-1"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://js.stripe.com/v3/"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-177388097-1');
</script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>@yield('page_title', 'Jet Locker')</title>
<link rel="icon" type="image/x-icon" href="{{ asset('/favicon.ico') }}" />
<link rel="stylesheet" href="{{ asset('home/css/bootstrap-reboot.min.css') }}">
<link rel="stylesheet" href="{{ asset('home/css/bootstrap.min.css') }}">
<link rel="stylesheet" href="{{ asset('home/css/style.css') }}">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
<style>
.invDiv{
cursor: pointer;
}
.invDiv:hover{
background:#f7f7f7;
}
</style>
@stack('style')
</head>
<body class="d-flex flex-column h-100">
<!-- Load Facebook SDK for JavaScript -->
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
xfbml : true,
version : 'v8.0'
});
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = 'https://connect.facebook.net/en_US/sdk/xfbml.customerchat.js';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<!-- Your Chat Plugin code -->
<div class="fb-customerchat"
attribution=setup_tool
page_id="108866450499807"
theme_color="#fe4a49">
</div>
<main role="main" class="flex-shrink-0 @yield('mian_background', '')">
<div class="header p-3 px-md-4 mb-3 bg-white">
<div class="container d-flex flex-column flex-md-row align-items-center">
<a class="my-0 mr-md-auto"><img src="home/images/logo.png" alt="" class="my-0 mr-md-auto logo" /></a>
<nav class="my-2 my-md-0">
<div class="btn-group pr-3">
<button type="button" id="inv-btn" class="btn btn-sm dropdown-toggle @php if(request()->segment(1) == 'invoice-upload' || request()->segment(1) == 'invoice'): @endphp active @php endif; @endphp" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
@yield('is_new_invoice', '')
<?php
//$Data = DB::Select("SELECT count(*) as cnt FROM warehouse_receipts right join warehouse_receipt_details on (warehouse_receipts.id=warehouse_receipt_details.warehouse_receipt_id) where warehouse_receipts.user_id='".Auth::User()->id."' AND warehouse_receipt_details.customer_purchase_slip_image is null");
//$Data = DB::Select("SELECT count(*) as cnt FROM invoices where user_id='".Auth::User()->id."' AND is_seen='0'");
//$Data = DB::Select("SELECT count(*) as cnt FROM invoices where user_id='".Auth::User()->id."'");
$AllData = \App\Models\Invoice::where('user_id', Auth::User()->id)->where('is_seen', '0')->get();
$Data = $AllData->count();
?>
@if($Data > 0)
<span id="notification" class="badge badge-pill badge-dark">new</span>
@endif
Invoices
</button>
<div class="dropdown-menu">
<a class="dropdown-item @if(request()->segment(1) === 'invoice') active @endif" href="{{ url('invoice') }}">Current Invoice</a>
<a class="dropdown-item @if(request()->segment(1) === 'invoice-upload') active @endif" href="{{ url('invoice-upload') }}">Upload Receipt</a>
</div>
</div>
{{-- <a class="btn btn-sm pr-4 @php if(request()->segment(1) == 'lockers'): @endphp active @php endif; @endphp" href="{{ url('lockers') }}">Lockers</a>--}}
{{-- <a class="btn btn-sm pr-4 @php if(request()->segment(1) == 'account'): @endphp active @php endif; @endphp" href="{{ url('account') }}">Account</a>--}}
{{-- <a class="btn btn-sm pr-4 @php if(request()->segment(1) == 'contact'): @endphp active @php endif; @endphp" href="{{ url('contact') }}">Contact Us</a>--}}
{{-- <a class="btn btn-sm btn-primary @php if(request()->segment(1) == 'paynowall'): @endphp active @php endif; @endphp" href="{{ url('paynowall') }}">Pay Now | <span id="AmountInv">${{$AmountInv}}</span></a> --}}
{{-- <button class="btn btn-sm btn-primary @php if(request()->segment(1) == 'paynowall'): @endphp active @php endif; @endphp" id="checkout-button">Pay Now | <span id="AmountInv">${{$AmountInv}}</span></button>--}}
<a href="{{ url('/logout') }}" class="btn btn-sm pl-4"
onclick="event.preventDefault();
document.getElementById('logout-form').submit();">
Log Out
</a>
<form id="logout-form" action="{{ url('/logout') }}" method="POST" style="display: none;">
{{ csrf_field() }}
</form>
</nav>
</div>
</div>
@yield('content')
</main>
<footer class="footer mt-auto pt-0">
<div class="pt-1"></div>
<div class="container">
<span>&copy; Jetlocker</span>
<span class="links">
<a href="tel:+1(242)123-4567">Tel.+1(242)123-4567</a>
<a href="mailto:hello@jetlocker.co" >hello@jetlocker.co</a>
</span>
<span class="float-md-right float-none">
<a href="https://www.facebook.com/jetlockerco" target="_blank" class="social fb"></a>
<a href="https://www.twitter.com/jetlockerco" target="_blank" class="social twitter"></a>
<a href="https://www.instagram.com/jetlockerco" target="_blank" class="social instagram"></a>
</span>
</div>
</footer>
<script src="{{ asset('home/js/jquery-3.4.1.min.js') }}"></script>
<script src="{{ asset('home/js/popper.min.js') }}"></script>
<script src="{{ asset('home/js/bootstrap.min.js') }}"></script>
<script src="{{ asset('home/js/script.js') }}"></script>
<script type="text/javascript">
var element = $('#inv-btn');
setTimeout(function() {
$('#notification').hide();
}, 5000);
</script>
<script type="text/javascript">
// Create an instance of the Stripe object with your publishable API key
var stripe = Stripe('pk_test_TYooMQauvdEDq54NiTphI7jx');
var checkoutButton = document.getElementById('checkout-button');
checkoutButton.addEventListener('click', function() {
var pay = $('#AmountInv').html();
//alert(pay);
// Create a new Checkout Session using the server-side endpoint you
// created in step 3.
$.ajaxSetup({
beforeSend: function(xhr, type) {
if (!type.crossDomain) {
xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'));
}
},
});
$.ajax({
url: '/setpay',
type: 'GET',
success: function( data ) {
console.log(data);
debugger;
//return false;
//alert(data);
if(data == 'InvoiceNotSelected'){
alert('Please select an invoice to proceed');
location.reload();
//return false;
}else{
//alert('Ok');
//return false;
fetch('/paynowall', {
method: 'POST',
headers: {
'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
},
})
.then(function(response) {
return response.json();
})
.then(function(session) {
return stripe.redirectToCheckout({ sessionId: session.id });
})
.then(function(result) {
// If `redirectToCheckout` fails due to a browser or network
// error, you should display the localized error message to your
// customer using `error.message`.
if (result.error) {
alert(result.error.message);
}
})
.catch(function(error) {
console.error('Error:', error);
});
}
}
})
//var url = 'http://localhost:8000/create-checkout-session';
});
</script>
@stack('scripts')
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment