Диплом: Автоматизация управленческого учета в дошкольном образовательном учреждении (на примере ИП «Мельникова»)

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
87
*/
public function actionLogout()
{
Yii::$app->user->logout();
return $this->goHome();
}
}
<?php
namespace backend\controllers;
use Yii;
use backend\models\Child;
use backend\models\ChildSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
/**
* ChildController implements the CRUD actions for Child model.
*/
class ChildController extends Controller
{
/**
* {@inheritdoc}
*/
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
88
];
}
/**
* Lists all Child models.
* @return mixed
*/
public function actionIndex()
{
$searchModel = new ChildSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
* Displays a single Child model.
* @param integer $id
* @return mixed
* @throws NotFoundHttpException if the model cannot be found
*/
public function actionView($id)
{
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* Creates a new Child model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
89
{
$model = new Child();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
}
return $this->render('create', [
'model' => $model,
]);
}
/**
* Updates an existing Child model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id
* @return mixed
* @throws NotFoundHttpException if the model cannot be found
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
}
return $this->render('update', [
'model' => $model,
]);
}
/**
* Deletes an existing Child model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* @param integer $id
* @return mixed
90
* @throws NotFoundHttpException if the model cannot be found
*/
public function actionDelete($id)
{
$this->findModel($id)->delete();
return $this->redirect(['index']);
}
/**
* Finds the Child model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Child the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = Child::findOne($id)) !== null) {
return $model;
}
throw new NotFoundHttpException('The requested page does not exist.');
}
}
<?php
namespace backend\models;
use Yii;
/**
* This is the model class for table "{{%child}}".
*
* @property int $id
* @property int $parent_id
91
* @property string $full_name
* @property string|null $medical_data
*
* @property ParentModel $parent
* @property Poll[] $polls
* @property Questionnaire[] $questionnaires
* @property Request[] $requests
* @property Test[] $tests
*/
class Child extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return '{{%child}}';
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['parent_id', 'full_name'], 'required'],
[['parent_id'], 'integer'],
[['medical_data'], 'string'],
[['full_name'], 'string', 'max' => 255],
[['parent_id'], 'exist', 'skipOnError' => true, 'targetClass' =>
ParentModel::className(), 'targetAttribute' => ['parent_id' => 'id']],
];
}
/**
* {@inheritdoc}
*/
92
public function attributeLabels()
{
return [
'id' => 'ID',
'parent_id' => 'Parent ID',
'full_name' => 'Full Name',
'medical_data' => 'Medical Data',
];
}
/**
* Gets query for [[Parent]].
*
* @return \yii\db\ActiveQuery
*/
public function getParent()
{
return $this->hasOne(Parent::className(), ['id' => 'parent_id']);
}
/**
* Gets query for [[Polls]].
*
* @return \yii\db\ActiveQuery
*/
public function getPolls()
{
return $this->hasMany(Poll::className(), ['child_id' => 'id']);
}
/**
* Gets query for [[Questionnaires]].
*
* @return \yii\db\ActiveQuery
*/
public function getQuestionnaires()
{
93
return $this->hasMany(Questionnaire::className(), ['child_id' => 'id']);
}
/**
* Gets query for [[Requests]].
*
* @return \yii\db\ActiveQuery
*/
public function getRequests()
{
return $this->hasMany(Request::className(), ['child_id' => 'id']);
}
/**
* Gets query for [[Tests]].
*
* @return \yii\db\ActiveQuery
*/
public function getTests()
{
return $this->hasMany(Test::className(), ['child_id' => 'id']);
}
}
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\Child */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="child-form">
<?php $form = ActiveForm::begin(); ?>
94
<?= $form->field($model, 'parent_id')->textInput() ?>
<?= $form->field($model, 'full_name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'medical_data')->textarea(['rows' => 6]) ?>
<div class="form-group">
<?= Html::submitButton('Save', ['class' => 'btn btn-success']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\ChildSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="child-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
'options' => [
'data-pjax' => 1
],
]); ?>
<?= $form->field($model, 'id') ?>
95
<?= $form->field($model, 'parent_id') ?>
<?= $form->field($model, 'full_name') ?>
<?= $form->field($model, 'medical_data') ?>
<div class="form-group">
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton('Reset', ['class' => 'btn btn-outline-secondary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\models\Child */
$this->title = 'Create Child';
$this->params['breadcrumbs'][] = ['label' => 'Children', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="child-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
<?php
96
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\Pjax;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\ChildSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Children';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="child-index">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Create Child', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?php Pjax::begin(); ?>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
'parent_id',
'full_name',
'medical_data:ntext',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>

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

"Автоматизация обработки заявок ООО "Проектно-Строительная Компания"
"Автоматизация процесса аттестации персонала для ООО "Нэт Бай Нэт Холдинг"
"Анализ интернет-активности конкурентов ( на примере конкурентов "Газпром нефть")
"Бухгалтерский учёт и аудит расчётов с подотчётними лицами в организации на примере ООО "ЛОЦ 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овершенствование управления рентабельности предприятия (на примере гуипп «бендерская типография «полиграфист»)
Event - менеджмент: реализация проекта (на примере ООО "АГРОПАК")