|
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/storage/framework/views/ |
Upload File : |
<?php $__env->startSection('content'); ?>
<!-- begin::main content -->
<style>
.input_upload{
width:100px;
height:35px;
position:absolute;
bottom:-34px;
right:350px;
}
.import-content p{
padding:0;
margin:0;
margin-bottom:8px;
font-size:13px;
}
.filter-form-box{
background-color:#FBFAFA;
padding:10px 24px;
position:absolute;
width:450px;
border:1px solid #ddd;
border-radius:5px;
top:71px;
z-index:20;
}
.filter-form-box input{
height:40px !important;
}
.diamond {
width: 20px;
height: 20px;
background-color: #FBFAFA;
transform: rotate(45deg);
position: relative;
top:-21px;
left:0px;
border-top:1px solid #ddd;
border-left:1px solid #ddd;
}
.seach-input:focus{
outline:none !important;
border-top:1px solid #ddd !important;
border-bottom:1px solid #ddd !important;
}
.seach-input{
height:40px !important;
border-top:1px solid #ddd !important;
border-bottom:1px solid #ddd !important;
border-left:1px solid #ddd !important;
}
</style>
<main class="main-content">
<div class="container">
<div class="toast d-none float-right" >
<div class="toast-body bg-success text-white">
<i class="fa fa-check fa-lg"></i>  Status Update Successfully
</div>
</div>
<!-- begin::page header -->
<div class="page-header">
<h3><?php echo e(__('message.licence')); ?> <?php echo e(__('message.key')); ?></h3>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<?php echo e(asset('dashboard')); ?>"><?php echo e(__('message.dashboard')); ?></a></li>
<li class="breadcrumb-item active" aria-current="page"><?php echo e(__('message.list')); ?></li>
</ol>
</nav>
</div>
<!-- end::page header -->
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-md-6 py-3">
<form action="<?php echo e(asset('distributor/licencekey')); ?>" method="get">
<div class="company-field-box">
<div>
<div class="input-group">
<div class="input-group-prepend">
<button type="button" class="btn border input-group-text filter-company-btn">
<i class="fa fa-filter fa-lg px-2"></i>
</button>
</div>
<input type="search" value="<?php echo e(isset($_GET['search']) ? $_GET['search'] : null); ?>" name="search" class="form-control border-right-0 seach-input">
<button class="btn border border-left-0" type="submit" style="margin-left:-5px;">
<i class="fa fa-search fa-lg"></i>
</button>
</div>
<div class="filter-form-box d-none">
<div class="diamond"></div>
<form method="get" action="<?php echo e(asset('distributor/licencekey')); ?>">
<div class="form-group">
<label><?php echo e(__('message.licence')); ?> <?php echo e(__('message.key')); ?></label>
<input value="<?php echo e(isset($_GET['licence_key']) ? $_GET['licence_key'] : null); ?>" type="text" name="licence_key" class="form-control" id="licence_key">
</div>
<div class="form-group">
<label><?php echo e(__('message.order_id')); ?> </label>
<input value="<?php echo e(isset($_GET['order_id']) ? $_GET['order_id'] : null); ?>" type="text" name="order_id" class="form-control" id="order_id">
</div>
<div class="form-group">
<label> <?php echo e(__('message.created')); ?> </label>
<input type="date" name="created_at" value="<?php echo e(isset($_GET['created_at']) ? $_GET['created_at'] : null); ?>" class="form-control" id="created_at">
</div>
<div class="row">
<div class="form-group col-6">
<label><?php echo e(__('message.start')); ?> <?php echo e(__('message.date')); ?></label>
<input type="date" name="start_date" value="<?php echo e(isset($_GET['start_date']) ? $_GET['start_date'] : null); ?>" class="form-control" id="start_date">
</div>
<div class="form-group col-6">
<label><?php echo e(__('message.end')); ?> <?php echo e(__('message.date')); ?></label>
<input type="date" name="end_date" value="<?php echo e(isset($_GET['end_date']) ? $_GET['end_date'] : null); ?>" class="form-control" id="end_date">
</div>
</div>
<div class="row">
<div class="form-group col-12">
<button type="submit" class="btn btn-success-lux mr-5 px-4 apply-button"><?php echo e(__('message.apply')); ?></button>
<a href="<?php echo e(asset('distributor/licencekey')); ?>" class="btn btn-primary-lux px-5 clear-button text-white"><?php echo e(__('message.clear')); ?></a>
</div>
</div>
</form>
</div>
</div>
</div>
</form>
</div>
<div class="col-md-6 d-flex justify-content-end py-3">
<button data-original-title="Delete Organizations" class="btn btn-danger text-uppercase text-white mr-2 d-none multiple-delete-btn">
<i class="fa fa-trash fa-lg" style="font-size:24px;"></i>
</button>
<a data-toggle="tooltip" data-original-title="Export Restaurant"
href="<?php echo e(asset('export-sales')); ?>"
class="btn btn-white-lux text-uppercase mr-2"><i
class="fa fa-download pr-2"></i>
<?php echo e(__('message.export')); ?>
</a>
<button type="button" class="btn btn-danger d-none" id="delete-multiple">
<i class="fa fa-trash fa-lg"></i>
</button>
</div>
</div>
</div>
<div class="card-body">
<?php if(isset($sales)): ?>
<div class="table-responsive">
<table class="table table-bordered" >
<thead style="background-color:#E9EEF1">
<tr>
<th>
<input type="checkbox" id="checkAll" />
</th>
<th ><?php echo e(__('message.sno')); ?></th>
<th><?php echo e(__('message.sales')); ?> <?php echo e(__('message.date')); ?> / <?php echo e(__('message.time')); ?></th>
<th><?php echo e(__('message.order_id')); ?></th>
<th><?php echo e(__('message.licence')); ?> <?php echo e(__('message.key')); ?></th>
<th><?php echo e(__('message.status')); ?></th>
<th><?php echo e(__('message.activation')); ?> <?php echo e(__('message.date')); ?></th>
<th><?php echo e(__('message.renewal')); ?> <?php echo e(__('message.date')); ?></th>
<th><?php echo e(__('message.sales')); ?> To <?php echo e(__('message.restaurant')); ?></th>
<?php if(Auth::user()->hasRole('employee')): ?>
<th><?php echo e(__('message.action')); ?></th>
<?php endif; ?>
</tr>
</thead>
<tbody>
<?php if(!empty($sales)): ?>
<?php $__currentLoopData = $sales; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<th>
<input type="checkbox" name="checkbox[]" class="userids" value="<?php echo e($value->id); ?>" />
</th>
<td><?php echo e(++$key); ?></td>
<td><?php echo e($value->created_at); ?></td>
<td><?php echo e($value->order_id); ?></td>
<td>
<?php if(isset($value->licence_details)): ?>
<?php echo e($value->licence_details->licence_key); ?>
<?php endif; ?>
</td>
<td>
<?php if($value->status === "INACTIVE"): ?>
<span class="btn btn-outline-warning btn-sm">Unused</span>
<?php else: ?>
<span class="btn btn-outline-success btn-sm">Used</span>
<?php endif; ?>
</td>
<td>
<span class="btn btn-outline-primary btn-sm">
<?php echo e($value->licence_details ? \Carbon\Carbon::parse($value->licence_details->activation_date)->format('d-m-y') : ''); ?>
</span>
</td>
<td>
<span class="btn btn-outline-success btn-sm">
<?php echo e(\Carbon\Carbon::parse($value->renewal_date)->format('d-m-y')); ?>
</span>
</td>
<td>
<?php if(isset($value->licence_details)): ?>
<?php if($value->licence_details->customer_id): ?>
<button disabled class="btn btn-outline-primary btn-sm ">Sold</button>
<?php else: ?>
<a href="<?php echo e(asset('distributor/sell-licence/'.$value->id)); ?>" class="btn btn-outline-primary btn-sm ">Sell Now</a>
<?php endif; ?>
<?php endif; ?>
</td>
<?php if(Auth::user()->hasRole('employee')): ?>
<td>
<div class="d-flex justify-content-center">
<button type="button" class="btn btn-outline-danger btn-sm licence-sell-delete-btn" value="<?php echo e($value->id); ?>">
<i class="fa fa-trash"></i>
</button>
</div>
</td>
<?php endif; ?>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php else: ?>
<h1>No Record Found!!</h1>
<?php endif; ?>
</tbody>
</table>
</div>
<div class="d-flex justify-content-center pagination-box"><?php echo e($sales->links()); ?></div>
<?php endif; ?>
</div>
</div>
</div>
<!-- The Modal -->
<div class="modal" id="sellModal">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header bg-primary rounded-0">
<h4 class="modal-title"><?php echo e(__('message.restaurant')); ?> </h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<!-- Modal body -->
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<form>
<div class="form-group">
<label><?php echo e(__('message.restaurant')); ?> </label>
<input type="hidden" value="<?php echo e(Auth::user()->id); ?>" class="employee_id">
<select class="form-control restaurant_change" name="restaurant_id" >
<option >--SELECT--</option>
<?php $__currentLoopData = $restaurant; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($value->id); ?>"><?php echo e($value->restaurant_name); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="d-flex justify-content-end">
<button type="submit" class="btn btn-outline-primary" >Sell Now</button>
</div>
</form>
</div>
<div class="col-md-6 border-left p-3">
<?php $__currentLoopData = $restaurant; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="shadow-sm p-3">
<h3>Restaurant Details</h3>
<hr>
<ul class="list-unstyled">
<li class="w-100"><strong>Name:</strong> <?php echo e($value->restaurant_name ? $value->restaurant_name : 'N/A'); ?></li>
<li class="w-100"><strong>Address:</strong> <?php echo e($value->address ? $value->address : 'N/A'); ?></li>
<li class="w-100"><strong>Email:</strong> <?php echo e($value->email ? $value->email : 'N/A'); ?></li>
<li class="w-100"><strong>Mobile:</strong> <?php echo e($value->mobile ? $value->mobile : 'N/A'); ?></li>
<li class="w-100"><strong>Owner Name:</strong> <?php echo e($value->owner_name ? $value->owner_name : 'N/A'); ?></li>
<li class="w-100"><strong>Manager Name:</strong> <?php echo e($value->manager_name ? $value->manager_name : 'N/A'); ?></li>
<li class="w-100"><strong>Manager Mobile:</strong> <?php echo e($value->manager_mobile ? $value->manager_mobile : 'N/A'); ?></li>
<li class="w-100"><strong>Manager Details:</strong> <?php echo e($value->manager_email ? $value->manager_email : 'N/A'); ?></li>
<li class="w-100"><strong>State:</strong> <?php echo e($value->state ? $value->state : 'N/A'); ?></li>
<li class="w-100"><strong>City:</strong> <?php echo e($value->city ? $value->city : 'N/A'); ?></li>
</ul>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
</div>
<!-- Modal footer -->
</div>
</div>
</div>
</main>
<!-- end::main content -->
<?php $__env->stopSection(); ?>
<?php $__env->startPush('footer-script'); ?>
<!-- begin::dataTable -->
<!-- end::dataTable -->
<script>
$(document).ready(function() {
$("#checkAll").click(function() {
$('.userids:checkbox').not(this).prop('checked', this.checked);
var length = $('.userids[type="checkbox"]:checked').length;
if($(".multiple-delete-btn").hasClass('d-none'))
{
$(".multiple-delete-btn").removeClass("d-none");
$(".multiple-delete-btn").html('<span class="pt-1">Delete ('+length+")</span>");
}
else
{
$(".multiple-delete-btn").addClass("d-none");
}
});
//employee delte button code
$(".licence-sell-delete-btn").click(function(){
var licence_sell_id = $(this).val();
swal({
title: 'Are you sure?',
text: 'Once deleted, you will not be recover!',
icon: 'warning',
dangerMode: true,
buttons: ["Cancel", "Yes!"],
}).then(function(value) {
if (value) {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$.ajax({
type: "post",
data: {
"id": licence_sell_id
},
url: "<?php echo e(asset('delete-sale')); ?>",
dataType: "html",
success: function(result) {
//console.log(result);
swal("success!", "Successfully deleted!", "success");
window.location.reload();
},
error:function(error)
{
swal("Failed !", "Failed !", "error");
window.location.reload();
}
});
}
});
});
// Delete Multiple
$(".multiple-delete-btn").click(function() {
var URL = "<?php echo e(asset('multiple-delete-sale')); ?>";
var user_ids = [];
$('.userids:checkbox:checked').each(function() {
user_ids.push($(this).val());
});
swal({
title: 'Are you sure?',
text: 'Once deleted, you will not be recover!',
icon: 'warning',
dangerMode: true,
buttons: ["Cancel", "Yes!"],
}).then(function(value) {
if (value) {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$.ajax({
type: "post",
data: {
"ids": user_ids
},
url: URL,
dataType: "html",
success: function(result) {
console.log(result);
swal("success!", "Successfully deleted!", "success");
window.location.reload();
},
error:function(xhr,status,error)
{
swal("failed!", "Failed !", "error");
window.location.reload();
}
});
}
});
});
$("#all-sells-input").click(function(){
$('.licence_id:checkbox').not(this).prop('checked', this.checked);
var length = $('.licence_id[type="checkbox"]:checked').length;
if($(".all-sells-btn").hasClass('d-none'))
{
$(".all-sells-btn").removeClass("d-none");
$(".all-sells-btn").html('<span class="pt-1">Sell Licence ('+length+")</span>");
}
if(length===0)
{
$(".all-sells-btn").addClass("d-none");
}
});
$('.licence_id').each(function(){
var licence_ids = [];
$(this).click(function(){
var length = $('.licence_id[type="checkbox"]:checked').length;
$(".all-sells-btn").removeClass("d-none");
$(".all-sells-btn").html('<span class="pt-1">Sell Licence ('+length+")</span>");
$('.licence_id:checkbox:checked').each(function() {
licence_ids.push($(this).val());
});
//console.log(licence_ids);
});
});
$(".sell-restaurant-btn").click(function(){
$("#sellModal").modal("show");
var licence_ids = [];
$('.licence_id:checkbox:checked').each(function() {
licence_ids.push($(this).val());
});
//console.log(licence_ids);
$(".licence-sell-form").submit(function(e){
e.preventDefault();
var distributor_id = $(".distributor_id").val();
var employee_id = $(".employee_id").val();
console.log(distributor_id);
distributorSell(licence_ids,distributor_id,employee_id);
});
});
//sell licence key ajax code
function distributorSell(licence_ids,distributor_id,employee_id)
{
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$.ajax({
type: "post",
data: {
"licence_ids": licence_ids,
"distributor_id":distributor_id,
"employee_id": employee_id
},
url: "<?php echo e(asset('sell-licence-key')); ?>",
dataType: "html",
success: function(result) {
//console.log(result);
swal("success!", "Successfully Sell Licence !", "success");
//window.location.reload();
},
error:function(xhr,status,error)
{
var err = JSON.parse(xhr.responseText);
swal("failed!", err.message, "error");
// window.location.reload();
}
});
}
});
$(".apply-button").click(function(){
$(".filter-form-box").addClass("d-none");
});
//filter company code
$(".filter-company-btn").click(function(){
if($(".filter-form-box").hasClass("d-none"))
{
$(".filter-form-box").removeClass("d-none");
}
else
{
$(".filter-form-box").addClass("d-none");
}
});
</script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\licence_panel\resources\views/sales/distributor/list.blade.php ENDPATH**/ ?>