<?php
$this->load->view("top_application");
//trace($ordmaster);
?>
<section class="dir-alp dir-pa-sp-top">
<div class="container" >
  <div class="row">
   <div class="dir-alp-tit">
        <h1>Payment Thanks</h1>
        <ol class="breadcrumb">
          <li><a href="<?php echo site_url(); ?>">Home</a> </li>
          <li><a title="Payment Thanks"> Payment Thanks</a></li>        </ol>
      </div>
      <div class="clearfix"></div>
      <div class="dir-alp-con">
      <div class="col-md-12 dir-alp-con-right list-grid-rig-pad padding_normal">
      <?php
      if (($ordmaster['payment_method'] == 'PayuMoney' && $ordmaster['payment_status'] == 'Paid') || $ordmaster['payment_method'] == 'Cash') {
        ?>
        <div class="text">
          Hey <?php echo ucwords($ordmaster['first_name']); ?>,<br />
          <span class="textBig">Your Order #<?php echo $ordmaster['invoice_number']; ?> is Confirmed!</span>
          <br />
          Thanks for Shopping! We will get back soon with more details regarding your order and its status.
        </div>
        <?php
      } else {
        ?>
        <div class="text">
          Hey <?php echo ucwords($ordmaster['first_name']); ?>,<br />
          <span class="textBig">Your Order #<?php echo $ordmaster['invoice_number']; ?> is Pending/Cancelled!</span><br />
          <small>Please contact website administrator for more details.</small>
        </div>
        <?php
      }
      ?>

      <div class="block-content login-content paymentbox">
       <div class="row">
          <?php
            //trace($ordmaster);
            $gTotal = 0;
            $discount_amount = $ordmaster['coupon_discount_amount'];
            foreach ($orddetail as $key => $val) {
              $gTotal += $val['product_price'] * $val['quantity'];
              //trace($val);
              ?>
           <div class="col-lg-4 col-md-4">
               <div class="products01">
                   <h3>Product</h3>
                   <ul>
                       <li><?php echo $val['product_name']; ?></li>
                       <li>Payment Method:</li>
                       <li>Total:</li>
                   </ul>
               </div>
           </div>
           <div class="col-lg-4 col-md-4">
               <div class="products01">
                   <h3>Quantity</h3>
                   <ul>
                       <li><?php echo $val['quantity']; ?></li>
                   </ul>
               </div>
           </div>
           <div class="col-lg-4 col-md-4">
               <div class="products01">
                   <h3>Price</h3>
                   <ul>
                       <li><?php echo display_price($val['product_price'] * $val['quantity']); ?></li>
                       <li><?php echo $ordmaster['payment_method']; ?></li>
                       <li>Rs. 0.60</li>
                   </ul>
               </div>
           </div>
            <?php
            }
            ?>
       </div>
        <table class="table table-bordered table-hover">
          <!--<tbody>
            <?php
            $gTotal = 0;
            $discount_amount = $ordmaster['coupon_discount_amount'];
            foreach ($orddetail as $key => $val) {
              $gTotal += $val['product_price'] * $val['quantity'];
              ?>
              <tr>
                <td>
                  <p><?php echo $val['product_name']; ?></p>
                </td>
                <td><?php echo $val['quantity']; ?></td>
                <td align="right"> <?php echo display_price($val['product_price'] * $val['quantity']); ?></td>
              </tr>
              <?php
            }
            ?>
          </tbody>-->
          <tfoot>
            <!--<tr>
              <td colspan="2"><strong>Payment Method:</strong></td>
              <td align="right"><?php echo $ordmaster['payment_method']; ?></td>
            </tr>-->
            <?php
            if ($ordmaster['payment_method'] == 'Cash') {
              ?>
              <tr>
                <td colspan="2"><strong>Subtotal:</strong></td>
                <td align="right"> <?php echo display_price($gTotal); ?></td>
              </tr>
              <tr>
                <td colspan="2"><strong>COD Charges:</strong></td>
                <td align="right"> <?php echo display_price('0'); ?></td>
              </tr>
              <?php
              if ($discount_amount > 0) {
                ?>
                <tr>
                  <td colspan="2"><strong><?php echo 'Discount (Coupon Applied)'; ?>:</strong></td>
                  <td align="right"> <?php echo display_price($discount_amount); ?></td>
                </tr>
                <?php
              }
              ?>
              <tr>
                <td colspan="2"><strong><?php echo ($this->session->userdata('lang') == 'p') ? $this->lang->line('total') : 'Total'; ?>:</strong></td>
                <td align="right"> <?php echo display_price($gTotal - $discount_amount); ?></td>
              </tr>
              <?php
            } else {
              if ($discount_amount > 0) {
                ?>
                <tr>
                  <td colspan="2"><strong><?php echo 'Discount (Coupon Applied)'; ?>:</strong></td>
                  <td align="right"> <?php echo display_price($discount_amount); ?></td>
                </tr>
                <?php
              }
              ?>
              <tr>
                <td colspan="2"><strong>Total:</strong></td>
                <td align="right"> <?php echo display_price($gTotal - $discount_amount); ?></td>
              </tr>
              <?php
            }
            ?>
          </tfoot>
        </table>
      </div>
    </div>
      </div>
      </div>
  </div>

</section>


<?php $this->load->view("bottom_application"); ?>