<?php $__env->startSection('title', 'Change Plan'); ?>
<?php $__env->startSection('content'); ?>
<style type="text/css">
  body{
    background-color: #f7f7f7;
    margin-top:20px;}
  /* pricing tables */
  .pricing-table {
    background: #e9f0f4;
    text-align: center;
    margin: 15px 0;
  }

  .pricing-table ul, .pricing-table ol {
    margin-bottom: 0;
    padding-left: 0;
  }

  .pricing-title {
    font-size: 18px;
    font-weight: 700;
    padding: 30px;
    margin-bottom: 0;
  }

  .pricing-table-price {
    background: #cdd4d8;
    font-weight: 700;
    padding: 30px;
    margin-bottom: 30px;
  }

  .pricing-table-price.w-rounded-price {
    display: table;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 30px auto;
    padding: 0;
  }

  .rounded-price {
    display: table-cell;
    text-align: center;
    vertical-align: middle;
  }

  .rounded-price .pricing-price {
    font-size: 1.75rem;
  }

  .rounded-price .pricing-currency {
    vertical-align: 10px;
  }

  .pricing-table-price p {
    color: #000;
    margin-bottom: 0;
  }

  .pricing-currency {
    font-size: 1.2rem;
    font-weight: 700;
    vertical-align: 25px;
  }

  .pricing-price {
    font-size: 3rem;
    font-weight: 700;
  }

  .pricing-period {
    font-weight: 700;
  }

  .pricing-table-content li {
    margin-bottom: 15px;
    font-size: 14px;
  }

  .pricing-table-button {
    padding: 15px 0 35px;
    line-height: 100px;
  }

  .featured.pricing-table {
    background: #9c64b8;
  }

  .featured.pricing-table .pricing-title {
    color: #fff;
  }

  .featured.pricing-table .pricing-table-content ul li {
    color: #eee;
  }

  .featured.pricing-table .pricing-table-price {
    background: #8853a1;
  }

  .featured.pricing-table .pricing-table-price p {
    color: #fff;
  }
  ul {
      list-style: none;
      padding: 0;
  }
  .bg-info-hover {
      background-color: #1397af !important;
  }
  .bg-info {
      background-color: #21b9d5 !important;
  }

  .bg-primary-hover {
      background-color: #8853a1 !important;
  }
  .bg-primary {
      background-color: #9c64b8 !important;
  }
  .text-white {
      color: #fff !important;
  }
</style>
<div class="wizard row">
    <div class="col-md-12 pd-4">
      <div class="box ">
        <!-- title of the page and heading-->
        <div class="box-header with-border main-box">
          <i class="ion ion-clipboard"></i>
          <h3 class="box-title">Change Plan</h3>
        </div>
        <!--end title-->
        <!-- start body of the page--> 
        <!-- start box body --> 
        <div class="box-body">
          <div class="col-md-12">
            <section id="pricing" class="bg-white">
              <div class="container">
                  <div class="spacer spacer-line border-primary">&nbsp;</div>
                  <div class="spacer">&nbsp;</div>
                  <div class="row">
                    <?php
                      //dd($plans);
                      $pname ="";
                       $activestatus = 0;
                    ?>

                    <?php $__currentLoopData = $plans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $plan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <?php if($plan->stripe_status=="active"): ?>
                        <?php
                          $activestatus =1;
                        ?>
                      <?php endif; ?>

                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php $__currentLoopData = $plans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $plan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <?php if($activestatus==1): ?>
                        <?php if($plan->active_flag==1): ?>
                          <?php
                              $pname = $plan->plan_name;
                          ?>
                          <?php $__currentLoopData = $slugname_arr; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $slugname): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                              <?php if($pname==$slugname): ?>
                                  <?php
                                      $invoice_plan_name = $display_name_arr[$slugname];
                                  ?>
                              <?php endif; ?>
                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                          <div class="col-md-4">
                              <div class="pricing-table bg-lightgrey">
                                  <div class="pricing-table-title">
                                      <h5 class="pricing-title bg-primary-hover text-white">
                                        <?php echo e($invoice_plan_name); ?>

                                      </h5>
                                  </div>
                                  <div class="pricing-table-price text-center bg-primary">
                                      <p class="title-font">
                                          <span class="pricing-period text-white mr-1">From</span>
                                          <span class="pricing-currency text-white"><?php if($plan->currency=="usd"): ?> $ <?php else: ?> <?php echo e($plan->currency); ?> <?php endif; ?></span>
                                          <span class="pricing-price text-white"><?php echo e($plan->amount); ?></span>
                                          <span class="pricing-period text-white">/ <?php echo e($plan->payment_interval); ?></span>
                                      </p>
                                  </div>
                                  <div class="pricing-table-content">
                                      <ul>
                                          <li><strong><?php echo e($invoice_plan_name); ?>Package</strong></li>
                                          <?php if($max_num_users[$plan->plan_name]): ?>
                                          <li><strong><?php echo e($max_num_users[$plan->plan_name]); ?> Users</strong></li>
                                          <?php else: ?>
                                          <li><strong>0 Professional</strong></li>
                                          <?php endif; ?>
                                          <!--<?php if($max_num_stds[$plan->plan_name]): ?>
                                          <li><strong><?php echo e($max_num_stds[$plan->plan_name]); ?> Standards</strong></li>
                                          <?php else: ?>
                                          <li><strong>0 Standards</strong></li>
                                          <?php endif; ?> -->
                                      </ul>
                                      <div class="pricing-table-button">
                                          &nbsp;&nbsp;
                                      </div><!-- / pricing-table-button -->
                                  </div><!-- / pricing-table-content -->
                              </div><!-- / pricing-table -->
                          </div><!-- / column -->
                        <?php endif; ?>
                        <?php if($plan->active_flag==0): ?>
                          <?php
                              $pname = $plan->plan_name;
                          ?>
                          <?php $__currentLoopData = $slugname_arr; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $slugname): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                              <?php if($pname==$slugname): ?>
                                  <?php
                                      $invoice_plan_name = $display_name_arr[$slugname];
                                  ?>
                              <?php endif; ?>
                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                          <div class="col-md-4">
                              <div class="pricing-table">
                                  <div class="pricing-table-title">
                                      <h5 class="pricing-title bg-info-hover text-white">
                                        <?php echo e($invoice_plan_name); ?>

                                      </h5>
                                  </div>
                                  <div class="pricing-table-price text-center bg-info">
                                      <p class="title-font">
                                          <span class="pricing-period text-white mr-1">From</span>
                                          <span class="pricing-currency text-white"><?php if($plan->currency=="usd"): ?> $ <?php else: ?> <?php echo e($plan->currency); ?> <?php endif; ?></span>
                                          <span class="pricing-price text-white"><?php echo e($plan->amount); ?></span>
                                          <span class="pricing-period text-white">/ <?php echo e($plan->payment_interval); ?></span>
                                      </p>
                                  </div>
                                  <div class="pricing-table-content">
                                      <ul>
                                          <li><strong><?php echo e($invoice_plan_name); ?> Package</strong></li>
                                          <?php if($max_num_users[$plan->plan_name]): ?>
                                          <li><strong><?php echo e($max_num_users[$plan->plan_name]); ?> Users</strong></li>
                                          <?php else: ?>
                                          <li><strong>0 Professional</strong></li>
                                          <?php endif; ?> 
                                          <!--<?php if($max_num_stds[$plan->plan_name]): ?>
                                          <li><strong><?php echo e($max_num_stds[$plan->plan_name]); ?> Standards</strong></li>
                                          <?php else: ?>
                                          <li><strong>0 Standards</strong></li>
                                          <?php endif; ?> -->
                                      </ul>
                                  </div><!-- / pricing-table-content -->
                                  <div class="pricing-table-content">
                                      <div class="pricing-table-button">
                                          <form id="payment-form" action="<?php echo e(URL::to('/change_plan_subscription')); ?>" method="POST">
                                            <?php echo csrf_field(); ?>

                                            <?php if($plan->active_flag==0): ?>
                                            <button type="submit" class="btn btn-primary" onClick='return confirmChangeCheck();'>Change</button>
                                            <input type="hidden" name="product_code" id="product_code" value="<?php echo e($plan->product_code); ?>">
                                            <input type="hidden" name="plan_name" id="plan_name" value="<?php echo e($plan->plan_name); ?>">
                                            <input type="hidden" name="email" id="email" value="<?php echo e($plan->email); ?>">
                                            <?php endif; ?>
                                          </form>
                                      </div><!-- / pricing-table-button -->
                                  </div><!-- / pricing-table-content -->
                              </div><!-- / pricing-table -->
                          </div><!-- / column -->
                        <?php endif; ?>
                      <?php else: ?>          
                          <?php
                              $pname = $plan->plan_name;
                          ?>
                          <?php $__currentLoopData = $slugname_arr; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $slugname): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                              <?php if($pname==$slugname): ?>
                                  <?php
                                      $invoice_plan_name = $display_name_arr[$slugname];
                                  ?>
                              <?php endif; ?>
                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                          <div class="col-md-4">
                              <div class="pricing-table">
                                  <div class="pricing-table-title">
                                      <h5 class="pricing-title bg-info-hover text-white">
                                        <?php echo e($invoice_plan_name); ?>

                                      </h5>
                                  </div>
                                  <div class="pricing-table-price text-center bg-info">
                                      <p class="title-font">
                                          <span class="pricing-period text-white mr-1">From</span>
                                          <span class="pricing-currency text-white"><?php if($plan->currency=="usd"): ?> $ <?php else: ?> <?php echo e($plan->currency); ?> <?php endif; ?></span>
                                          <span class="pricing-price text-white"><?php echo e($plan->amount); ?></span>
                                          <span class="pricing-period text-white">/ <?php echo e($plan->payment_interval); ?></span>
                                      </p>
                                  </div>
                                  <div class="pricing-table-content">
                                      <ul>
                                          <li><strong>
                                            <?php echo e($invoice_plan_name); ?> Package</strong></li>
                                          <?php if($max_num_users[$plan->plan_name]): ?>
                                          <li><strong><?php echo e($max_num_users[$plan->plan_name]); ?> Users</strong></li>
                                          <?php else: ?>
                                          <li><strong>0 Professional</strong></li>
                                          <?php endif; ?> 
                                          <!--<?php if($max_num_stds[$plan->plan_name]): ?>
                                          <li><strong><?php echo e($max_num_stds[$plan->plan_name]); ?> Standards</strong></li>
                                          <?php else: ?>
                                          <li><strong>0 Standards</strong></li>
                                          <?php endif; ?> -->
                                      </ul>
                                  </div><!-- / pricing-table-content -->
                                  <div class="pricing-table-content">
                                      <div class="pricing-table-button">
                                        
                                          <?php
                                            $payment_interval = $plan->payment_interval;
                                            $emailaddress = $plan->email;
                                            if($payment_interval=="month")
                                            {
                                                $frequency = "monthly";
                                            }
                                            if($payment_interval=="year")
                                            {
                                                $frequency = "annual";
                                            }
                                            $formurl= "";
                                            if($payment_link_val[$plan->plan_name][$frequency]!="")
                                            {
                                              $formurl = $payment_link_val[$plan->plan_name][$frequency];
                                              $formurl = $formurl."?prefilled_email=".$emailaddress;
                                            }
                                          ?>
                                          <?php if($formurl): ?>
                                            <a href="<?php echo e($formurl); ?>"  class="btn btn-info btn-sm">Proceed To Payment</a>                                        
                                          <?php endif; ?>
                                      </div><!-- / pricing-table-button -->
                                  </div><!-- / pricing-table-content -->
                              </div><!-- / pricing-table -->
                          </div><!-- / column -->
                      <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  </div><!-- / row -->
              </div><!-- / container -->
            </section>
          </div>
        </div>
      </div>
    </div>
</div>
<script>
  function confirmChangeCheck() 
  {
      var result = confirm('Are you sure you want to Change Your Current Active Plan?');

      if (result) 
      {
          return true;
      } 
      else 
      {
          return false;
      }
  }
</script>
<?php $__env->stopSection(); ?> 
<?php echo $__env->make('adminlte::page', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>