<?=$javascript->link('add_edit_user_ajax');?>

<div class="users form">
    <?php echo $form->create('User',array('action'=>'add_user'));?>
    <?php

    echo $form->input('first_name');
    echo $form->input('last_name');
    echo $form->input('email');
    echo $form->input('job_title');
    echo $form->input('phone');
    echo $form->input('phone_extension');
    echo $form->input('mobile');
    echo $form->input('fax');

    echo $form->input('direct_phone');
    echo $form->input('notes');


    switch($type) {
	case 'contact':
	    echo $form->input('customer_id', array('type'=>'hidden', 'value'=>$customer_id));
	    echo $form->input('type', array('type'=>'hidden', 'value'=>'contact'));
	    $buttonStr = 'Contact';
	    break;

	case 'principle':
	    echo $form->input('principle_id', array('type'=>'hidden', 'value'=>$principle_id));
	    $buttonStr = 'Principle Contact';

	case 'user':
	    $buttonStr = 'User';
	    break;

	default:
	    break;
    }

    switch($action) {
	case 'add':
	    $actionStr = 'Add';
	    break;

	case 'edit':
	    $actionStr ='Edit';
	    echo $form->input('id', array('type'=>'hidden', 'value'=>$user_id));

	    break;


    }


    echo $form->submit($actionStr.' '.$buttonStr, array('id'=>'submitUserButton'));


    ?>
</div>
