Back | Home
الـ Path الحالي: /home/picotech/domains/instantly.picotech.app/public_html/vendor/iyzico/../nikic/../dflydev/../ramsey/../maennchen/../tijsverkoyen/.././psr/../phpoffice/./../dragonmantank/../phpoption/.././sebastian/../async-aws/../phpunit/../webklex/../graham-campbell/../../storage/framework/views
الملفات الموجودة في هذا الـ Path:
.
..
014f015afea1dc7500195991bcfa8f176dbc32db.php
07eb0c5e36532718bd7306274d6d2cc21e737005.php
0b030bb44c5cd8ec1e19d561b8cfaab02c6b4213.php
0d7a09694098e95a45d17833d64be8f35a9a7e8c.php
0e0dca7c1522ba5c4265e397d0a3a2a9c5162c29.php
0e8228543495dc28d3cb24d7b47cb42352664c8c.php
12ad57cec85e6dd979c5ba3c97795f3354e23276.php
1521c678ad9b704a30ed70fd5ef45ded086254e7.php
15447ff3a7745d78adf20e0f45c05eacacd38e0e.php
1f1469a6a281f6a32af41d5536e42e3b4e92bb50.php
202a79c48aa0ae4a38082bf11181f84f96131b03.php
2214a7ad55415a58ccad6d7c425c4c14a893bf44.php
2246a9f29a1cdff1867b72393e2c432ebca1a36b.php
26f8268e78ede6475048503298b6c08159f8ac4b.php
2a5c7b83a930fb83ca753398cc439062f321dbfc.php
3661ad2a393444ce6f3580918a6db33978515feb.php
373d8bf797c2cd18d6100056292e96bbe5ed2eaa.php
3acfed4a9f407b5dd866d424e805251d7e694903.php
46aa54d0a5c7e9f5bd842c1872d309cc9ccc26cd.php
4742cba3382c36778d6918b8b0601f5190c1413d.php
49223248cbe190d700f95dcd38f19a033a213ca0.php
5245a6b9b8a6ea2a0181cef4dc166a23417a3999.php
5439a676cbb69d4769cde6668ac8ca3e41e50d06.php
577d2cad63c5e58aabf5b5b5d99f14457ee44b2e.php
583a3a66e361fcfdaca6368aaa7d63a1ff646d6b.php
5a929092b55f5ad932088b544ca2422b62b9abce.php
5ac0ae29bfb853fbff045dcec8a903fd14c798d8.php
5e4304c3ba5503115870f62aeba948139f33a260.php
6a559dab939705f9cb4279fab6434670ca9d1c41.php
86165a8436d1d36681215f3417be02e88d59cb82.php
8a62182dd6ccc5e7079f027b6340be60972af6d7.php
8e1f10d1d057ed70111e6e5fc3b81a28ef8cf262.php
8fb1f4e22141387c73bd7c12b25de2e21f4c9c36.php
92947c71427af814ddd53947528e15eb499a5722.php
96d44ac88dd4c07e1acac9f2187eb2b2a14be126.php
98542d7308a69d5a6654e4600942a99642fd774a.php
9d2cfc31c19278b822b682dc946d01cdd82c79c4.php
9d664b6008e4754e9c63b10b7c50a1170cc872ad.php
a1d1d37df4b611fcd0790e32e0c56a10891abc39.php
a7be8f099345e3025dcd9c43dec01c27367abc70.php
a88ac301f77331bbc56726eddc15790472e8f1f7.php
ae2fa8599d13b20ecb917e722f51e1ef853d22ae.php
b1d5facf876faf4a87d29938f1a5b879d965e682.php
b45c42bb1c58ce71e25733d805738f7c837c4a4b.php
c38db14909a67e7a9cbef86b61c399f23ff061a6.php
c5ae2305f0e0f66f497c33aa0f0bdac8eeea989a.php
cb3172ea8b11e30d761eafcaaf5f600650077dc4.php
cb8913772ca980d39918642130252d05f4a07457.php
d235be06c2919413fb85620eb175dd42e45e8c3e.php
d2aca08ac439173bf419beacb73f1baa8bc25e36.php
d4e643a1268739ceb03175800a5959c5c43eb4e3.php
d9210607629855bbf8053938aede7803cfca0aad.php
d9ccc6df93afcd1534286cfbfbb90cef8ee091b0.php
d9e016b5d015a0f8580ffe73bd70f02ce05fd9cd.php
df2df3f1718fc518e471cc968ba4bea8ffdff680.php
f75e3a4d7af77f16ad2162632744d4f70f630fb6.php
fc9c3c1bddec0c3f12c59ea3a7974331a0afeb6d.php

مشاهدة ملف: 8fb1f4e22141387c73bd7c12b25de2e21f4c9c36.php

<?php $__env->startSection('title','Edit Campaign'); ?>

<?php $__env->startSection('extra-css'); ?>
    <link rel="stylesheet" href="<?php echo e(asset('plugins/select2/css/select2.min.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('plugins/ion-rangeslider/css/ion.rangeSlider.min.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('plugins/daterangepicker/daterangepicker.css')); ?>">

    <style>
        .template_modal {
            position: fixed;
        }

    </style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="campaign_edit_nav">
        <a href="" class="campaign_name_title" id="campaign_name_title"><?php echo e($campaign->title); ?> &nbsp; &nbsp;<i
                class="fas fa-pencil-alt ml-2"></i></a>
        <div class="float-right">
            <?php if($campaign->title && $campaign->from_email && $campaign->to_email && $campaign->start_date && $campaign->end_date && $campaign->start_time && $campaign->end_time && $campaign->template_id && $campaign->from_email_name && $campaign->subject_line && $campaign->status!='running'): ?>
                <button type="button" class="campaign_cancel_btn" id="template_preview_modal_btn">Preview & Test
                </button>
                <a href="<?php echo e(route('customer.campaign.template.send',['campaign_id'=>$campaign->id])); ?>"
                   class="campaign_create_btn">Schedule</a>
            <?php else: ?>
                <button type="button" class="campaign_cancel_btn btn_disable">Preview & Test</button>
                <button type="button" class="campaign_create_btn btn_disable">Schedule</button>
            <?php endif; ?>
        </div>
    </div>
    <div class="from_section_tabs">
        <div class="from_section" id="from_section_from">
            <div class="from_headingBlock">
                <div class="from_headingSvg <?php echo e(isset($campaign->from_email_name)?'edit_suc':''); ?>">
                    <svg viewBox="0 0 512 512">
                        <path
                            d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"></path>
                    </svg>
                    <h1 class="from_headingBlock_h1">From</h1>
                </div>
                <div id="from_content_btn_div">
                    <button type="button" class="campaign_cancel_btn" id="from_content_btn">
                        Add from
                    </button>
                </div>
                <div class="d-none" id="cencel_btn_from_div">
                    <button type="button" class="rounded-circle campaign_cancel_btn cancel_btn cancel_btn_from">
                        <i class="fa fa-times"></i>
                    </button>
                </div>
            </div>
            <div class="from_headingBlock_who">Who is sending this email campaign?</div>
            <div class="to_content d-none" id="from_content">
                <span class="contactList_heading"><b>Email Address</b> &nbsp; &nbsp;<i
                        class="fa fa-question-circle campaign_toltip" data-toggle="tooltip" data-placement="right"
                        title="Choose the email address that appears in the recipient's inbox when they receive your campaign."></i></span>
                <div class="contactList_dropdown">
                    <select class="form-control" id="campaign_sender">
                        <?php if($senders->isNotEmpty()): ?>
                            <?php $__currentLoopData = $senders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sender): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option data-from-email="<?php echo e($sender->from_mail.'@'.$sender->domain); ?>">
                                    <?php echo e($sender->from_mail.'@'.$sender->domain); ?>

                                </option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php endif; ?>
                    </select>
                    <div class="searchDropdown_header">

                        <div class="query_builder query_builder_from">
                            <a href="<?php echo e(route('customer.sender.create')); ?>"
                               class="clickable_button clickable_inline "
                               style="margin-left: 1rem; padding: 8px;">
                                <svg viewBox="0 0 14 14" height="16" width="16" class="icon_margin">
                                    <path
                                        d="M13 5.5H8.5V1a1 1 0 00-1-1h-1a1 1 0 00-1 1v4.5H1a1 1 0 00-1 1v1a1 1 0 001 1h4.5V13a1 1 0 001 1h1a1 1 0 001-1V8.5H13a1 1 0 001-1v-1a1 1 0 00-1-1z"
                                        fill-rule="evenodd"></path>
                                </svg>
                                Add a sender
                            </a>
                        </div>
                    </div>

                    
                </div>
                <form method="post" action="<?php echo e(route('customer.campaign.update',[$campaign])); ?>">
                    <?php echo csrf_field(); ?>
                    <?php echo method_field('put'); ?>
                    <input type="hidden" name="from_email"
                           value="<?php echo e(isset($campaign->from_email)?$campaign->from_email:''); ?>" id="from_email_input_val">
                    <input type="hidden" name="update_type" value="from">
                    <div class="form-group">
                        <label for="" class="campaign_name">Name &nbsp; &nbsp;<i class="fa fa-question-circle"
                                                                                 data-toggle="tooltip"
                                                                                 data-placement="right"
                                                                                 title="Enter a name (e.g. your company name) to help campaign recipients recognize you in their inbox."></i></label>
                        <input type="text" name="from_email_name" class="form-control" placeholder="Enter From Name"
                               value="<?php echo e(isset($campaign->from_email_name)?$campaign->from_email_name:''); ?>">
                    </div>

                    <a class="clickable_link" id="clickable_link_from">Advanced options
                        <svg viewBox="0 0 320 512">
                            <path
                                d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"></path>
                        </svg>
                    </a>
                    <div class="query_builder query_builder_from_sec" id="clickable_link_from_section">
                        <div class="form-group">
                            <label for="">Customize the Reply-To Email address</label>
                            <input type="email" name="reply_to_email" class="form-control"
                                   placeholder="Customize the Reply-To Email address" id="reply_to_email"
                                   value="<?php echo e(isset($campaign->reply_to_email)?$campaign->reply_to_email:''); ?>">
                        </div>
                        <div class="form-group">
                            <label for="">Customize the 'To' Field</label>
                            <input type="email" name="customize_to_email" class="form-control"
                                   placeholder="Customize the 'To' Field" id="customize_to_email"
                                   value="<?php echo e(isset($campaign->customize_to_email)?$campaign->customize_to_email:''); ?>">
                        </div>
                    </div>
                    <hr class="divider">
                    <div class="mt-4">
                        <button type="submit" class="campaign_create_btn">Save</button>
                        <button type="button" class="campaign_cancel_btn cancel_btn_from">Cancel</button>
                    </div>
                </form>
            </div>
        </div>
        <div class="from_section" id="from_section_to">
            <div class="from_headingBlock">
                <div class="from_headingSvg <?php echo e(isset($campaign->to_email) && $campaign->to_email!=""?'edit_suc':''); ?>">
                    <svg viewBox="0 0 512 512">
                        <path
                            d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"></path>
                    </svg>
                    <h1 class="from_headingBlock_h1">To</h1>
                </div>
                <div id="to_content_btn_div">
                    <button type="button" class="campaign_cancel_btn" id="to_content_btn">
                        Add recipients
                    </button>
                </div>
                <div class="d-none" id="cencel_btn_to_div">
                    <button type="button" class="rounded-circle campaign_cancel_btn cancel_btn cancel_btn_to">
                        <i class="fa fa-times"></i>
                    </button>
                </div>
            </div>
            <div class="from_headingBlock_who" id="who_text_to">Choose your group list(s)</div>
            <div class="to_content d-none" id="to_content">
                <nav class="tabs_container">
                    <a class="navigation_link">Groups </a>
                </nav>
                <span class="contactList_heading"><b>Send to</b></span>
                <div class="contactList_dropdown">
                    <div class="toSearch_block">
                        <div>
                            <div class="entry_field" id="select_a_list">
                                <p class="search_text">Select a group</p>
                                <span class="arrow_svg">
                                    <svg viewBox="0 0 320 512"><path
                                            d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"></path></svg>
                                </span>
                            </div>
                            <div class="searchListing_dropdown" id="select_a_list_section">
                                <div class="row ml-4">
                                    <?php if($groups->isNotEmpty()): ?>
                                        <?php $__currentLoopData = $groups; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $group): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php
                                                $groupId = json_decode($campaign->group_id);
                                            ?>
                                            <div class="col-lg-4">
                                                <div class="form-check">
                                                    <input id="group-list-<?php echo e($group->id); ?>"
                                                           class="form-check-input groupCheckChecked" type="checkbox"
                                                           value=""
                                                           data-group-id="<?php echo e($group->id); ?>" <?php echo e(isset($groupId) && in_array($group->id, $groupId)?'checked':''); ?> >
                                                    <label class="form-check-label" for="group-list-<?php echo e($group->id); ?>">
                                                        <?php echo e($group->name); ?>

                                                    </label>
                                                </div>
                                            </div>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php endif; ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <hr class="divider">
                <div class="toGauge">
                    <div>
                        <?php
                            $to = json_decode($campaign->to_email);
                            if ($to){
                             $to_emails = count($to);
                            }else{
                                $to_emails = 0;
                            }
                        ?>
                        <div class="gaugeHeading"><b class="gauge_value"><span id="group_contact_count"
                                                                               data-group-contact-count="<?php echo e($currentPlan->email_limit - $useEmail); ?>"><?php echo e($to_emails); ?></span>
                                recipients</b>
                            <span><span data-remaining="<?php echo e($currentPlan->email_limit - $useEmail); ?>"
                                        id="remainingEmail"><?php echo e($currentPlan->email_limit - $useEmail); ?></span> remaining emails</span>
                        </div>
                        <div class="gauge_track">
                            <div class="gauge_thumb" id="gauge_thumb" style="width: <?php echo e($to_emails); ?>%;"></div>
                        </div>
                        <p class="toGauge_info">Send to as many recipients as you wish, within your plan limits. </p>
                    </div>
                </div>
                <form method="post" action="<?php echo e(route('customer.campaign.update',[$campaign])); ?>">
                    <?php echo csrf_field(); ?>
                    <?php echo method_field('put'); ?>
                    <input type="hidden" name="update_type" value="to">
                    <div id="to_email"></div>
                    <div class="mt-4">
                        <button type="submit" class="campaign_create_btn" id="to_email_button">Save</button>
                        <button type="button" class="campaign_cancel_btn cancel_btn_to">Cancel</button>
                    </div>
                </form>
            </div>
        </div>
        <div class="from_section" id="from_section_subject">
            <div class="from_headingBlock">
                <div class="from_headingSvg <?php echo e(isset($campaign->subject_line)?'edit_suc':''); ?>">
                    <svg viewBox="0 0 512 512">
                        <path
                            d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"></path>
                    </svg>
                    <h1 class="from_headingBlock_h1">Subject</h1>
                </div>
                <div id="subject_content_div">
                    <button type="button" class="campaign_cancel_btn" id="subject_content_btn">
                        Add Subject
                    </button>
                </div>
                <div class="d-none" id="cencel_btn_subject_div">
                    <button type="button" class="rounded-circle campaign_cancel_btn cancel_btn cancel_btn_subject">
                        <i class="fa fa-times"></i>
                    </button>
                </div>
            </div>
            <div class="from_headingBlock_who">Add a subject line for this campaign.</div>
            <form method="post" action="<?php echo e(route('customer.campaign.update',[$campaign])); ?>">
                <?php echo csrf_field(); ?>
                <?php echo method_field('put'); ?>
                <input type="hidden" name="update_type" value="subject">
                <div class="to_content d-none" id="subject_content">
                    <div class="form-group">
                        <label class="campaign_name ml-2" for="">Subject line &nbsp; &nbsp;<i
                                class="fa fa-question-circle campaign_toltip" data-toggle="tooltip"
                                data-placement="right"
                                title="Write a subject line that clearly describes your email content. It will be visible in your recipient's inbox and is the first content they will see. For example: 'Private sale: 25% off our new collection"></i></label>
                        <div class="input-group ml-2">
                            <input class="form-control border-end-0 border" type="text" name="subject_line"
                                   value="<?php echo e(isset($campaign->subject_line)?$campaign->subject_line:''); ?>">
                            <span class="input-group-append">
                             <button class="btn btn-outline-secondary bg-white border ms-n3" type="button">
                                  <i class="fa fa-user"></i>
                             </button>
                        </span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="campaign_name ml-2" for="">Preview text &nbsp; &nbsp;<i
                                class="fa fa-question-circle campaign_toltip" data-toggle="tooltip"
                                data-placement="right"
                                title="Write a short text (about 35 characters) that gives an overview of the content of your email. This will significantly increase your opening rate. This feature is supported by most email clients, like Gmail and Yahoo. The text will be displayed in your recipient's inbox, just below the subject."></i></label>
                        <div class="input-group ml-2">
                            <input class="form-control border-end-0 border" type="text" name="preview_text"
                                   value="<?php echo e(isset($campaign->preview_text)?$campaign->preview_text:''); ?>">
                            <span class="input-group-append">
                         <button class="btn btn-outline-secondary bg-white border ms-n3" type="button">
                              <i class="fa fa-user"></i>
                         </button>
                    </span>
                        </div>
                    </div>

                    <hr class="divider">
                    <div class="mt-4 ml-2">
                        <button type="submit" class="campaign_create_btn">Save</button>
                        <button type="button" class="campaign_cancel_btn cancel_btn_subject">Cancel</button>
                    </div>
                </div>
            </form>

        </div>
        <div class="from_section" id="from_section_date_time">
            <div class="from_headingBlock">
                <div
                    class="from_headingSvg <?php echo e(isset($campaign->start_time) && $campaign->start_time!=""?'edit_suc':''); ?>">
                    <svg viewBox="0 0 512 512">
                        <path
                            d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"></path>
                    </svg>
                    <h1 class="from_headingBlock_h1">Date & Tme</h1>
                </div>
                <div id="date_time_content_div">
                    <button type="button" class="campaign_cancel_btn" id="date_time_content_btn">
                        Add Date & Time
                    </button>
                </div>
                <div class="d-none" id="cencel_btn_date_time_div">
                    <button type="button" class="rounded-circle campaign_cancel_btn cancel_btn cancel_btn_date_time">
                        <i class="fa fa-times"></i>
                    </button>
                </div>
            </div>
            <div class="from_headingBlock_who">Add date & time for this campaign.</div>

            <div class="to_content d-none" id="date_time_content">
                <form method="post" action="<?php echo e(route('customer.campaign.update',[$campaign])); ?>">
                    <?php echo csrf_field(); ?>
                    <?php echo method_field('put'); ?>
                    <input type="hidden" name="update_type" value="date_time">
                    <div class="row">
                        <div class="col-lg-6">
                            <div class="form-group">
                                <label for="date">Starting Date</label>
                                <input type="date" class="form-control"
                                       value="<?php echo e(isset($campaign->start_date)?$campaign->start_date->format('Y-m-d'):''); ?>"
                                       name="starting_date">
                            </div>
                        </div>
                        <div class="col-lg-6">
                            <div class="form-group">
                                <label for="date">Ending Date</label>
                                <input type="date" class="form-control"
                                       value="<?php echo e(isset($campaign->end_date)?$campaign->end_date->format('Y-m-d'):''); ?>"
                                       name="ending_date">
                            </div>
                        </div>
                        <div class="col-lg-6">
                            <div class="form-group">
                                <label for="time">Starting Time</label>
                                <input type="time" class="form-control"
                                       value="<?php echo e(isset($campaign->start_time)?$campaign->start_time:''); ?>"
                                       name="starting_time">
                            </div>
                        </div>
                        <div class="col-lg-6">
                            <div class="form-group">
                                <label for="time">Ending Time</label>
                                <input type="time" class="form-control"
                                       value="<?php echo e(isset($campaign->end_time)?$campaign->end_time:''); ?>" name="ending_time">
                            </div>
                        </div>
                    </div>
                    <hr class="divider">
                    <div class="mt-4 ml-2">
                        <button type="submit" class="campaign_create_btn">Save</button>
                        <button type="button" class="campaign_cancel_btn cancel_btn_date_time">Cancel</button>
                    </div>
                </form>
            </div>

        </div>
        <div class="last_from_section" id="from_section_design">
            <div class="from_headingBlock">
                <div class="from_headingSvg <?php echo e(isset($campaign->template_id)?'edit_suc':''); ?>">
                    <svg viewBox="0 0 512 512">
                        <path
                            d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"></path>
                    </svg>
                    <h1 class="from_headingBlock_h1">Design</h1>
                </div>
                <div id="design_content_div">
                    <button type="button" class="campaign_cancel_btn" id="design_content_btn">
                        Design email
                    </button>
                </div>
                <div class="d-none" id="cencel_btn_design_div">
                    <button type="button" class="rounded-circle campaign_cancel_btn cancel_btn cancel_btn_design">
                        <i class="fa fa-times"></i>
                    </button>
                </div>
            </div>
            <?php
                $campaignName = auth('customer')->user()->campaign_template()->where('id',$campaign->template_id)->first();
            ?>
            <?php if(isset($campaignName->template)): ?>
                <div class="row">
                    <?php if($campaignName->template == 'one'): ?>
                        <div class="col-lg-4 m-auto">
                            <div class="form-group">
                                <div class="tempate_img">
                                    <img src="<?php echo e(asset('images/template.png')); ?>" alt="">
                                </div>
                                <div class="frame_hover_img">
                                    <div class="btn_position">
                                        <div class="btn_primary">
                                            <a href="<?php echo e(route('customer.campaign.template.show',['template'=>'one','campaign_id'=>$campaign->id])); ?>"
                                               class="campaign_create_btn">Edit template</a>
                                        </div>
                                        <div class="btn_preview">
                                            <button type="button" class="campaign_cancel_btn clickable_pre"
                                                    data-img="template1.png">
                                                <svg viewBox="0 0 512 512">
                                                    <path fill="currentColor"
                                                          d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"></path>
                                                </svg>
                                                Preview
                                            </button>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                    <?php elseif($campaignName->template == 'two'): ?>
                        <div class="col-lg-4 m-auto">
                            <div class="form-group">
                                <div class="tempate_img">
                                    <img src="<?php echo e(asset('images/template1.png')); ?>" alt="">
                                </div>
                                <div class="frame_hover_img">
                                    <div class="btn_position">
                                        <div class="btn_primary">
                                            <a href="<?php echo e(route('customer.campaign.template.show',['template'=>'two','campaign_id'=>$campaign->id])); ?>"
                                               class="campaign_create_btn">Edit template</a>
                                        </div>
                                        <div class="btn_preview">
                                            <button type="button" class="campaign_cancel_btn clickable_pre"
                                                    data-img="template1.png">
                                                <svg viewBox="0 0 512 512">
                                                    <path fill="currentColor"
                                                          d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"></path>
                                                </svg>
                                                Preview
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php elseif($campaignName->template == 'three'): ?>
                        <div class="col-lg-4 m-auto">
                            <div class="form-group">
                                <div class="tempate_img">
                                    <img src="<?php echo e(asset('images/template2.jpeg')); ?>" alt="">
                                </div>

                                <div class="frame_hover_img">
                                    <div class="btn_position">
                                        <div class="btn_primary">
                                            <a href="<?php echo e(route('customer.campaign.template.show',['template'=>'three','campaign_id'=>$campaign->id])); ?>"
                                               class="campaign_create_btn">Edit template</a>
                                        </div>
                                        <div class="btn_preview">
                                            <button type="button" class="campaign_cancel_btn clickable_pre"
                                                    data-img="template2.jpeg">
                                                <svg viewBox="0 0 512 512">
                                                    <path fill="currentColor"
                                                          d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"></path>
                                                </svg>
                                                Preview
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php elseif($campaignName->template == 'four'): ?>
                        <div class="col-lg-4 m-auto">
                            <div class="form-group">
                                <div class="tempate_img">
                                    <img src="<?php echo e(asset('images/template3.png')); ?>" alt="">
                                </div>
                                <div class="frame_hover_img">
                                    <div class="btn_position">
                                        <div class="btn_primary">
                                            <a href="<?php echo e(route('customer.campaign.template.show',['template'=>'four','campaign_id'=>$campaign->id])); ?>"
                                               class="campaign_create_btn">Edit template</a>
                                        </div>
                                        <div class="btn_preview">
                                            <button type="button" class="campaign_cancel_btn clickable_pre"
                                                    data-img="template3.png">
                                                <svg viewBox="0 0 512 512">
                                                    <path fill="currentColor"
                                                          d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"></path>
                                                </svg>
                                                Preview
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php elseif($campaignName->template == 'five'): ?>
                        <div class="col-lg-4 m-auto">
                            <div class="form-group">
                                <div class="tempate_img">
                                    <img src="<?php echo e(asset('images/template4.png')); ?>" alt="">
                                </div>
                                <div class="frame_hover_img">
                                    <div class="btn_position">
                                        <div class="btn_primary">
                                            <a href="<?php echo e(route('customer.campaign.template.show',['template'=>'five','campaign_id'=>$campaign->id])); ?>"
                                               class="campaign_create_btn">Edit template</a>
                                        </div>
                                        <div class="btn_preview">
                                            <button type="button" class="campaign_cancel_btn clickable_pre"
                                                    data-img="template4.png">
                                                <svg viewBox="0 0 512 512">
                                                    <path fill="currentColor"
                                                          d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"></path>
                                                </svg>
                                                Preview
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php elseif($campaignName->template == 'six'): ?>
                        <div class="col-lg-4 m-auto">
                            <div class="form-group">
                                <div class="tempate_img">
                                    <img src="<?php echo e(asset('images/template5.png')); ?>" alt="">
                                </div>
                                <div class="frame_hover_img">
                                    <div class="btn_position">
                                        <div class="btn_primary">
                                            <a href="<?php echo e(route('customer.campaign.template.show',['template'=>'six','campaign_id'=>$campaign->id])); ?>"
                                               class="campaign_create_btn">Edit template</a>
                                        </div>
                                        <div class="btn_preview">
                                            <button type="button" class="campaign_cancel_btn clickable_pre"
                                                    data-img="template5.png">
                                                <svg viewBox="0 0 512 512">
                                                    <path fill="currentColor"
                                                          d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"></path>
                                                </svg>
                                                Preview
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php endif; ?>
                </div>
            <?php else: ?>
                <div class="from_headingBlock_who">Create your email content.</div>
            <?php endif; ?>

            <div class="to_content d-none" id="design_content">
                <div class="container">
                    <div class="row">
                        <div class="col-lg-4">
                            <div class="form-group">
                                <div class="tempate_img">
                                    <img src="<?php echo e(asset('images/template.png')); ?>" alt="">
                                </div>
                                <div class="frame_hover_img">
                                    <div class="btn_position">
                                        <div class="btn_primary">
                                            <a href="<?php echo e(route('customer.campaign.template.show',['template'=>'one','campaign_id'=>$campaign->id])); ?>"
                                               class="campaign_create_btn">Use template</a>
                                        </div>
                                        <div class="btn_preview">
                                            <button type="button" class="campaign_cancel_btn clickable_pre"
                                                    data-img="template1.png">
                                                <svg viewBox="0 0 512 512">
                                                    <path fill="currentColor"
                                                          d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"></path>
                                                </svg>
                                                Preview
                                            </button>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                        <div class="col-lg-4">
                            <div class="form-group">
                                <div class="tempate_img">
                                    <img src="<?php echo e(asset('images/template1.png')); ?>" alt="">
                                </div>
                                <div class="frame_hover_img">
                                    <div class="btn_position">
                                        <div class="btn_primary">
                                            <a href="<?php echo e(route('customer.campaign.template.show',['template'=>'two','campaign_id'=>$campaign->id])); ?>"
                                               class="campaign_create_btn">Use template</a>
                                        </div>
                                        <div class="btn_preview">
                                            <button type="button" class="campaign_cancel_btn clickable_pre"
                                                    data-img="template1.png">
                                                <svg viewBox="0 0 512 512">
                                                    <path fill="currentColor"
                                                          d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"></path>
                                                </svg>
                                                Preview
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-4">
                            <div class="form-group">
                                <div class="tempate_img">
                                    <img src="<?php echo e(asset('images/template2.jpeg')); ?>" alt="">
                                </div>

                                <div class="frame_hover_img">
                                    <div class="btn_position">
                                        <div class="btn_primary">
                                            <a href="<?php echo e(route('customer.campaign.template.show',['template'=>'three','campaign_id'=>$campaign->id])); ?>"
                                               class="campaign_create_btn">Use template</a>
                                        </div>
                                        <div class="btn_preview">
                                            <button type="button" class="campaign_cancel_btn clickable_pre"
                                                    data-img="template2.jpeg">
                                                <svg viewBox="0 0 512 512">
                                                    <path fill="currentColor"
                                                          d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"></path>
                                                </svg>
                                                Preview
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-4">
                            <div class="form-group">
                                <div class="tempate_img">
                                    <img src="<?php echo e(asset('images/template3.png')); ?>" alt="">
                                </div>
                                <div class="frame_hover_img">
                                    <div class="btn_position">
                                        <div class="btn_primary">
                                            <a href="<?php echo e(route('customer.campaign.template.show',['template'=>'four','campaign_id'=>$campaign->id])); ?>"
                                               class="campaign_create_btn">Use template</a>
                                        </div>
                                        <div class="btn_preview">
                                            <button type="button" class="campaign_cancel_btn clickable_pre"
                                                    data-img="template3.png">
                                                <svg viewBox="0 0 512 512">
                                                    <path fill="currentColor"
                                                          d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"></path>
                                                </svg>
                                                Preview
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-4">
                            <div class="form-group">
                                <div class="tempate_img">
                                    <img src="<?php echo e(asset('images/template4.png')); ?>" alt="">
                                </div>
                                <div class="frame_hover_img">
                                    <div class="btn_position">
                                        <div class="btn_primary">
                                            <a href="<?php echo e(route('customer.campaign.template.show',['template'=>'five','campaign_id'=>$campaign->id])); ?>"
                                               class="campaign_create_btn">Use template</a>
                                        </div>
                                        <div class="btn_preview">
                                            <button type="button" class="campaign_cancel_btn clickable_pre"
                                                    data-img="template4.png">
                                                <svg viewBox="0 0 512 512">
                                                    <path fill="currentColor"
                                                          d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"></path>
                                                </svg>
                                                Preview
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-4">
                            <div class="form-group">
                                <div class="tempate_img">
                                    <img src="<?php echo e(asset('images/template5.png')); ?>" alt="">
                                </div>
                                <div class="frame_hover_img">
                                    <div class="btn_position">
                                        <div class="btn_primary">
                                            <a href="<?php echo e(route('customer.campaign.template.show',['template'=>'six','campaign_id'=>$campaign->id])); ?>"
                                               class="campaign_create_btn">Use template</a>
                                        </div>
                                        <div class="btn_preview">
                                            <button type="button" class="campaign_cancel_btn clickable_pre"
                                                    data-img="template5.png">
                                                <svg viewBox="0 0 512 512">
                                                    <path fill="currentColor"
                                                          d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"></path>
                                                </svg>
                                                Preview
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <hr class="divider">
                <div class="mt-4 ml-2">
                    <button type="button" class="campaign_create_btn">Save</button>
                    <button type="button" class="campaign_cancel_btn cancel_btn_design">Cancel</button>
                </div>
            </div>
        </div>
    </div>

    <div id="template_modal" class="template_modal d-none">
        <div class="template-modal-content">
            <span class="template-close" id="template_close">&times;</span>
            <div id="imageDiv" class="imageDiv"></div>
        </div>
    </div>

    <div id="template_title_modal" class="template_modal d-none">
        <div class="template-modal-content">
            <span class="template-close template_title_close">&times;</span>
            <form method="post" action="<?php echo e(route('customer.campaign.update',[$campaign])); ?>">
                <?php echo csrf_field(); ?>
                <?php echo method_field('put'); ?>
                <input type="hidden" name="update_type" value="title">
                <div class="row">
                    <div class="col-lg-6 m-auto pt-5">
                        <div class="card">
                            <div class="form-group mt-3">
                                <label for="title" class="campaign_name">Campaign Name</label>
                                <input type="text" class="form-control" value="<?php echo e($campaign->title); ?>" required
                                       placeholder="Enter Campaign Title" name="title" id="title">
                            </div>
                            <div class="mt-4">
                                <button type="submit" class="campaign_create_btn">Update campaign</button>
                                <button type="button" class="campaign_cancel_btn template_title_close">Cancel</button>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>

    <div id="template_preview_modal" class="template_modal d-none">
        <div class="template-modal-content">
            <span class="template-close template_preview_close">&times;</span>
            <div class="previewBody_container">
                <div class="previewContainer_left">
                    <div class="previewTest_frame">
                        <div class="frame_header">
                            <?php if(isset($campaign->from_email) && $campaign->from_email): ?>
                                <div class="frameHeader_div">
                                    <div class="frameHeader_title">
                                        From
                                    </div>
                                    <?php echo e(auth()->user()->full_name); ?> <?php echo e($campaign->from_email); ?>

                                </div>
                            <?php endif; ?>
                            <?php if(isset($campaign->to_email) && $campaign->to_email): ?>
                                <?php
                                    $to = '';
                                    foreach (json_decode($campaign->to_email) as $to_email){
                                        $to .= $to_email.",";
                                    }
                                ?>

                                <div class="frameHeader_div">
                                    <div class="frameHeader_title">
                                        To
                                    </div>
                                    <?php echo e($to); ?>

                                </div>
                            <?php endif; ?>
                            <?php if(isset($campaign->subject_line) && $campaign->subject_line): ?>
                                <div class="frameHeader_div">
                                    <div class="frameHeader_title">
                                        Subject
                                    </div>
                                    <?php echo e($campaign->subject_line); ?>

                                </div>
                            <?php endif; ?>
                            <?php if(isset($campaign->preview_text) && $campaign->preview_text): ?>
                                <div class="frameHeader_div">
                                    <div class="frameHeader_title">
                                        Preview
                                    </div>
                                    <?php echo e($campaign->preview_text); ?>

                                </div>
                            <?php endif; ?>
                            <?php if(isset($campaign->start_date) && $campaign->start_date): ?>
                                <div class="frameHeader_div">
                                    <div class="frameHeader_title">
                                        Starting Date
                                    </div>
                                    <?php echo e($campaign->start_date->format('Y-m-d')); ?>

                                </div>
                            <?php endif; ?>
                            <?php if(isset($campaign->end_date) && $campaign->end_date): ?>
                                <div class="frameHeader_div">
                                    <div class="frameHeader_title">
                                        Ending Date
                                    </div>
                                    <?php echo e($campaign->end_date->format('Y-m-d')); ?>

                                </div>
                            <?php endif; ?>
                            <?php if(isset($campaign->start_time) && $campaign->start_time): ?>
                                <div class="frameHeader_div">
                                    <div class="frameHeader_title">
                                        Starting time
                                    </div>
                                    <?php echo e($campaign->start_time); ?>

                                </div>
                            <?php endif; ?>
                            <?php if(isset($campaign->end_time) && $campaign->end_time): ?>
                                <div class="frameHeader_div">
                                    <div class="frameHeader_title">
                                        Ending time
                                    </div>
                                    <?php echo e($campaign->end_time); ?>

                                </div>
                            <?php endif; ?>
                        </div>
                        <div class="frame_body">
                            <div class="template_section tem_preview mt-5">
                                <?php if(isset($template->template) && ($template->template == 'one' || $template->template == 'two' || $template->template == 'three' || $template->template == 'four')): ?>
                                    <div class="template_logo_div template_modal_hover_none">
                                        <?php if(isset($campaign_template->logo_img) && $campaign_template->logo_img): ?>
                                            <img src="<?php echo e(asset('uploads/'.$campaign_template->logo_img)); ?>" alt="">
                                        <?php elseif(isset($campaign_template->logo_url) && $campaign_template->logo_url): ?>
                                            <img src="<?php echo e($campaign_template->logo_url); ?>" alt="">
                                        <?php else: ?>
                                            <img src="<?php echo e(asset('images/logo-img.png')); ?>" alt="">
                                        <?php endif; ?>
                                    </div>
                                <?php endif; ?>

                                <?php if(isset($template->template) && ($template->template == 'one' || $template->template == 'two' || $template->template == 'three')): ?>
                                    <div class="template_title template_modal_hover_none">
                                        <h1><?php echo e(isset($campaign_template->heading) && $campaign_template->heading?$campaign_template->heading:'This is your headline.'); ?></h1>
                                    </div>
                                <?php endif; ?>

                                <?php if(isset($template->template) && ($template->template == 'one' || $template->template == 'two' || $template->template == 'three' || $template->template == 'four')): ?>
                                    <div class="template_shopping_img template_modal_hover_none">
                                        <?php if(isset($campaign_template->product_img_upload) && $campaign_template->product_img_upload): ?>
                                            <img src="<?php echo e(asset('uploads/'.$campaign_template->product_img_upload)); ?>"
                                                 alt="">
                                        <?php elseif(isset($campaign_template->product_image_url) && $campaign_template->product_image_url): ?>
                                            <img src="<?php echo e($campaign_template->product_image_url); ?>" alt="">
                                        <?php else: ?>
                                            <img src="<?php echo e(asset('images/shopping-img.png')); ?>" alt="">
                                        <?php endif; ?>
                                    </div>
                                <?php endif; ?>

                                <?php if(isset($template->template) && ($template->template == 'two' || $template->template == 'three')): ?>
                                    <div class="template_product_pre">
                                        <div class="template_product_img template_modal_hover_none">
                                            <?php if(isset($campaign_template->first_product_img_upload) && $campaign_template->first_product_img_upload): ?>
                                                <img
                                                    src="<?php echo e(asset('uploads/'.$campaign_template->first_product_img_upload)); ?>"
                                                    alt="">
                                            <?php elseif(isset($campaign_template->first_product_image_url) && $campaign_template->first_product_image_url): ?>
                                                <img src="<?php echo e($campaign_template->first_product_image_url); ?>" alt="">
                                            <?php else: ?>
                                                <img src="<?php echo e(asset('images/product-img-one.png')); ?>" alt="">
                                            <?php endif; ?>

                                        </div>
                                        <div class="template_product_img margin_left_img template_modal_hover_none">
                                            <?php if(isset($campaign_template->sec_product_img_upload) && $campaign_template->sec_product_img_upload): ?>
                                                <img
                                                    src="<?php echo e(asset('uploads/'.$campaign_template->sec_product_img_upload)); ?>"
                                                    alt="">
                                            <?php elseif(isset($campaign_template->sec_product_image_url) && $campaign_template->sec_product_image_url): ?>
                                                <img src="<?php echo e($campaign_template->sec_product_image_url); ?>" alt="">
                                            <?php else: ?>
                                                <img src="<?php echo e(asset('images/product-img-two.png')); ?>" alt="">
                                            <?php endif; ?>
                                        </div>
                                    </div>
                                <?php endif; ?>
                                <div class="template_heading_section template_modal_hover_none">
                                    <h2><?php echo e(isset($campaign_template->campaign_title) && $campaign_template->campaign_title?$campaign_template->campaign_title:'Your title here'); ?></h2>
                                    <p>
                                        <?php echo e(isset($campaign_template->campaign_description) && $campaign_template->campaign_description?$campaign_template->campaign_description:' Start your newsletter with multiple visually striking images.
                                        Start by replacing the full-width header and main images with your own, or use a solid color background.'); ?>

                                    </p>
                                    <a href="<?php echo e(isset($campaign_template->campaign_call_to_action) && $campaign_template->campaign_call_to_action?$campaign_template->campaign_call_to_action:''); ?>"
                                       class="campaign_create_btn call_to_action">Call to action</a>
                                </div>
                                <div class="template_last template_modal_hover_none">
                                    <h5><?php echo e(isset($campaign_template->company_name) && $campaign_template->company_name?$campaign_template->company_name:'My Company'); ?></h5>
                                    <p><?php echo e(isset($campaign_template->email_description) && $campaign_template->email_description?$campaign_template->email_description:'You have received this email because you have subscribed to our newsletter.'); ?></p>
                                    <a href="<?php echo e(isset($campaign_template->unsubscribe_link) && $campaign_template->unsubscribe_link?$campaign_template->unsubscribe_link:route('unsubscribe',['email'=>'{email}'])); ?>">Unsubscribe</a>
                                    <div class="template_last_log template_modal_hover_none">
                                        <?php if(isset($campaign_template->logo_img) && $campaign_template->logo_img): ?>
                                            <img src="<?php echo e(asset('uploads/'.$campaign_template->logo_img)); ?>" alt="">
                                        <?php elseif(isset($campaign_template->logo_url) && $campaign_template->logo_url): ?>
                                            <img src="<?php echo e($campaign_template->logo_url); ?>" alt="">
                                        <?php else: ?>
                                            <img src="<?php echo e(asset('images/logo-img.png')); ?>" alt="">
                                        <?php endif; ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="previewContainer_right">
                    <div class="previewAnd_test">
                        <div>
                            <h2 class="previewTest_subheading">
                                <i class="fas fa-paper-plane"></i>
                                Send test
                            </h2>
                            <p class="previewTest_subcontent">Send the current preview as a test email to yourself or
                                your colleagues.</p>
                            <div class="contactList_dropdown">
                                <div class="toSearch_block">
                                    <div>
                                        <div class="entry_field" id="test_select_contact_list">
                                            <p class="search_text">Select a list</p>
                                            <span class="arrow_svg">
                                                <svg viewBox="0 0 320 512"><path
                                                        d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"></path></svg>
                                            </span>
                                        </div>
                                        <div class="searchListing_dropdown contact_list_dropdown"
                                             id="select_contact_list_section">
                                            <div class="contact_list">
                                                <div class="row ml-4">
                                                    <div id="add_on_contact"></div>
                                                    <?php if($contacts->isNotEmpty()): ?>
                                                        <?php $__currentLoopData = $contacts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $contact): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                            <div class="col-lg-12">
                                                                <div class="form-check">
                                                                    <input class="form-check-input contactCheckChecked"
                                                                           name="contact_email[]" type="checkbox"
                                                                           value="<?php echo e($contact->email); ?>"
                                                                           data-email="<?php echo e($contact->email); ?>"
                                                                           id="contactCheckChecked-<?php echo e($contact->id); ?>"
                                                                    >
                                                                    <label class="form-check-label"
                                                                           for="contactCheckChecked-<?php echo e($contact->id); ?>">
                                                                        <?php echo e($contact->email); ?>

                                                                    </label>
                                                                </div>
                                                            </div>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                    <?php endif; ?>
                                                </div>
                                            </div>
                                            <div class="searchListing_divider"></div>
                                            <div class="addressInput d-none" id="contact_add_section">
                                                <div class="invalid_email_error d-none">
                                                    <i class="fa fa-times-circle"></i>
                                                    Invalid Email
                                                </div>
                                                <div class="add_email_success d-none">
                                                    <i class="fa fa-check"></i>
                                                    Email successfully added
                                                </div>
                                                <div class="form-group mt-1">
                                                    <input type="email" class="form-control" autocomplete="new-password"
                                                           placeholder="Enter your email" value=""
                                                           id="add_contact_email">
                                                </div>
                                                <div>
                                                    <button type="button" class="campaign_create_btn"
                                                            id="add_contact_submit_button">Save
                                                    </button>
                                                    <button type="button"
                                                            class="campaign_cancel_btn add_contact_cancel_btn">Cancel
                                                    </button>
                                                </div>
                                            </div>
                                            <div class="query_builder query_builder_from contact_add_btn">
                                                <a href="" class="clickable_button clickable_inline"
                                                   style="margin-left: 1rem; padding: 8px;" id="contact_add_button">
                                                    <svg viewBox="0 0 14 14" height="16" width="16" class="icon_margin">
                                                        <path
                                                            d="M13 5.5H8.5V1a1 1 0 00-1-1h-1a1 1 0 00-1 1v4.5H1a1 1 0 00-1 1v1a1 1 0 001 1h4.5V13a1 1 0 001 1h1a1 1 0 001-1V8.5H13a1 1 0 001-1v-1a1 1 0 00-1-1z"
                                                            fill-rule="evenodd"></path>
                                                    </svg>
                                                    Add a sender
                                                </a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                            <div>
                                <?php if($campaign->title && $campaign->from_email && $campaign->start_date && $campaign->end_date && $campaign->start_time && $campaign->end_time && $campaign->template_id && $campaign->from_email_name && $campaign->subject_line && $campaign->reply_to_email): ?>
                                    <form action="<?php echo e(route('customer.campaigns.preview.test')); ?>" method="post">
                                        <?php echo csrf_field(); ?>
                                        <div id="seleted_conteact_emails_div"></div>
                                        <input type="hidden" name="contact_campaign_id" value="<?php echo e($campaign->id); ?>">
                                        <input type="hidden" name="contact_from_email"
                                               value="<?php echo e($campaign->from_email); ?>">
                                        <input type="hidden" name="contact_start_date"
                                               value="<?php echo e($campaign->start_date); ?>">
                                        <input type="hidden" name="contact_end_date" value="<?php echo e($campaign->end_date); ?>">
                                        <input type="hidden" name="contact_start_time"
                                               value="<?php echo e($campaign->start_time); ?>">
                                        <input type="hidden" name="contact_end_time" value="<?php echo e($campaign->end_time); ?>">
                                        <input type="hidden" name="contact_template_id"
                                               value="<?php echo e($campaign->template_id); ?>">
                                        <input type="hidden" name="contact_from_email_name"
                                               value="<?php echo e($campaign->from_email_name); ?>">
                                        <input type="hidden" name="contact_reply_to_email"
                                               value="<?php echo e($campaign->reply_to_email); ?>">
                                        <input type="hidden" name="contact_subject_line"
                                               value="<?php echo e($campaign->subject_line); ?>">
                                        <input type="hidden" name="contact_preview_text"
                                               value="<?php echo e($campaign->preview_text); ?>">

                                        <button type="submit" class="campaign_create_btn">Send Test</button>
                                    </form>
                                    
                                <?php else: ?>
                                    <button disabled type="button"
                                            class="campaign_create_btn preview_and_test_send_btn">Send
                                        Test
                                    </button>
                                <?php endif; ?>

                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('extra-scripts'); ?>
    <script>
        $(document).on('click', '#select_a_list', function (e) {
            e.preventDefault();
            $('#select_a_list_section').toggle();

        });
        $(document).on('click', '#dont_send_to', function (e) {
            e.preventDefault();
            $('#dont_send_to_section').toggle();

        });
        $(document).on('click', '#clickable_link', function (e) {
            e.preventDefault();
            $('#clickable_link_section').toggle();

        });
        $(document).on('click', '#to_content_btn', function (e) {
            e.preventDefault();
            $('#to_content').removeClass('d-none');
            $('#from_section_to').addClass('toActive_block');
            $('#cencel_btn_to_div').removeClass('d-none');
            $('#to_content_btn_div').addClass('d-none');
            $('#who_text_to').addClass('d-none');
        });
        $(document).on('click', '.cancel_btn_to', function (e) {
            e.preventDefault();
            $('#to_content').addClass('d-none');
            $('#from_section_to').removeClass('toActive_block');
            $('#cencel_btn_to_div').addClass('d-none');
            $('#to_content_btn_div').removeClass('d-none');
            $('#who_text_to').removeClass('d-none');
        });
        $(document).on('click', '#clickable_link_from', function (e) {
            e.preventDefault();
            $('#clickable_link_from_section').toggle();

        });
        $(document).on('click', '#select_a_list_from', function (e) {
            e.preventDefault();
            $('#select_a_list_from_section').toggle();

        });
        $(document).on('click', '#from_content_btn', function (e) {
            e.preventDefault();
            $('#from_content').removeClass('d-none');
            $('#from_section_from').addClass('toActive_block');
            $('#cencel_btn_from_div').removeClass('d-none');
            $('#from_content_btn_div').addClass('d-none');
            $('#campaign_sender').trigger('change');
        });
        $(document).on('click', '.cancel_btn_from', function (e) {
            e.preventDefault();
            $('#from_content').addClass('d-none');
            $('#from_section_from').removeClass('toActive_block');
            $('#cencel_btn_from_div').addClass('d-none');
            $('#from_content_btn_div').removeClass('d-none');
        });

        $(document).on('click', '#subject_content_btn', function (e) {
            e.preventDefault();
            $('#subject_content').removeClass('d-none');
            $('#from_section_subject').addClass('toActive_block');
            $('#cencel_btn_subject_div').removeClass('d-none');
            $('#subject_content_div').addClass('d-none');
        });

        $(document).on('click', '.cancel_btn_subject', function (e) {
            e.preventDefault();
            $('#subject_content').addClass('d-none');
            $('#from_section_subject').removeClass('toActive_block');
            $('#cencel_btn_subject_div').addClass('d-none');
            $('#subject_content_div').removeClass('d-none');
        });


        $(document).on('click', '#campaign_name_title', function (e) {
            e.preventDefault();
            $('#template_title_modal').removeClass('d-none');
        });
        $(document).on('click', '.template_title_close', function (e) {
            e.preventDefault();
            $('#template_title_modal').addClass('d-none');
        });


        $(document).on('click', '.clickable_pre', function (e) {
            e.preventDefault();
            const image = $(this).attr('data-img');
            document.getElementById('imageDiv').innerHTML = `<img src="/images/${image}">`;
            $('#template_modal').removeClass('d-none');
        });
        $(document).on('click', '#template_close', function (e) {
            e.preventDefault();
            $('#template_modal').addClass('d-none');
        });

        $(document).on('click', '#design_content_btn', function (e) {
            e.preventDefault();
            $('#design_content').removeClass('d-none');
            $('#from_section_design').addClass('toActive_block');
            $('#cencel_btn_design_div').removeClass('d-none');
            $('#design_content_div').addClass('d-none');
        });
        $(document).on('click', '.cancel_btn_design', function (e) {
            e.preventDefault();
            $('#design_content').addClass('d-none');
            $('#from_section_design').removeClass('toActive_block');
            $('#cencel_btn_design_div').addClass('d-none');
            $('#design_content_div').removeClass('d-none');
        });
        $(document).on('click', '#date_time_content_btn', function (e) {
            e.preventDefault();
            $('#date_time_content').removeClass('d-none');
            $('#from_section_date_time').addClass('toActive_block');
            $('#cencel_btn_date_time_div').removeClass('d-none');
            $('#date_time_content_div').addClass('d-none');
        });
        $(document).on('click', '.cancel_btn_date_time', function (e) {
            e.preventDefault();
            $('#date_time_content').addClass('d-none');
            $('#from_section_date_time').removeClass('toActive_block');
            $('#date_time_content_div').removeClass('d-none');
            $('#cencel_btn_date_time_div').addClass('d-none');
        });


        $(document).on('change', '.groupCheckChecked', function (e) {
            e.preventDefault();
            let groupIds = [];
            let toEmail = '';
            $(".groupCheckChecked").each(function () {
                const inputChecked = $(this).is(':checked');
                const groupId = $(this).attr('data-group-id');
                if (inputChecked) {
                    groupIds.push(parseInt($(this).attr('data-group-id')));
                    toEmail += `<input type="hidden" name="group_id[]" value="${groupId}">`;
                }
            });
            $('#to_email').html(toEmail);

            if (groupIds.length <= 0) {
                $("#gauge_thumb").css("width", '0%');
                $('#group_contact_count').text('0');
                $('#to_email').html('');
                $('#remainingEmail').text($('#remainingEmail').attr('data-remaining'));
                $("#to_email_button").attr('disabled', 'true');
                return true;
            }
            $.ajax({
                url: '<?php echo e(route('customer.campaign.template.get.to.email')); ?>',
                method: "GET",
                data: {
                    group_id: groupIds,
                },
                success: function (res) {
                    if (res.status == 'success') {
                        let total = res.data.to_count;

                        $("#gauge_thumb").css("width", total + '%');

                        $('#group_contact_count').text(total);
                        const pre_remaining = $('#remainingEmail').attr('data-remaining');
                        const currentRemaining = parseInt(pre_remaining) - total;
                        $('#remainingEmail').text(currentRemaining);

                        if (currentRemaining <= 0) {
                            $("#to_email_button").attr('disabled', 'true');
                        } else {
                            $("#to_email_button").removeAttr('disabled');
                        }

                    }
                },
                error: function (err) {
                    $("#gauge_thumb").css("width", '0%');
                    $('#group_contact_count').text('0');
                    $('#to_email').html('');
                    $('#remainingEmail').text($('#remainingEmail').attr('data-remaining'));
                    $("#to_email_button").attr('disabled', 'true');
                }
            });
        })

        $(function () {
            const reply_to_email = $('#reply_to_email').val();
            const customize_to_email = $('#customize_to_email').val();
            if (reply_to_email || customize_to_email) {
                $('#clickable_link_from').trigger('click')

            }
        })

        $(function () {
            $('[data-toggle="tooltip"]').tooltip()
        })
        $(document).on('click', '#template_preview_modal_btn', function (e) {
            e.preventDefault();
            $('#template_preview_modal').removeClass('d-none');
            $('body').addClass('scroll_hidden');
        });
        $(document).on('click', '.template_preview_close', function (e) {
            e.preventDefault();
            $('#template_preview_modal').addClass('d-none');
            $('body').removeClass('scroll_hidden');
        });
        $(document).on('click', '#test_select_contact_list', function (e) {
            e.preventDefault();
            $('#select_contact_list_section').toggle();

        });
        $(document).on('click', '#contact_add_button', function (e) {
            e.preventDefault();
            $('#contact_add_section').removeClass('d-none');
            $('#contact_add_button').addClass('d-none');

        });
        $(document).on('click', '.add_contact_cancel_btn', function (e) {
            e.preventDefault();
            $('#contact_add_section').addClass('d-none');
            $('#contact_add_button').removeClass('d-none');
        });

        $('#add_contact_submit_button').on('click', function (e) {
            const email = $('#add_contact_email').val();
            $.ajax({
                url: '<?php echo e(route('customer.campaigns.preview.email.store')); ?>',
                method: "POST",
                data: {
                    _token: '<?php echo e(csrf_token()); ?>',
                    email: email,
                },
                success: function (res) {
                    if (res.status == 'success') {
                        $('.add_email_success').removeClass('d-none')
                        $('.invalid_email_error').addClass('d-none')
                        $('#add_on_contact').append(`<div class="col-lg-12">
                                                                <div class="form-check">
                                                                    <input class="form-check-input groupCheckChecked" type="checkbox" value="">
                                                                    <label class="form-check-label" for="flexCheckChecked">
                                                                        ${email}
                                                    </label>
                                                </div>
                                            </div>`)
                        window.setTimeout(function () {
                            $('.invalid_email_error').addClass('d-none')
                            $('.add_email_success').addClass('d-none')
                        }, 5000);
                    } else {
                        $('.invalid_email_error').removeClass('d-none')
                        $('.add_email_success').addClass('d-none')
                        window.setTimeout(function () {
                            $('.invalid_email_error').addClass('d-none')
                            $('.add_email_success').addClass('d-none')
                        }, 5000);
                    }
                }
            });
        })


        $('.contactCheckChecked').on('change', function (e) {
            var emails = [];
            $("input[name='contact_email[]']:checked").each(function () {
                emails.push($(this).val());
            });
            console.log(emails)
            if (emails) {
                $('#preview_and_test_send_btn').removeClass('preview_and_test_send_btn');
                document.getElementById("to_email_button").disabled = false;
            }

            let html = '';
            $.each(emails, function (index, value) {
                html += `<input type="hidden" name="seleted_conteact_emails[]" value="${value}">`;
            });
            $('#seleted_conteact_emails_div').html(html)
        })
        $(function () {
            const emails = $('#seleted_conteact_emails').val()
            if (emails) {
                $('#preview_and_test_send_btn').removeClass('preview_and_test_send_btn');
                document.getElementById("to_email_button").disabled = false;
            } else {
                document.getElementById("to_email_button").disabled = true;
                $('#preview_and_test_send_btn').addClass('preview_and_test_send_btn');
            }

            $('.groupCheckChecked').first().trigger('change');

        })
        $('#preview_and_test_send_btn').on('click', function (e) {
            const emailHas = $('input[name="seleted_conteact_emails[]"]').val();
            ``
            let email = [];
            $('input[name="seleted_conteact_emails[]"]').each(function () {
                email.push($(this).val());
            });
            if (emailHas) {
                $.ajax({
                    url: '<?php echo e(route('customer.campaigns.preview.test')); ?>',
                    method: "POST",
                    data: {
                        _token: '<?php echo e(csrf_token()); ?>',
                        email: email,
                    },
                    success: function (res) {
                        if (res.status == 'success') {


                        }
                    }
                });
            }


        })

        const campaignSender = $('#campaign_sender').select2({
            multiple: false,
            placeholder: 'Type from email'
        });

        campaignSender.on('change', function (e) {
            const from_mail = $(this).val();
            $('#from_email_input_val').val(from_mail);
        })


    </script>

<?php $__env->stopSection(); ?>


<?php echo $__env->make('layouts.customer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/picotech/domains/instantly.picotech.app/public_html/resources/views/customer/campaign/edit.blade.php ENDPATH**/ ?>