<?php
  /**
   * Checkout
   *
   * @package Digital Downloads Pro
   * @author wojoscripts.com
   * @copyright 2010
   * @version $Id: checkout.php, v2.00 2011-07-10 10:12:05 gewa Exp $
   */
  define("_VALID_PHP", true);
  require_once("init.php");
	  
  $cartrow = $content->getCartContent();
  $totalrow = $content->getCartTotal();
  $discount = $totalrow['total'] - $totalrow['coupon'];
?>
<?php include("header.php");?>
  <h1>&nbsp;فـرآیـنـد پـرداخـت نـهـائـی&nbsp;</h1>
  <p class="info">. در اینجا می توانید خـریـد خود را - پـرداخـت نـهـائـی - نمائیـد. قبل از اقـدام به پـرداخـت می بایسـت در سـایـت عـضـو شـده و وارد سـایـت شـده باشیـد</p>
  <?php if(!$cartrow):?>
    <div class="msgInfo"><span>!تـوجـه</span>! بـا عـرض پـوزش سـبـد خـریـد شمـا خـالـی اسـت</div>
    <?php else:?>
    <div class="box">
      <div id="process-checkout">
        <table cellpadding="0" cellspacing="0" class="display">
          <thead>
            <tr>
              <th width="20" class="left">#</th>
              <th class="right">نـام محصـول</th>
              <th class="right">قیمـت محصـول</th>
              <th align="center">تـعـداد</th>
              <th align="center">قیمـت کـل</th>
              <th width="25">&nbsp;</th>
            </tr>
          </thead>
          <tbody>
            <?php $i = 0;?>
            <?php foreach ($cartrow as $ccrow): ?>
            <?php $i++;;?>
            <tr>
              <th><?php echo $i;?>.</th>
              <td><?php echo $ccrow['title'];?></td>
              <td><?php echo $core->formatMoney($ccrow['price']);?></td>
              <td align="center"><?php echo $ccrow['total'];?></td>
              <td align="center"><?php echo $core->formatMoney($ccrow['total'] * $ccrow['price']);?></td>
              <td><a href="javascript:void(0);" class="del-cart-full" id="item_<?php echo $ccrow['pid'];?>"><img src="<?php echo SITEURL;?>/images/del.png" alt=""/></a></td>
            </tr>
            <?php endforeach;?>
            <?php unset($ccrow);?>
            <tr>
              <td colspan="4" align="left" valign="top"><strong>
                <?php if($totalrow['coupon'] !=0):?>
                تخفـیف :&nbsp;&nbsp;&nbsp;&nbsp;<br />
                <?php endif;?>
                جـمـع :&nbsp;&nbsp;&nbsp;&nbsp;<br />
                </strong></td>
              <td align="center" valign="top"><strong>
                <?php if($totalrow['coupon'] !=0):?>
                - <?php echo $core->formatMoney($totalrow['coupon']);?><br />
                <?php endif;?>
                <?php echo $core->formatMoney($discount);?><br />
                </strong></td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td colspan="4" align="left" valign="top"><strong style="color:#F00">جـمـع کـل :&nbsp;&nbsp;&nbsp;&nbsp;</strong></td>
              <td align="center" valign="top"><strong style="color:#F00"><?php echo $core->formatMoney($discount);?></strong></td>
              <td>&nbsp;</td>
            </tr>
          </tbody>
        </table>
      </div>
      <table cellpadding="0" cellspacing="0" class="display">
        <tfoot>
          <tr>
            <td colspan="2" align="center"><a href="<?php echo SITEURL;?>/summary.php" class="button-sml">ادامـه پـرداخـت نـهـائـی</a></td>
          </tr>
        </tfoot>
        <tbody>
          <tr>
            <td width="150" align="left">کـد تخفـیف :</td>
            <td align="right"><input name="coupon" type="text" id="discount" class="inputbox-sml"/>
              <a href="javascript:void(0);" id="verify-code"><strong>بـررسـی</strong></a> <span id="totaldiscount"></span></td>
          </tr>
        </tbody>
      </table>
  </div>
<?php endif;?>
<?php include("footer.php");?>