Final Roundmail system, show users with missing tips/jokers in playerlist as well.
This commit is contained in:
parent
6d7ee1a47c
commit
70e28110cb
19 changed files with 3700 additions and 66 deletions
231
pfosten/app/Http/Controllers/RoundmailController.php
Normal file
231
pfosten/app/Http/Controllers/RoundmailController.php
Normal file
|
|
@ -0,0 +1,231 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Roundmail;
|
||||
use App\User;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Mail\RoundmailMailer;
|
||||
use Auth;
|
||||
use DB;
|
||||
use Log;
|
||||
use Carbon;
|
||||
|
||||
class RoundmailController extends Controller
|
||||
{
|
||||
|
||||
public function index()
|
||||
{
|
||||
if (Auth::guest()) { return redirect("/"); }
|
||||
if (!Auth::user()->admin) { return redirect("/"); }
|
||||
|
||||
$mails_db = Roundmail::all();
|
||||
$mails=array();
|
||||
foreach($mails_db as $mail_db) {
|
||||
$fields=array();
|
||||
$fields['id'] = $mail_db->id;
|
||||
$fields['send_date'] = $mail_db->send_date;
|
||||
$fields['topic'] = $mail_db->topic;
|
||||
|
||||
$sender = User::where('id','=',$mail_db->user_id)->first();
|
||||
$sender_name="(Gelöschter Anwender)";
|
||||
if ($sender) { $sender_name=$sender->name; }
|
||||
$fields['sender'] = $sender_name;
|
||||
|
||||
array_push($mails,$fields);
|
||||
}
|
||||
$mails=array_reverse($mails);
|
||||
|
||||
return view('roundmails.index',compact('mails'));
|
||||
}
|
||||
|
||||
public function show($mail_id) {
|
||||
if (Auth::guest()) { return redirect("/"); }
|
||||
if (!Auth::user()->admin) { return redirect("/"); }
|
||||
|
||||
$user_id=Auth::user()->id;
|
||||
|
||||
$users = DB::table('users')->where('deleted',null)->orderBy('lastname')->get();
|
||||
|
||||
$active_users=array();
|
||||
$activeMailList=array();
|
||||
|
||||
|
||||
$inactive_users=array();
|
||||
$inactiveMailList=array();
|
||||
|
||||
|
||||
$missingTippMailList=array();
|
||||
$missingJokerMailList=array();
|
||||
|
||||
$adminMailList=array();
|
||||
|
||||
$topic="";
|
||||
//TODO: umrüsten für Anzeige von Bestandsmails
|
||||
$send_date = date("d.m.Y h:i:s", time());
|
||||
|
||||
|
||||
Log::info("Users to check for missing tipps:" . sizeof($users));
|
||||
foreach($users as $user) {
|
||||
if (User::is_season_paid($user->id)) {
|
||||
array_push($active_users,$user);
|
||||
array_push($activeMailList,$user->email);
|
||||
} else {
|
||||
array_push($inactive_users, $user);
|
||||
array_push($inactiveMailList,$user->email);
|
||||
}
|
||||
|
||||
//Log::info("user-id=".$user->id.", ".$user->name);
|
||||
//Log::info("Tipp: ".User::hasMissingTipp($user->id));
|
||||
|
||||
if (User::hasMissingTipp($user->id)) {
|
||||
array_push($missingTippMailList,$user->email);
|
||||
}
|
||||
|
||||
if (User::hasMissingJoker($user->id) ) {
|
||||
array_push($missingJokerMailList,$user->email);
|
||||
}
|
||||
|
||||
if ($user->admin==true) {
|
||||
array_push($adminMailList,$user->email);
|
||||
}
|
||||
}
|
||||
|
||||
Log::info("Size of missingMailist=".sizeof($missingTippMailList));
|
||||
|
||||
$activeMailList = implode(",",$activeMailList);
|
||||
$inactiveMailList = implode(",",$inactiveMailList);
|
||||
$missingTippMailList = implode(",",$missingTippMailList);
|
||||
$missingJokerMailList = implode(",",$missingJokerMailList);
|
||||
$adminMailList = implode(",",$adminMailList);
|
||||
|
||||
|
||||
|
||||
$topic="";
|
||||
$mail_message="";
|
||||
$sender_name=Auth::user()->name;
|
||||
$recipients="";
|
||||
$viewmode=false;
|
||||
if ($mail_id>-1) {
|
||||
$viewmode=true;
|
||||
$mail = Roundmail::where('id','=',$mail_id)->first();
|
||||
$send_date = $mail->send_date;
|
||||
$topic = $mail->topic;
|
||||
$mail_message = str_replace('<br/>','\n',$mail->message);
|
||||
$recipients = $mail->recipients;
|
||||
$sender = User::where('id','=',$mail->user_id)->first();
|
||||
$sender_name = $sender->name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return view('roundmails.show',compact('mail_id','activeMailList','inactiveMailList','missingTippMailList','missingJokerMailList','adminMailList','send_date','user_id','topic', 'mail_message', 'recipients', 'sender_name','viewmode'));
|
||||
|
||||
}
|
||||
|
||||
public function send() {
|
||||
if (Auth::guest()) { return redirect("/"); }
|
||||
if (!Auth::user()->admin) { return redirect("/"); }
|
||||
|
||||
|
||||
// Validate form
|
||||
$this->validate(request(), [
|
||||
'user_id' => 'required',
|
||||
'send_date' => 'required',
|
||||
'topic' => 'required',
|
||||
'message' => 'required',
|
||||
'recipients'=> 'required'
|
||||
]);
|
||||
|
||||
Log::info("Preparing to send from user_id ".request('user_id'));
|
||||
|
||||
/*
|
||||
foreach($users as $user) {
|
||||
|
||||
Log::info("Sending RoundmailMailer to: ".$user->name);
|
||||
\Mail::to($user)->send(new RoundmailMailer);
|
||||
}
|
||||
*/
|
||||
|
||||
$u = new User(['email'=>'magus@zauberturm.de','name'=>'Torsten der Schneider']);
|
||||
|
||||
|
||||
|
||||
$r = new RoundmailMailer();
|
||||
$r->user_id = Auth::user()->id;
|
||||
$r->send_date = Carbon\Carbon::now();
|
||||
$r->recipients = request('recipients');
|
||||
$r->topic = request('topic');
|
||||
$r->mail_message = str_replace("\n","<br/>", request('message'));
|
||||
|
||||
// Die hier ist nur für die DB
|
||||
$rm = new RoundMail();
|
||||
$rm->send_date=$r->send_date;
|
||||
$rm->recipients=$r->recipients;
|
||||
$rm->user_id=$r->user_id;
|
||||
$rm->topic=$r->topic;
|
||||
$rm->message=$r->mail_message;
|
||||
$rm->save();
|
||||
|
||||
\Mail::to(explode(",",$r->recipients))->send($r);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// COPY/PAST, please replace !
|
||||
|
||||
|
||||
$user_id=Auth::user()->id;
|
||||
|
||||
$users = DB::table('users')->where('deleted',null)->orderBy('lastname')->get();
|
||||
$active_users=array();
|
||||
$activeMailList=array();
|
||||
|
||||
|
||||
$inactive_users=array();
|
||||
$inactiveMailList=array();
|
||||
|
||||
$users_with_missing_tips=array(); // $users_with_missing_tips (or jokers)
|
||||
$missingMailList=array();
|
||||
|
||||
$adminMailList=array();
|
||||
|
||||
$topic="";
|
||||
//TODO: umrüsten für Anzeige von Bestandsmails
|
||||
$maildate = date("d.m.Y h:i:s", time());
|
||||
|
||||
foreach($users as $user) {
|
||||
if (User::is_season_paid($user->id)) {
|
||||
array_push($active_users,$user);
|
||||
array_push($activeMailList,$user->email);
|
||||
} else {
|
||||
array_push($inactive_users, $user);
|
||||
array_push($inactiveMailList,$user->email);
|
||||
}
|
||||
|
||||
if (User::hasMissingJoker($user->id) || User::hasMissingTipp($user->id)) {
|
||||
array_push($users_with_missing_tips,$user);
|
||||
array_push($missingMailList,$user->email);
|
||||
}
|
||||
|
||||
if ($user->admin) {
|
||||
array_push($adminMailList,$user->email);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$activeMailList = implode(",",$activeMailList);
|
||||
$inactiveMailList = implode(",",$inactiveMailList);
|
||||
$missingMailList = implode(",",$missingMailList);
|
||||
$adminMailList = implode(",",$adminMailList);
|
||||
|
||||
|
||||
$round_id=-1;
|
||||
return view('roundmails.show',compact('round_id','activeMailList','inactiveMailList','missingMailList','adminMailList','maildate','user_id','topic'));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@ use App\Season;
|
|||
use App\Round;
|
||||
use App\Game;
|
||||
use App\User;
|
||||
use App\Tipp;
|
||||
use DB;
|
||||
use Auth;
|
||||
use Log;
|
||||
|
|
@ -104,6 +105,8 @@ class RoundsController extends Controller
|
|||
]);
|
||||
// Sign them in
|
||||
|
||||
Tipp::createAllTips();
|
||||
|
||||
// Redirect to the home page
|
||||
return redirect('/rounds');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ use DB;
|
|||
|
||||
class TippsController extends Controller
|
||||
{
|
||||
//Duplicate from Tipps model
|
||||
//TODO: Refactor usage to use only the Tipps version
|
||||
public static function createTipps($user_id) {
|
||||
$activeSeason = Season::getCurrent();
|
||||
|
||||
|
|
@ -45,6 +47,8 @@ class TippsController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
//Duplicate from Tipps model
|
||||
//TODO: Refactor usage to use only the Tipps version
|
||||
public static function createAllTips(){
|
||||
$users = DB::table('users')->where('deleted',null)->get();
|
||||
foreach($users as $user) {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use App\Round;
|
|||
use App\Game;
|
||||
use App\Tipp;
|
||||
use App\Quota;
|
||||
use App\Mail\Roundmail;
|
||||
use App\Mail\RoundmailMailer;
|
||||
|
||||
use DB;
|
||||
use Auth;
|
||||
|
|
@ -24,6 +24,9 @@ class UsersController extends Controller
|
|||
$roundname="";
|
||||
$report="";
|
||||
|
||||
$result=User::hasMissingJoker(1);
|
||||
Log::info("!!! =>".$result);
|
||||
if (!$result) { Log::info("Joker is missing");}
|
||||
$currentSeason=Season::getCurrent();
|
||||
|
||||
$display_rounds=array();
|
||||
|
|
@ -51,19 +54,42 @@ class UsersController extends Controller
|
|||
if (Auth::guest()) { return redirect("/"); }
|
||||
if (!Auth::user()->admin) { return redirect("/"); }
|
||||
|
||||
|
||||
|
||||
$currentSeason=Season::getCurrent();
|
||||
$active_user_count = sizeof( DB::table('payments')->where('season_id',$currentSeason->id)->whereNotNull('paid_date')->get() );
|
||||
$total_user_count = sizeof( DB::table('payments')->where('season_id',$currentSeason->id)->get() );
|
||||
|
||||
$users = DB::table('users')->where('deleted',null)->orderBy('lastname')->get();
|
||||
|
||||
|
||||
foreach($users as $user) {
|
||||
Log::info($user->id);
|
||||
foreach($users as $key => $user) {
|
||||
// Log::info($users[0]->id);
|
||||
// Log::info($key);
|
||||
// Log::info($user->id);
|
||||
//
|
||||
// Log::info("------------------------------");
|
||||
|
||||
|
||||
if (User::hasMissingTipp($user->id)) {
|
||||
$users[$key]->missingTippText="Tipps fehlen";
|
||||
$users[$key]->tippStyling="red";
|
||||
} else {
|
||||
$users[$key]->missingTippText="Runde getippt";
|
||||
$users[$key]->tippStyling="green";
|
||||
}
|
||||
if (User::hasMissingJoker($user->id)) {
|
||||
$users[$key]->missingJokerText="Joker fehlt";
|
||||
$users[$key]->jokerStyling="red";
|
||||
} else {
|
||||
$users[$key]->missingJokerText="Joker gesetzt";
|
||||
$users[$key]->jokerStyling="green";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return view('users.index', compact('users','active_user_count'));
|
||||
return view('users.index', compact('users','active_user_count','total_user_count'));
|
||||
}
|
||||
/*
|
||||
public function showUsers() {
|
||||
|
|
@ -124,6 +150,8 @@ class UsersController extends Controller
|
|||
|
||||
Payment::set_payment_date(request('id'), $season_id, request('paid'));
|
||||
|
||||
Tipp::createAllTips();
|
||||
|
||||
return redirect('/users');
|
||||
}
|
||||
|
||||
|
|
@ -406,12 +434,12 @@ class UsersController extends Controller
|
|||
public function mailtest() {
|
||||
// Works:
|
||||
// $user = User::where('id','=',1)->first();
|
||||
// \Mail::to($user)->send(new Roundmail);
|
||||
// \Mail::to($user)->send(new RoundmailMailer);
|
||||
|
||||
$users = User::whereIn('id',array(1,2,7,57))->get();
|
||||
$users = User::whereIn('id',array(1))->get();
|
||||
foreach($users as $user) {
|
||||
Log::info("Sending Roundmail to: ".$user->name);
|
||||
\Mail::to($user)->send(new Roundmail);
|
||||
Log::info("Sending RoundmailMailer to: ".$user->name);
|
||||
\Mail::to($user)->send(new RoundmailMailer);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
42
pfosten/app/Mail/RoundmailMailer.php
Normal file
42
pfosten/app/Mail/RoundmailMailer.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
||||
class RoundmailMailer extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public $user_id;
|
||||
public $send_date;
|
||||
public $recipients;
|
||||
public $topic;
|
||||
public $mail_message;
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
|
||||
|
||||
public function build()
|
||||
{
|
||||
|
||||
return $this->subject($this->topic)->view('emails.roundmail');
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -38,7 +38,9 @@ class Round extends Model
|
|||
$games = Game::where('round_id','=',$round->id)->get();
|
||||
$completed = true;
|
||||
foreach($games as $game) {
|
||||
if ($game->score1==-1 || $game->score2==-1) { $completed=false; }
|
||||
if ($game->score1==-1 || $game->score2==-1) {
|
||||
$completed=false;
|
||||
}
|
||||
}
|
||||
return $completed;
|
||||
}
|
||||
|
|
@ -59,13 +61,7 @@ class Round extends Model
|
|||
$season_id = Season::getCurrent()->id;
|
||||
$rounds = Round::where('season_id','=',$season_id)->orderBy('id')->get();
|
||||
foreach($rounds as $round) {
|
||||
$games = Game::where('round_id','=',$round->id);
|
||||
foreach ($games as $game) {
|
||||
if ($game->score1 == -1 || $game->score2 == -1) {
|
||||
return $round->id;
|
||||
}
|
||||
}
|
||||
|
||||
if (!Round::isCompleted($round->id)) return $round->id;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
12
pfosten/app/Roundmail.php
Normal file
12
pfosten/app/Roundmail.php
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Roundmail extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'send_date', 'recipients','topic','message','user_id'
|
||||
];
|
||||
}
|
||||
|
|
@ -175,4 +175,40 @@ class Tipp extends Model
|
|||
|
||||
return $rStr;
|
||||
}
|
||||
|
||||
public static function createTipps($user_id) {
|
||||
$activeSeason = Season::getCurrent();
|
||||
|
||||
$rounds = Round::all()->where('season_id', '=', $activeSeason->id);
|
||||
foreach($rounds as $round) {
|
||||
|
||||
$games=Game::all()->where('round_id','=',$round->id);
|
||||
foreach($games as $game) {
|
||||
|
||||
// Tipp erzeugen wenn noch nicht vorhanden
|
||||
$tipp = DB::table('tipps')->where([
|
||||
['game_id','=',$game->id],
|
||||
['user_id','=',$user_id]]
|
||||
)->first();
|
||||
if (! $tipp) {
|
||||
Log::info('Creating missing tip: game_id=' . $game->id . ", user_id=" . $user->id);
|
||||
$tipp=Tipp::create([
|
||||
'user_id' => $user_id,
|
||||
'game_id'=> $game->id,
|
||||
'score1'=> -1,
|
||||
'score2'=> -1,
|
||||
'joker'=> false
|
||||
]);
|
||||
$tipp->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function createAllTips(){
|
||||
$users = DB::table('users')->where('deleted',null)->get();
|
||||
foreach($users as $user) {
|
||||
Tipp::createTipps($user->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,13 +132,20 @@ class User extends Authenticatable
|
|||
|
||||
public static function hasMissingTipp($user_id) {
|
||||
$round_id = Round::getFirstIncompleteRound();
|
||||
$games = Game::where('round_id','=',$round_id);
|
||||
$games = Game::where('round_id','=',$round_id)->get();
|
||||
|
||||
|
||||
|
||||
foreach ($games as $game) {
|
||||
$tipp = Tipp::where('game_id','=',$game->id)->first();
|
||||
$tipp = Tipp::where([['game_id','=',$game->id],['user_id','=',$user_id]])->first();
|
||||
|
||||
if ($tipp->score1 == -1 || $tipp->score2 == -1) {
|
||||
Log::info("!!! User ".$user_id." has a missing tipp for game_id ".$game->id.", round = ".$round_id);
|
||||
return 1;
|
||||
} else {
|
||||
if ($user_id==2) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -146,17 +153,26 @@ class User extends Authenticatable
|
|||
|
||||
public static function hasMissingJoker($user_id) {
|
||||
$round_id = Round::getFirstIncompleteRound();
|
||||
$games = Game::where('round_id','=',$round_id);
|
||||
|
||||
//Log::info("round_id for jokercheck=".$round_id);
|
||||
$games = Game::where('round_id','=',$round_id." user_id=".$user_id)->get();
|
||||
$joker=0;
|
||||
foreach ($games as $game) {
|
||||
$tipp = Tipp::where('game_id','=',$game->id)->first();
|
||||
|
||||
$tipp = Tipp::where([['game_id','=',$game->id],['user_id','=',$user_id]])->first();
|
||||
|
||||
|
||||
if(!$tipp) {
|
||||
Log::info("tipp is null! OMG! // Infos: user_id=".$user_id.", game_id=".$game->id.", round_id=".$round_id);
|
||||
}
|
||||
|
||||
if ($tipp->joker == true) { $joker=1; }
|
||||
//Log::info("!!! Joker for user_id ".$user_id.", round_id=".$round_id.", game_id=".$game->id." was found.");
|
||||
}
|
||||
|
||||
if ($joker==1) {
|
||||
return false;
|
||||
}
|
||||
Log::info("!!! Joker is missing for user_id=".$user_id." round_id=".$round_id);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
3207
pfosten/d0274241_2017-08-23_1729.sql
Normal file
3207
pfosten/d0274241_2017-08-23_1729.sql
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateRoundmailsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::dropIfExists('roundmails');
|
||||
Schema::create('roundmails', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('user_id');
|
||||
$table->date('send_date');
|
||||
$table->text('recipients',15000);
|
||||
$table->string('topic',200);
|
||||
$table->text('message',16000);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
Schema::dropIfExists('roundmails');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -2,18 +2,9 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Test</title>
|
||||
<title>{{ $topic }}</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Rundmail Test</h1>
|
||||
|
||||
<h3>Um nicht alle Spieler mit Spam zu belästigen, sende ich die Test-Rundmails in den nächsten Tagen</h3>
|
||||
<h3>an Euch Administratoren (Volker Geissler, Wilfried Moitzheim, Michael Schmitz).</h3>
|
||||
<p> </p>
|
||||
<h3>Seid tapfer, ich belästige euch mit dem Test-Spam nur für ein paar Tage ;-)</h3>
|
||||
<p> </p>
|
||||
<h3>Wenn diese Auto-Mails vor unleserlichen Sonderzeichen nur so strotzen, lasst es mich wissen: torsten.schneider@programmschmiede.de</h3>
|
||||
<p> </p>
|
||||
<h3>-Torsten.</h3>
|
||||
<h4>{!! $mail_message !!}</h4>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -8,8 +8,9 @@
|
|||
<a class="lead" href="/">Start</a>
|
||||
@if (Auth::user()->admin)
|
||||
<a class="lead" href="/seasons">Saison</a>
|
||||
<a class="lead" href="/rounds#{{\App\Round::getClosestRoundToNow()}}">Runden</a>
|
||||
<a class="lead" href="/rounds#{{\App\Round::getFirstIncompleteRound()}}">Runden</a>
|
||||
<a class="lead" href="/users">Spieler</a>
|
||||
<a class="lead" href="/roundmails">Rundmail</a>
|
||||
@endif
|
||||
<a class="lead" href="/users/show_payouts">Quoten</a>
|
||||
<a class="lead" href="/tipps">Tipps</a>
|
||||
|
|
|
|||
|
|
@ -4,17 +4,24 @@
|
|||
<section class="jumbotron text-center container">
|
||||
<!-- <div class="container"> -->
|
||||
|
||||
<span class="lead col-md-10" >Rundmails</span><a class="lead col-md-2" href="/roundmails/show/-1">Neue Rundmail</a>
|
||||
<span class="lead col-md-10" >Rundmails</span><a class="lead col-md-2" href="/roundmails/show/-1">Neue Rundmail</a>
|
||||
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
|
||||
<div class="col-md-10">
|
||||
<h4>(Neue Rundmail erstellen)</h4>
|
||||
<h4>(Datum-sortierte Liste der letzten Themen)</h4>
|
||||
<h4>(Mail-Liste)</h4>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<table>
|
||||
@foreach($mails as $mail )
|
||||
<tr>
|
||||
|
||||
<!-- </div> -->
|
||||
<td style='width:200px;'>{{ $mail['send_date'] }}</td>
|
||||
<td style='width:400px;'> <a href='/roundmails/show/{{ $mail['id'] }}'>{{ $mail['topic'] }} </a></td>
|
||||
<td style='width:200px;'> {{ $mail['sender'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- </div> -->
|
||||
|
||||
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -7,26 +7,23 @@
|
|||
<p> </p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<form method="POST" action="/roundmails/send" class="text-center col-md-12">
|
||||
{{ csrf_field() }}
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<label class="col-md-2" style="width:200px;">Datum der Mail</label>
|
||||
<input class="col-md-8" style="width:400px" value="xxxxxxx" readonly></input>
|
||||
<input class="col-md-8" style="width:400px" id="send_date" name="send_date" value="{{ $send_date }}" readonly></input>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label class="col-md-2" style="width:200px;">Versender:</label>
|
||||
<input class="col-md-8" style="width:400px" id="sender_name" name="sender_name" value="{{ $sender_name }}" readonly></input>
|
||||
</div>
|
||||
<p> </p>
|
||||
|
||||
<div class="col-md-12">
|
||||
<label class="col-md-2" style="width:200px;">Thema:</label>
|
||||
<input class="col-md-8" style="width:400px" name="topic" value="">
|
||||
<input class="col-md-8" style="width:400px" id="topic" name="topic" value="{{ $topic }}">
|
||||
</div>
|
||||
|
||||
|
||||
|
|
@ -35,7 +32,7 @@
|
|||
|
||||
<label>Empfänger:</label>
|
||||
<p> </p>
|
||||
<textarea id="recipients" name="recipients" class="form-control" style="min-height:150px;height:auto;">dummy@doof.de</textarea>
|
||||
<textarea id="recipients" name="recipients" class="form-control" style="min-height:150px;height:auto;">{{ $recipients }}</textarea>
|
||||
|
||||
|
||||
<p> </p>
|
||||
|
|
@ -46,17 +43,21 @@
|
|||
<button onClick="setAdminRecipient(); return false;">Alle Administatoren</button>
|
||||
<button onClick="setActiveRecipient(); return false;">Alle aktiven Spieler</button>
|
||||
<button onClick="setInactiveRecipient(); return false;">Alle inaktiven Spieler (keine Zahlung)</button>
|
||||
<button onClick="setMissingRecipient(); return false;">Alle Spieler mit fehlenden Eingaben</button>
|
||||
|
||||
<button onClick="setMissingTippRecipient(); return false;">Alle Spieler mit fehlenden Tipps</button>
|
||||
<button onClick="setMissingJokerRecipient(); return false;">Alle Spieler mit fehlenden Jokern</button>
|
||||
|
||||
<p> </p>
|
||||
<label>Nachricht</label>
|
||||
<textarea name="message" class="form-control" style="min-height:250px;height:auto;">I am a message text</textarea>
|
||||
|
||||
<textarea id="message" name="message" class="form-control" style="min-height:250px;height:auto;">{{$mail_message}}</textarea>
|
||||
<input type="hidden" id="user_id" name="user_id" value="{{ $user_id }}">
|
||||
|
||||
<p></p>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary">Senden</button>
|
||||
@if (!$viewmode)
|
||||
<button type="submit" class="btn btn-primary">Senden</button>
|
||||
@else
|
||||
<a href="/roundmails" style="font-size: 24px;">Zurück</a>
|
||||
@endif
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
|
@ -80,10 +81,16 @@
|
|||
elem.innerHTML = "{{ $inactiveMailList }}";
|
||||
}
|
||||
|
||||
function setMissingRecipient()
|
||||
function setMissingTippRecipient()
|
||||
{
|
||||
var elem = document.getElementById("recipients");
|
||||
elem.innerHTML = "{{ $missingMailList }}";
|
||||
elem.innerHTML = "{{ $missingTippMailList }}";
|
||||
}
|
||||
|
||||
function setMissingJokerRecipient()
|
||||
{
|
||||
var elem = document.getElementById("recipients");
|
||||
elem.innerHTML = "{{ $missingJokerMailList }}";
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,24 +4,28 @@
|
|||
<section class="jumbotron text-center container">
|
||||
<!-- <div class="container"> -->
|
||||
|
||||
<div class="lead col-md-8" >{{$active_user_count}} aktive Spieler:</div>
|
||||
<div class="lead col-md-8" >aktive Spieler: {{ $total_user_count }} , davon bezahlt: {{$active_user_count}}</div>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<div class="col-md-12">
|
||||
<table class="table-bordered" >
|
||||
<tr class="table-bordered">
|
||||
<td class="table-bordered col-std-4">Name</td>
|
||||
<td class="table-bordered col-std-2">Name</td>
|
||||
<td class="table-bordered col-std-2"> Saison bezahlt </td>
|
||||
<td class="table-bordered col-std-4"> E-Mail Adresse </td>
|
||||
<td class="table-bordered col-std-2"> E-Mail Adresse </td>
|
||||
<td class="table-bordered col-std-2">Status</td>
|
||||
<td class="table_bordered col-std-2">Tipps</td>
|
||||
<td class="table_bordered col-std-2">Joker</td>
|
||||
</tr>
|
||||
@foreach($users as $user)
|
||||
<tr>
|
||||
<td class="table-bordered col-md-4" > <a class="text list-unstyled" href="/users/edit/{{$user->id}}">{{ $user->name }} </a></td>
|
||||
<td class="table-bordered">{{ App\User::is_season_paid($user->id) }}</td>
|
||||
<td>{{ $user->email }}</td>
|
||||
<td class="table-bordered"> {{ ($user->admin ? "Administrator":"Spieler") }} </td>
|
||||
<td class="table-bordered"> {{ ($user->admin ? "Administrator":"Spieler") }} </td>
|
||||
<td class="table-bordered" style="color:#bfd7d8;background-color:{{$user->tippStyling}};"> {{ $user->missingTippText }} </td>
|
||||
<td class="table-bordered" style="color:#bfd7d8;background-color:{{$user->jokerStyling}};"> {{ $user->missingJokerText }} </td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
*/
|
||||
|
||||
|
||||
Route::get('/','UsersController@main')->name('home');
|
||||
|
||||
Route::get('/register','RegistrationController@create');
|
||||
Route::post('/register','RegistrationController@store');
|
||||
|
||||
|
|
@ -19,9 +21,6 @@ Route::get('/login','SessionsController@create');
|
|||
Route::post('/login','SessionsController@store');
|
||||
Route::get('/logout','SessionsController@destroy');
|
||||
|
||||
|
||||
Route::get('/','UsersController@main')->name('home');
|
||||
|
||||
Route::get('/seasons','SeasonsController@index');
|
||||
Route::get('/seasons/create','SeasonsController@create');
|
||||
Route::post('/seasons/store','SeasonsController@store');
|
||||
|
|
@ -50,7 +49,8 @@ Route::get('/tipps','TippsController@index');
|
|||
Route::get('/tipps/edit/{tipp_id}','TippsController@edit');
|
||||
Route::post('/tipps/store','TippsController@store');
|
||||
|
||||
Route::get('/email','UsersController@mailtest2');
|
||||
Route::get('/email','UsersController@mailtest');
|
||||
|
||||
Route::get('/roundmails','RoundmailController@index');
|
||||
Route::get('/roundmails/show/{mail_id}','RoundmailController@show');
|
||||
Route::post('/roundmails/send','RoundmailController@send');
|
||||
|
|
@ -17,6 +17,7 @@ return array(
|
|||
'App\\Http\\Controllers\\GamesController' => $baseDir . '/app/Http/Controllers/GamesController.php',
|
||||
'App\\Http\\Controllers\\PaymentController' => $baseDir . '/app/Http/Controllers/PaymentController.php',
|
||||
'App\\Http\\Controllers\\RegistrationController' => $baseDir . '/app/Http/Controllers/RegistrationController.php',
|
||||
'App\\Http\\Controllers\\RoundmailController' => $baseDir . '/app/Http/Controllers/RoundmailController.php',
|
||||
'App\\Http\\Controllers\\RoundsController' => $baseDir . '/app/Http/Controllers/RoundsController.php',
|
||||
'App\\Http\\Controllers\\SeasonsController' => $baseDir . '/app/Http/Controllers/SeasonsController.php',
|
||||
'App\\Http\\Controllers\\SessionsController' => $baseDir . '/app/Http/Controllers/SessionsController.php',
|
||||
|
|
@ -28,6 +29,7 @@ return array(
|
|||
'App\\Http\\Middleware\\RedirectIfAuthenticated' => $baseDir . '/app/Http/Middleware/RedirectIfAuthenticated.php',
|
||||
'App\\Http\\Middleware\\TrimStrings' => $baseDir . '/app/Http/Middleware/TrimStrings.php',
|
||||
'App\\Http\\Middleware\\VerifyCsrfToken' => $baseDir . '/app/Http/Middleware/VerifyCsrfToken.php',
|
||||
'App\\Mail\\RoundmailMailer' => $baseDir . '/app/Mail/RoundmailMailer.php',
|
||||
'App\\Payment' => $baseDir . '/app/Payment.php',
|
||||
'App\\Providers\\AppServiceProvider' => $baseDir . '/app/Providers/AppServiceProvider.php',
|
||||
'App\\Providers\\AuthServiceProvider' => $baseDir . '/app/Providers/AuthServiceProvider.php',
|
||||
|
|
@ -36,6 +38,7 @@ return array(
|
|||
'App\\Providers\\RouteServiceProvider' => $baseDir . '/app/Providers/RouteServiceProvider.php',
|
||||
'App\\Quota' => $baseDir . '/app/Quota.php',
|
||||
'App\\Round' => $baseDir . '/app/Round.php',
|
||||
'App\\Roundmail' => $baseDir . '/app/Roundmail.php',
|
||||
'App\\Season' => $baseDir . '/app/Season.php',
|
||||
'App\\Setting' => $baseDir . '/app/Setting.php',
|
||||
'App\\Tipp' => $baseDir . '/app/Tipp.php',
|
||||
|
|
@ -54,6 +57,7 @@ return array(
|
|||
'CreatePasswordResetsTable' => $baseDir . '/database/migrations/2014_10_12_100000_create_password_resets_table.php',
|
||||
'CreatePaymentsTable' => $baseDir . '/database/migrations/2017_06_19_112638_create_payments_table.php',
|
||||
'CreateQuotasTable' => $baseDir . '/database/migrations/2017_08_16_164654_create_quotas_table.php',
|
||||
'CreateRoundmailsTable' => $baseDir . '/database/migrations/2017_08_22_111913_create_roundmails_table.php',
|
||||
'CreateRoundsTable' => $baseDir . '/database/migrations/2017_06_19_112646_create_rounds_table.php',
|
||||
'CreateSeasonsTable' => $baseDir . '/database/migrations/2017_06_19_112652_create_seasons_table.php',
|
||||
'CreateSettingsTable' => $baseDir . '/database/migrations/2017_06_19_112625_create_settings_table.php',
|
||||
|
|
|
|||
4
pfosten/vendor/composer/autoload_static.php
vendored
4
pfosten/vendor/composer/autoload_static.php
vendored
|
|
@ -289,6 +289,7 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
'App\\Http\\Controllers\\GamesController' => __DIR__ . '/../..' . '/app/Http/Controllers/GamesController.php',
|
||||
'App\\Http\\Controllers\\PaymentController' => __DIR__ . '/../..' . '/app/Http/Controllers/PaymentController.php',
|
||||
'App\\Http\\Controllers\\RegistrationController' => __DIR__ . '/../..' . '/app/Http/Controllers/RegistrationController.php',
|
||||
'App\\Http\\Controllers\\RoundmailController' => __DIR__ . '/../..' . '/app/Http/Controllers/RoundmailController.php',
|
||||
'App\\Http\\Controllers\\RoundsController' => __DIR__ . '/../..' . '/app/Http/Controllers/RoundsController.php',
|
||||
'App\\Http\\Controllers\\SeasonsController' => __DIR__ . '/../..' . '/app/Http/Controllers/SeasonsController.php',
|
||||
'App\\Http\\Controllers\\SessionsController' => __DIR__ . '/../..' . '/app/Http/Controllers/SessionsController.php',
|
||||
|
|
@ -300,6 +301,7 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
'App\\Http\\Middleware\\RedirectIfAuthenticated' => __DIR__ . '/../..' . '/app/Http/Middleware/RedirectIfAuthenticated.php',
|
||||
'App\\Http\\Middleware\\TrimStrings' => __DIR__ . '/../..' . '/app/Http/Middleware/TrimStrings.php',
|
||||
'App\\Http\\Middleware\\VerifyCsrfToken' => __DIR__ . '/../..' . '/app/Http/Middleware/VerifyCsrfToken.php',
|
||||
'App\\Mail\\RoundmailMailer' => __DIR__ . '/../..' . '/app/Mail/RoundmailMailer.php',
|
||||
'App\\Payment' => __DIR__ . '/../..' . '/app/Payment.php',
|
||||
'App\\Providers\\AppServiceProvider' => __DIR__ . '/../..' . '/app/Providers/AppServiceProvider.php',
|
||||
'App\\Providers\\AuthServiceProvider' => __DIR__ . '/../..' . '/app/Providers/AuthServiceProvider.php',
|
||||
|
|
@ -308,6 +310,7 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
'App\\Providers\\RouteServiceProvider' => __DIR__ . '/../..' . '/app/Providers/RouteServiceProvider.php',
|
||||
'App\\Quota' => __DIR__ . '/../..' . '/app/Quota.php',
|
||||
'App\\Round' => __DIR__ . '/../..' . '/app/Round.php',
|
||||
'App\\Roundmail' => __DIR__ . '/../..' . '/app/Roundmail.php',
|
||||
'App\\Season' => __DIR__ . '/../..' . '/app/Season.php',
|
||||
'App\\Setting' => __DIR__ . '/../..' . '/app/Setting.php',
|
||||
'App\\Tipp' => __DIR__ . '/../..' . '/app/Tipp.php',
|
||||
|
|
@ -326,6 +329,7 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb
|
|||
'CreatePasswordResetsTable' => __DIR__ . '/../..' . '/database/migrations/2014_10_12_100000_create_password_resets_table.php',
|
||||
'CreatePaymentsTable' => __DIR__ . '/../..' . '/database/migrations/2017_06_19_112638_create_payments_table.php',
|
||||
'CreateQuotasTable' => __DIR__ . '/../..' . '/database/migrations/2017_08_16_164654_create_quotas_table.php',
|
||||
'CreateRoundmailsTable' => __DIR__ . '/../..' . '/database/migrations/2017_08_22_111913_create_roundmails_table.php',
|
||||
'CreateRoundsTable' => __DIR__ . '/../..' . '/database/migrations/2017_06_19_112646_create_rounds_table.php',
|
||||
'CreateSeasonsTable' => __DIR__ . '/../..' . '/database/migrations/2017_06_19_112652_create_seasons_table.php',
|
||||
'CreateSettingsTable' => __DIR__ . '/../..' . '/database/migrations/2017_06_19_112625_create_settings_table.php',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue