$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 { echo '<img src="' . Yii::app()->baseUrl . '/images/no_image_icon.jpg" alt="" height=29 width=29>'; } } ?> <span class="username"><?php echo $username; ?> </span> <i class="icon-angle-down"></i> </a> <ul class="dropdown-menu" style="display:none;"> <li class="sub-menu"><a href="<?php
<?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"> </td> <td> </td> </tr> </table>
$('#updateData').attr('href', editLinkPath + '/employee/employeeTransaction/updateprofiletab4?id=' + '<?php echo $_REQUEST["id"]; ?>'); }); $("#personal-tab").click(function(event) { $('#updateData').attr('href', editLinkPath + '/employee/employeeTransaction/updateprofiletab1?id=' + '<?php echo $_REQUEST["id"]; ?>'); }); }); </script> <div class="clear-div"></div> <div class="profile-page-box"> <!--===============================Page header start============================--> <div class="page-title-header"><i class="fa fa-plus"></i> View Employee Profile</div> <!--===============================Page header end============================--> <?php $empInfo = EmployeeTransaction::model()->findByPk($_REQUEST['id']); $emppicPath = EmployeePhotos::model()->findByPk($empInfo->employee_transaction_emp_photos_id); $emp_photo=Yii::app()->baseUrl."/college_data/emp_images/".$emppicPath->employee_photos_path; ?> <!--Profile Tab Start--> <div class="profile-box-bg"> <div class="profilebox-left"> <div class="profile-image-tab"> <?php if(Yii::app()->user->checkAccess('EmployeeTransaction.UpdateEmployeeData') && (Yii::app()->user->getState('emp_id') == $_REQUEST['id']) || Yii::app()->user->checkAccess('EmployeeTransaction.UpdateAllEmployeeData') && $model->employee_status==0) { ?> <a title="Change Picture" href ="<?php echo Yii::app()->baseUrl.'/employee/employeeTransaction/updateprofilephoto?id='.$_REQUEST['id']; ?>"> <?php }?> <div class="profile-box-user"><img src="<?php echo $emp_photo;?>" width="200" height="200"></div></a> </div> </div> <div class="profilebox-middle" style="font-family : sans-serif; "> <div class="profile-username"><?php echo $empInfo->Rel_Emp_Info->employee_first_name.' '.$empInfo->Rel_Emp_Info->employee_last_name ;?> </div> <div style="color: rgb(85, 85, 85); font-size: 15px; height: 35px; line-height: 35px;"><i class="fa fa-sort-amount-desc" style="width: 30px; color: #D9534F;"></i> Department : <?php echo (!empty($empInfo->Rel_Department->department_name) ? $empInfo->Rel_Department->department_name : "Not Set");?></div>
public function loadReadNotice() { $res = array(); $list = StudentNotification::model()->findAll(array('limit'=>10, 'order'=>'student_notification_id desc','condition'=>'student_notification_to = :to AND student_notification_alert_after_date <= :afterdate AND student_notification_alert_before_date >= :beforedate', 'params'=> array(':to' => Yii::app()->user->getState('stud_id'), ':afterdate'=>date('Y-m-d'),':beforedate'=>date('Y-m-d')))); $menu = null; foreach($list as $notice) { $usertype=User::model()->findByPk($notice->student_notification_from)->user_type; $menu .= ($notice->student_notification_read == 1) ? '<div class="notify-data">' : '<div class="notify-data unread">'; if($usertype=="employee") { $tran=EmployeeTransaction::model()->findByAttributes(array('employee_transaction_user_id'=>$notice->student_notification_from)); $emp_model = EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id'=>$tran->employee_transaction_id)); $photo=EmployeePhotos::model()->findByPk($tran['employee_transaction_emp_photos_id']); $menu .= '<span class="userimage">'; if(file_exists(Yii::app()->baseUrl.'/college_data/emp_images/'.$photo->employee_photos_path)) $user_image = Yii::app()->baseUrl.'/college_data/emp_images/'.$photo->employee_photos_path; else $user_image = Yii::app()->baseUrl.'/college_data/emp_images/no-images'; $menu .= CHtml::image($user_image,"",array("width"=>"50px","height"=>"50px")); $menu .='</span><span class="username">'; $menu .= ucfirst(strtolower($emp_model->employee_first_name)).' '.ucfirst(strtolower($emp_model->employee_last_name)).'</span>'; } else { $user=User::model()->findByPk($notice->student_notification_from); $org=$user->user_organization_id; $name=$user->user_organization_email_id; $menu .= '<span class="userimage">'; $user_image = Yii::app()->baseUrl.'/college_data/emp_images/no-images'; $menu .= CHtml::image($user_image,'No Image',array('width'=>'50px','height'=>'50px')); $menu .='</span><span class="username">'; $menu .=ucfirst(strtolower(strstr($name,'@',true))); $menu .='</span>'; } $menu .='<div class="notificationlink">'; $menu .='<a href='.Yii::app()->request->baseUrl.'/notification/studentNotification/Read?id='.$notice->student_notification_id.'>'; $menu .=$notice->student_notification_title.'</a></div></div>'; } if(!empty($list)) $menu .='<span class="view-more-notice">'.CHtml::link('View More..','../notification/studentNotification/index').'</span>'; return $menu; }
$orgstate = State::model()->findByPk($org_data->state)->state_name; $emp = array(); $i = 0; ?> <?php if($employee_data1) { foreach($employee_data1 as $emp) { $orglogo = CHtml::image(Yii::app()->controller->createUrl('/site/loadImage', array('id'=>Yii::app()->user->getState('org_id'))),'No Image',array('width'=>35,'height'=>30)); $empphoto = EmployeePhotos::model()->findByPk($emp['employee_transaction_emp_photos_id'])->employee_photos_path; ?> <div class="outer"> <div class="main"> <!--Header div--> <div class="idcardheader"> <div class="logo"> <?php echo $orglogo;?> </div> <div class="collegeheader"> <?php echo $org_data->organization_name;?> </div> </div>
public function loadReadNotice() { $res = array(); $emp_trans = EmployeeTransaction::model()->findAll(array('select'=>'employee_transaction_user_id')); $s=0; if($emp_trans) { $d = CHtml::listData($emp_trans,'employee_transaction_user_id','employee_transaction_user_id'); $s = implode(',',$d); } $list = EmployeeNotification::model()->findAll(array('limit'=>10,'order'=>'id desc','condition'=>'emp_notice_to = :to AND alert_after_date <= :afterdate AND alert_before_date >= :beforedate and t.from IN('.$s.')', 'params'=> array(':to' => Yii::app()->user->getState('emp_id'), ':afterdate'=>date('Y-m-d'),':beforedate'=>date('Y-m-d')))); $menu = null; foreach($list as $notice) { $usertype=User::model()->findByPk($notice->from)->user_type; $menu .= '<div class="notify-data">'; if($usertype=="employee") { $tran=EmployeeTransaction::model()->findByAttributes(array('employee_transaction_user_id'=>$notice->from)); $emp_model = EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id'=>$tran->employee_transaction_id)); $photo=EmployeePhotos::model()->findByPk($tran['employee_transaction_emp_photos_id']); $menu .= '<span class="userimage">'; if(file_exists(Yii::app()->baseUrl.'/college_data/emp_images/'.$photo->employee_photos_path)) $user_image = Yii::app()->baseUrl.'/college_data/emp_images/'.$photo->employee_photos_path; else $user_image = Yii::app()->baseUrl.'/college_data/emp_images/no-images'; $menu .= CHtml::image($user_image,"No Image",array("width"=>"50px","height"=>"50px")); $menu .='</span><span class="username">'; $menu .= ucfirst(strtolower($emp_model->employee_first_name)).' '.ucfirst(strtolower($emp_model->employee_last_name)).'</span>'; } else { $tran=StudentTransaction::model()->findByAttributes(array('student_transaction_user_id'=>$notice->from)); $stud_model = StudentInfo::model()->findByAttributes(array('student_info_transaction_id'=>$tran->student_transaction_id)); $photo=StudentPhotos::model()->findByPk($tran['student_transaction_student_photos_id']); $menu .= '<span class="userimage">'; if(file_exists(Yii::app()->baseUrl.'/college_data/stud_images/'.$photo->student_photos_path)) $user_image = Yii::app()->baseUrl.'/college_data/stud_images/'.$photo->student_photos_path; else $user_image = Yii::app()->baseUrl.'/college_data/emp_images/no-images'; $menu .= CHtml::image($user_image,"No Image",array("width"=>"50px","height"=>"50px")); $menu .='</span><span class="username">'; $menu .= ucfirst(strtolower($stud_model->student_first_name))." ".ucfirst(strtolower($stud_model->student_last_name))." (".$stud_model->student_enroll_no.")</span>"; } $menu .='<div class="notificationlink">'; $menu .='<a href='.Yii::app()->request->baseUrl.'/notification/employeeNotification/Read?id='.$notice->id.'>'; $menu .=$notice->title.'</a></div></div>'; } if(!empty($list)) $menu .='<span class="view-more-notice">'.CHtml::link('View More..','../notification/employeeNotification/index').'</span>'; return $menu; }
<?php if(Yii::app()->user->checkAccess('Exam.BranchSubjectwiseScheduling.Studentexamtimetable') ) { ?> <div id="divlink8" class="info-link"> <?php echo CHtml::link('Exam Timetable',array('/exam/branchSubjectwiseScheduling/studentexamtimetable','id'=>Yii::app()->user->getState('stud_id')),array('target'=>'_blank','style'=>'text-decoration:none;color:white;')); ?> </div> <?php } ?> </div> <?php } //end student if else if(Yii::app()->user->getState('emp_id')) { $employeemodel = EmployeeTransaction::model()->find('employee_transaction_id='.Yii::app()->user->getState('emp_id')); $info = EmployeeInfo::model()->findByPk($employeemodel->employee_transaction_employee_id); $photo = EmployeePhotos::model()->findByPk($employeemodel->employee_transaction_emp_photos_id); ?> <div id="menulink"> <div id="studentlogo"> <?php if($employeemodel->Rel_Photo->employee_photos_path != null) echo CHtml::link(CHtml::image(Yii::app()->baseUrl.'/college_data/emp_images/'.$photo->employee_photos_path,"",array("width"=>"178px","height"=>"176px")),array('/college_data/emp_images/'.$photo->employee_photos_path),array('id'=>'imagelink'))."</br></br>"; /* $config = array( 'scrolling' => 'no', 'autoDimensions' => false, 'width' => '795', 'height' => '250',
/** Delete Photo of update profile*/ public function actionPhotoDelete($id) { $model = $this->loadModel($id); $emp_photo = EmployeePhotos::model()->findByPk($model->employee_transaction_emp_photos_id); $dir1 = Yii::getPathOfAlias('webroot').'/college_data/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); $emp_photo->employee_photos_path = "no-images"; $emp_photo->save(); } else { $emp_photo->employee_photos_path = "no-images"; $emp_photo->save(); } } } closedir($dh); $this->redirect(array('EmployeeTransaction/update','id'=>$model->employee_transaction_id)); }
<?php $this->breadcrumbs = array('Employee' => array('admin'), 'Profile'); ?> <div class="operation"> <?php echo CHtml::link('Back', array('admin'), array('class' => 'btnback')); echo CHtml::link('Edit', array('updateTab1', 'id' => $model->employee_transaction_id), array('class' => 'btnupdate')); ?> </div> <div class="portlet box green"> <i class="icon-reorder"></i> <div class="portlet-title">View Details </div> <?php $this->widget('zii.widgets.jui.CJuiTabs', array('headerTemplate' => '<li><a href="{url}" title="{title}">{title}</a></li>', 'tabs' => array('Personal Profile' => $this->renderPartial("tabs/view_tab1", array('lang' => $lang, 'model' => $model, 'info' => $info), $this), 'Guardian Info' => $this->renderPartial("tabs/view_tab2", array('model' => $model, 'info' => $info), $this), 'Address Info' => $this->renderPartial("tabs/view_tab4", array('address' => $address, 'lang' => $lang, 'model' => $model, 'info' => $info), $this), 'Academic Record' => $this->renderPartial("tabs/view_academicrec", array('emp_record' => $emp_record), $this), 'Documents' => $this->renderPartial("tabs/view_document", array('emp_doc' => $emp_doc), $this)), 'htmlOptions' => array('class' => 'profile-tab'))); ?> <div class="profile-picture"> <?php $pic = EmployeePhotos::model()->findByPk($model->employee_transaction_emp_photos_id)->employee_photos_path; echo CHtml::image(Yii::app()->baseUrl . '/college_data/emp_images/' . $pic, 'employee', array('width' => 200, 'height' => 200)); ?> </div> </div>
if($employee_transaction[0]->employee_transaction_emp_address_id != null) $EmployeeAddress = EmployeeAddress::model()->findByPk($employee_transaction[0]->employee_transaction_emp_address_id); else $EmployeeAddress = new EmployeeAddress; ?> <h3 class="title">Employee Detail</h3> <table class="no_border"> <tr> <td rowspan='4' width="135px" align="center" style="border:1px solid #74b9f0;"> <img src="college_data/emp_images/<?php echo EmployeePhotos::model()->findBypk($employee_transaction[0]-> employee_transaction_emp_photos_id)->employee_photos_path; ?>" height="147px" width="129px"/> </td> <td class="label" width="130px;" style="border:1.5px solid white;"><b>Name</b></td><td><?php echo $EmployeeInfo->employee_first_name." ".$EmployeeInfo->employee_middle_name." ".$EmployeeInfo->employee_last_name;?></td> </tr> <tr style="background:none"> <td class="label" style="border:1.5px solid white;"><b>Attendance Card Id<b/></td><td><?php echo $EmployeeInfo->employee_attendance_card_id;?></td> </tr> <tr> <td class="label" style="border:1.5px solid white;"><b>Designation</b></td><td><?php echo $EmployeeDesignation->employee_designation_name;?></td> </tr> <tr style="background:none"> <td class="label" style="border:1.5px solid white;"><b>Department</b></td><td><?php echo $Department->department_name;?></td> </tr>
/** * 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 = EmployeePhotos::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
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); } //$assign_comp_model = assignCompanyUserTable::model()->findByPk($ass_comp->id); $dir1 = Yii::getPathOfAlias('webroot') . '/college_data/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(); } EmployeeAcademicRecordTrans::model()->deleteAll(" \temployee_academic_record_trans_user_id= :empId", array(':empId' => $id)); EmployeeDocsTrans::model()->deleteAll("employee_docs_trans_user_id = :empId", array(':empId' => $id)); } // 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.'); } }
/** @return $menu. Return birth date of employee details of current date. */ public function Loadbirthdays() { $current_date = date('m-d'); $employee_info=EmployeeInfo::model()->findAll('DATE_FORMAT(employee_dob, "%m-%d")="'.$current_date.'"'); $menu = "<h2 style=text-align:center;>".date("d-M-Y")."</h2>"; foreach($employee_info as $emp) { $tran=EmployeeTransaction::model()->findByAttributes(array('employee_transaction_employee_id'=>$emp['employee_id'])); if(isset($tran)) { $menu .= '<div class="birthday">'; $photo=EmployeePhotos::model()->findByPk($tran['employee_transaction_emp_photos_id']); $menu .= '<span class="userimage">'; $user_image = Yii::app()->baseUrl.'/college_data/emp_images/no-images'; if(isset($photo)) { if(file_exists(Yii::app()->baseUrl.'/college_data/emp_images/'.$photo->employee_photos_path)) $user_image = Yii::app()->baseUrl.'/college_data/emp_images/'.$photo->employee_photos_path; } $menu .= CHtml::image($user_image,"No Image",array("width"=>"60px","height"=>"60px")); $menu .='</span><span class="username">'; $menu .= ucfirst(strtolower($emp->title)).' '.ucfirst(strtolower($emp->employee_first_name)).' '.ucfirst(strtolower($emp->employee_last_name)).'</span></br>'. ucfirst(strtolower($tran->Rel_Designation->employee_designation_name)).'</br>'.date_format(new DateTime($emp->employee_dob),'d-m-Y').'</div>'; } } return $menu; }
->where('et.employee_status = 0 AND DATE_FORMAT(ef.employee_dob, "%m-%d") = "'.date('m-d').'"') ->queryAll(); if(!empty($empDOB)) { ?> <div class="span3"> <div class="dashbox blue"> <div class="box-header blue"> <span class="title"><i class="fa fa-gift"></i> Today's birthday list</span> </div> <div class="box-content"> <?php foreach($empDOB as $list) { $picPath = EmployeePhotos::model()->findByPk($list['employee_transaction_emp_photos_id']); $designation = EmployeeDesignation::model()->findByPk($list['employee_transaction_designation_id']); $department = Department::model()->findByPk($list['employee_transaction_department_id']); ?> <div class="box-section"> <div class="avatar"><img src="<?php echo Yii::app()->baseUrl; ?>/college_data/emp_images/<?php echo $picPath->employee_photos_path; ?>" width="41" height="40"></div> <div class="news-content"> <div class="news-title"><?php echo $list['employee_first_name']." ".$list['employee_last_name']."<br><span style='color:#2572EB'>".$designation->employee_designation_name." / ".$department->department_name."</span>";?></div> <!--<div class="news-text">Today, 10:30 PM</div> --> </div> </div> <?php } ?>