//'enableAjaxValidation'=>true,
	//'clientOptions'=>array('validateOnSubmit'=>true),
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php // echo $form->errorSummary($model); ?>

	<div class="block-error">
		<?php echo Yii::app()->user->getFlash('not-select-attendece'); ?>
	</div>
	<div class="row">
		<?php 
			$org_id = Yii::app()->user->getState('org_id');
			$emp_id = $model->employee_id;
			$leave_data = EmployeeLeaveMaster::model()->findAll('empid = '.$emp_id);
			$leave = array();
			$ap = array();			
			?>
		<?php echo $form->labelEx($model,'attendence'); ?>
		<?php echo $form->dropDownList($model,'attendence',array("P"=>"Present","LWP"=>"Absent")); ?>
		<span class="status">&nbsp;</span> 
		<?php echo $form->error($model,'attendence'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'time1'); ?>
		<?php
		 $this->widget('application.extensions.jui_timepicker.JTimePicker', array(
		    'model'=>$model,
		     'attribute'=>'time1',
		     // additional javascript options for the date picker plugin
 public function beforeDelete()
 {
     $id = $this->employee_transaction_id;
     $emp_leave = EmployeeLeaveMaster::model()->findAll(array('condition' => 'empid=' . $id));
     $att_check = Attendence::model()->findAll(array('condition' => 'employee_id=' . $id));
     $emp_att = Employee_attendence::model()->findAll(array('condition' => 'employee_id=' . $id));
     $emp_leave_app = EmployeeLeaveApplication::model()->findAll(array('condition' => 'employee_leave_application_employee_code=' . $id . ' OR employee_leave_application_approved_by_code=' . $id . ' OR employee_leave_application_approved_by_code_2=' . $id));
     $emp_rep = EmployeeReportingTable::model()->findAll(array('condition' => 'emp_reporting_table_user_id=' . $id . ' OR emp_reporting_table_reporting_level_1=' . $id . ' OR emp_reporting_table_reporting_level_2=' . $id));
     $emp_sal = EmployeeSalaryStructure::model()->findAll(array('condition' => 'employee_id=' . $id));
     $ass_sub = AssignSubject::model()->findAll(array('condition' => 'subject_faculty_id=' . $id));
     $time_table = TimeTableDetail::model()->findAll(array('condition' => 'faculty_emp_id=' . $id));
     if (!empty($emp_leave) || !empty($att_check) || !empty($emp_att) || !empty($emp_leave_app) || !empty($emp_rep) || !empty($emp_sal) || !empty($ass_sub) || !empty($time_table)) {
         Yii::app()->user->setFlash('error', "You can not delete this record because it is used in another table.");
         return false;
     } else {
         Yii::app()->user->setFlash('success', "Deleted Sucessfully");
         return true;
     }
 }