|
Server : Apache/2.4.41 (Ubuntu) System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64 User : www-data ( 33) PHP Version : 8.2.12 Disable Function : NONE Directory : /var/www/leadai/leadai.co.in/resources/views/restaurant_key/ |
Upload File : |
@extends('layout')
@section('content')
<!-- begin::main content -->
<style>
/* Styles for tabs */
.tab {
display: inline-block;
padding: 12px 26px;
cursor: pointer;
background-color: #E6EAED;
margin-right: -4px; /* Remove spacing between tabs */
}
/* Style for highlighted tab */
.tab.active {
background-color: white;
}
/* Content area style */
.tab-content {
padding: 20px;
border-radius: 0 0 5px 5px;
display: none; /* Hide all content areas by default */
}
/* Show active content area */
.tab-content.active {
display: block;
}
.form-group input, .form-group select{
height:42px;
padding-top:10px 25px !important;
}
.form-group label, .tab{
font-size:13px !important;
}
.company-save-btn{
position:fixed;
bottom:0;left:250px;
background-color:white;
border-top:1px solid #ccc;
}
.inner-border{
border:-2px solid #ddd !important;
}
@media only screen and (max-width: 768px) {
.company-save-btn{
position:fixed;
bottom:0;left:0px;
background-color:white;
border-top:1px solid #ccc;
}
}
</style>
<main class="main-content px-0">
<div class="container">
<!-- begin::page header -->
<div class="page-header m-0 border-0">
<h3> {{__('message.edit')}} {{__('message.licence')}}</h3>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{{ asset('dashboard') }}">{{__('message.dashboard')}}</a></li>
<li class="breadcrumb-item" aria-current="page"><a href="{{ asset('licencekey') }}">{{__('message.licence')}}</a></li>
<li class="breadcrumb-item active" aria-current="page">{{__('message.edit')}}</li>
</ol>
</nav>
</div>
<!-- end::page header -->
<div class="row ">
<div class="col-md-12">
<x-flashMessage />
<div class="card border-0">
<div class="card-body py-0 border">
<form action="{{ asset('edit-licencekey') }}" method="post">
<div class="row">
<div class="col-md-6 py-3 pt-5">
@csrf
<input type="hidden" name="licence_id" value="{{$licencekey->id}}">
<div class="form-group d-flex justify-content-between align-items-center">
<label for="licence_key" class="col-md-4">{{__('message.licence')}} {{__('message.key')}}</label>
<div class="col-md-8 px-0 mb-0">
<input value="{{$licencekey->licence_key}}" type="text" class="form-control" name="licence_key" id="licencekey">
@if ($errors->has('licence_key'))
<div class="error">
{{ $errors->first('licence_key') }}
</div>
@endif
</div>
</div>
<div class="d-flex justify-content-end mb-4">
<button type="button" class="btn btn-outline-primary generate-licence-btn">Generate Licence Key</button>
</div>
<div class="form-group d-flex justify-content-between align-items-center mb-4">
<label for="employee_id" class="col-md-4">Assign To Employee : </label>
<div class="col-md-8 px-0">
<select type="text" class="form-control" name="employee_id" >
<option selected>--SELECT--</option>
@foreach($employee as $emp)
<option value="{{$emp->id}}" {{$emp->id == $licencekey->employee_id ? 'selected' : ''}} class="text-capitalize">{{$emp->name}}</option>
@endforeach
</select>
@if ($errors->has('employee_id'))
<div class="error">
{{ $errors->first('employee_id') }}
</div>
@endif
</div>
</div>
<div class="form-group d-flex justify-content-between align-items-center mb-4">
<label for="created_date" class="col-md-4">{{__('message.created')}} </label>
<div class="col-md-8 px-0">
<input type="date" value="{{$licencekey->created_date}}" class="form-control" name="created_date" id="dateInput">
@if ($errors->has('created_date'))
<div class="error">
{{ $errors->first('created_date') }}
</div>
@endif
</div>
</div>
<div class="form-group d-flex justify-content-between align-items-center mb-4">
<label for="activation_date" class="col-md-4">Date Of Activation </label>
<div class="col-md-8 px-0">
<input type="date" class="form-control" name="activation_date" value="{{$licencekey->activation_date}}" >
@if ($errors->has('activation_date'))
<div class="error">
{{ $errors->first('activation_date') }}
</div>
@endif
</div>
</div>
<div class="form-group d-flex justify-content-between align-items-center mb-4">
<label for="duration" class="col-md-4">{{__('message.duration')}} </label>
<div class="col-md-8 px-0">
<input type="number" class="form-control" name="duration" value="{{$licencekey->duration}}">
@if ($errors->has('duration'))
<div class="error">
{{ $errors->first('duration') }}
</div>
@endif
</div>
</div>
</div>
<div class="col-md-6 border-left px-0">
<!-- Tabs -->
<div id="tabs" class="border-bottom">
<div class="tab active" onclick="openTab('tab1')">
<strong> {{__('message.customer')}}</strong>
</div>
</div>
<!-- Tab content -->
<div class="tab-content active animate__animated animate__fadeIn" id="tab1">
<div class="form-group d-flex justify-content-between align-items-center">
<label for="customer_name" class="col-md-4"> {{__('message.customer')}} {{__('message.name')}}</label>
<div class="col-md-8 px-0">
<input class="form-control" name="customer_name" id="customer_name" value="{{$licencekey->customer_name}}">
@if ($errors->has('customer_name'))
<div class="error">
{{ $errors->first('customer_name') }}
</div>
@endif
</div>
</div>
<div class="form-group d-flex justify-content-between align-items-center">
<label for="customer_mobile" class="col-md-4"> {{__('message.customer')}} {{__('message.phone')}}</label>
<div class="col-md-8 px-0">
<input class="form-control" name="customer_mobile" id="customer_mobile" value="{{$licencekey->customer_mobile}}">
@if ($errors->has('customer_mobile'))
<div class="error">
{{ $errors->first('customer_mobile') }}
</div>
@endif
</div>
</div>
<div class="form-group d-flex justify-content-between align-items-center">
<label for="customer_email" class="col-md-4"> {{__('message.customer')}} {{__('message.email')}}</label>
<div class="col-md-8 px-0">
<input class="form-control" name="customer_email" id="customer_email" value="{{$licencekey->customer_email}}">
@if ($errors->has('customer_email'))
<div class="error">
{{ $errors->first('customer_email') }}
</div>
@endif
</div>
</div>
</div>
</div>
</div>
<div class="py-5" style="z-index:50;position:absolute" >
<div class="py-3 px-5 w-100 company-save-btn " >
<button type="submit" class="btn btn-success-lux"><i class="fa fa-check"></i>  {{__('message.save')}}</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</main>
<!-- end::main content -->
@endsection
@push('footer-script')
<!-- begin::select2 -->
<link rel="stylesheet" href="{{ asset('public/admin/vendors/select2/css/select2.min.css') }}" type="text/css">
<script src="{{ asset('public/admin/vendors/select2/js/select2.min.js') }}"></script>
<!-- end::select2 -->
<script>
$(document).ready(function() {
$('#js-example-basic-roles').select2({});
let today = new Date();
let day = String(today.getDate()).padStart(2, '0');
let month = String(today.getMonth() + 1).padStart(2, '0'); // January is 0!
let year = today.getFullYear();
// Format date as YYYY-MM-DD
let currentDate = year + '-' + month + '-' + day;
// Set the value of the date input to the current date
$('#dateInput').val(currentDate);
});
$("#billing_country").on("change",function(){
var company_id = $(this).val();
stateFetch(company_id,"billing_state");
});
$("#location_country").on("change",function(){
var company_id = $(this).val();
stateFetch(company_id,"location_state");
});
function generateRandomKey(length)
{
let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let result = '';
let charactersLength = characters.length;
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}
$(".generate-licence-btn").click(function() {
let randomKey = generateRandomKey(16);
$("#licencekey").val(randomKey);
});
function openTab(tabId) {
// Get all tabs and hide them
var tabs = document.querySelectorAll('.tab-content');
tabs.forEach(function(tab) {
tab.classList.remove('active');
});
// Remove active class from all tabs
var tabButtons = document.querySelectorAll('.tab');
tabButtons.forEach(function(button) {
button.classList.remove('active');
});
// Show the clicked tab and add active class
document.getElementById(tabId).classList.add('active');
document.querySelector('[onclick="openTab(\'' + tabId + '\')"]').classList.add('active');
}
</script>
@endpush