<!-- Progress Bar -->
<?php echo $this->progressBar;?>

<!-- Cart Summary -->
<?php echo $this->cartSummary;?>

<!-- Main Page -->
<div style="margin-right:220px; margin-bottom:20px;">
    <form action="<?php echo $this->nextUrl;?>" method="POST">
    <input type="hidden" name="productGroup" value="<?php echo $this->productGroup;?>">
    <input type="hidden" name="product" value="<?php echo $this->product;?>">
    <input type="hidden" name="formId" value="packageSelect">

    <?php if($this->packageCount > 0) { ?>

        <div style="border:2px solid #ddd; background:#f6f6f6; padding:15px; margin-bottom:20px;-moz-border-radius: 5px;-webkit-border-radius: 5px;">
            <?php if($this->dropdownCount > 1) { ?>
                <?php echo $this->lang('Choose Product');?>: <select name="product" onchange = "window.location.href='order.php?step=1&productGroup=<?php echo $this->productGroup;?>&product='+this.options[this.selectedIndex].value">
                  <?php foreach($this->packages AS $package) { ?>
                    <?php if(!$package['showDropdown']) { continue; } ?>
                    <option value="<?php echo $package['id'];?>" <?php if($package['selected']){ echo "selected";}?>><?php echo $package['planname'];?></option>
                  <?php } //end foreach ?>
                </select>
                <br><br>
            <?php } ?>
            <h3><?php echo $this->planname;?></h3>
            <br>
            <div id="productDesc">
            	<?php echo $this->description;?>
            </div>
        </div>

        <?php if($this->stockLevel > 0) { ?>
           <div style='border:1px solid #efefbb; background:#FEFFED; font-weight:bold; margin-bottom:20px; padding:10px;-moz-border-radius: 5px;-webkit-border-radius: 5px;'><?php echo $this->lang('Stock Level');?>: <?php echo $this->stockLevel;?></div>
        <?php } elseif($this->stockLevel == 0 && $this->stockControl == 0) { ?>
           <div style='border:1px solid #900; background:#ffeded; color:#900; font-weight:bold; margin-bottom:20px; padding:10px;-moz-border-radius: 5px;-webkit-border-radius: 5px;'><?php echo $this->lang('This product is sold out and there may be a delay in processing your order!');?></div>
        <?php } elseif($this->stockLevel == 0 && $this->stockControl == 1) { ?>
           <div style='border:1px solid #900; background:#ffeded; color:#900; font-weight:bold; margin-bottom:20px; padding:10px;-moz-border-radius: 5px;-webkit-border-radius: 5px;'><?php echo $this->lang('This product is sold out and no new orders are being accepted!');?></div>
        <?php } ?>

        <table class="ts2" cellspacing="0">
          <tr style="background:#E8F3F8;">
            <td>&nbsp;</td>
            <td><strong><?php echo $this->lang('Term Length');?></strong></td>
            <td><strong><?php echo $this->lang('Price Per Term');?></strong></td>
            <td><strong><?php echo $this->lang('Setup Fee');?></strong></td>
            <td><strong><?php if($this->showSaved) { echo $this->lang("You Save");}?></strong></td>
          </tr>
       <?php foreach($this->pricing AS $price) { ?>
          <tr>
            <td><input name="priceTerm" type="radio" value="<?php echo $price['termId'];?>" <?php if($this->stockControl == 0 && $price['selected']) { echo "checked";} elseif($this->stockControl == 1){ echo "disabled";}?> /></td>
            <td><?php echo $price['term'];?></td>
            <td><?php echo $price['price'];?></td>
            <td><?php echo $price['setup'];?></td>
            <td><?php if($this->showSaved) { echo $price['save'];}?></td>
          </tr>
       <?php } //end foreach ?>

       <?php if(!$this->validPricing) { ?>
          <tr>
            <td align="center" colspan="5" style="font-weight:bold; color:#900;"><?php echo $this->lang("There are no valid pricing terms for this product.");?></td>
          </tr>
       <?php } //end if ?>
        </table>

       <?php if($this->validPricing && $this->stockControl == 0) { ?>
         <input class="submit" type="submit" value="<?php echo $this->lang('Continue');?> &raquo;" />
       <?php } //end if ?>

   <?php } else { ?>

    <div style='border:1px solid #900; background:#ffeded; color:#900; font-weight:bold; margin-bottom:20px; padding:10px;-moz-border-radius: 5px;-webkit-border-radius: 5px;'><?php echo $this->lang("An Invalid Product was Specified");?></div>

   <?php } ?>

</form>

</div>

<div class="clear"></div>