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

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
97
<?php Pjax::end(); ?>
</div>
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\models\Child */
$this->title = 'Update Child: ' . $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Children', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model-
>id]];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="child-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\models\Child */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Children', 'url' => ['index']];
98
$this->params['breadcrumbs'][] = $this->title;
\yii\web\YiiAsset::register($this);
?>
<div class="child-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Delete', ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'parent_id',
'full_name',
'medical_data:ntext',
],
]) ?>
</div>
<?php
namespace backend\controllers;
use Yii;
use backend\models\Test;
use backend\models\TestSearch;
99
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
/**
* TestController implements the CRUD actions for Test model.
*/
class TestController extends Controller
{
/**
* {@inheritdoc}
*/
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
];
}
/**
* Lists all Test models.
* @return mixed
*/
public function actionIndex()
{
$searchModel = new TestSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
100
}
/**
* Displays a single Test 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 Test model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new Test();
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 Test model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id
101
* @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 Test model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* @param integer $id
* @return mixed
* @throws NotFoundHttpException if the model cannot be found
*/
public function actionDelete($id)
{
$this->findModel($id)->delete();
return $this->redirect(['index']);
}
/**
* Finds the Test model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Test the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
102
protected function findModel($id)
{
if (($model = Test::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 "{{%test}}".
*
* @property int $id
* @property int $parent_id
* @property int $child_id
* @property string $result
* @property string $duration
* @property string $date
*
* @property Report[] $reports
* @property Child $child
* @property Parent $parent
*/
class Test extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
103
return '{{%test}}';
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['parent_id', 'child_id', 'result', 'duration', 'date'], 'required'],
[['parent_id', 'child_id'], 'integer'],
[['result'], 'string'],
[['duration', 'date'], 'safe'],
[['child_id'], 'exist', 'skipOnError' => true, 'targetClass' => Child::className(),
'targetAttribute' => ['child_id' => 'id']],
[['parent_id'], 'exist', 'skipOnError' => true, 'targetClass' => Parent::className(),
'targetAttribute' => ['parent_id' => 'id']],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'parent_id' => 'Parent ID',
'child_id' => 'Child ID',
'result' => 'Result',
'duration' => 'Duration',
'date' => 'Date',
];
}
/**
* Gets query for [[Reports]].
104
*
* @return \yii\db\ActiveQuery
*/
public function getReports()
{
return $this->hasMany(Report::className(), ['test_id' => 'id']);
}
/**
* Gets query for [[Child]].
*
* @return \yii\db\ActiveQuery
*/
public function getChild()
{
return $this->hasOne(Child::className(), ['id' => 'child_id']);
}
/**
* Gets query for [[Parent]].
*
* @return \yii\db\ActiveQuery
*/
public function getParent()
{
return $this->hasOne(Parent::className(), ['id' => 'parent_id']);
}
}
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\Test */
/* @var $form yii\widgets\ActiveForm */
?>
105
<div class="test-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'parent_id')->textInput() ?>
<?= $form->field($model, 'child_id')->textInput() ?>
<?= $form->field($model, 'result')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'duration')->textInput() ?>
<?= $form->field($model, 'date')->textInput() ?>
<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\TestSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="test-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
106
'method' => 'get',
'options' => [
'data-pjax' => 1
],
]); ?>
<?= $form->field($model, 'id') ?>
<?= $form->field($model, 'parent_id') ?>
<?= $form->field($model, 'child_id') ?>
<?= $form->field($model, 'result') ?>
<?= $form->field($model, 'duration') ?>
<?php // echo $form->field($model, 'date') ?>
<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\Test */
$this->title = 'Create Test';
$this->params['breadcrumbs'][] = ['label' => 'Tests', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;

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

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