<div class="quoteProducts form">
<?php echo $form->create('QuoteProduct');?>
	<fieldset>
 		<legend><?php __('Add Product to this Quote');?></legend>
<?php

		echo $form->input('quote_id', array('type' => 'hidden', 'value' => $quote['Quote']['id']));


                echo $form->input('quantity', array('class' => 'required validate-number', 'title'=>'Please enter the quantity. It must be a number'));

                echo $form->input('option', array('label' => 'This item is optional'));

                echo $form->input('principle_id', array('empty' => 'Select a Principle'));
		echo $ajax->observeField('QuoteProductPrincipleId', array(
									'url' => 'principle_products',
									'frequency' => 0.2,
									'update' => 'products'
								));


		echo $form->input('product_id', array('type' => 'select', 'id'=>'products'));

                
		
		echo $ajax->observeField('products', array(

									'url' => 'product_options',
									'frequency' => 0.2,
									'update' => 'productoptions'
								));


		echo $ajax->div('productoptions');
		echo $ajax->divEnd('productoptions');


                echo $form->input('unit_price');

		//echo '<div id="productoptions"></div>';
		//echo $form->select('QuoteProduct.product_id', null, null, array('id'=>'products'));
		 //*/
		
/*
		echo $form->input('item_number');
		echo $form->input('option');
		echo $form->input('quantity');
		echo $form->input('cost_price');
		echo $form->input('currency_id');
		echo $form->input('our_discount');
		echo $form->input('packing');
		echo $form->input('shipping_weight');
		echo $form->input('shipping_cost');
		echo $form->input('exchange_rate');
		echo $form->input('duty');
		echo $form->input('finance');
		echo $form->input('misc');
		echo $form->input('gross_sell_price');
		echo $form->input('target_gp');
		echo $form->input('title');
		echo $form->input('description');
		echo $form->input('quote_id');
		echo $form->input('product_id');
		echo $form->input('discount');
 */

?>
	</fieldset>
<?php echo $form->end('Submit');
    echo $javascript->codeBlock("new Validation('QuoteProductAddForm', {immediate : true, useTitles : true});", array('allowCache'=>true, 'safe'=>false));


?>
</div>
<div class="actions">
	<ul>
		<li><?php echo $html->link(__('List QuoteProducts', true), array('action' => 'index'));?></li>
		<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
		<li><?php echo $html->link(__('List Quotes', true), array('controller' => 'quotes', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Quote', true), array('controller' => 'quotes', 'action' => 'add')); ?> </li>
		<li><?php echo $html->link(__('List Products', true), array('controller' => 'products', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Product', true), array('controller' => 'products', 'action' => 'add')); ?> </li>
	</ul>
</div>
