<div class="panel panel-primary">

    <header class="panel-heading">
      <h2><?php echo app('translator')->getFromJson('backend.button-redirection'); ?></h2>
    </header>

    <div class="panel-body">

      <?php echo $__env->make('flash::message', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

      <form action="<?php echo e(route('updateRedirection')); ?>" method="POST">
        <?php echo e(csrf_field()); ?>

        <input name="id1" type="hidden" value="<?php echo e(isset($banner1->id) ? $banner1->id : ''); ?>">
        <input name="id2" type="hidden" value="<?php echo e(isset($banner2->id) ? $banner2->id : ''); ?>">

        <div class="col-xs-12 col-sm-6">
          <div class="panel panel-primary">

            <div class="panel-heading">
              <?php 
                $get = $banner1->locales()->where('locale',config('app.locale'))->first();
                $target_page = '';
                if ($banner1->media_target) {
                  $target_page = App\PageName::where('key', $banner1->media_target)->first();
                }
               ?>
              <h3><?php echo e(isset($get->media_title) ? $get->media_title : $banner1->media_title); ?></h3>
            </div>

            <div class="panel-body">

              <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
                  <div class="form-group">
                    <label for="button" class="control-label"><?php echo app('translator')->getFromJson('backend.current-button'); ?></label>
                    <a class="btn btn-primary" href="/<?php echo e($target_page ? $target_page->slug : ''); ?>">
                      <?php echo e($target_page ? ucwords($target_page->page_name) : 'No Target'); ?>

                    </a>
                  </div>
                </div>

                <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
                  <label for="select" class="control-label"><?php echo app('translator')->getFromJson('backend.new-redirection'); ?></label>
                  <select name="redirect1" class="selectpicker" data-width="100%">
                    <?php $__currentLoopData = $pageName; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $page): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <option value="<?php echo e($page->key); ?>" <?php echo e($page->key==$banner1->media_target ? 'selected' : ''); ?>>
                        <?php echo e($page->page_name); ?>

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

            </div>

          </div>
        </div>

        <div class="col-xs-12 col-sm-6">
          <div class="panel panel-primary">

            <div class="panel-heading">
              <?php 
                $get = $banner2->locales()->where('locale',config('app.locale'))->first();
                $target_page = '';
                if ($banner2->media_target) {
                  $target_page = App\PageName::where('key', $banner2->media_target)->first();
                }
               ?>
              <h3><?php echo e(isset($get->media_title) ? $get->media_title : $banner2->media_title); ?></h3>
            </div>

            <div class="panel-body">

              <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
                  <div class="form-group">
                    <label for="button" class="control-label"><?php echo app('translator')->getFromJson('backend.current-page'); ?></label>
                    <a class="btn btn-primary" href="/<?php echo e($target_page ? $target_page->slug : ''); ?>">
                      <?php echo e($target_page ? ucwords($target_page->page_name) : 'No Target'); ?>

                    </a>
                  </div>
                </div>

                <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
                  <label for="select" class="control-label"><?php echo app('translator')->getFromJson('backend.new-redirection'); ?></label>
                  <select name="redirect2" class="selectpicker" data-width="100%">
                    <?php $__currentLoopData = $pageName; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $page): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <option value="<?php echo e($page->key); ?>" <?php echo e($page->key==$banner2->media_target ? 'selected' : ''); ?>>
                        <?php echo e($page->page_name); ?>

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

            </div>

          </div>
        </div>

        <div class="col-xs-12 text-right">
          <button type="submit" class="btn btn-primary"><?php echo app('translator')->getFromJson('backend.update'); ?></button>
        </div>

      </form>

    </div>


  </div>