<?php
echo form_open('employees/check_report_password/'.$person_info->person_id,array('id'=>'employee_form'));
?>
<?php
$password_label_attributes = array('class'=>'required','style'=>'font-weight:bold;width: 98px;');
?>

<div class="field_row clearfix" style="padding-top:50px;">	
<?php echo form_label($this->lang->line('employees_password').':', 'password_shawpon',$password_label_attributes); ?>
	<div class='form_field'>
	<?php echo form_password(array(
		'name'=>'password_shawpon',
		'id'=>'password_shawpon',
		'autocomplete'=>'new-password'
	),'',' size="50" style="border: 1px solid #FF0000;"');?>
	</div>
</div>

<div class="field_row clearfix" style="text-align: center;">
<?php
echo form_submit(array(
	'name'=>'submit',
	'id'=>'submit',
	'value'=>"SET REPORT PASSWORD",
	'class'=>'button_thickbox button_thickbox_blue')
);

?>
</div>
<?php 
echo form_close();
?>
<script type='text/javascript'>

//validation and submit handling
$(document).ready(function()
{
	$('#employee_form').validate({
		submitHandler:function(form)
		{
			$(form).ajaxSubmit({
			success:function(response)
			{
				tb_remove();
				post_person_form_submit(response);
			},
			dataType:'json'
		});

		},
		errorLabelContainer: "#error_message_box",
 		wrapper: "li",
		rules: 
		{
			username:
			{
				required:true,
				//minlength: 5
			},
			
			old_password:
			{
				required:true,
				//minlength: 8
			},
			password:
			{
				required:true,
				//minlength: 8
			},
			password_shawpon:
			{
				required:true,
				//minlength: 8
			},	
			repeat_password:
			{
 				equalTo: "#password"
			}
   		},
		messages: 
		{
     		username:
     		{
     			required: "<?php echo $this->lang->line('employees_username_required'); ?>",
     			minlength: "<?php echo $this->lang->line('employees_username_minlength'); ?>"
     		},
     		
			old_password:
			{
				required:"<?php echo $this->lang->line('employees_old_password_required'); ?>",
			},
			password:
			{
				required:"<?php echo $this->lang->line('employees_password_required'); ?>",
				minlength: "<?php echo $this->lang->line('employees_password_minlength'); ?>"
			},
			password_shawpon:
			{
				required:"<?php echo $this->lang->line('employees_password_required'); ?>",
			},
			repeat_password:
			{
				equalTo: "<?php echo $this->lang->line('employees_password_must_match'); ?>"
     		}
		}
	});
});
</script>