<div class="unittype-wrapper" style="display:none">    
            <?php 
//echo $form->textFieldControlGroup($model,'sub_quantity',array('class'=>'span2','prepend'=>'$'));
?>
        </div>
        
        <?php 
echo $form->dropDownListControlGroup($model, 'currency_code', CurrencyType::model()->getCurrencyCode(), array('class' => 'span3'));
?>
        
        <?php 
echo $form->textFieldControlGroup($model, 'cost_price', array('class' => 'span3'));
?>
        
        <?php 
echo $form->dropDownListControlGroup($model, 'profit_margin_id', ProfitMargin::model()->getProfitMargin(), array('class' => 'span3', 'empty' => '-- Select Profit Margin --', 'data-url' => Yii::app()->createUrl('item/f5pricetier')));
?>

	    <?php 
//echo $form->textFieldControlGroup($model,'unit_price',array('class'=>'span3'));
?>
        
        <div id="pricetier_cart">
            <?php 
foreach ($price_tiers as $i => $price_tier) {
    ?>
                <div class="form-group">
                    <?php 
    echo CHtml::label($price_tier["tier_name"], $i, array('class' => 'col-sm-3 control-label no-padding-right'));
    ?>
                    <div class="col-sm-9">
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return ProfitMargin the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = ProfitMargin::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }