|
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'); ?>
<main class="main-content">
<div class="container">
<!-- begin::page header -->
<div class="page-header border-0">
<h3> Edit <?php echo \App\Helpers\Frontend::lead_name(); ?></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" aria-current="page"><a href="<?php echo e(asset('leads/list')); ?>">list</a></li>
<li class="breadcrumb-item active" aria-current="page"><?php echo e(__('message.edit')); ?></li>
</ol>
</nav>
</div>
<!-- end::page header -->
<div class="row">
<div class="col-md-12">
<?php if (isset($component)) { $__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\FlashMessage::class, []); ?>
<?php $component->withName('flashMessage'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74)): ?>
<?php $component = $__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74; ?>
<?php unset($__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74); ?>
<?php endif; ?>
<div class="card">
<div class="card-body">
<form action="<?php echo e(route('leads.update', Request::segment(3))); ?>" method="post" enctype="multipart/form-data">
<?php echo csrf_field(); ?>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="user_id">User <span class="text-danger">*</span></label>
<select <?php echo e((Auth::user()->hasRole('admin') || Auth::user()->can('assign-user')) ? "":"disabled"); ?> class="form-control select2 select2-hidden-accessible" multiple name="user_id[]" id="user_id">
<option disabled >Select User</option>
<?php if(!$users->isEmpty()): ?>
<?php
$leadusers = $lead->lead_user;
?>
<?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($user->id); ?>"
<?php if(!empty($leadusers)): ?>
<?php $__currentLoopData = $leadusers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $leaduse): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php echo e($user->id == $leaduse->user_id ? 'selected' : ''); ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
>
<?php echo e($user->name); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
</select>
<?php if($errors->has('user_id')): ?>
<div class="error">
<?php echo e($errors->first('user_id')); ?>
</div>
<?php endif; ?>
</div>
</div>
<div class="col-md-4">
<div class="form-group ">
<label> <?php echo e(__('message.name')); ?> <span class="text-danger">*</span></label>
<input type="text" class="form-control" name="name" id="name"
value="<?php echo e($lead->name); ?>">
<?php if($errors->has('name')): ?>
<div class="error">
<?php echo e($errors->first('name')); ?>
</div>
<?php endif; ?>
</div>
</div>
<div class="col-md-4">
<div class="form-group ">
<label><?php echo e(__('message.email')); ?> <span class="text-danger">*</span> </label>
<input type="email" class="form-control" name="email"
value="<?php echo e($lead->email); ?>">
<?php if($errors->has('email')): ?>
<div class="error">
<?php echo e($errors->first('email')); ?>
</div>
<?php endif; ?>
</div>
</div>
<div class="col-md-4">
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="phone">Country</label>
<select class="form-control" name="phonecode">
<?php if(!$country_codes->isEmpty()): ?>
<?php $__currentLoopData = $country_codes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $country_code): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($country_code->phonecode); ?>"
<?php echo e($country_code->phonecode == $lead->phonecode ? 'selected' : ''); ?>>
+<?php echo e($country_code->phonecode); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
</select>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<label><?php echo e(__('message.phone')); ?> <span class="text-danger">*</span>
</label>
<input type="number" class="form-control " name="mobile"
id="mobile" value="<?php echo e($lead->phone); ?>">
<?php if($errors->has('phone')): ?>
<div class="error">
<?php echo e($errors->first('phone')); ?>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Pipeline <span class="text-danger">*</span></label>
<select class="form-control " name="pipeline_id" id="pipeline_id">
<option>Select Pipeline</option>
<?php if(!$pipelines->isEmpty()): ?>
<?php $__currentLoopData = $pipelines; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pipeline): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($pipeline->id); ?>"
<?php echo e($pipeline->id == $lead->pipeline_id ? 'selected' : ''); ?>>
<?php echo e($pipeline->name); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
</select>
<?php if($errors->has('pipeline_id')): ?>
<div class="error">
<?php echo e($errors->first('pipeline_id')); ?>
</div>
<?php endif; ?>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Stage <span class="text-danger">*</span></label>
<select class="form-control " name="stage_id" id="stage_id">
<option>Select Stage</option>
<?php if(!$lead_stage->isEmpty()): ?>
<?php $__currentLoopData = $lead_stage; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $stage): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($stage->id); ?>"
<?php echo e($stage->id == $lead->stage_id ? 'selected' : ''); ?>>
<?php echo e($stage->name); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
</select>
<?php if($errors->has('stage_id')): ?>
<div class="error">
<?php echo e($errors->first('stage_id')); ?>
</div>
<?php endif; ?>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Source <span class="text-danger">*</span></label>
<select class="form-control " name="source_id" id="source_id">
<option value="">Select Source</option>
<?php if(!$sources->isEmpty()): ?>
<?php $__currentLoopData = $sources; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $source): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($source->id); ?>"
<?php echo e($source->id == $lead->sources ? 'selected' : ''); ?>>
<?php echo e($source->name); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
</select>
<?php if($errors->has('source_id')): ?>
<div class="error">
<?php echo e($errors->first('source_id')); ?>
</div>
<?php endif; ?>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Products <span class="text-danger">*</span></label>
<select class="form-control " name="product_id" id="product_id">
<option value="">Select Product</option>
<?php if(!$products->isEmpty()): ?>
<?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($product->id); ?>"
<?php echo e($product->id == $lead->products ? 'selected' : ''); ?>>
<?php echo e($product->name); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
</select>
<?php if($errors->has('product_id')): ?>
<div class="error">
<?php echo e($errors->first('product_id')); ?>
</div>
<?php endif; ?>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Branch</label>
<select class="form-control" id="branch_id" required
placeholder="Select Branch" name="branch_id">
<option>Select Branch</option>
<?php if(isset($branches)): ?>
<?php $__currentLoopData = $branches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $branch): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($branch->id); ?>" <?php echo e($branch->id == $lead->branch_id ? 'selected' : ''); ?>><?php echo e($branch->name); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
</select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Order </label>
<input type="number" class="form-control" name="order"
value="<?php echo e($lead->order); ?>">
<?php if($errors->has('order')): ?>
<div class="error">
<?php echo e($errors->first('order')); ?>
</div>
<?php endif; ?>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label htmlFor="subject" class="font-semibold">Profile Image</label>
<input name="profile_image" id="profile_image" type="file" class="form-control" />
<a href="<?php echo e(asset($lead->profile_image)); ?>" target="_blank"><img src="<?php echo e(asset($lead->profile_image)); ?>" style="width:100px;"></a>
</div>
<?php if($errors->has('profile_image')): ?>
<div class=" text-danger">
<?php echo e($errors->first('profile_image')); ?>
</div>
<?php endif; ?>
</div>
<div class="col-md-12">
<div class="form-group">
<label>Notes </label>
<textarea class="form-control" name="notes"><?php echo e($lead->notes); ?></textarea>
<?php if($errors->has('notes')): ?>
<div class="error">
<?php echo e($errors->first('notes')); ?>
</div>
<?php endif; ?>
</div>
<button type="submit" class="btn btn-success">Update</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</main>
<!-- end::main content -->
<?php $__env->stopSection(); ?>
<?php $__env->startPush('footer-script'); ?>
<!-- begin::select2 -->
<link rel="stylesheet" href="<?php echo e(asset('public/admin/vendors/select2/css/select2.min.css')); ?>" type="text/css">
<script src="<?php echo e(asset('public/admin/vendors/select2/js/select2.min.js')); ?>"></script>
<!-- end::select2 -->
<script>
$('select').select2({});
$(document).ready(function() {
$('#js-example-basic-roles').select2({});
});
$("#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 stateFetch(company_id, appendState) {
$.ajax({
type: "post",
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
data: {
"id": company_id
},
url: "<?php echo e(asset('fetch-state')); ?>",
dataType: "html",
success: function(result) {
$("#" + appendState).html("");
var allData = JSON.parse(result);
if (allData.message == "success") {
var data = allData.data;
var i;
var dOption = "<option selected disabled>--Select--</option>";
$("#" + appendState).append(dOption);
for (i = 0; i < data.length; i++) {
var option = `<option value="${data[i].id}">
${data[i].state_name}
</option>
`;
$("#" + appendState).append(option);
}
} else {
console.log("failed");
}
},
error: function(xhr, error, status) {
console.log(JSON.parse(xhr.responseText));
}
});
}
//location city code
$("#location_city").on("click", function() {
//var search = $(this).val();
$(".location_city_search_box").html("");
if ($(".main-add-city-box").hasClass("d-none")) {
$(".main-add-city-box").removeClass("d-none");
$(".add-search-city-box").removeClass("d-none");
var typed_city = `
<input type="search" class='form-control border px-2 search-city-val'
style='list-style:none;cursor:pointer;'>`;
$(".add-search-city-box").html(typed_city);
$(".search-city-val").focus();
$(".search-city-val").on('input', function() {
$(".location_city_search_box").removeClass("d-none");
var search = $(this).val();
$.ajax({
type: "post",
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
data: {
"search": search
},
url: "<?php echo e(asset('search-city')); ?>",
dataType: "html",
success: function(result) {
$(".location_city_search_box").html("");
var allData = JSON.parse(result);
if (allData.message == "success") {
//$(".location_city_search_box").removeClass('d-none');
var data = allData.data;
console.log(data);
var i;
var new_li = `<li class='text-capitalize rounded new_city_add_btn text-white p-2 mb-2' addcity="${search}" style='list-style:none;cursor:pointer;background:grey'>
Add  "${search}"...</li>`;
$(".location_city_search_box").append(new_li);
for (i = 0; i < data.length; i++) {
var li = `<li class='text-capitalize rounded city_name_li bg-dark text-white p-2 mb-2' city='${data[i].city_name}' style='list-style:none;cursor:pointer;background:grey'>
${data[i].city_name}</li>`;
$(".location_city_search_box").append(li);
}
$(".city_name_li").click(function() {
var city = $(this).attr('city');
console.log(city);
$("#location_city").val(city);
$(".location_city_search_box").addClass('d-none');
$(".main-add-city-box").addClass("d-none");
$(".add-search-city-box").addClass("d-none");
});
} else {
console.log("failed");
var new_li = `<li class='text-capitalize rounded new_city_add_btn bg-dark text-white p-2 mb-2' addcity="${search}" style='list-style:none;cursor:pointer'>
Add  "${search}"...</li>`;
$(".location_city_search_box").append(new_li);
}
$(".new_city_add_btn").click(function() {
var city = $(this).attr('addcity');
var loc_city = $("#location_city").val(city);
// alert(loc_city);
//var city_name = $("#b_city_name").val();
addCity(city, "main-add-city-box", "location_city");
});
},
error: function(xhr, error, status) {
console.log(JSON.parse(xhr.responseText));
var new_li = `<li class='text-capitalize rounded new_city_add_btn bg-dark text-white p-2 mb-2' addcity="${search}" style='list-style:none;cursor:pointer'>
Add  "${search}"...</li>`;
$(".location_city_search_box").append(new_li);
}
});
});
} else {
$(".main-add-city-box").addClass("d-none");
}
});
//city code
$("#billing_city").on("click", function() {
//var search = $(this).val();
$(".billing_city_search_box").html("");
$(".billing-main-add-city-box").removeClass("d-none");
$(".billing-add-search-city-box").removeClass("d-none");
var typed_city = `
<input type="search" class='form-control innder-border border search-city-val'
style='list-style:none;cursor:pointer'>`;
$(".billing-add-search-city-box").html(typed_city);
$(".search-city-val").focus();
$(".search-city-val").on('input', function() {
$(".billing_city_search_box").removeClass("d-none");
var search = $(this).val();
$.ajax({
type: "post",
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
data: {
"search": search
},
url: "<?php echo e(asset('search-city')); ?>",
dataType: "html",
success: function(result) {
$(".billing_city_search_box").html("");
var allData = JSON.parse(result);
if (allData.message == "success") {
//$(".location_city_search_box").removeClass('d-none');
var data = allData.data;
console.log(data);
var i;
var new_li = `<li class='text-capitalize rounded new_city_add_btn p-2 mb-2' addcity="${search}" style='list-style:none;cursor:pointer;background:#ddd'>
Add  "${search}"...</li>`;
$(".billing_city_search_box").append(new_li);
for (i = 0; i < data.length; i++) {
var li = `<li class='text-capitalize rounded city_name_li p-2 mb-2' city='${data[i].city_name}' style='list-style:none;cursor:pointer;'>
${data[i].city_name}</li>`;
$(".billing_city_search_box").append(li);
}
$(".city_name_li").on('mouseover', function() {
$(this).css({
'background': '#ddd',
'color': 'white'
});
});
$(".city_name_li").on('mouseleave', function() {
// Reset background and text color when mouse leaves
$(this).css({
'background': '',
'color': ''
});
});
$(".city_name_li").click(function() {
var city = $(this).attr('city');
console.log(city);
$("#billing_city").val(city);
$(".billing_city_search_box").addClass('d-none');
$(".billing-main-add-city-box").addClass("d-none");
$(".billing-add-search-city-box").addClass("d-none");
});
} else {
console.log("failed");
var new_li = `<li class='text-capitalize rounded new_city_add_btn bg-dark text-white p-2 mb-2' addcity="${search}" style='list-style:none;cursor:pointer'>
Add  "${search}"...</li>`;
$(".billing_city_search_box").append(new_li);
}
$(".new_city_add_btn").click(function() {
var city = $(this).attr('addcity');
var loc_city = $("#billing_city").val(city);
// alert(loc_city);
//var city_name = $("#b_city_name").val();
addCity(city, "billing-main-add-city-box", "billing_city");
});
},
error: function(xhr, error, status) {
console.log(JSON.parse(xhr.responseText));
var new_li = `<li class='text-capitalize rounded new_city_add_btn bg-dark text-white p-2 mb-2' addcity="${search}" style='list-style:none;cursor:pointer'>
Add  "${search}"...</li>`;
$(".location_city_search_box").append(new_li);
}
});
});
});
$(".location-add-city-btn").click(function() {
if ($(".location-add-city-box").hasClass("d-none")) {
$(".location-add-city-box").removeClass("d-none");
$(".location-add-city-box").removeClass("animate__animated animate__fadeOut");
$(".location-add-city-box").addClass("animate__animated animate__bounceInRight");
$(".location-add-city-box i").removeClass("fa-plus");
$(".location-add-city-box i").addClass("fa-minus");
} else {
$(".location-add-city-box").removeClass("animate__animated animate__bounceInRight")
$(".location-add-city-box").addClass("animate__animated animate__fadeOut");
$(".location-add-city-box").addClass("d-none");
$(".location-add-city-box i").removeClass("fa-minus");
$(".location-add-city-box i").addClass("fa-plus");
}
});
$(".l-city-form-btn").click(function() {
var city_name = $("#l_city_name").val();
addCity(city_name, "location-add-city-box", "location_city");
});
function addCity(city_name, cityformBox, city_input) {
$.ajax({
type: "post",
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
data: {
"city_name": city_name
},
url: "<?php echo e(asset('add-city')); ?>",
dataType: "html",
success: function(result) {
console.log(result);
var allData = JSON.parse(result);
if (allData.message == "success") {
$("." + cityformBox).addClass("d-none");
$("." + city_input).val(allData.data);
} else {
//console.log("failed");
}
},
error: function(xhr, error, status) {
console.log(JSON.parse(xhr.responseText));
}
});
}
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');
}
$(".billing-btn-toggle").click(function() {
if ($(".billing-address-main").hasClass('d-none')) {
$(".billing-address-main").removeClass("d-none");
} else {
$(".billing-address-main").addClass("d-none");
}
});
</script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/leadai/leadai.co.in/resources/views/leads/edit.blade.php ENDPATH**/ ?>