<!DOCTYPE html>
<html lang="en">
<head>
 <?php $this->load->view('front/includes/header-script')?>
 <title><?=TITLE?></title>
</head>
<body>
 <header>
  <div class="container">
   <div class="logo d-flex">
    <img src="<?=base_url();?>assets/front/img/logo.jpg" alt=""> 
    <span class="d-flex align-items-center justify-content-center">
     <h1>Continuing Education Registration</h1>
   </span>
 </div>
</div>
</header>
<div class="container">
  <section class="abc-approve">
    <div class="container">
      <h1>Review / Approve Registrations</h1>
      <?php 
      $cart = $this->session->userdata('cart');
      foreach ($cart as $cartcount => $form) {
        $classform = $this->session->userdata('classform'.$form);
        foreach ($classform as $formcount => $data) { ?>
         <h2><?=$data['class_name']?></h2>
         <p>Start Date: <?=date("m-d-Y",strtotime($data['calss_start_date']))?><br>
           End Date: <?=date("m-d-Y",strtotime($data['calss_end_date']))?><br>
           Time: <?=date('h:i A',strtotime($data['calss_start_time']))?> - <?=date('h:i A',strtotime($data['calss_end_time']))?><br>
           Location: <?=$data['class_room']?>, <?=$data['class_address']?>, <?=$data['class_city']?>, <?=$data['class_state']?>, <?=$data['class_code']?><br>
           Days of Week: <?php ob_start(); foreach (explode(",", $data['class_day']) as $day) {
             echo ucfirst(strtolower($day)).',';
           }
           $output = ob_get_clean();
           echo rtrim($output, ',');
           ?>
         </p>
         <div class="approve">
           <?php 
           $member = $this->session->userdata('member'.$form);
           if(isset($member['M'])) { ?>
             <label><span><?=$this->session->userdata('mcount'.$form)?></span>Member / Alumni</label>
             <?php foreach ($member['M'] as $key => $val)  { ?>
               <div class="d-flex approve-content">
                <div class="col-sm-8 no-pad"><?=isset($val['first_name'])? $val['first_name'] : ''?> <?=isset($val['last_name'])? $val['last_name'] : ''?> <?=isset($val['email_id'])? $val['email_id'] : ''?> <?=isset($val['phone_no'])? $val['phone_no'] : ''?> <?=isset($val['ssn'])? $val['ssn'] : ''?></div>
                <div class="col-sm-4">$ <?=$data['class_price_m']?>.00</div>
              </div>
            <?php } } 
            $memplus = $this->session->userdata('memplus'.$form);
            if(isset($memplus['M2'])) { ?>
             <label><span><?=$this->session->userdata('mpluscount'.$form)?></span>Member / Alumni 2+</label>
             <?php foreach ($memplus['M2'] as $key => $val)  { ?>
               <div class="d-flex approve-content">
                <div class="col-sm-8 no-pad"><?=isset($val['first_name'])? $val['first_name'] : ''?> <?=isset($val['last_name'])? $val['last_name'] : ''?> <?=isset($val['email_id'])? $val['email_id'] : ''?> <?=isset($val['phone_no'])? $val['phone_no'] : ''?> <?=isset($val['ssn'])? $val['ssn'] : ''?></div>
                <div class="col-sm-4">$ <?=$data['class_price_m2']?>.00</div>
              </div>
            <?php } } 
            $nonmember = $this->session->userdata('nonmember'.$form);
            if(isset($nonmember['N'])) { ?>
             <label><span><?=$this->session->userdata('ncount'.$form)?></span>Non-Member</label>
             <?php foreach ($nonmember['N'] as $key => $val) { ?>
               <div class="d-flex approve-content">
                <div class="col-sm-8 no-pad"><?=isset($val['first_name'])? $val['first_name'] : ''?> <?=isset($val['last_name'])? $val['last_name'] : ''?> <?=isset($val['email_id'])? $val['email_id'] : ''?> <?=isset($val['phone_no'])? $val['phone_no'] : ''?> <?=isset($val['ssn'])? $val['ssn'] : ''?></div>
                <div class="col-sm-4">$ <?=$data['class_price_n']?>.00</div>
              </div>
            <?php } }
            $nonplus = $this->session->userdata('nonplus'.$form);
            if(isset($nonplus['N2'])) { ?>
             <label><span><?=$this->session->userdata('npluscount'.$form)?></span>Non-Member 2+</label>
             <?php foreach ($nonplus['N2'] as $key => $val) { ?>
               <div class="d-flex approve-content">
                <div class="col-sm-8 no-pad"><?=isset($val['first_name'])? $val['first_name'] : ''?> <?=isset($val['last_name'])? $val['last_name'] : ''?> <?=isset($val['email_id'])? $val['email_id'] : ''?> <?=isset($val['phone_no'])? $val['phone_no'] : ''?> <?=isset($val['ssn'])? $val['ssn'] : ''?></div>
                <div class="col-sm-4">$ <?=$data['class_price_n2']?>.00</div>
              </div>
            <?php } }
            $semember = $this->session->userdata('semember'.$form);
            if(isset($semember['S'])) { ?>
             <label><span><?=$this->session->userdata('scount'.$form)?></span>Subscribing Employer</label>
             <?php foreach ($semember['S'] as $key => $val) { ?>
               <div class="d-flex approve-content">
                <div class="col-sm-8 no-pad"><?=isset($val['first_name'])? $val['first_name'] : ''?> <?=isset($val['last_name'])? $val['last_name'] : ''?> <?=isset($val['email_id'])? $val['email_id'] : ''?> <?=isset($val['phone_no'])? $val['phone_no'] : ''?> <?=isset($val['ssn'])? $val['ssn'] : ''?></div>
                <div class="col-sm-4">$ <?=$data['class_price_s']?>.00</div>
              </div>
            <?php } } ?>
            <div class="d-flex alumi-content class-sum">
              <div class="col-sm-8 no-pad">Class Total</div>
              <div class="col-sm-4">$ <?=$this->session->userdata('classtotal'.$form);?>.00</div>
            </div>
          <?php  } } ?>
          <div class="d-flex alumi-content class-sum grand">
            <div class="col-sm-8 no-pad">Grand Total</div>
            <div class="col-sm-4">$ <?=$this->session->userdata('granttotal');?>.00</div>
          </div>
          <div class="d-flex justify-content-between abc-btn">
            <div class="p-2"><a href="<?= base_url();?>review/back"><button type="button" class="btn" style="background: #be0000; color: #fff;">Back</button></a></div>
            <div class="p-2 ml-auto"><a href="<?= base_url();?>order-payment"><button type="button" class="btn" style="background: #899ec4;">Approve</button></a></div>
          </div>
        </div>
      </section>
      <?php $this->load->view('front/includes/footer-script')?>
    </body>
    </html>