Диплом: Автоматизация контроля качества работы персонала в ИП Мельникова

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
87
*/
public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'actions' => ['login', 'error'],
'allow' => true,
],
[
'actions' => ['logout', 'index'],
'allow' => true,
'roles' => ['@'],
],
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'logout' => ['post'],
88
],
],
];
}
/**
* {@inheritdoc}
*/
public function actions()
{
return [
'error' => [
'class' => 'yii\web\ErrorAction',
],
];
}
/**
* Displays homepage.
*
* @return string
*/
89
public function actionIndex()
{
return $this->render('index');
}
/**
* Login action.
*
* @return string
*/
public function actionLogin()
{
if (!Yii::$app->user->isGuest) {
return $this->goHome();
}
$model = new LoginForm();
if ($model->load(Yii::$app->request->post()) && $model->login()) {
return $this->goBack();
} else {
$model->password = '';
90
return $this->render('login', [
'model' => $model,
]);
}
}
/**
* Logout action.
*
* @return string
*/
public function actionLogout()
{
Yii::$app->user->logout();
return $this->goHome();
}
}
<?php
namespace backend\tests\functional;
91
use backend\tests\FunctionalTester;
use common\fixtures\UserFixture;
/**
* Class LoginCest
*/
class LoginCest
{
/**
* Load fixtures before db transaction begin
* Called in _before()
* @see \Codeception\Module\Yii2::_before()
* @see \Codeception\Module\Yii2::loadFixtures()
* @return array
*/
public function _fixtures()
{
return [
'user' => [
'class' => UserFixture::className(),
'dataFile' => codecept_data_dir() . 'login_data.php'
]
92
];
}
/**
* @param FunctionalTester $I
*/
public function loginUser(FunctionalTester $I)
{
$I->amOnPage('/site/login');
$I->fillField('Username', 'erau');
$I->fillField('Password', 'password_0');
$I->click('login-button');
$I->see('Logout (erau)', 'form button[type=submit]');
$I->dontSeeLink('Login');
$I->dontSeeLink('Signup');
}
}
?php
namespace backend\models;
use Yii;
/**
* This is the model class for table "{{%employee}}".
93
*
* @property int $id
* @property int $position_id
* @property string $surname
* @property string $name
* @property string|null $middle_name
* @property string|null $date_birth
* @property int $passport_series
* @property int $passport_number
* @property int $service_record_number
*
* @property CardEfficiency[] $cardEfficiencies
* @property CardEfficiency[] $cardEfficiencies0
* @property Position $position
* @property LogEfficiency[] $logEfficiencies
* @property PaySlip[] $paySlips
* @property ScheduleWorks[] $scheduleWorks
* @property SettlementAccount[] $settlementAccounts
* @property Shift[] $shifts
*/
class Employee extends \yii\db\ActiveRecord
{
94
/**
* {@inheritdoc}
*/
public static function tableName()
{
return '{{%employee}}';
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['position_id', 'surname', 'name', 'passport_series', 'passport_number',
'service_record_number'], 'required'],
[['position_id', 'passport_series', 'passport_number', 'service_record_number'],
'integer'],
[['date_birth'], 'safe'],
[['surname', 'name', 'middle_name'], 'string', 'max' => 255],
[['position_id'], 'exist', 'skipOnError' => true, 'targetClass' =>
Position::className(), 'targetAttribute' => ['position_id' => 'id']],
];
}
95
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'position_id' => 'Position ID',
'surname' => 'Surname',
'name' => 'Name',
'middle_name' => 'Middle Name',
'date_birth' => 'Date Birth',
'passport_series' => 'Passport Series',
'passport_number' => 'Passport Number',
'service_record_number' => 'Service Record Number',
];
}
/**
* Gets query for [[CardEfficiencies]].
*
* @return \yii\db\ActiveQuery
96
*/
public function getCardEfficiencies()
{
return $this->hasMany(CardEfficiency::className(), ['employee_id' => 'id']);
}
/**
* Gets query for [[CardEfficiencies0]].
*
* @return \yii\db\ActiveQuery
*/
public function getCardEfficiencies0()
{
return $this->hasMany(CardEfficiency::className(), ['leader_id' => 'id']);
}
/**
* Gets query for [[Position]].
*
* @return \yii\db\ActiveQuery
*/
public function getPosition()
{

Смотрите также:

"Автоматизация обработки заявок ООО "Проектно-Строительная Компания"
"Автоматизация процесса аттестации персонала для ООО "Нэт Бай Нэт Холдинг"
"Анализ интернет-активности конкурентов ( на примере конкурентов "Газпром нефть")
"Бухгалтерский учёт и аудит расчётов с подотчётними лицами в организации на примере ООО "ЛОЦ 10""
«Психологическое сопровождение персонала в организации на примере ООО «Крокус»
«Управление ресурсами проекта» (на примере организации ООО «ЛАКОСТЭ»)
Agile-методология в управлении проектами на примере ООО «Ресурсный центр «Академия КлассИнфо»
Aвтoмaтизaция пpoцecca вeдeния инфopмaциoннoй бaзы o дoлжнocтяx и вaкaнcияx c укaзaниeм тpeбoвaний к уpoвню знaний и нaвыкoв кaндидaтoв для гpуппы кaдpoв вoйcкoвoй чacти 3474»
Cовершенствование деловой оценки персонала в организации (на примере ООО "Даймонд кейтеринг развитие")
Cовершенствование управления рентабельности предприятия (на примере гуипп «бендерская типография «полиграфист»)