Example #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = EmpInfo::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['emp_info_id' => $this->emp_info_id, 'emp_dob' => $this->emp_dob, 'emp_joining_date' => $this->emp_joining_date, 'emp_mobile_no' => $this->emp_mobile_no, 'emp_experience_year' => $this->emp_experience_year, 'emp_experience_month' => $this->emp_experience_month, 'emp_guardian_mobile_no' => $this->emp_guardian_mobile_no, 'emp_info_emp_master_id' => $this->emp_info_emp_master_id]);
     $query->andFilterWhere(['like', 'emp_unique_id', $this->emp_unique_id])->andFilterWhere(['like', 'emp_attendance_card_id', $this->emp_attendance_card_id])->andFilterWhere(['like', 'emp_title', $this->emp_title])->andFilterWhere(['like', 'emp_first_name', $this->emp_first_name])->andFilterWhere(['like', 'emp_middle_name', $this->emp_middle_name])->andFilterWhere(['like', 'emp_last_name', $this->emp_last_name])->andFilterWhere(['like', 'emp_name_alias', $this->emp_name_alias])->andFilterWhere(['like', 'emp_mother_name', $this->emp_mother_name])->andFilterWhere(['like', 'emp_gender', $this->emp_gender])->andFilterWhere(['like', 'emp_religion', $this->emp_religion])->andFilterWhere(['like', 'emp_bloodgroup', $this->emp_bloodgroup])->andFilterWhere(['like', 'emp_birthplace', $this->emp_birthplace])->andFilterWhere(['like', 'emp_email_id', $this->emp_email_id])->andFilterWhere(['like', 'emp_maritalstatus', $this->emp_maritalstatus])->andFilterWhere(['like', 'emp_photo', $this->emp_photo])->andFilterWhere(['like', 'emp_languages', $this->emp_languages])->andFilterWhere(['like', 'emp_bankaccount_no', $this->emp_bankaccount_no])->andFilterWhere(['like', 'emp_qualification', $this->emp_qualification])->andFilterWhere(['like', 'emp_specialization', $this->emp_specialization])->andFilterWhere(['like', 'emp_hobbies', $this->emp_hobbies])->andFilterWhere(['like', 'emp_reference', $this->emp_reference])->andFilterWhere(['like', 'emp_guardian_name', $this->emp_guardian_name])->andFilterWhere(['like', 'emp_guardian_relation', $this->emp_guardian_relation])->andFilterWhere(['like', 'emp_guardian_qualification', $this->emp_guardian_qualification])->andFilterWhere(['like', 'emp_guardian_occupation', $this->emp_guardian_occupation])->andFilterWhere(['like', 'emp_guardian_income', $this->emp_guardian_income])->andFilterWhere(['like', 'emp_guardian_homeadd', $this->emp_guardian_homeadd])->andFilterWhere(['like', 'emp_guardian_officeadd', $this->emp_guardian_officeadd])->andFilterWhere(['like', 'emp_guardian_phone_no', $this->emp_guardian_phone_no])->andFilterWhere(['like', 'emp_guardian_email_id', $this->emp_guardian_email_id]);
     return $dataProvider;
 }
Example #2
0
 public function actionEmployeeProfilePdf($eid)
 {
     $nationality = $empAdd = [];
     $empMaster = EmpMaster::findOne($eid);
     $empDocs = EmpDocs::find()->where(['emp_docs_emp_master_id' => $eid])->join('join', 'document_category dc', 'dc.doc_category_id = emp_docs_category_id AND dc.is_status <> 2')->all();
     $empInfo = EmpInfo::find()->where(['emp_info_emp_master_id' => $eid])->one();
     if ($empMaster->emp_master_nationality_id !== null) {
         $nationality = Nationality::findOne($empMaster->emp_master_nationality_id)->nationality_name;
     }
     if ($empMaster->emp_master_emp_address_id !== null) {
         $empAdd = EmpAddress::findOne($empMaster->emp_master_emp_address_id);
     }
     $html = $this->renderPartial('/emp-master/empprofilepdf', ['empDocs' => $empDocs, 'empMaster' => $empMaster, 'empInfo' => $empInfo, 'nationality' => $nationality, 'empAdd' => $empAdd]);
     $fName = $empInfo->emp_first_name . "_" . $empInfo->emp_last_name . "_" . date('Ymd_His');
     return Yii::$app->pdf->exportData(Yii::t('emp', 'Employee Profile'), $fName, $html);
 }
Example #3
0
                                            $add_co = '';
                                        }
                                        echo "<td class='text-center'>" . EmpAddress::findOne($sd['emp_master_emp_address_id'])->emp_padd . " " . $add_c . " " . $add_s . " " . $add_co . "</td>";
                                    } else {
                                        echo "<td>&nbsp;</td>";
                                    }
                                } else {
                                    if ($s == 'emp_joining_date') {
                                        $jdate = EmpInfo::findOne($sd['emp_master_emp_info_id'])->{$s};
                                        echo "<td class='text-center'>" . date('d-m-Y', strtotime($jdate)) . "</td>";
                                    } else {
                                        if ($s == 'emp_dob') {
                                            $bdate = EmpInfo::findOne($sd['emp_master_emp_info_id'])->{$s};
                                            echo "<td class='text-center'>" . date('d-m-Y', strtotime($bdate)) . "</td>";
                                        } else {
                                            echo "<td class='text-center'>" . EmpInfo::findOne($sd['emp_master_emp_info_id'])->{$s} . "</td>";
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        $i++;
        echo "</tr>";
        $m++;
    }
    echo "</table>";
}
                                     } else {
                                         echo "<td >&nbsp;</td>";
                                     }
                                 } else {
                                     if ($s == 'emp_joining_date') {
                                         $jdate = EmpInfo::findOne($sd['emp_master_emp_info_id'])->{$s};
                                         echo "<td style='text-align:center;width:250px;'>" . date('d-m-Y', strtotime($jdate)) . "</td>";
                                     } else {
                                         if ($s == 'emp_dob') {
                                             $bdate = EmpInfo::findOne($sd['emp_master_emp_info_id'])->{$s};
                                             echo "<td style='text-align:center;width:250px;'>" . date('d-m-Y', strtotime($bdate)) . "</td>";
                                         } else {
                                             if ($s == 'emp_email_id') {
                                                 echo "<td style='text-align:center;width:250px;'>" . Empinfo::findOne($sd['emp_master_emp_info_id'])->{$s} . "</td>";
                                             } else {
                                                 echo "<td style='align:center; valign:'middle';'>" . EmpInfo::findOne($sd['emp_master_emp_info_id'])->{$s} . "</td>";
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     $i++;
     echo "</tr>";
 }
 echo "</table></div>";
Example #5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEmpMasterEmpInfo()
 {
     return $this->hasOne(EmpInfo::className(), ['emp_info_id' => 'emp_master_emp_info_id']);
 }
 public function actionEmpPhoto($eid)
 {
     $model = $this->findModel($eid);
     $info = EmpInfo::findOne($model->emp_master_emp_info_id);
     $info->scenario = 'photo-upload';
     $old_photo = $info->emp_photo;
     if ($info->load(Yii::$app->request->post())) {
         $info->attributes = $_POST['EmpInfo'];
         $info->emp_photo = UploadedFile::getInstance($info, 'emp_photo');
         $model->updated_by = Yii::$app->getid->getId();
         $model->updated_at = new \yii\db\Expression('NOW()');
         if ($info->validate('emp_photo') && !empty($info->emp_photo)) {
             $ext = substr(strrchr($info->emp_photo, '.'), 1);
             $photo = $old_photo;
             $dir1 = Yii::getAlias('@webroot') . '/data/emp_images/';
             if (file_exists($dir1 . $photo) && $photo != 'no-photo' && $photo != NULL) {
                 unlink($dir1 . $photo);
             }
             if ($ext != null) {
                 $newfname = $info->emp_first_name . '_' . $info->emp_unique_id . '.' . $ext;
                 $returnResults = $info->emp_photo->saveAs(Yii::getAlias('@webroot') . '/data/emp_images/' . ($info->emp_photo = $newfname));
                 if ($returnResults) {
                     $info->save(false);
                 }
             }
         }
         return $this->redirect(['view', 'id' => $model->emp_master_id]);
     }
     return $this->renderAjax('photo_form', ['model' => $model, 'info' => $info]);
 }
Example #7
0
	    <div class="col-xs-12 col-sm-4 col-lg-4 form-group">
		<?php 
echo Html::label('Category', '');
?>
		<?php 
echo Html::dropDownList('category', null, ArrayHelper::map(\app\modules\employee\models\EmpCategory::find()->where(['is_status' => 0])->all(), 'emp_category_id', 'emp_category_name'), ['prompt' => 'Select Category', 'class' => 'form-control']);
?>
	    </div>			
	</div>
	<div class="row">
		<div class="col-xs-12 col-sm-4 col-lg-4 form-group">
			<?php 
echo Html::label('Gender', '');
?>
			<?php 
echo Html::dropDownList('gender', null, EmpInfo::getGenderOptions(), ['prompt' => 'Select Gender', 'class' => 'form-control']);
?>
		</div>
		<div class="col-xs-12 col-sm-4 col-lg-4 form-group">	
			<?php 
echo Html::label('City', '');
?>
			<?php 
echo Html::dropDownList('city', null, ArrayHelper::map(\app\models\City::find()->where(['is_status' => 0])->all(), 'city_id', 'city_name'), ['prompt' => 'Select City', 'class' => 'form-control']);
?>
		</div>
	</div>
	<hr>
	<div class="row">
		<?php 
echo $this->render('emp_select_form', ['query' => $query]);
Example #8
0
 /**
  * Finds the EmpInfo model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return EmpInfo the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = EmpInfo::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Example #9
0
 /** Use for update employee login user details.
  *  @param integer $id the ID of the model to be update.
  */
 public function actionUpdateemploginid($id)
 {
     $model = $this->findModel($id);
     $emp_data = EmpMaster::find()->where(['emp_master_user_id' => $id])->one();
     $emp_info = EmpInfo::findOne($emp_data->emp_master_emp_info_id)->emp_first_name;
     if (isset($_POST['User'])) {
         $model->attributes = $_POST['User'];
         $model->user_login_id = $_POST['User']['user_login_id'];
         \Yii::$app->session->setFlash('resetemploginid', "<i class='glyphicon glyphicon-info-sign'></i> " . $emp_info . "'s Login id is Reset");
         if ($model->save()) {
             \Yii::$app->session->setFlash('resetemploginid', "<i class='glyphicon glyphicon-info-sign'></i> " . $emp_info . "'s Login id is Reset");
             return $this->redirect(['resetemploginid']);
         }
     }
     return $this->render('updateemploginid', ['model' => $model]);
 }