kokjan/frontend/controllers/BannerReportController.php

35 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2026-02-25 06:59:34 +00:00
<?php
namespace frontend\controllers;
use common\models\BannerReport;
use Yii;
use yii\base\Exception;
class BannerReportController extends \yii\web\Controller
{
public function actionIndex()
{
$model = new BannerReport();
if($model->load(Yii::$app->request->post()) && $model->save()) {
try {
Yii::$app->session->setFlash('success', 'บันทึกข้อมูลเรียบร้อยแล้ว กรุณารอการติดต่อกลับจากเจ้าหน้าที่');
Yii::$app->hanuman->sendNotify('แจ้งเบาะแสป้ายโฆษณาหรือสิ่งอื่นใดที่รุกล้ำทางสาธารณะที่ไม่ชอบด้วยกฎหมาย');
} catch (Exception $exception) {
Yii::$app->session->setFlash('error', $exception->getMessage());
}
return $this->redirect(['index']);
}
return $this->render('index', [
'model' => $model
]);
}
}