File: /var/www/html/owlcrm/storage/framework/views/34d1a52427abe68cb9e058a47b7c9288.php
<!-- Button trigger modal -->
<div class="action_mark">
<button type="button" class="btn btn-dark btn-sm" data-toggle="modal" data-target="#view_task<?php echo e($row->id); ?>">
<i class="fa fa-eye"></i>
</button>
<div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
<input
type="checkbox"
class="custom-control-input toggle-status"
id="paymentSwitch<?php echo e($task->id); ?>"
onchange="updatePaymentStatus(<?php echo e($task->id); ?>, this)"
<?php echo e($task->payment_status ? 'checked disabled' : ''); ?>>
<label class="custom-control-label" for="paymentSwitch<?php echo e($task->id); ?>">
<?php echo e($task->payment_status ? 'Payment Done' : 'Mark as Done '); ?>
</label>
</div>
<!-- View Modal -->
<div class="modal fade viewTask_modal" id="view_task<?php echo e($row->id); ?>" tabindex="-1" role="dialog"
aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header viewTask_modalheader">
<h3 class="modal-title" id="exampleModalLabel">View Task</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body viewTask_modalBody">
<div class="row">
<div class="col-md-8">
<!-- Main Task Details -->
<div class="viewTask_col1">
<p><strong>Subject:</strong> <?php echo e($task->subject); ?></p>
<p><strong>Description:</strong> <?php echo e($task->description); ?></p>
<div class="modal-footer d-flex justify-content-center px-0">
<!-- Direct Comment Form -->
<form action="<?php echo e(route('comments.store', $task->id)); ?>" method="POST" data-task-id="<?php echo e($task->id); ?>" class="w-100" id="commentForm<?php echo e($task->id); ?>">
<?php echo csrf_field(); ?>
<div class="form-group">
<label for="comment">Add Comment</label>
<textarea name="comment" id="comment<?php echo e($task->id); ?>" class="form-control" rows="3" placeholder="Enter your comment here..." required></textarea>
</div>
<div class="text-right">
<button type="submit" class="btn btn-dark" id="submitButton">
<i class="fa fa-paper-plane"></i> Submit
</button>
</div>
</form>
</div>
<div class="user_name d-flex align-items-center mb-3">
<i class="fas fa-user"></i>
<p class="mb-0 ml-2">
<?php echo e($task->created_by_user->first_name ?? 'Unknown User'); ?>
<?php echo e($task->created_by_user->last_name ?? ''); ?>
</p>
</div>
<ul id="commentsList">
<?php $__currentLoopData = $task->comments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $comment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<li class="card card-dark">
<div>
<?php echo e($comment->comment); ?>
</div>
<small><?php echo e($comment->created_at->format('Y/m/d H:i:s')); ?></small>
</li>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</ul>
</div>
</div>
<div class="col-md-4">
<div class="viewTask_col2">
<table class="table">
<tr>
<th>Assigned To:</th>
<td><?php echo e($task->user->first_name ?? 'Not Assigned'); ?> <?php echo e($task->user->last_name ?? ''); ?></td>
</tr>
<tr>
<th>User:</th>
<td><?php echo e($task->created_by_user->first_name ?? 'Unknown User'); ?> <?php echo e($task->created_by_user->last_name ?? ''); ?></td>
</tr>
<tr>
<th>State:</th>
<td><?php echo e($task->state); ?></td>
</tr>
<tr>
<th>Status:</th>
<td><?php echo e($task->status == 0 ? 'in-active' : 'active'); ?></td>
</tr>
<tr>
<th>Start Date:</th>
<td><?php echo e(formatDate($task->reminder_date, 'Y/m/d H:i:s')); ?></td>
</tr>
<tr>
<th>Due Date:</th>
<td><?php echo e(formatDate($task->due_date, 'Y/m/d H:i:s')); ?></td>
</tr>
<tr>
<th>Priority:</th>
<td><?php echo e($task->priority); ?></td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Edit Modal -->
<div class="modal fade" id="edit_task<?php echo e($row->id); ?>" tabindex="-1" role="dialog"
aria-labelledby="editTaskModalLabel<?php echo e($row->id); ?>" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title" id="editTaskModalLabel<?php echo e($row->id); ?>">Edit Task</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<form method="POST" action="<?php echo e(route('updateleadTask', $row->id)); ?>" class="jqueryValidation">
<!-- CSRF Token -->
<?php echo csrf_field(); ?>
<div class="modal-body">
<div class="form-group">
<label for="user_id">Assign to</label>
<select class="form-control" name="user_id" required>
<option value="">--Select--</option>
<?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($user->id); ?>"
<?php echo e($task->assigned_to == $user->id ? 'selected' : ''); ?>>
<?php echo e($user->first_name . ' ' . $user->last_name); ?>
</option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="form-group">
<label for="subject">Subject</label>
<?php if (isset($component)) { $__componentOriginale5d826ae10df3aa87f8449f474c11664 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginale5d826ae10df3aa87f8449f474c11664 = $attributes; } ?>
<?php $component = JeroenNoten\LaravelAdminLte\View\Components\Form\Input::resolve(['id' => 'subject','name' => 'subject'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('adminlte-input'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(JeroenNoten\LaravelAdminLte\View\Components\Form\Input::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'form-control','placeholder' => 'Enter Subject','value' => ''.e(old('subject', $task->subject)).'','required' => true]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginale5d826ae10df3aa87f8449f474c11664)): ?>
<?php $attributes = $__attributesOriginale5d826ae10df3aa87f8449f474c11664; ?>
<?php unset($__attributesOriginale5d826ae10df3aa87f8449f474c11664); ?>
<?php endif; ?>
<?php if (isset($__componentOriginale5d826ae10df3aa87f8449f474c11664)): ?>
<?php $component = $__componentOriginale5d826ae10df3aa87f8449f474c11664; ?>
<?php unset($__componentOriginale5d826ae10df3aa87f8449f474c11664); ?>
<?php endif; ?>
</div>
<div class="form-group">
<label for="start_date">Start Date</label>
<?php if (isset($component)) { $__componentOriginale5d826ae10df3aa87f8449f474c11664 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginale5d826ae10df3aa87f8449f474c11664 = $attributes; } ?>
<?php $component = JeroenNoten\LaravelAdminLte\View\Components\Form\Input::resolve(['id' => 'start_date','name' => 'start_date'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('adminlte-input'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(JeroenNoten\LaravelAdminLte\View\Components\Form\Input::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['type' => 'date','class' => 'form-control','placeholder' => 'Enter Start Date','value' => ''.e(old('start_date', $task->start_date ? \Carbon\Carbon::parse($task->start_date)->format('Y-m-d') : '')).'','required' => true]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginale5d826ae10df3aa87f8449f474c11664)): ?>
<?php $attributes = $__attributesOriginale5d826ae10df3aa87f8449f474c11664; ?>
<?php unset($__attributesOriginale5d826ae10df3aa87f8449f474c11664); ?>
<?php endif; ?>
<?php if (isset($__componentOriginale5d826ae10df3aa87f8449f474c11664)): ?>
<?php $component = $__componentOriginale5d826ae10df3aa87f8449f474c11664; ?>
<?php unset($__componentOriginale5d826ae10df3aa87f8449f474c11664); ?>
<?php endif; ?>
</div>
<div class="form-group">
<label for="due_date">Due Date</label>
<?php if (isset($component)) { $__componentOriginale5d826ae10df3aa87f8449f474c11664 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginale5d826ae10df3aa87f8449f474c11664 = $attributes; } ?>
<?php $component = JeroenNoten\LaravelAdminLte\View\Components\Form\Input::resolve(['id' => 'due_date','name' => 'due_date'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('adminlte-input'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(JeroenNoten\LaravelAdminLte\View\Components\Form\Input::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['type' => 'date','class' => 'form-control','placeholder' => 'Enter Due Date','value' => ''.e(old('due_date', $task->due_date ? \Carbon\Carbon::parse($task->due_date)->format('Y-m-d') : '')).'','required' => true]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginale5d826ae10df3aa87f8449f474c11664)): ?>
<?php $attributes = $__attributesOriginale5d826ae10df3aa87f8449f474c11664; ?>
<?php unset($__attributesOriginale5d826ae10df3aa87f8449f474c11664); ?>
<?php endif; ?>
<?php if (isset($__componentOriginale5d826ae10df3aa87f8449f474c11664)): ?>
<?php $component = $__componentOriginale5d826ae10df3aa87f8449f474c11664; ?>
<?php unset($__componentOriginale5d826ae10df3aa87f8449f474c11664); ?>
<?php endif; ?>
</div>
<div class="form-group">
<label for="priority">Priority</label>
<select name="priority" id="priority" class="form-control" required>
<?php $__currentLoopData = App\Models\Task::PRIORITIES; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $priority): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($key); ?>"
<?php echo e(old('priority', $task->priority ?? '0') == $key ? 'selected' : ''); ?>>
<?php echo e($priority); ?>
</option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="form-group">
<label for="state">State</label>
<select name="state" id="state" class="form-control" required>
<?php $__currentLoopData = App\Models\Task::States; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $state): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($key); ?>"
<?php echo e(old('state', $task->state ?? 'pending') == $key ? 'selected' : ''); ?>>
<?php echo e($state); ?>
</option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="form-group">
<label for="description">Description</label>
<textarea class="form-control" id="description" name="description" rows="4" placeholder="Enter Description"
required><?php echo e(old('description', $task->description)); ?></textarea>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-danger">Update</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</form>
</div>
</div>
</div>
<!-- Delete Modal -->
<div class="modal fade" id="delete_task<?php echo e($row->id); ?>" tabindex="-1" role="dialog"
aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title" id="exampleModalLabel">Delete Task</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>This will delete this Lead task permanently</p>
<p>Are you sure?</p>
</div>
<div class="modal-footer">
<form method="POST" action="<?php echo e(route('leadTask.destroy', $row->id)); ?>">
<!-- CSRF Token -->
<?php echo csrf_field(); ?>
<!-- Hidden input to simulate DELETE method -->
<input type="hidden" name="_method" value="DELETE">
<button type="submit" class="btn btn-danger" id="delete_btn" data-id="' . $row->id . '">Yes,
Delete</button>
</form>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<?php $__env->startSection('js'); ?>
<script>
$(document).on('change', '.toggle-status', function() {
const $this = $(this); // Save reference to the toggle switch
const taskId = $this.data('id');
const isChecked = $this.is(':checked');
const statusLabel = $this.siblings('label');
if (!confirm(`Are you sure you want to ${isChecked ? 'mark as done' : 'mark as not done'}?`)) {
$this.prop('checked', !isChecked); // Revert the change
return;
}
$.ajax({
url: '/task/' + taskId + '/update-payment-status', // Update the route here
method: 'POST',
data: {
_token: '<?php echo e(csrf_token()); ?>',
payment_status: paymentStatus
},
success: function(response) {
console.log(response);
if (response.success) {
// Update the label based on the payment status
$(checkbox).next('label').text(paymentStatus ? 'Payment Done' : 'Mark as Done');
} else {
alert('Failed to update payment status. Please try again.');
}
},
error: function(xhr, status, error) {
console.log(xhr.responseText); // Log any errors from the server
alert('An error occurred. Please try again.');
}
});
});
</script>
<?php $__env->stopSection(); ?>
<?php /**PATH /var/www/html/owlcrm/resources/views/users/leads/partially/leadtask-delete.blade.php ENDPATH**/ ?>