



<?php $__env->startSection('content'); ?>
  <!--<script src="https://cdn.tiny.cloud/1/r3qqyu0qnlntsbjedd3ylvp8iqhqdsmt7iq9uq7h2vgf0e8f/tinymce/6/tinymce.min.js" referrerpolicy="origin"></script>-->
  <script src="https://cdn.tiny.cloud/1/r3qqyu0qnlntsbjedd3ylvp8iqhqdsmt7iq9uq7h2vgf0e8f/tinymce/5/tinymce.min.js" referrerpolicy="origin"></script>
  <script>
        tinymce.init({
            selector: 'textarea',

            image_class_list: [
            {title: 'img-responsive', value: 'img-responsive'},
            ],
            height: 500,
            setup: function (editor) {
                editor.on('init change', function () {
                    editor.save();
                });
            },
            plugins: [
                "advlist autolink lists link image charmap print preview anchor",
                "searchreplace visualblocks code fullscreen",
                "insertdatetime media table contextmenu paste imagetools"
            ],
            toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image ",

            image_title: true,
            automatic_uploads: false,
            images_upload_url: "<?php echo e(url('mail-templpate/uploadImage')); ?>",
            file_picker_types: 'image',
            file_picker_callback: function(cb, value, meta) {
                var input = document.createElement('input');
                input.setAttribute('type', 'file');
                input.setAttribute('accept', 'image/*');
                input.onchange = function() {
                    var file = this.files[0];

                    var reader = new FileReader();
                    reader.readAsDataURL(file);
                    reader.onload = function () {
                        var id = 'blobid' + (new Date()).getTime();
                        var blobCache =  tinymce.activeEditor.editorUpload.blobCache;
                        var base64 = reader.result.split(',')[1];
                        var blobInfo = blobCache.create(id, file, base64);
                        blobCache.add(blobInfo);
                        cb(blobInfo.blobUri(), { title: file.name });
                    };
                };
                input.click();
            }
        });    </script>
    <?php echo $__env->make('components.notification', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

    <div class="row mt-4 align-items-center">
        <div class="col-md-12">
            <form method="post" id="formBlast" action="<?php echo e(url('mail-template/submit-blast')); ?>">
                <?php echo csrf_field(); ?>
                <label>Subject</label>
                <input type="text" class="form-control" name="blast_subject" value="<?php echo e($email->blast_subject); ?>">
                <br>
                <label>Body</label>
              <textarea name="blast_body" id="mytextarea"><?= $email->blast_body ?></textarea>
              <br>
              <label>Cabang</label>
                <select class="select2 form-control <?php $__errorArgs = ['id_branch'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="id_branch">
                    <option value=''>---Semua Cabang---</option>
                    <?php $__currentLoopData = $branch; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value='<?php echo e($item->cabang); ?>' <?php echo e(old('id_branch') == $item->id ? 'selected' : ''); ?>><?php echo e($item->cabang); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <br>
                <br>
              <label>Bulan</label>
                <select class="select2 form-control <?php $__errorArgs = ['id_month'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="id_month">
                    <option value=''>---Semua Bulan---</option>
                    <?php $__currentLoopData = $months; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $month): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value='<?php echo e($month); ?>' <?php echo e(old('tgl_lahir') == $item ? 'selected' : ''); ?>><?php echo e($month); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
        <br><br>
    <button type="submit" id="btnSubmitBlast" class="btn btn-primary mr-2"><i class="fa fa-save"></i> Simpan</button>

            </form>            
        </div>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('custom-script'); ?>
    <script>
        $("#formBlast").submit(function(){
            $("#btnSubmitBlast").prop('disabled','true')
        })
    </script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('layouts.template', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\Code\Kuliah\Magang\coffeetoffee\resources\views/email/blast.blade.php ENDPATH**/ ?>