Merge branch 'master' of https://github.com/sebathefox/skolehjem-webapp into master
This commit is contained in:
@@ -358,6 +358,42 @@ class UserController extends Controller
|
||||
return redirect()->route("users.index");
|
||||
}
|
||||
|
||||
public function createajax() {
|
||||
// Check the UserEvent table if there is a row that has the user_id AND the event_id
|
||||
$User = User::query()->where('id', '=', auth()->user()->id);
|
||||
|
||||
// If you are in the Event, then remove yourself.
|
||||
if (count($User->get()) > 0) {
|
||||
// If not, then it keeps going and saves and shows a success message
|
||||
$User->update([ "wants_emails" => true ]);
|
||||
|
||||
if (request()->cookie('languagesSetting') == "dk")
|
||||
return '<p class="text-center"><b>Du får nu mails, når der kommer nyheder!</b></p>';
|
||||
if (request()->cookie('languagesSetting') == "en")
|
||||
return "<p class='text-center'><b>You'll now receive a mail when there's news!</b></p>";
|
||||
|
||||
return '<p class="text-center"><b>Du får nu mails, når der kommer nyheder!</b></p>';
|
||||
}
|
||||
}
|
||||
|
||||
public function createajaxcancel() {
|
||||
// Check the UserEvent table if there is a row that has the user_id AND the event_id
|
||||
$User = User::query()->where('id', '=', auth()->user()->id);
|
||||
|
||||
// If you are in the Event, then remove yourself.
|
||||
if (count($User->get()) > 0) {
|
||||
// If not, then it keeps going and saves and shows a success message
|
||||
$User->update([ "wants_emails" => false ]);
|
||||
|
||||
if (request()->cookie('languagesSetting') == "dk")
|
||||
return '<p class="text-center"><b>Du får ikke mails mere, når kommer nyheder!</b></p>';
|
||||
if (request()->cookie('languagesSetting') == "en")
|
||||
return "<p class='text-center'><b>You'll no longer receive a mail when there's news!</b></p>";
|
||||
|
||||
return '<p class="text-center"><b>Du får ikke mails mere, når kommer nyheder!</b></p>';
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************/
|
||||
/* Search and settings */
|
||||
/*******************************************/
|
||||
|
||||
Reference in New Issue
Block a user