HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-26-0-120 6.17.0-1009-aws #9~24.04.2-Ubuntu SMP Fri Mar 6 23:50:29 UTC 2026 x86_64
User: ubuntu (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: //var/www/html/owlcrm/storage/framework/views/db3ff9dfa619aae27512abf6066c3ba7.php
<?php $__env->startSection('title', 'Dashboard'); ?>

<?php $__env->startSection('content_header'); ?>
    <h1>Reminder</h1>
    <small>Manage Reminder</small>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="card card-dark">
        <div class="card-header">
            <h3 class="card-title"> Add Reminder</h3>
        </div>
        <?php if(session('error')): ?>
            <h6 class="alert alert-danger">
                <?php echo e(session('error')); ?>

            </h6>
        <?php endif; ?>
        <?php if($errors->any()): ?>
            <div class="alert alert-danger">
                <ul>
                    <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <li><?php echo e($error); ?></li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </ul>
            </div>
        <?php endif; ?>
        <form method="POST" id="add_reminder" role="form" action="<?php echo e(route('reminder.store')); ?>" class="jqueryValidation">
            <?php echo csrf_field(); ?>
            <div class="card-body">

                <div class=" form-group">
                    <label for="reminder_to">Reminder To</label>
                    <select class="form-control" name="reminder_to" id="">
                        <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($user->first_name . $user->last_name); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>

                

                <div class="form-group">
                    <label for="entity_type"> Entity Type </label>
                    <select name="entity_type" id="entity_type" class="form-control">
                        <option value="">--Select--</option>
                        <?php $__currentLoopData = App\Models\Reminder::Entity; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $entity): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($key); ?>"><?php echo e($entity); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>
                
                    
                    <input type="hidden" name="entity_id" id="entity_id" value="<?php echo e(auth()->user()->id); ?>">
                    
                

                
                <div class="form-group">
                    <label for="reminder_date">Reminder Date</label>
                    <?php if (isset($component)) { $__componentOriginale5d826ae10df3aa87f8449f474c11664 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginale5d826ae10df3aa87f8449f474c11664 = $attributes; } ?>
<?php $component = JeroenNoten\LaravelAdminLte\View\Components\Form\Input::resolve(['id' => 'reminder_date','name' => 'reminder_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' => 'datetime-local','class' => 'form-control','placeholder' => 'Enter Reminder Date and Time','required' => true,'min' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(now()->format('Y-m-d\TH:i'))]); ?>
<?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 id="reminder_date_error" class="text-danger" style="display: none;"></div> <!-- Error message -->
                </div>
                


                
                <div class="form-group">

                    <input type="checkbox" id="email_notification" name="email_notification" value="1" checked
                        <?php echo e(old('email_notification') == 'on' ? 'checked' : ''); ?>>
                    <label for="email_notification">Email Notification</label>
                </div>


                <div class="form-group">

                    <input type="checkbox" id="is_active" name="is_active" value="1" checked
                        <?php echo e(old('is_active') == 'on' ? 'checked' : ''); ?>>
                    <label for="is_active">Is Active</label>
                </div>

                <div class="form-group">
                    <label for="description">Description</label>
                    <textarea class="form-control" id="description" name="description" rows="4" placeholder="Enter Description"
                        required></textarea>
                </div>


                <div class="card-footer d-flex justify-content-end">
                    <a href="<?php echo e(route('reminder.index')); ?>" class="btn btn-danger mx-1">Cancel</a>
                    <button type="submit"  class="btn btn-dark mx-1">Submit</button>
                </div>
        </form>
    </div>

    <?php $__env->startPush('js'); ?>
        <script>
            $(document).ready(function() {
                var $submitBtn = $('#submitBtn');
                var $reminderDate = $('#reminder_date');
                var $errorMsg = $('#reminder_date_error');
                $submitBtn.prop('disabled', true);
                function validateDate() {
                    var reminderDate = new Date($reminderDate.val());
                    var currentDate = new Date();
                    if (!reminderDate || isNaN(reminderDate.getTime()) || reminderDate < currentDate) {
                        $errorMsg.text(reminderDate ? 'Please select a future date.' : 'Reminder date is required.').show();
                        $submitBtn.prop('disabled', true);
                    } else {
                        $errorMsg.hide();
                        $submitBtn.prop('disabled', false);
                    }
                }
                // Validate on input change and form submit
                $reminderDate.on('input', validateDate);
                $('#reminderForm').on('submit', function(event) {
                    if ($submitBtn.prop('disabled')) {
                        event.preventDefault();
                    }
                });
                // for Entity_type and entity_id
                $('#entity_type').on('change', function() {
                    let entityType = $(this).val();
                    console.log('Selected entity type:', entityType);
                    if (entityType) {
                        $.ajax({
                            url: '/reminder/create',
                            type: 'GET',
                            data: {
                                entity_type: entityType
                            },
                            dataType: 'json',
                            success: function(response) {
                                console.log('Response:', response);
                                let entityIdSelect = $('#entity_id');
                                entityIdSelect.empty();
                                entityIdSelect.append('<option value="">Select</option>');
                                if (response.success) {
                                    $.each(response.entities, function(index, entity) {
                                        entityIdSelect.append('<option value="' + entity
                                            .id + '">' + entity.first_name + entity
                                            .last_name + '</option>');
                                    });


                                } else {
                                    alert(response.message);
                                }
                            },
                            error: function(xhr, status, error) {
                                console.error('Error fetching entity IDs:', error);
                            }
                        });
                    } else {
                        $('#entity_id').empty().append('<option value="">Select Entity Id</option>');
                    }
                });
            });

            //    End Entity_type and entity_id
        </script>
    <?php $__env->stopPush(); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('adminlte::page', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/owlcrm/resources/views/users/reminder/create.blade.php ENDPATH**/ ?>