<div class="enquiries form">
<?php echo $form->create('Enquiry');?>
	<fieldset>
 		<legend><?php __("New Enquiry: Step $step");?></legend>
	<?php
		
		if($step == 1) {
			echo '<div class="input text">';
			echo '<span>Start typing the Company name and it should appear in a list below. It must already exist in the database</span>';
			echo $form->label('Customer.name', 'Company Name');
			echo $ajax->autoComplete('Customer.name', '/enquiries/completeCustomer');
			echo '</div>';
			echo $form->input('step', array('type'=>'hidden', 'value' => $step));
			echo $form->input('finished', array('type' => 'hidden', 'value' => 'false'));
			echo $form->end('Proceed to Step 2');
		}
		else {
		
		//echo $form->select('Contact.id', array(), null, array('id'=>'contacts'));
		echo $form->input('Customer.name', array('readonly'=>'readonly', 'value'=>$customer['Customer']['name']));
		echo $form->input('contact_id');
		echo $form->input('state_id');
		echo $form->input('country_id');
		echo $form->input('gst', array('label' => 'Is GST Applicable', 'options' => array('1' => 'Yes', '0' => 'No')));
		echo $form->input('principle_id');
		echo $form->input('status_id');
		echo $form->input('comments');
		echo $form->input('customer_id', array('type'=>'hidden', 'value' => $customer['Customer']['id']));
		echo $form->input('finished', array('type' => 'hidden', 'value' => 'true'));
		echo $form->input('user_id', array('type' => 'hidden', 'value' => $user_id));
		echo $form->input('step', array('type'=>'hidden', 'value' => $step));
		echo $form->end('Submit');
		
		}
	?>
	</fieldset>

</div>
<div class="actions">
	<ul>
		<li><?php echo $html->link(__('New Customer', true), array('controller'=> 'customers', 'action'=>'add')); ?> </li>
	</ul>
</div>

