Exemplo n.º 1
0
    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = Employee::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'employee_id' => $this->employee_id,
            'user_id' => $this->user_id,
        ]);

        $query->andFilterWhere(['like', 'emp_firstname', $this->emp_firstname])
            ->andFilterWhere(['like', 'emp_lastname', $this->emp_lastname])
            ->andFilterWhere(['like', 'emp_midname', $this->emp_midname])
            ->andFilterWhere(['like', 'emp_position', $this->emp_position])
            ->andFilterWhere(['like', 'emp_department', $this->emp_department]);

        return $dataProvider;
    }
Exemplo n.º 2
0
				//['label' => 'Migration', 'url' => ['/migrated-alumni/index']],
				['label' => 'Testimonials', 'url' => ['/testimonials/index']],
				['label' => 'Users', 'url' => ['/user/index']],
				[ 
                    'label' => 'Logout (' . Yii::$app->user->identity->username . ')',
                    'url' => ['/site/logout'],
                    'linkOptions' => ['data-method' => 'post']],
					
               
					
					
                ];
				
			}else if ($roles == 'user'){
			$userid = ArrayHelper::getValue(User::find()->where(['username' => Yii::$app->user->identity->username])->one(), 'id');
			$employeeid = ArrayHelper::getValue(Employee::find()->where(['user_id' => $userid])->one(), 'employee_id');

			
                $menuItems =[
				['label' => 'Home', 'url' => ['/site/index']],
				['label' => 'Alumni', 'url' => ['/alumni/index']],
				//['label' => 'City', 'url' => ['/city/index']],
				//['label' => 'Course', 'url' => ['/course/index']],
				//['label' => 'School', 'url' => ['/school/index']],
				//['label' => 'Province', 'url' => ['/province/index']],
				//['label' => 'Region', 'url' => ['/region/index']],
				//['label' => 'Employee', 'url' => ['/employee/view', 'id' => $employeeid]],
                ['label' => 'Event', 'url' => ['/event/index']],
				//['label' => 'Logs', 'url' => ['/logs/index']],
				//['label' => 'Migration', 'url' => ['/migration/index']],
				['label' => 'Testimonials', 'url' => ['/testimonials/index']],
Exemplo n.º 3
0
 public function actionProspek()
 {
     $regional = Regional::find()->all();
     $badanhukum = Employee::find()->select(['FIELD2'])->distinct('FIELD2')->all();
     $bussiness = Employee::find()->select(['FIELD9'])->distinct('FIELD9')->all();
     $query = new Query();
     $data = array();
     foreach ($regional as $rows) {
         $query->select('COUNT(*) AS JUMLAH')->from('TABLE2')->join('LEFT OUTER JOIN', 'TABLE3', 'TABLE3.FIELD2 = TABLE2.FIELD1')->where(['TABLE3.FIELD7' => $rows->FIELD1])->andWhere('TABLE3.FIELD3 IS NOT NULL')->all();
         $handphone = $query->createCommand()->queryScalar();
         $query->select('COUNT(*) AS JUMLAH')->from('TABLE2')->join('LEFT OUTER JOIN', 'TABLE3', 'TABLE3.FIELD2 = TABLE2.FIELD1')->where(['TABLE3.FIELD7' => $rows->FIELD1])->andWhere('TABLE3.FIELD6 IS NOT NULL')->all();
         $email = $query->createCommand()->queryScalar();
         $query->select('COUNT(*) AS JUMLAH')->from('TABLE2')->join('LEFT OUTER JOIN', 'TABLE3', 'TABLE3.FIELD2 = TABLE2.FIELD1')->where(['TABLE3.FIELD7' => $rows->FIELD1])->andWhere('TABLE2.FIELD7 IS NOT NULL')->all();
         $phone = $query->createCommand()->queryScalar();
         array_push($data, array('regional' => $rows->FIELD1, 'handphone' => $handphone, 'email' => $email, 'phone' => $phone));
     }
     return $this->render('prospek', ['data' => $data, 'regional' => $regional, 'badanhukum' => $badanhukum, 'bussiness' => $bussiness]);
 }