Диплом: Автоматизация приема и обработки заявок отделом техподдержки (на примере ООО "Гарпикс")

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
110
* @return mixed
*/
public function actionIndex()
{
Yii::$app->user->identity->accessAdminOnly;
$dataProvider = new ActiveDataProvider(['query' =>
ClaimType::find(),]);
return $this->render('index', ['dataProvider' => $dataProvider,]);
}
/**
* Displays a single ClaimType model.
* @param integer $id
*
* @return mixed
*/
public function actionView($id)
{
Yii::$app->user->identity->accessAdminOnly;
return $this->render('view', ['model' => $this->findModel($id),]);
}
/**
* Creates a new ClaimType model.
* If creation is successful, the browser will be redirected to the 'view' page.
*
* @return mixed
111
*/
public function actionCreate()
{
Yii::$app->user->identity->accessAdminOnly;
$model = new ClaimType();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('create', ['model' => $model,]);
}
}
/**
* Updates an existing ClaimType model.
* If update is successful, the browser will be redirected to the 'view' page.
*
* @return mixed
*/
public function actionUpdate($id)
{
Yii::$app->user->identity->accessAdminOnly;
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('update', ['model' => $model,]);
}
}
112
/**
* Deletes an existing ClaimType model.
* If deletion is successful, the browser will be redirected to the 'index'
page.
* @param integer $id
*
* @return mixed
*/
public function actionDelete($id)
{
Yii::$app->user->identity->accessAdminOnly;
$this->findModel($id)->delete();
return $this->redirect(['index']);
}
/**
* Finds the ClaimType model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
*
* @return ClaimType the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = ClaimType::findOne($id)) !== null) {
return $model;
} else {
113
throw new NotFoundHttpException('The requested page does not
exist.');
}
}
}
?>
<?php
namespace app\controllers;
use Yii;
use app\models\DayType;
use yii\data\ActiveDataProvider;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
/**
* DayTypeController implements the CRUD actions for DayType model.
*/
class DayTypeController extends Controller
{
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['post'],
114
],
],
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'actions' => ['index', 'view', 'create', 'update', 'delete'],
'allow' => true,
'roles' => [
'@'
],
],
],
],
];
}
/**
* Lists all DayType models.
*
* @return mixed
*/
public function actionIndex()
{
Yii::$app->user->identity->accessAdminOnly;
$dataProvider = new ActiveDataProvider(['query' => DayType::find(),]);
return $this->render('index', ['dataProvider' => $dataProvider,]);
}
115
/**
* Displays a single DayType model
* @param integer $id
*
* @return mixed
*/
public function actionView($id)
{
Yii::$app->user->identity->accessAdminOnly;
return $this->render('view', ['model' => $this->findModel($id),]);
}
/**
* Creates a new DayType model.
* If creation is successful, the browser will be redirected to the 'view' page.
*
* @return mixed
*/
public function actionCreate()
{
Yii::$app->user->identity->accessAdminOnly;
$model = new DayType();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('create', ['model' => $model,]);
}
}
116
/**
* Updates an existing DayType model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id
*
* @return mixed
*/
public function actionUpdate($id)
{
Yii::$app->user->identity->accessAdminOnly;
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('update', ['model' => $model,]);
}
}
/**
* Deletes an existing DayType model.
* If deletion is successful, the browser will be redirected to the 'index'
page.
* @param integer $id
*
* @return mixed
*/
public function actionDelete($id)
{
Yii::$app->user->identity->accessAdminOnly;
117
$this->findModel($id)->delete();
return $this->redirect(['index']);
}
/** * Finds the DayType model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
*
* @return DayType the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = DayType::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not
exist.');
}
}
}
?>
<?php
namespace app\controllers;
use Yii;
use app\models\Defect;
use yii\data\ActiveDataProvider;
use yii\web\Controller;
118
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
/**
* DefectController implements the CRUD actions for Defect model.
*/
class DefectController extends Controller
{
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => [
'post'
],
],
],
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'actions' => ['index', 'view', 'create', 'update', 'delete'],
'allow' => true,
'roles' => [
'@'
],
119
],
],
],
];
}
/**
* Lists all Defect models.
*
* @return mixed
*/
public function actionIndex()
{
Yii::$app->user->identity->accessAdminOnly;
$dataProvider = new ActiveDataProvider(['query' => Defect::find(),]);
return $this->render('index', ['dataProvider' => $dataProvider,]);
}
/**
* Displays a single Defect model.
* @param integer $id
*
* @return mixed
*/
public function actionView($id)
{
Yii::$app->user->identity->accessAdminOnly;
return $this->render('view', ['model' => $this->findModel($id),]);
}

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

"Автоматизация обработки заявок ООО "Проектно-Строительная Компания"
"Автоматизация процесса аттестации персонала для ООО "Нэт Бай Нэт Холдинг"
"Анализ интернет-активности конкурентов ( на примере конкурентов "Газпром нефть")
"Бухгалтерский учёт и аудит расчётов с подотчётними лицами в организации на примере ООО "ЛОЦ 10""
«Психологическое сопровождение персонала в организации на примере ООО «Крокус»
Cовершенствование деловой оценки персонала в организации (на примере ООО "Даймонд кейтеринг развитие")
IPO - инструмент финансирования деятельности организации. На примере ПАО «Нефтяная компания «Лукойл»
PR как средство продвижения организации (на примере ПАО "Тамбовский завод "Комсомолец им. Н.С. Артемова")
PR-коммуникации в сфере общественного питания (на примере кафе-кондитерской «Cream Cheese»)
SMM как средство повышения эффективности работы учреждений социокультурной сферы (на примере Малого театра)