element('tipbox', array('tip'=>
"You can add a new Contact to an Existing Customer while creating the enquiry. If the Contact you want to assign to the enquiry
doesn't appear in the drop down list, click 'New Contact'")); ?>
create('Enquiry');?>
';
echo 'Start typing the Company name and it should appear in a list below. It must already exist in the database ';
echo $form->label('Customer.name', 'Company Name');
echo $ajax->autoComplete('Customer.name', '/enquiries/completeCustomer');
echo ' ';
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('user_id', array('label' =>'Assigned to User'), $users);
echo '';
echo $form->input('contact_id', array('div' => false));
echo ' ';
echo $ajax->link('New Contact', array('controller' => 'contacts', 'action' => 'add_one',$customer['Customer']['id']), array('update'=>'contact'));
echo $html->image('contact-new.png');
echo '
';
echo 'The Contact will be emailed informing them of the new Enquiry ';
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', array('maxlength' => '250000'));
echo $form->input('customer_id', array('type'=>'hidden', 'value' => $customer['Customer']['id']));
echo $form->input('finished', array('type' => 'hidden', 'value' => 'true'));
echo $form->input('step', array('type'=>'hidden', 'value' => $step));
echo $form->input('billing_address_id', array('div' => 'addressradio', 'legend' => 'Billing Address', 'options' => $billing_addresses_list, 'type' => 'radio'));
echo $form->input('shipping_address_id', array('div' => 'addressradio','legend' => 'Shipping Address', 'options' => $shipping_addresses_list, 'type' => 'radio'));
echo $form->input('send_enquiry_email', array('label' => 'Send the Contact an Enquiry Confirmation Email', 'type' => 'select', 'selected' => 1, 'options' => array(1 => 'Yes', 0 => 'No')));
echo $form->end('Add Enquiry');
echo 'After submitting it will take a moment to email the customer, if you selected the checkbox above, before you are redirected to the new Enquiry. ';
}
?>
link(__('New Customer', true), array('controller'=> 'customers', 'action'=>'add')); ?>