Hinzugefügt
Umfrage zum Impfstatus
This commit is contained in:
parent
3dfe08273e
commit
1da1de62cb
67
app/Http/Controllers/SurveyController.php
Normal file
67
app/Http/Controllers/SurveyController.php
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Created by PhpStorm.
|
||||||
|
* User: Marco Glietsch
|
||||||
|
* Date: 22.11.2018
|
||||||
|
* Time: 09:28
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use App\Models\SurveyCoronaState;
|
||||||
|
use App\Helpers\AccessHelper as Access;
|
||||||
|
use \Carbon\Carbon;
|
||||||
|
use Response;
|
||||||
|
use Illuminate\Support\Facades\Input;
|
||||||
|
use App\Helpers\StringHelper;
|
||||||
|
|
||||||
|
class SurveyController extends ExtendedController
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->middleware(['auth' => 'surveyPermissions'])->except('surveyCoronaState', 'surveyCoronaStateSave');
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function surveyCoronaState(Request $request)
|
||||||
|
{
|
||||||
|
$formdata = new SurveyCoronaState();
|
||||||
|
$view = view("inc.survey.coronaState");
|
||||||
|
$view->with('url', $this->route);
|
||||||
|
$view->with('formdata', $formdata);
|
||||||
|
|
||||||
|
return $view;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function surveyCoronaStateSave(Request $request)
|
||||||
|
{
|
||||||
|
$request->request->add(['city' => $request->city[0]]);
|
||||||
|
$formdata = $request->validate([
|
||||||
|
'department' => 'required',
|
||||||
|
'state' => 'required|min:3',
|
||||||
|
'expiration_date' => 'date_format:d.m.Y',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'department.required' => 'Pflichtfeld',
|
||||||
|
'state.required' => 'Pflichtfeld',
|
||||||
|
'state.min' => 'Mindestens :min Zeichen',
|
||||||
|
'birthday.date_format' => 'Das Datum muss im Format tt.mm.jjjj (tag.monat.jahr) eingegeben werden',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$model = new SurveyCoronaState();
|
||||||
|
$model->fill($request->all());
|
||||||
|
$model->expiration_date = Carbon::createFromFormat('d.m.Y', $request->birthday);
|
||||||
|
$model->department = $request->department[0];
|
||||||
|
$model->survey_id = 1;
|
||||||
|
$model->save();
|
||||||
|
|
||||||
|
$view = view("inc.contact.surveyCoronaStateSuccess");
|
||||||
|
|
||||||
|
|
||||||
|
return $view;
|
||||||
|
}
|
||||||
|
}
|
||||||
26
app/Models/SurveyCoronaState.php
Executable file
26
app/Models/SurveyCoronaState.php
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use App\Models\Traits\FullTextSearch;
|
||||||
|
use App\Models\Traits\Documents;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use OwenIt\Auditing\Contracts\Auditable;
|
||||||
|
use Illuminate\Support\Arr;
|
||||||
|
use Cviebrock\EloquentSluggable\Sluggable;
|
||||||
|
use App\Helpers\TagHelper;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use App\Helpers\PostHelper;
|
||||||
|
use App\Http\Controllers\ServiceController;
|
||||||
|
|
||||||
|
class SurveyCoronaState extends ExtendedModel
|
||||||
|
{
|
||||||
|
protected $fillable = [
|
||||||
|
'survey_id',
|
||||||
|
'department',
|
||||||
|
'state',
|
||||||
|
'expiration_date',
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $table = 'survey_corona_state';
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class CreateSurveyCoronaStateTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('survey_corona_state', function (Blueprint $table) {
|
||||||
|
$table->increments('id');
|
||||||
|
$table->integer('survey_id');
|
||||||
|
$table->string('department', 20);
|
||||||
|
$table->string('state', 50);
|
||||||
|
$table->date('expiration_date');
|
||||||
|
$table->timestamps();
|
||||||
|
$table->softDeletes();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('subscribe_vaccinate');
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
public/images/logo-175-m.png
Normal file
BIN
public/images/logo-175-m.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
@ -50,6 +50,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="post-item-container fixed-bottom m-3 p-3" style="width:250px;">
|
||||||
|
<div class="post-item card shadow-hover">
|
||||||
|
<a href="http://jubilaeum.feuerwehr-eppingen.de">
|
||||||
|
<div class="card-body mb-3 pb-0">
|
||||||
|
<h4 class="card-title">
|
||||||
|
Alles zum 175 jährigen Jubiläum finden sie hier
|
||||||
|
</h4>
|
||||||
|
<img src="{{ config('app.url') }}/images/logo-175-m.png" height="93">
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="footer-copyright py-3 text-center">
|
<div class="footer-copyright py-3 text-center">
|
||||||
© {{ date("Y") }} | <a href="/seite/datenschutzerklaerung">Datenschutz</a> | <a href="/seite/impressum">Impressum</a>
|
© {{ date("Y") }} | <a href="/seite/datenschutzerklaerung">Datenschutz</a> | <a href="/seite/impressum">Impressum</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user