예제 #1
0
 public function actionAutoCompleteLookup()
 {
     if (Yii::app()->request->isAjaxRequest && isset($_GET['q'])) {
         /* q is the default GET variable name that is used by
            / the autocomplete widget to pass in user input
            */
         $org = Yii::app()->user->getState('org_id');
         $name = $_GET['q'];
         // this was set with the "max" attribute of the CAutoComplete widget
         $limit = min($_GET['limit'], 50);
         $userArray = EmployeeInfo::model()->findAll(array('condition' => 't.employee_first_name LIKE :name and employee_info_transaction_id IN(select employee_transaction_id from employee_transaction where employee_transaction_organization_id =' . $org . ')', 'params' => array(':name' => "%{$name}%")));
         $returnVal = '';
         foreach ($userArray as $userAccount) {
             $returnVal .= $userAccount->getAttribute('employee_first_name') . " " . $userAccount->getAttribute('employee_middle_name') . " " . $userAccount->getAttribute('employee_last_name') . '|' . $userAccount->getAttribute('employee_info_transaction_id') . "\n";
         }
         echo $returnVal;
     }
 }
예제 #2
0
		$params = array(
			':timetable_id' => $timetableid,
			':div_id'=>$stud_model->student_transaction_division_id,
			':start'=>date('Y-m-d',strtotime($alldate[0])),
			':end'=>date('Y-m-d',strtotime($alldate[5])),
			':proxy'=>1,
			));
	$n = 0; 
   foreach($proxy_data as $list) {
	$result = TimeTableDetail::model()->findByPk($list->proxy_id);
?>

<tr>
<td><?php echo ++$n; ?></td>
<td><?php echo EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id'=>$list->faculty_emp_id))->employee_first_name; ?></td>
<td><?php echo EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id'=>$result->faculty_emp_id))->employee_first_name; ?></td>
<td><?php echo SubjectMaster::model()->findByPk($result->subject_id)->subject_master_alias; ?></td>
<td><?php echo $result->lec; ?></td>
<td><?php echo date('d-m-Y',strtotime($result->lecture_date)); ?></td>
</tr>
<?php } ?>
</table></div>
<?php
	}

	   }
	}//if $_REQUEST['student_id'] end
	else
	{
		echo CHtml::link('GO BACK',Yii::app()->createUrl('/site/newdashboard')); 
		echo "No student Login";
  margin:auto;
}
@media print {
.certificate_main{
  border:none !important;
  padding-top:50px;
}
}
</style>
</head>
<title><?php echo Certificate::model()->findByPk($certificate_type)->certificate_title;?>
</title>
<body>

<?php
$emp_info = EmployeeInfo::model()->findByAttributes(array('employee_attendance_card_id'=>$attendence_no));
	
if(!empty($_REQUEST['empid']))
{
echo CHtml::link('GO BACK', array('/employee/employeeTransaction/employeeCertificates','id'=>$_REQUEST['empid']),array('id'=>'printid1'));
}
else {
echo CHtml::link('GO BACK',array('certificate/EmployeeCertificategeneration'),array('id'=>'printid1'));
echo CHtml::button('Save',array('id'=>'printid1','class'=>'submit','submit' => array('certificate/SaveEmployeeCertificatedata','emp_id'=>$emp_info->employee_info_transaction_id,'ctype'=>$certificate_type)));
}

?>
<button style='margin-left:50px;' class='submit' onclick="javascript:window.print()" id="printid1" class="submit">Print</button>
<?php
if($emp_info)
{
예제 #4
0
	<?php	
	$i=1;
	$m=1;  
	foreach($list as $value)
	  {	
		if(($m%2) == 0)
		{
		  $class = "odd";
		}
		else
		{
		  $class = "even";
		}?>
	<tr class="<?php echo $class;?>">
	<?php echo '<input type="hidden" name="result[]" value="'. $value. '">';
	$info= EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id'=>$value));?>
	<td class="col2"> <?php echo $i ;?></td>
	<td class="col2"><?php echo $info->employee_first_name." ".$info->employee_last_name;?></td>
	<td class="col2"><?php echo $info->employee_attendance_card_id;?></td>
</tr>

<?php	
	$i++;$m++;}

?>

</table>
</div></div></br>
<div class="portlet box blue" style="margin-top:20px;">
<i class="icon-reorder"></i>
 <div class="portlet-title"><span class="box-title">Fill Details</span>
예제 #5
0
                      <li class="activetab"><a href="#tab1" id="personal-tab">Profile</a></li>
                      <li><a href="#tab2" id="guardian-tab">Guardian Info</a></li>
                      <li><a href="#tab3" id="other-tab">Other Info</a></li>
                      <li><a href="#tab4" id="add-tab">Address Info</a></li>
                      <li><a href="#tab5">Documents</a></li>
                      <li><a href="#tab6">Cetificates</a></li>
                      <!--li><a href="#tab7">Qualification</a></li-->
                    </ul><div class="clear-div"></div>  
                </div>
                <div id="tab1" class="tab-content active">
                    <div class="content-box-border">
                        <div class="content-bg-he">Profile</div>
                        <div class="content-bg-inner">
                            <div class="content-bg-inner-one">
				<?php
			$info = EmployeeInfo::model()->findByPk($empInfo->employee_transaction_employee_id); 
				?>
                                <table width="100%" cellpadding="0" cellspacing="0">
                                  <tr>
                                    <td class="table-cell-title" width="23%">Employee No</td>
                                    <td class="table-cell-content" width="23%"><?php echo (!empty($empInfo->Rel_Emp_Info->employee_no) ? $empInfo->Rel_Emp_Info->employee_no : "Not Set");?></td>
                                    <td class="table-cell-title" width="23%">Employee Unique Id</td>
                                    <td class="table-cell-content" width="23%"><?php echo (!empty($info->employee_unique_id) ? $info->employee_unique_id : "Not Set");?></td>
                                  </tr>
                                  <tr>
                                    <td class="table-cell-title">Name Alias</td>
                                    <td class="table-cell-content"><?php echo (!empty($info->employee_name_alias) ? $info->employee_name_alias : "Not Set");?></td>
                                    <td class="table-cell-title">Private Email </td>
                                    <td class="table-cell-content"><?php echo (!empty($info->employee_private_email) ? $info->employee_private_email : "Not Set");?></td>
                                  </tr>
                                  <tr>
	public function actionDoChacked(){
		$model=new EmployeeSmsEmailDetails;
		$model->scenario='selectedsms';
		Yii::app()->clientScript->registerScript("message-script", "
		$(document).ready(function() {
		$('input.radio').bind('change', function (){
		    if($(this).val()=='1')
			$('#EmployeeSmsEmailDetails_message_email_text').attr('maxlength','160');
		    else
			 $('#EmployeeSmsEmailDetails_message_email_text').attr('maxlength','');
		});
		});
		", CClientScript::POS_END);
		$this->performAjaxValidation($model);
		if(isset($_POST['EmployeeSmsEmailDetails'])) {
		   $model->attributes=$_POST['EmployeeSmsEmailDetails'];
		    $emp_ids = $_POST['result']; 
		   foreach ($emp_ids as $item) {
			$num_list[]=EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id'=>$item))->employee_private_mobile;
			$email_list[]=EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id'=>$item))->employee_private_email;
		   }		

		$message=$model->message_email_text;
		$sms_email_status=$model->email_sms_status;

		if($sms_email_status==1)
		{
			$output = implode(",",$num_list);	
			$smsobj=new SmsApi;
			$r=$smsobj->sendsms($output,$message);
			if(preg_match('/SMS/',$r))
   			{
				echo 'Message sucessfully sent';
				$i=0;
				foreach($emp_ids as $item)
				{			
					$model->employee_sms_email_id=null;				
					$model->employee_id = $item;	
					$model->created_by = Yii::app()->user->id;
					$model->creation_date = new CDbExpression('NOW()');
					$tran=EmployeeTransaction::model()->findByPk($item);
					$department=$tran->employee_transaction_department_id;
					$model->department_id=$department;
					$model->employee_sms_email_details_ack_id="sent";
					$model->setIsNewRecord(true);
					$model->save(false);
					$i++;
				}
			$this->redirect(array('admin'));	
			}
			else
			{
				$this->render('error_form');
	
			}
		}
		if($sms_email_status==2)
		{
				$mailobj=new MailApi;
				$to = implode(",",$email_list);
				
				$mailobj->sendmail($to,$message);

				foreach($emp_ids as $item)
				{
					$model->employee_sms_email_id=null;
					$model->employee_id = $item;	
					$model->created_by = Yii::app()->user->id;
					$model->creation_date = new CDbExpression('NOW()');
					$tran=EmployeeTransaction::model()->findByPk($item);
					$department=$tran->employee_transaction_department_id;
					$model->department_id=$department;
					
					$model->setIsNewRecord(true);

					$model->save(false);
				}
			$this->redirect(array('admin'));	

			}
		}
		else {
		
		  if(!empty($_POST['selectedempid'])) 
		   {
		     $emp_data =explode(',', $_POST['selectedempid']);		
		     $this->render('message_form',array('list'=>$emp_data,'model'=>$model));
	 	   }
		   else {
		   	$this->redirect(array('employeebulksmsemail'));	
		   }
		}
        }	
예제 #7
0
Yii::app()->clientScript->registerScript(
  'myHideEffect',
  '$(".flash-error").animate({opacity: 1.0}, 2000).fadeOut("slow");',
CClientScript::POS_READY
);
?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>
<?php
if(Yii::app()->user->hasFlash('photo-save')) { ?>
	<div class="flash-error">
		<?php echo Yii::app()->user->getFlash('photo-save');?>	
	</div>
<?php } ?>
<?php 
		$emp_roll_no = EmployeeInfo::model()->findAll();
		$empno='';
		if(Yii::app()->controller->action->id=='create')
		{
			if(empty($emp_roll_no))
			{
			$empno=$info->employee_unique_id=1;
			}
			else
			{
				foreach($emp_roll_no as $s)
				{
		            		$emp[]=$s['employee_unique_id'];
					$empno=MAX($emp)+1;
				}			
			}
예제 #8
0
				}
			   }

			   print '<table id="time-table-struc" style="font-size:10px;">';
			   print '<tr>';
			   print '<th>Lecture No.</th>';
			   print '<th>Subject</th>';
			   print '<th>Faculty Name</th>';
			   print '<th>Room No.</th>';
			   print '<th>Time</th>';
			   foreach($check_timetable as $list) {
			   if($list->subject_type != 1 && $list->batch_id !=$stud_model->student_transaction_batch_id)
			   {
				continue;
			   }

			   print '<tr>';
			   print '<td>'.$list->lec.'</td>';	
			   print '<td>'.SubjectMaster::model()->findByPk($list->subject_id)->subject_master_alias.'</td>';	
			   print '<td>'.EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id'=>$list->faculty_emp_id))->employee_first_name.'</td>';	

			   print '<td>'.RoomDetailsMaster::model()->findByPk($list->room_id)->room_name.'</td>';	
			   print '<td>'.$time[$list->lec].'</td></tr>';			
			
	          	   }
		print '</table>';?>
</div>
</div>
</div>
<?php } ?>
 protected function renderContent()
 {
     $current_date = date('Y-m-d');
     if (Yii::app()->user->getState('stud_id')) {
         $criteria = new CDbCriteria();
         //$criteria->select = 'academic_term_id'; // select fields which you want in output
         $criteria->condition = 'current_sem = 1 AND academic_term_organization_id = ' . Yii::app()->user->getState('org_id');
         $semname = AcademicTerm::model()->findAll($criteria);
         $data = CHtml::listData($semname, 'academic_term_id', 'academic_term_id');
         $stud_model = StudentTransaction::model()->findByPk(Yii::app()->user->getState('stud_id'));
         $check_sem = in_array($stud_model->student_academic_term_name_id, $data);
         $timetableid = 0;
         if (!$check_sem) {
             echo "<h3 align=center style=color:red>Sorry, No timetable available for this student.</h3>";
         } else {
             $check_timetable = TimeTableDetail::model()->findAllByAttributes(array('acdm_name_id' => $stud_model->student_academic_term_name_id, 'division_id' => $stud_model->student_transaction_division_id, 'lecture_date' => $current_date), 'proxy_status <> :status', array(':status' => 1));
             if (empty($check_timetable)) {
                 echo "<h3 align=center style=color:red>Sorry, No timetable available for this student.</h3>";
             } else {
                 $timetable = TimeTable::model()->findByPk($check_timetable[0]->timetable_id);
                 $time1 = date('H:i A', strtotime($timetable['clg_start_time']));
                 if ($timetable->zero_lec == 1) {
                     $time[] = $time1;
                 } else {
                     $time[1] = $time1;
                 }
                 $lec_dur = LecDuration::model()->findAll(array('condition' => 'timetable_id=' . $timetable['timetable_id']));
                 foreach ($lec_dur as $list) {
                     $break = NoOfBreakTable::model()->findByAttributes(array('after_lec_break' => $list['lecture'], 'timetable_id' => $timetable['timetable_id']));
                     if ($break) {
                         $dur1 = date('i', strtotime($break['duration']));
                         $timestamp = strtotime($time1) + 60 * $dur1;
                         $time1 = date('g:i A', $timestamp);
                         $timestamp = strtotime($time1) + 60 * $list['duration'];
                         $time1 = date('g:i A', $timestamp);
                         $time[] = $time1;
                     } else {
                         $timestamp = strtotime($time1) + 60 * $list['duration'];
                         $time1 = date('g:i A', $timestamp);
                         $time[] = $time1;
                     }
                 }
                 print '<table id="time-table-struc" style="font-size:10px;">';
                 print '<tr>';
                 print '<th>Lecture No.</th>';
                 print '<th>Subject</th>';
                 print '<th>Faculty Name</th>';
                 print '<th>Room No.</th>';
                 print '<th>Time</th>';
                 foreach ($check_timetable as $list) {
                     if ($list->subject_type != 1 && $list->batch_id != $stud_model->student_transaction_batch_id) {
                         continue;
                     }
                     print '<tr>';
                     print '<td>' . $list->lec . '</td>';
                     print '<td>' . SubjectMaster::model()->findByPk($list->subject_id)->subject_master_alias . '</td>';
                     print '<td>' . EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id' => $list->faculty_emp_id))->employee_first_name . '</td>';
                     print '<td>' . RoomDetailsMaster::model()->findByPk($list->room_id)->room_name . '</td>';
                     print '<td>' . $time[$list->lec] . '</td></tr>';
                 }
                 print '</table>';
             }
         }
     } else {
         if (Yii::app()->user->getState('emp_id')) {
             $criteria = new CDbCriteria();
             //$criteria->select = 'academic_term_id';
             $criteria->condition = 'current_sem = 1 AND academic_term_organization_id = ' . Yii::app()->user->getState('org_id');
             $semname = AcademicTerm::model()->findAll($criteria);
             $data = CHtml::listData($semname, 'academic_term_id', 'academic_term_id');
             $data_arr = implode(',', $data);
             $timetable_criteria = new CDbCriteria();
             $timetable_criteria->condition = 'acdm_name_id in (' . $data_arr . ') AND faculty_emp_id = ' . Yii::app()->user->getState('emp_id') . ' AND lecture_date = "' . date('Y-m-d') . '"';
             $time_table_details = TimeTableDetail::model()->findAll($timetable_criteria);
             if ($time_table_details) {
                 $timetable = TimeTable::model()->findByPk($time_table_details[0]->timetable_id);
                 $time1 = date('H:i A', strtotime($timetable['clg_start_time']));
                 if ($timetable->zero_lec == 1) {
                     $time[] = $time1;
                 } else {
                     $time[1] = $time1;
                 }
                 $lec_dur = LecDuration::model()->findAll(array('condition' => 'timetable_id=' . $timetable['timetable_id']));
                 foreach ($lec_dur as $list) {
                     $break = NoOfBreakTable::model()->findByAttributes(array('after_lec_break' => $list['lecture'], 'timetable_id' => $timetable['timetable_id']));
                     if ($break) {
                         $dur1 = date('i', strtotime($break['duration']));
                         $timestamp = strtotime($time1) + 60 * $dur1;
                         $time1 = date('g:i A', $timestamp);
                         $timestamp = strtotime($time1) + 60 * $list['duration'];
                         $time1 = date('g:i A', $timestamp);
                         $time[] = $time1;
                     } else {
                         $timestamp = strtotime($time1) + 60 * $list['duration'];
                         $time1 = date('g:i A', $timestamp);
                         $time[] = $time1;
                     }
                 }
                 print '<table id="time-table-struc" style="font-size:10px;">';
                 print '<tr>';
                 print '<th>Lecture No.</th>';
                 print '<th>Branch</th>';
                 print '<th>Sem</th>';
                 print '<th>Division</th>';
                 print '<th>Subject</th>';
                 print '<th>Room No.</th>';
                 print '<th>Time</th>';
                 foreach ($time_table_details as $list) {
                     print '<tr>';
                     print '<td>' . $list->lec . '</td>';
                     print '<td>' . Branch::model()->findByPk($list->branch_id)->branch_name . '</td>';
                     print '<td>' . AcademicTerm::model()->findByPk($list->acdm_name_id)->academic_term_name . '</td>';
                     print '<td>' . Division::model()->findByPk($list->division_id)->division_code . '</td>';
                     print '<td>' . SubjectMaster::model()->findByPk($list->subject_id)->subject_master_alias . '</td>';
                     print '<td>' . RoomDetailsMaster::model()->findByPk($list->room_id)->room_name . '</td>';
                     print '<td>' . $time[$list->lec] . '</td></tr>';
                 }
                 print '</table>';
             } else {
                 echo "<h3 align=center style=color:red>Sorry, No timetable available.</h3>";
             }
         }
     }
 }
예제 #10
0
//	array('label'=>'','url'=>array('index')),
	array('label'=>'','url'=>array('create'),'linkOptions'=>array('class'=>'Create','title'=>'Create')),
	array('label'=>'','url'=>array('update','id'=>$model->employee_certificate_details_table_id),'linkOptions'=>array('class'=>'Edit','title'=>'Update')),
	array('label'=>'','url'=>'#','linkOptions'=>array('submit'=>array('delete','id'=>$model->employee_certificate_details_table_id),'confirm'=>'Are you sure you want to delete this item?','confirm'=>'Are you sure you want to delete this item?', 'class'=>'Delete','title'=>'Delete')),
	array('label'=>'','url'=>array('admin'),'linkOptions'=>array('class'=>'Manage','title'=>'Manage')),
);
?>

<h1>View Employee Certificate Details </h1>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		array(
                'name'=>'employee_first_name',
//                'type'=>'raw',		
                'value'=>EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id'=>$model->employee_certificate_details_table_emp_id))->employee_first_name,
	          ),
		array('name'=>'certificate_title',
			'value'=>$model->emp_certificate_name->certificate_title,
		), 
		array('name'=>'employee_certificate_created_by',
			'value'=>User::model()->findByPk($model->employee_certificate_created_by)->user_organization_email_id,
		),
		array(
                'name'=>'employee_certificate_creation_date',	
                'value'=>($model->employee_certificate_creation_date == 0000-00-00) ? 'Not Set' : date_format(new DateTime($model->employee_certificate_creation_date), 'd-m-Y'),
	        ),
	),
)); ?></div>
		</td>
		<td>
		      <?php 
            echo EmployeeInfo::model()->findByPk($v['employee_transaction_employee_id'])->employee_attendance_card_id;
            ?>
		
		</td>
		<td>
		      <?php 
            echo EmployeeInfo::model()->findByPk($v['employee_transaction_employee_id'])->employee_first_name;
            ?>
		
		</td>
		<td>
		      <?php 
            echo EmployeeInfo::model()->findByPk($v['employee_transaction_employee_id'])->employee_last_name;
            ?>
		
		</td>
				
		<td>
		      <?php 
            echo EmployeeDesignation::model()->findByPk($v['employee_transaction_designation_id'])->employee_designation_name;
            ?>
		
		</td>
		<td>
		      <?php 
            echo Department::model()->findByPk($v['employee_transaction_department_id'])->department_name;
            ?>
		
<?php
$year = date('Y');
if(isset($month))
{
$month_value = $month;

$num = cal_days_in_month(CAL_GREGORIAN, $month_value, date('Y')); 
$colspan=$num+9;
$col=$num+6;
if($employee_data )
{
	$emp_info=new EmployeeInfo;
	$org = Organization::model()->findAll();
	$org_data=$org[0];
	$dept=Department::model()->findbyPk($employee_data[0]['employee_transaction_department_id'])->department_name;
	$type=EmployeeInfo::model()->findbyPk($employee_data[0]['employee_id'])->employee_type;
	
	$m=0;
	
	echo '<table class="report-table" border="2" > ';
	echo "<thead>";
	echo "<tr align=center> <th  colspan = 15 style=text-align:left;> ".CHtml::image(Yii::app()->controller->createUrl('/site/loadImage', array('id'=>$org_data->organization_id)),'No Image',array('width'=>80,'height'=>55,'style'=>'float:left;margin-left:200px;')) ."
	 <big> <b>".$org_data->organization_name ."</big><br>". $org_data->address_line1." ".$org_data->address_line2."</br>"  . City::model()->findBypk($org_data->city)->city_name.", ".State::model()->findBypk($org_data->state)->state_name.", ".Country::model()->findBypk($org_data->country)->name."." ." </th> <br>	 </tr>";

    	echo "<tr><th colspan=2 ><b> Month </b> </th> <th align=left colspan=".$colspan."> <b>".date("F", mktime(0,0,0,$month))."</b></th></tr>";	

	echo "<tr><th ><br><br>SI No.</th>";

	echo "<th colspan=2><br><br> Employee Name </th>";

	for($i = 1; $i<=$num; $i++) {
	/**
	 * Manages all models.
	 */
	public function actionTransferemployee()
	{
		$model=new EmployeeTransaction('transferemployee');
		$info=new EmployeeInfo;
		$user =new User;
		$photo =new EmployeePhotos;
		$address=new EmployeeAddress;
		$lang=new LanguagesKnown;
		$ass_comp = new assignCompanyUserTable;
		$auth_assign = new AuthAssignment;

		$this->performAjaxValidation(array($info,$model,$user));
		if(!empty($_POST['user_id1']))
		{
			$model->attributes=$_POST['EmployeeTransaction'];
			$info->attributes=$_POST['EmployeeInfo'];
			
		
			$trans_id = $_POST['user_id1'];
			$old_model = EmployeeTransaction::model()->resetScope()->findByPk($trans_id);
			$old_info = EmployeeInfo::model()->findByPk($old_model->employee_transaction_employee_id);
			$old_info->transfer_left_remarks= $_POST['EmployeeTransaction']['transfer_left_remarks'];
			$old_info->employee_left_transfer_date = new CDbExpression('NOW()');
			$old_info->save(false);

			$old_model->employee_status = 1;
			$old_model->save();


			$user = User::model()->findByPk($old_model->employee_transaction_user_id);
			
			$user->user_created_by =  Yii::app()->user->id;
			$user->user_creation_date = new CDbExpression('NOW()');
			$user->user_organization_id = $_POST['EmployeeTransaction']['employee_transaction_organization_id'];
			
			if($user->save())
			{
			$org_data = Organization::model()->findByPk($_POST['EmployeeTransaction']['employee_transaction_organization_id']);
			$org_name = $org_data->organization_name;
			$org_arr = explode(' ',$org_name);
			$bizrule = 'return Yii::app()->user->getState("org_id")=='.$_POST['EmployeeTransaction']['employee_transaction_organization_id'].";";
			$var_data = serialize($_POST['EmployeeTransaction']['employee_transaction_organization_id']);
			$suffix_lab = '';
			foreach($org_arr as $list)
				$suffix_lab .= $list[0];


			$auth_assign->itemname = 'Employee of '.$suffix_lab;
			$check = AuthAssignment::model()->findByAttributes(array('itemname'=>$auth_assign->itemname,'userid' => $user->user_id,'data' =>$var_data));
			if(empty($check)){
			$auth_assign->userid = $user->user_id;
			$auth_assign->bizrule = $bizrule;
			$auth_assign->data = $var_data;
			
			$auth_assign->save();
			}

			$ass_comp->assign_user_id = $user->user_id;
			$ass_comp->assign_role_id = 3;
			$ass_comp->assign_org_id = $_POST['EmployeeTransaction']['employee_transaction_organization_id'];
			$ass_comp->assign_created_by = Yii::app()->user->id;
			$ass_comp->assign_creation_date = new CDbExpression('NOW()');
			$ass_comp->save();

			$info = $old_info;
			$info->employee_joining_date = new CDbExpression('NOW()');
			$info->employee_type = $_POST['EmployeeInfo']['employee_type'];
			$info->employee_attendance_card_id = '';
			$info->employee_created_by =  Yii::app()->user->id;
			$info->employee_creation_date = new CDbExpression('NOW()');
			$info->employee_left_transfer_date = NULL;
			$info->employee_id = null;
			$info->setIsNewRecord(true);
			$info->save(false);
			
			$model = $old_model;
			$model->employee_transaction_id = null;
			$model->setIsNewRecord(true);
			$model->employee_transaction_user_id = $user->user_id;
			$model->employee_transaction_employee_id = $info->employee_id;
			$model->employee_transaction_shift_id = $_POST['EmployeeTransaction']['employee_transaction_shift_id'];
			$model->employee_transaction_designation_id = $_POST['EmployeeTransaction']['employee_transaction_designation_id']; 
			$model->employee_transaction_department_id = $_POST['EmployeeTransaction']['employee_transaction_department_id'];
			$model->employee_transaction_organization_id = $_POST['EmployeeTransaction']['employee_transaction_organization_id'];
			$model->employee_status = 0;
			$model->save(false);
			EmployeeInfo::model()->updateByPk($model->employee_transaction_employee_id, array('employee_info_transaction_id'=>$model->employee_transaction_id));
			Yii::app()->user->setFlash('success',"Transfer of ".$info->employee_first_name.' to '.$org_name.' successfully.!');
			$this->redirect(array('employeeTransaction/admin'));	
			}
			
		}
		$this->render('transfer_employee',array(
			'model'=>$model,'info'=>$info,'user'=>$user,
		));

	}
		</td>
		<td>
		      <?php 
            echo $StudentInfo->student_first_name;
            ?>
		
		</td>
		<td>
		      <?php 
            echo $v['attendence'];
            ?>
		
		</td>
		<td>
		      <?php 
            echo EmployeeInfo::model()->find(' 	employee_info_transaction_id=' . $v['employee_id'])->employee_first_name;
            ?>
		
		</td>
		<td>
		      <?php 
            echo Branch::model()->findByPk($v['branch_id'])->branch_name;
            ?>
		
		</td>
		<td>
		      <?php 
            echo SubjectMaster::model()->findByPk($v['sub_id'])->subject_master_name;
            ?>
		
		</td>
 public function actionDelete($id)
 {
     if (Yii::app()->request->isPostRequest) {
         // we only allow deletion via POST request
         $model = $this->loadModel($id);
         $employee_info = EmployeeInfo::model()->findByPk($model->employee_transaction_employee_id);
         if ($model->employee_transaction_emp_address_id != null) {
             $address = EmployeeAddress::model()->findByPk($model->employee_transaction_emp_address_id);
         }
         $emp_photo = EmployeePhotos::model()->findByPk($model->employee_transaction_emp_photos_id);
         if ($model->employee_transaction_languages_known_id != null) {
             $lang_known = LanguagesKnown::model()->findByPk($model->employee_transaction_languages_known_id);
         }
         $dir1 = Yii::getPathOfAlias('webroot') . '/emp_images/';
         if ($dh = opendir($dir1)) {
             if ($emp_photo->employee_photos_path == "no-images") {
             } else {
                 if (file_exists($dir1 . $emp_photo->employee_photos_path)) {
                     chmod($dir1 . $emp_photo->employee_photos_path, 777);
                     unlink($dir1 . $emp_photo->employee_photos_path);
                 }
             }
         }
         closedir($dh);
         if ($this->loadModel($id)->delete()) {
             $use_model = User::model()->findByPk($model->employee_transaction_user_id)->delete();
             $emp_photo->delete();
             $employee_info->delete();
             if ($model->employee_transaction_emp_address_id != null) {
                 $address->delete();
             }
             if ($model->employee_transaction_languages_known_id != null) {
                 $lang_known->delete();
             }
         }
         // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
         if (!isset($_GET['ajax'])) {
             $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
         }
     } else {
         throw new CHttpException(400, 'Invalid request. Please do not repeat this request again.');
     }
 }
예제 #16
0
		$employee = EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id'=>$_REQUEST['emp_id']));
		$emp_name = $employee['employee_first_name'].''.$employee['employee_middle_name'].''.$employee['employee_last_name'];
		$this->widget('CAutoComplete',array(
		     'name'=>'employee_id', 
		     'url'=>CController::createUrl('Dependent/autocompletelookup'),
		     'minChars'=>1,
		     'delay'=>10,
		     'value'=>$emp_name,
		     'matchCase'=>false,
		     'methodChain'=>".result(function(event,item){\$(\"#user_id1\").val(item[1]);})",
		    
		     ));
		}
		else
		{
		$employee = EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id'=>$emp_id));
		$emp_name = $employee['employee_first_name'].''.$employee['employee_middle_name'].''.$employee['employee_last_name'];
		$this->widget('CAutoComplete',array(
		     'name'=>'employee_id', 
		     'url'=>CController::createUrl('Dependent/autocompletelookup'),
		     'minChars'=>1,
		     'delay'=>10,
		     'value'=>$emp_name,
		     'matchCase'=>false,
		     'methodChain'=>".result(function(event,item){\$(\"#user_id1\").val(item[1]);})",
		    
		     ));
		}
		?><span class="status">&nbsp;</span>
		<?php //echo $form->error($model,'employee_id'); ?>
	</div>
예제 #17
0
<div class="operation">
<?php echo CHtml::link('Back', array('admin'), array('class'=>'btnback'));?>
</div>
</div>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		array(
                'name'=>'student_notification_content',
		'type'=>'raw',
		),

		array(
                'name'=>'student_notification_alert_after_date',
                'value'=>date_format(date_create($model->student_notification_alert_after_date), "d-m-Y")
          	),
	
		array(
                'name'=>'student_notification_alert_before_date',
                'value'=>date_format(date_create($model->student_notification_alert_before_date), "d-m-Y")
          	),
	
		array(
		'name'=>'student_notification_from',
		'value'=>(User::model()->findByPk($model->student_notification_from)->user_type=='employee')?(EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id'=>(EmployeeTransaction::model()->findByAttributes(array('employee_transaction_user_id'=>$model->student_notification_from))->employee_transaction_id)))->employee_first_name):(ucfirst(strtolower(strstr(User::model()->findByPk($model->student_notification_from)->user_organization_email_id,'@',true)))),
		),
	),
	'htmlOptions'=> array('class'=>'custom-view'),
)); ?></div>
예제 #18
0
	<table>
	<tr>
		<td>First Name</td>
		<td>Last Name</td>
		<td>Attendence Card</td>
		<td>Designation</td>
		<td>Department</td>
		<td>Shift</td>
		<td>Resign Application Date</td>
		<td>Resign Approve Date</td>
		<td></td>
	</tr>
<?php	
	foreach($resign_emp_data as $list)
	{
		$emp_info = EmployeeInfo::model()->resetScope()->findByAttributes(array('employee_info_transaction_id'=>$list['employee_transaction_id']));
		$emp_level_max = Yii::app()->db->createCommand()
				->select('MAX(reporting_priority),employee_exit_reporting_employee_id')
				->from('employee_exit_reporting')
				->group('employee_exit_employee_id')
				->where('employee_exit_employee_id ='.$list['employee_transaction_id'])
				->queryRow();
		
		$max_priority = $emp_level_max['MAX(reporting_priority)'];
		$reporting_emp_id = EmployeeExitReporting::model()->findByAttributes(array('employee_exit_employee_id'=>$list['employee_transaction_id'],'reporting_priority'=>$max_priority));
		$report_emp = $reporting_emp_id['employee_exit_reporting_employee_id'];
		$exit_details = EmployeeExitDetails::model()->findByAttributes(array('employee_exit_details_employee_id'=>$list['employee_transaction_id'],'reporting_employee_id'=>$report_emp,'reporting_employee_review_status'=>2));
		$app_date = $exit_details['employee_resign_application_date'];
?>
	<tr>
		<td><?php echo $emp_info['employee_first_name']?></td>
예제 #19
0
      public function loadAllNotice($list)
      {
	$menu = null;
	foreach($list as $notice) {
       	$menu .= '<div class="notify-data notifiche">';
	$menu .='<span class="username">'; 
	$menu .=$notice->student_notification_title;
	$menu .='</span></br>';
	$menu .='<span class="notice-lable"><b>From</b></span><span class="notice-content">';
	$menu .=(User::model()->findByPk($notice->student_notification_from)->user_type=='employee')?(EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id'=>(EmployeeTransaction::model()->findByAttributes(array('employee_transaction_user_id'=>$notice->student_notification_from))->employee_transaction_id)))->employee_first_name):(ucfirst(strtolower(strstr(User::model()->findByPk($notice->student_notification_from)->user_organization_email_id,'@',true)))); 	 
	$menu .='</span><span class="notice-lable"><b>Content</b></span>'; 
	$menu .='<span class="notice-content">'.$notice->student_notification_content.'</span></div>'; 	
	}

	return $menu;

      }
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'employee_id');
?>
		<?php 
//$faculty = array();
$facultytablelist = EmployeeTransaction::model()->findAll('employee_transaction_organization_id=' . Yii::app()->user->getState('org_id'));
//$i=0;
$facname = array();
foreach ($facultytablelist as $f) {
    //echo $f['employee_transaction_employee_id'];
    $res1 = EmployeeTransaction::model()->findByAttributes(array('employee_transaction_employee_id' => $f['employee_transaction_employee_id']));
    //	echo $res1[''];
    $temp1 = EmployeeInfo::model()->findByAttributes(array('employee_type' => 1, 'employee_id' => $f['employee_transaction_employee_id']));
    if ($temp1) {
        $temp = $res1['employee_transaction_id'];
        $facname[$temp] = $temp1['employee_first_name'];
    }
}
echo $form->dropDownList($model, 'employee_id', $facname, array('empty' => 'Select Faculty'));
?>
		<?php 
echo $form->error($model, 'employee_id');
?>
	</div>
	

	
		
예제 #21
0
?>

<h1>View Daily Attendence Email</h1>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		//'student_attendence_email_id',
		array(
                'name'=>'employee_first_name',
	        'value'=> EmployeeInfo::model()->findByAttributes(array(
						'employee_info_transaction_id' => $model->student_attendence_email_emp_id))->employee_first_name,
		),
		array(
                'name'=>'employee_last_name',
	        'value'=> EmployeeInfo::model()->findByAttributes(array(
						'employee_info_transaction_id' => $model->student_attendence_email_emp_id))->employee_last_name,
		),
		array(
                'name'=>'branch_name',
	        'value'=> ($model->student_attendence_email_branch_id==0)?"All Branch":Branch::model()->findByPk($model->student_attendence_email_branch_id)->branch_name,
		),

		array(
                'name'=>'employee_transaction_designation_id',
	        'value'=> EmployeeDesignation::model()->findByPk($model->rel_emp_tran->employee_transaction_designation_id)->employee_designation_name,
		),
		'student_attendence_email_minute',
		'student_attendence_email_hour',

		array(
 public function actionUpdate_emp_password($id)
 {
     $model = $this->loadModel($id);
     //$emp_email=EmployeeInfo::model()->findByPk($_REQUEST['id'])->employee_private_email;
     $emp_data = EmployeeTransaction::model()->findByAttributes(array('employee_transaction_user_id' => $_REQUEST['id']));
     $emp_info = EmployeeInfo::model()->findByPk($emp_data->employee_transaction_employee_id)->employee_first_name;
     $model->user_password = MD5($model->user_organization_email_id . $model->user_organization_email_id);
     $model->save();
     Yii::app()->user->setFlash('resetemppassword', $emp_info . ' ' . "Password is Reset");
     $this->redirect(array('user/resetemppassword'));
 }
예제 #23
0
<?php
   $info = EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id'=>Yii::app()->user->getState('emp_id')));
   $tranDetails = EmployeeTransaction::model()->findByPk(Yii::app()->user->getState('emp_id'));
   $picPath = EmployeePhotos::model()->findByPk($tranDetails->employee_transaction_emp_photos_id);
?>
<div class="image-tab">
<div class="image-box-user"><img src="<?php echo Yii::app()->baseUrl; ?>/college_data/emp_images/<?php echo $picPath->employee_photos_path; ?>" width="112" height="112"></div>
</div>
<div class="info-tab">
<div class="myinfo">
	<div class="info-title">My Information</div>
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td class="info-label">Name - </td>
        <td class="info-content"><?php echo $info->employee_first_name.' '.$info->employee_last_name; ?></td>
        <td class="info-label">Birth Date -</td>
        <td class="info-content"><?php if(!empty($info->employee_dob) && $info->employee_dob!='0000-00-00') { echo $info->employee_dob; }else { echo "Not Set";} ?></td>
      </tr>
      <tr>
        <td class="info-label">Gender - </td>
        <td class="info-content"><?php echo (!empty($info->employee_gender) ? $info->employee_gender : "Not Set"); ?></td>
        <td class="info-label">Designation  -</td>
        <td class="info-content"><?php echo (!empty($tranDetails->Rel_Designation->employee_designation_name) ? $tranDetails->Rel_Designation->employee_designation_name : "Not Set"); ?></td>
      </tr>
      <tr>
        <td class="info-label">Department - </td>
        <td class="info-content"><?php echo (!empty($tranDetails->Rel_Department->department_name) ? $tranDetails->Rel_Department->department_name : "Not Set"); ?></td>
        <td class="info-label">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
예제 #24
0
 public function actionForgotpassword()
 {
     $this->layout = 'loginLayout';
     $model = new LoginForm();
     if (isset($_POST['LoginForm'])) {
         $model->attributes = $_POST['LoginForm'];
         $user_id = User::model()->findByAttributes(array('user_organization_email_id' => $_POST['LoginForm']['username']));
         if (!empty($user_id)) {
             $random = substr(number_format(time() * rand(), 0, '', ''), 0, 10);
             $mail = '';
             $check_user = StudentTransaction::model()->find('student_transaction_user_id =' . $user_id->user_id);
             if (!empty($check_user)) {
                 $mail = StudentInfo::model()->findByPk($check_user->student_transaction_student_id)->student_email_id_1;
             }
             $check_user_emp = EmployeeTransaction::model()->find('employee_transaction_user_id =' . $user_id->user_id);
             if (!empty($check_user_emp)) {
                 $mail = EmployeeInfo::model()->findByPk($check_user_emp->employee_transaction_employee_id)->employee_private_email;
             }
             if ($mail != '') {
                 $mailobj = new MailApi();
                 $r = $mailobj->sendmail($mail, $random);
                 $update_user = User::model()->findByPk($user_id->user_id);
                 $update_user->user_password = md5($random . $random);
                 $update_user->save();
                 $this->redirect(array('smsNotification', 'status' => 'success'));
             }
         } else {
             $this->redirect(array('smsNotification', 'status' => 'user_not_exist'));
         }
     }
     $this->render('forgotpassword', array('model' => $model));
 }
    protected function renderContent()
    {
        $day = array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
        if (Yii::app()->user->getState('stud_id')) {
            $date = date('Y-m-d');
            $ts = strtotime($date);
            $week_number = date('W', $ts);
            $year = date('Y');
            for ($day1 = 1; $day1 < 7; $day1++) {
                $alldate[] = date('d-m-Y', strtotime($year . "W" . $week_number . $day1));
            }
            $criteria = new CDbCriteria();
            //$criteria->select = 'academic_term_id'; // select fields which you want in output
            $criteria->condition = 'current_sem = 1 AND academic_term_organization_id = ' . Yii::app()->user->getState('org_id');
            $semname = AcademicTerm::model()->findAll($criteria);
            $data = CHtml::listData($semname, 'academic_term_id', 'academic_term_id');
            $stud_model = StudentTransaction::model()->findByPk(Yii::app()->user->getState('stud_id'));
            $check_sem = in_array($stud_model->student_academic_term_name_id, $data);
            //var_dump($check_sem); exit;
            $timetableid = 0;
            if (!$check_sem) {
                echo "<h3 align=center style=color:red>Sorry, No timetable available for this student.</h3>";
            } else {
                $check_timetable = TimeTableDetail::model()->findByAttributes(array('acdm_name_id' => $stud_model->student_academic_term_name_id, 'division_id' => $stud_model->student_transaction_division_id));
                if (empty($check_timetable)) {
                    echo "<h3 align=center style=color:red>Sorry, No timetable available for this student.</h3>";
                } else {
                    $timetableid = $check_timetable->timetable_id;
                    $model = TimeTable::model()->findByPk($timetableid);
                    $nooflec = $model->No_of_Lec;
                    $sum = $nooflec;
                    $lec_duration = LecDuration::model()->findAllByAttributes(array(), $condition = 'timetable_id = :table_id ', $params = array(':table_id' => $timetableid));
                    $lec = array();
                    foreach ($lec_duration as $l) {
                        $lec[] = $l['duration'];
                    }
                    $createdate = date_create($model->creation_date);
                    $starti = 1;
                    if ($model->zero_lec == 1) {
                        $starti = 0;
                    }
                    $time = $model->clg_start_time;
                    $time = date('H:i A', strtotime($time));
                    $timestamp = strtotime($time);
                    $time = date('g:i A', $timestamp);
                    ?>

			<table id="time-table-struc" bgcolor="#CBE7ED"  border="2" style= width:auto;font-size:8px;border-collapse:collapse; height:auto;"  align="center">
			<th  align=center>
				Day/Time
			</th>

<?php 
                    $i = 0;
                    while ($i < 6) {
                        echo "<th>" . $day[$i] . "</br>(" . $alldate[$i] . ")</th>";
                        $i++;
                    }
                    $break = "";
                    $l = 0;
                    $count = array(1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0);
                    for ($i = $starti; $i <= $nooflec; $i++) {
                        $days = count($day);
                        echo "<tr>";
                        $duration = NoOfBreakTable::model()->findByAttributes(array('timetable_id' => $timetableid, 'after_lec_break' => $i));
                        $dur = $duration['duration'];
                        if ($dur) {
                            $dur1 = date('i', strtotime($dur));
                        }
                        if ($break) {
                            echo "<td style=width:100px;>" . $time . "-</br>" . date('g:i A', strtotime($time) + $dur1 * 60) . "</td><td colspan=7 align=center><font color='green'><b>Break</b></font></td></tr>";
                            $break = "";
                            $timestamp = strtotime($time) + $dur1 * 60;
                            $time = date('g:i A', $timestamp);
                            $i--;
                            continue;
                        } else {
                            echo "<td style=width:100px;>" . $time . "-</br>" . date('g:i A', strtotime($time) + 60 * $lec[$l]) . "</td>";
                            $timestamp = strtotime($time) + 60 * $lec[$l];
                            $l++;
                            $time = date('g:i A', $timestamp);
                        }
                        for ($j = 1; $j <= $days; ++$j) {
                            $subname = "";
                            $room = "";
                            $faculty = "";
                            $batch = "";
                            if ($count[$j] > 0) {
                                $count[$j]--;
                                continue;
                            }
                            $result = TimeTableDetail::model()->findAllByAttributes(array(), $condition = 'timetable_id = :table_id AND day = :day AND lec = :lec AND division_id = :div_id AND lecture_date = :lecdate and proxy_status <> :proxy_status', $params = array(':table_id' => $timetableid, ':day' => $j, ':lec' => $i, ':div_id' => $stud_model->student_transaction_division_id, ':lecdate' => date('Y-m-d', strtotime($alldate[$j - 1])), ':proxy_status' => 2));
                            $break = NoOfBreakTable::model()->findAllByAttributes(array(), $condition = 'timetable_id = :table_id  AND after_lec_break = :lec', $params = array(':table_id' => $timetableid, ':lec' => $i));
                            if ($result) {
                                foreach ($result as $list) {
                                    if ($list['lect_hour'] > 1) {
                                        $count[$j] = $list['lect_hour'] - 1;
                                    }
                                    echo "<td rowspan=" . $list['lect_hour'] . " align=center style=background:#C0CCCC; width:100px;>";
                                    break;
                                }
                                foreach ($result as $check) {
                                    if ($check->batch_id != 0) {
                                        $batch = "(" . Batch::model()->findByPk($check->batch_id)->batch_name . ")";
                                    }
                                    $subname = SubjectMaster::model()->findByPk($check->subject_id)->subject_master_alias;
                                    $room = "(" . RoomDetailsMaster::model()->findByPk($check->room_id)->room_name . ")";
                                    $faculty = "(" . EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id' => $check->faculty_emp_id))->employee_name_alias . ")";
                                    if ($batch) {
                                        echo "</br>" . $subname . "</br>" . $batch . "</br>" . $room . "</br>" . $faculty;
                                    } else {
                                        echo "</br>" . $subname . "</br>" . $room . "</br>" . $faculty;
                                    }
                                }
                                echo "</td>";
                            } else {
                                echo "<td style=width:100px;>" . $subname . "</br>" . $batch . "</br>" . $room . "</br>" . $faculty . "</td>";
                            }
                        }
                        echo "</tr>";
                    }
                    echo "</table>";
                    ?>
<h5>Proxy details</h5>

<table id="time-table-struc" style="font-size:10px;">
<tr>
<th>Sr. No.</th>
<th>Employee Name</th>
<th>Proxy Employee Name</th>
<th>Subject</th>
<th>Lecture No.</th>
<th>Date</th>
</tr>
<?php 
                    $proxy_data = TimeTableDetail::model()->findAllByAttributes(array(), $condition = 'timetable_id = :timetable_id and division_id = :div_id and lecture_date >= :start and lecture_date< :end and proxy_status = :proxy order by lec', $params = array(':timetable_id' => $timetableid, ':div_id' => $stud_model->student_transaction_division_id, ':start' => date('Y-m-d', strtotime($alldate[0])), ':end' => date('Y-m-d', strtotime($alldate[5])), ':proxy' => 1));
                    $n = 0;
                    foreach ($proxy_data as $list) {
                        $result = TimeTableDetail::model()->findByPk($list->proxy_id);
                        ?>

<tr>
<td><?php 
                        echo ++$n;
                        ?>
</td>
<td><?php 
                        echo EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id' => $list->faculty_emp_id))->employee_first_name;
                        ?>
</td>
<td><?php 
                        echo EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id' => $result->faculty_emp_id))->employee_first_name;
                        ?>
</td>
<td><?php 
                        echo SubjectMaster::model()->findByPk($result->subject_id)->subject_master_alias;
                        ?>
</td>
<td><?php 
                        echo $result->lec;
                        ?>
</td>
<td><?php 
                        echo date('d-m-Y', strtotime($result->lecture_date));
                        ?>
</td>
</tr>
<?php 
                    }
                    ?>
</table>
<?php 
                }
                //ELSE END
            }
        } else {
            if (Yii::app()->user->getState('emp_id')) {
                $timetableid = 0;
                $date = date('Y-m-d');
                $ts = strtotime($date);
                $week_number = date('W', $ts);
                $alldate[0] = 'No';
                $year = date('Y');
                for ($day2 = 1; $day2 < 7; $day2++) {
                    $alldate[$day2] = date('d-m-Y', strtotime($year . "W" . $week_number . $day2));
                }
                $semname = AcademicTerm::model()->findAllByAttributes(array(), $condition = 'current_sem = :current_sem and academic_term_organization_id=:org_id', $params = array(':current_sem' => 1, ':org_id' => Yii::app()->user->getState('org_id')));
                foreach ($semname as $s) {
                    $semid = $s['academic_term_id'];
                    $check = TimeTableDetail::model()->findByAttributes(array('acdm_name_id' => $semid, 'faculty_emp_id' => Yii::app()->user->getState('emp_id')));
                    if ($check) {
                        $timetableid = $check['timetable_id'];
                        break;
                    }
                }
                if (!empty($timetableid)) {
                    $day = array(" ", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
                    $model = TimeTable::model()->findByPk($timetableid);
                    $nooflec = $model->No_of_Lec;
                    $sum = $nooflec;
                    $lec_duration = LecDuration::model()->findAllByAttributes(array(), $condition = 'timetable_id = :table_id ', $params = array(':table_id' => $timetableid));
                    $lec = array();
                    foreach ($lec_duration as $l) {
                        $lec[] = $l['duration'];
                    }
                    $starti = 1;
                    if ($model->zero_lec == 1) {
                        $starti = 0;
                    }
                    $time = $model->clg_start_time;
                    $time = date('H:i A', strtotime($time));
                    $createdate = date_create($model->creation_date);
                    ?>

			<table id="time-table-struc" bgcolor="#CBE7ED" border="2" style="width:auto;font-size:9px;border-collapse:collapse; height:auto;" >
			<th>
				Day/Time
			</th>

			<?php 
                    $i = 0;
                    while ($i < 7) {
                        echo "<th style='font-size:8px'>" . $day[$i] . "</br>(" . $alldate[$i] . ")</th>";
                        $i++;
                    }
                    $l = 0;
                    $break = "";
                    $dur1 = 0;
                    $count = array(1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0);
                    for ($i = $starti; $i <= $nooflec; $i++) {
                        $days = count($day);
                        echo "<tr>";
                        $duration = NoOfBreakTable::model()->findByAttributes(array('timetable_id' => $timetableid, 'after_lec_break' => $i));
                        if ($duration) {
                            $dur = $duration['duration'];
                            $dur1 = date('i', strtotime($dur));
                        }
                        if ($break) {
                            echo "<td style=width:100px;>" . $time . "-</br>" . date('g:i A', strtotime($time) + $dur1 * 60) . "</td><td colspan=7 align=center ><font color='green'><b>Break</b></font></td></tr>";
                            $break = "";
                            $timestamp = strtotime($time) + $dur1 * 60;
                            $time = date('g:i A', $timestamp);
                            $i--;
                            continue;
                        } else {
                            echo "<td style=width:100px;>" . $time . "-</br>" . date('g:i A', strtotime($time) + 60 * $lec[$l]) . "</td><td style=width:25px;><b>" . $i . "</b></td>";
                            $timestamp = strtotime($time) + 60 * $lec[$l];
                            $l++;
                            $time = date('g:i A', $timestamp);
                        }
                        for ($j = 1; $j <= $days - 1; ++$j) {
                            $subname = "";
                            $room = "";
                            $faculty = "";
                            $batch = "";
                            if ($count[$j] > 0) {
                                $count[$j]--;
                                continue;
                            }
                            $result = TimeTableDetail::model()->findAllByAttributes(array(), $condition = 'day = :day AND lec = :lec AND faculty_emp_id = :emp_id AND timetable_id=:table_id AND lecture_date =:lecdate and proxy_status <> :status', $params = array(':table_id' => $timetableid, ':day' => $j, ':lec' => $i, ':emp_id' => Yii::app()->user->getState('emp_id'), ':lecdate' => date('Y-m-d', strtotime($alldate[$j])), ':status' => 2));
                            $break = NoOfBreakTable::model()->findAllByAttributes(array(), $condition = 'after_lec_break = :lec AND timetable_id=:table_id', $params = array(':table_id' => $timetableid, ':lec' => $i));
                            if ($result) {
                                foreach ($result as $list) {
                                    if ($list['lect_hour'] > 1) {
                                        $count[$j] = $list['lect_hour'] - 1;
                                    }
                                    echo "<td rowspan=" . $list['lect_hour'] . " align=center style=background:#C0CCCC; border-color:black; width:150px;>";
                                    break;
                                }
                                foreach ($result as $check) {
                                    if ($check->batch_id != 0) {
                                        $batch = "(" . Batch::model()->findByPk($check->batch_id)->batch_name . ")";
                                    }
                                    $subname = SubjectMaster::model()->findByPk($check->subject_id)->subject_master_alias;
                                    $room = "(" . RoomDetailsMaster::model()->findByPk($check->room_id)->room_name . ")";
                                    $div = Division::model()->findByPk($check->division_id)->division_code;
                                    //$faculty="(".EmployeeInfo::model()->findByPk($check->faculty_emp_id)->employee_name_alias.")";
                                    if ($batch) {
                                        echo $subname . "</br>" . $batch . "</br>" . $room;
                                    } else {
                                        echo $subname . "</br>" . "(" . $div . ")" . "</br>" . $room;
                                    }
                                }
                                echo "</td>";
                            } else {
                                echo "<td style=width:150px;>" . $subname . "</br>" . $batch . "</br>" . $room . "</td>";
                            }
                        }
                        //for j end
                        echo "</tr>";
                    }
                    //for i end
                    echo "</table>";
                    ?>
<h5>Proxy Lectures</h5>

<table id="time-table-struc" border="1" style="font-size:10px;">
<tr>
<th>Sr. No.</th>
<th>Employee Name</th>
<th>Division</th>
<th>Subject</th>
<th>Room</th>
<th>Lecture No.</th>
<th>Date</th>
</tr>
<?php 
                    $proxy_data = TimeTableDetail::model()->findAllByAttributes(array(), $condition = 'timetable_id = :timetable_id and proxy_employee_id = :emp_id and lecture_date >= :start and lecture_date< :end and proxy_status = :proxy order by lec', $params = array(':timetable_id' => $timetableid, ':emp_id' => Yii::app()->user->getState('emp_id'), ':start' => date('Y-m-d', strtotime($alldate[0])), ':end' => date('Y-m-d', strtotime($alldate[5])), ':proxy' => 1));
                    $n = 0;
                    foreach ($proxy_data as $list) {
                        $result = TimeTableDetail::model()->findByPk($list->proxy_id);
                        ?>

<tr>
<td><?php 
                        echo ++$n;
                        ?>
</td>
<td><?php 
                        echo EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id' => $list->faculty_emp_id))->employee_first_name;
                        ?>
</td>
<td><?php 
                        echo Division::model()->findByPk($result->division_id)->division_code;
                        ?>
</td>
<td><?php 
                        echo SubjectMaster::model()->findByPk($result->subject_id)->subject_master_alias;
                        ?>
</td>
<td><?php 
                        echo RoomDetailsMaster::model()->findByPk($result->room_id)->room_name;
                        ?>
</td>
<td><?php 
                        echo $result->lec;
                        ?>
</td>
<td><?php 
                        echo date('d-m-Y', strtotime($result->lecture_date));
                        ?>
</td>
</tr>
<?php 
                    }
                    ?>
</table>		

<?php 
                } else {
                    echo "<h3 align=center style=color:red>Sorry, No timetable available.</h3>";
                }
            }
        }
    }
			   {
				if($c == $t)
	                	   	print ' | ';
				else			
			        	print ' <div style="border-right:thin solid #74B9F0; float: left;  width:'.((100/$count)-14).'%; padding-right: 5px; margin-right: 5px;">';
				$fname=EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id'=>$faculty[$fac]));		
				print $fname->employee_first_name.' '.$fname->employee_last_name;
				print '</div>';
				$fac++;
			   }		
			   print "</th>";
			   $fac--;		  
			 }	
			 else
			 {
				$fname=EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id'=>$faculty[$fac]));		
		print '<th>'.$fname->employee_first_name.' '.$fname->employee_last_name.'</th>';
			 }
		}
	  	else 
			print '<th>--</th>';
		$cs++;
	}	

	print '<tr > </tr>';	
	$cs=0;
	for($b=0;$b<count($batch);$b++)
	{		
		if($batch[$b]!=0)
		{
			if($cols[$b]>1)
		
 	</tr>
	<?php 
    foreach ($model as $m => $v) {
        if ($m != 0) {
            ?>
	<tr>
       		<td>
			<?php 
            echo $k;
            ?>
		</td>
		<td>	
			
			<?php 
            echo EmployeeInfo::model()->findByAttributes(array("employee_info_transaction_id" => $v['employee_certificate_details_table_emp_id']))->employee_first_name;
            ?>
			
		</td>  
		<td>	
			<?php 
            echo Certificate::model()->findByPk($v['employee_certificate_type_id'])->certificate_title;
            ?>
		</td>  
		

		<td>	
			<?php 
            echo User::model()->findByPk($v['employee_certificate_created_by'])->user_organization_email_id;
            ?>
		</td>  
 public function chkunique()
 {
     $cardid_length = strlen((string) $this->employee_attendance_card_id);
     $cardid = $this->employee_attendance_card_id;
     $digit = 0;
     $diff = 10 - $cardid_length;
     for ($i = 1; $i <= $diff; $i++) {
         $cardid = $digit . $cardid;
     }
     if ($this->isNewRecord) {
         $empcardid = EmployeeInfo::model()->findAll('employee_attendance_card_id=' . $cardid);
     } else {
         $empcardid = EmployeeInfo::model()->findAll('employee_attendance_card_id=' . $cardid . ' and employee_info_transaction_id<>' . $_REQUEST['id']);
     }
     if ($empcardid) {
         $this->addError('employee_attendance_card_id', "Employee IdCard must be unique.");
         return false;
     } else {
         return true;
     }
 }
예제 #29
0
	<?php 
echo $org[0]['organization_name'];
?>
	</div>

		<li class="dropdown user">

		<?php 
$user = User::model()->findByPk(Yii::app()->user->id)->user_type;
if ($user == 'admin') {
    $username = '******';
} else {
    if ($user == 'student') {
        $username = StudentInfo::model()->findByPk(StudentTransaction::model()->findByAttributes(array('student_transaction_user_id' => Yii::app()->user->id))->student_transaction_student_id)->student_first_name;
    } else {
        $username = EmployeeInfo::model()->findByPk(EmployeeTransaction::model()->findByAttributes(array('employee_transaction_user_id' => Yii::app()->user->id))->employee_transaction_employee_id)->employee_first_name;
    }
}
?>
		<a data-close-others="true" data-hover="dropdown" data-toggle="dropdown" class="dropdown-toggle" href="#">
		<?php 
$checkUser = StudentTransaction::model()->findByAttributes(array('student_transaction_user_id' => Yii::app()->user->id));
if ($checkUser) {
    $avtar = StudentPhotos::model()->findByPk($checkUser->student_transaction_student_photos_id)->student_photos_path;
    echo CHtml::image(Yii::app()->baseUrl . '/college_data/stud_images/' . $avtar, 'Student', array('height' => 29, 'width' => '29'));
} else {
    $checkUser = EmployeeTransaction::model()->findByAttributes(array('employee_transaction_user_id' => Yii::app()->user->id));
    if ($checkUser) {
        $avtar = EmployeePhotos::model()->findByPk($checkUser->employee_transaction_emp_photos_id)->employee_photos_path;
        echo CHtml::image(Yii::app()->baseUrl . '/college_data/emp_images/' . $avtar, 'Student', array('height' => 29, 'width' => '29'));
    } else {
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = EmployeeInfo::model()->findByPk((int) $id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }