/** * wordt gezet indien een contractaanbod wordt gedaan door de approxUser * @param string $code_title * @return string description **/ public function getEventDescription($code_title) { $approxuser = Gebruikers::findOne(['id' => Yii::$app->user->id]); $company = $approxuser->company; $titleDesc = CalendarCodeDescriptions::findOne(['code_title' => $code_title])->description; $BEDRIJFSNAAM = $company->name; $START = ''; return preg_replace('/\\{([A-Z]+)\\}/e', "\$\$1", $titleDesc); }
/** * wordt gezet indien een contractaanbod wordt gedaan door de approxUser * @param string $code_title * @return string description **/ public function getEventDescription($code_title) { $approxuser = Gebruikers::findOne(['id' => Yii::$app->user->id]); $company = $approxuser->company; $titleDesc = CalendarCodeDescriptions::findOne(['code_title' => $code_title])->description; $this->BEDRIJFSNAAM1 = $company->name; $this->START1 = ''; return preg_replace_callback('/\\{([A-Z]+)\\}/', function ($matches) { $a = ''; if ($matches[0] == '{BEDRIJFSNAAM}') { $a = $this->BEDRIJFSNAAM1; } elseif ($matches[0] == '{START}') { $a = $this->START1; } return $a; }, $titleDesc); }
/** * start de dialog om een contract aan te bieden **/ public function actionDialogContr() { $id = ArrayHelper::getValue($_POST, 'id'); $calenderevent = CalendarEvents::findOne(['id' => $id]); $start = substr($calenderevent->start, 0, 10); //Zie of er op die dag all contracten die zijn geaccepteerd. // $query = new Query(); $query->from('calendar_events'); $query->where(['start' => substr($calenderevent->start, 0, 10), 'user_id' => $calenderevent->user_id]); $query->andWhere(['like', 'code_title', 'Accep']); if ($query->count() > 0) { return $this->renderAjax('_dialogContrbezet', ['calenderevent' => $calenderevent]); } $usercv = UserCv::findOne(['user_id' => $calenderevent->user_id]); $user = User::findOne(['id' => $calenderevent->user_id]); $contractdeal = new ContractDeals(); $company = Company::findOne(['id' => $user->company_id]); $usercontactperson = Gebruikers::findOne(['id' => $calenderevent->user_id]); return $this->renderAjax('_dialogContr', ['calenderevent' => $calenderevent, 'company' => $company, 'usercv' => $usercv, 'contractdeal' => $contractdeal, 'user' => $user]); }
/** * Finds the Gebruikers model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Gebruikers the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Gebruikers::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }