Compare commits

..

No commits in common. "master" and "development" have entirely different histories.

415 changed files with 20784 additions and 105445 deletions

View File

@ -1,35 +0,0 @@
name: CD
on:
push:
branches: [ production ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: a0a2dd521e6af856629d95da2a32f196957a78b0
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: cd skolehjem
- run: npm install
- run: npm run production
- name: Commit built assets
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git checkout -B deploy
git add -f public/
git commit -m "Build front-end assets"
git push -f origin deploy
- name: Deploy to production
uses: appleboy/ssh-action@master
with:
username: ekapp
host: sebathefox.dk
password: Aa123456&
script: 'cd /home/ekapp/public_html/skolehjem && ./server_deploy.sh'

View File

@ -94,6 +94,7 @@
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>

View File

@ -1,5 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

View File

@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="laravel.sqlite" uuid="f7be1ece-08dd-4ce3-8bc7-5dce0780cc96">
<data-source source="LOCAL" name="laravel.sqlite" uuid="bf392a85-1584-4a27-a552-e491a55b9410">
<driver-ref>sqlite.xerial</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
<jdbc-url>jdbc:sqlite:$PROJECT_DIR$/skolehjem/database/laravel.sqlite</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

View File

@ -1,18 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/skolehjem/public/images/icons/backpack-hvid.svg" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/skolehjem/public/images/icons/eye-dark.svg" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/skolehjem/public/images/icons/feedback.svg" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/skolehjem/public/images/icons/food.svg" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/skolehjem/public/images/icons/location.svg" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/skolehjem/public/images/icons/phone.svg" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/skolehjem/public/images/icons/preview-dark.svg" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/skolehjem/public/images/icons/preview.svg" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/skolehjem/public/images/icons/print-hvid.svg" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/skolehjem/public/images/icons/questionmark.svg" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/skolehjem/public/images/icons/statistics.svg" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/skolehjem/public/images/icons/users-hvid.svg" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/skolehjem/public/images/icons/wash.svg" charset="UTF-8" />
</component>
</project>

View File

@ -4,23 +4,30 @@
<include_path>
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/container" />
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/event-dispatcher" />
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/http-factory" />
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/http-message" />
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/log" />
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/simple-cache" />
<path value="$PROJECT_DIR$/skolehjem/vendor/psy/psysh" />
<path value="$PROJECT_DIR$/skolehjem/vendor/opis/closure" />
<path value="$PROJECT_DIR$/skolehjem/vendor/voku/portable-ascii" />
<path value="$PROJECT_DIR$/skolehjem/vendor/asm89/stack-cors" />
<path value="$PROJECT_DIR$/skolehjem/vendor/brick/math" />
<path value="$PROJECT_DIR$/skolehjem/vendor/nikic/php-parser" />
<path value="$PROJECT_DIR$/skolehjem/vendor/defuse/php-encryption" />
<path value="$PROJECT_DIR$/skolehjem/vendor/league/commonmark" />
<path value="$PROJECT_DIR$/skolehjem/vendor/league/event" />
<path value="$PROJECT_DIR$/skolehjem/vendor/league/flysystem" />
<path value="$PROJECT_DIR$/skolehjem/vendor/league/oauth2-server" />
<path value="$PROJECT_DIR$/skolehjem/vendor/nesbot/carbon" />
<path value="$PROJECT_DIR$/skolehjem/vendor/nyholm/psr7" />
<path value="$PROJECT_DIR$/skolehjem/vendor/ramsey/collection" />
<path value="$PROJECT_DIR$/skolehjem/vendor/ramsey/uuid" />
<path value="$PROJECT_DIR$/skolehjem/vendor/vlucas/phpdotenv" />
<path value="$PROJECT_DIR$/skolehjem/vendor/dnoegel/php-xdg-base-dir" />
<path value="$PROJECT_DIR$/skolehjem/vendor/egulias/email-validator" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laminas/laminas-diactoros" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laminas/laminas-zendframework-bridge" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laravel/framework" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laravel/passport" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laravel/tinker" />
@ -55,12 +62,16 @@
<path value="$PROJECT_DIR$/skolehjem/vendor/doctrine/inflector" />
<path value="$PROJECT_DIR$/skolehjem/vendor/doctrine/lexer" />
<path value="$PROJECT_DIR$/skolehjem/vendor/firebase/php-jwt" />
<path value="$PROJECT_DIR$/skolehjem/vendor/lcobucci/jwt" />
<path value="$PROJECT_DIR$/skolehjem/vendor/php-http/message-factory" />
<path value="$PROJECT_DIR$/skolehjem/vendor/fideloper/proxy" />
<path value="$PROJECT_DIR$/skolehjem/vendor/fruitcake/laravel-cors" />
<path value="$PROJECT_DIR$/skolehjem/vendor/paragonie/random_compat" />
<path value="$PROJECT_DIR$/skolehjem/vendor/phpoption/phpoption" />
<path value="$PROJECT_DIR$/skolehjem/vendor/phpseclib/phpseclib" />
<path value="$PROJECT_DIR$/skolehjem/vendor/ralouphie/getallheaders" />
<path value="$PROJECT_DIR$/skolehjem/vendor/guzzlehttp/guzzle" />
<path value="$PROJECT_DIR$/skolehjem/vendor/guzzlehttp/promises" />
<path value="$PROJECT_DIR$/skolehjem/vendor/guzzlehttp/psr7" />
<path value="$PROJECT_DIR$/skolehjem/vendor/swiftmailer/swiftmailer" />
<path value="$PROJECT_DIR$/skolehjem/vendor/tijsverkoyen/css-to-inline-styles" />
@ -68,12 +79,21 @@
<path value="$PROJECT_DIR$/skolehjem/vendor/composer" />
<path value="$PROJECT_DIR$/skolehjem/vendor/spatie/laravel-permission" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laravel/ui" />
<path value="$PROJECT_DIR$/skolehjem/vendor/jaybizzle/crawler-detect" />
<path value="$PROJECT_DIR$/skolehjem/vendor/jenssegers/agent" />
<path value="$PROJECT_DIR$/skolehjem/vendor/mobiledetect/mobiledetectlib" />
<path value="$PROJECT_DIR$/skolehjem/vendor/scrivo/highlight.php" />
<path value="$PROJECT_DIR$/skolehjem/vendor/filp/whoops" />
<path value="$PROJECT_DIR$/skolehjem/vendor/facade/ignition-contracts" />
<path value="$PROJECT_DIR$/skolehjem/vendor/facade/flare-client-php" />
<path value="$PROJECT_DIR$/skolehjem/vendor/mockery/mockery" />
<path value="$PROJECT_DIR$/skolehjem/vendor/theseer/tokenizer" />
<path value="$PROJECT_DIR$/skolehjem/vendor/webmozart/assert" />
<path value="$PROJECT_DIR$/skolehjem/vendor/fzaninotto/faker" />
<path value="$PROJECT_DIR$/skolehjem/vendor/facade/ignition" />
<path value="$PROJECT_DIR$/skolehjem/vendor/phpunit/php-timer" />
<path value="$PROJECT_DIR$/skolehjem/vendor/phpunit/php-code-coverage" />
<path value="$PROJECT_DIR$/skolehjem/vendor/phpunit/php-file-iterator" />
<path value="$PROJECT_DIR$/skolehjem/vendor/phpunit/php-text-template" />
<path value="$PROJECT_DIR$/skolehjem/vendor/phpunit/php-token-stream" />
<path value="$PROJECT_DIR$/skolehjem/vendor/sebastian/version" />
@ -99,52 +119,9 @@
<path value="$PROJECT_DIR$/skolehjem/vendor/phpunit/phpunit" />
<path value="$PROJECT_DIR$/skolehjem/vendor/myclabs/deep-copy" />
<path value="$PROJECT_DIR$/skolehjem/vendor/phar-io/manifest" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laravelcollective/html" />
<path value="$PROJECT_DIR$/skolehjem/vendor/directorytree/ldaprecord" />
<path value="$PROJECT_DIR$/skolehjem/vendor/directorytree/ldaprecord-laravel" />
<path value="$PROJECT_DIR$/skolehjem/vendor/tightenco/collect" />
<path value="$PROJECT_DIR$/skolehjem/vendor/dompdf/dompdf" />
<path value="$PROJECT_DIR$/skolehjem/vendor/barryvdh/laravel-dompdf" />
<path value="$PROJECT_DIR$/skolehjem/vendor/phenx/php-font-lib" />
<path value="$PROJECT_DIR$/skolehjem/vendor/phenx/php-svg-lib" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laravel-notification-channels/webpush" />
<path value="$PROJECT_DIR$/skolehjem/vendor/minishlink/web-push" />
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/http-client" />
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/http-factory" />
<path value="$PROJECT_DIR$/skolehjem/vendor/web-token/jwt-key-mgmt" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laminas/laminas-diactoros" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laminas/laminas-zendframework-bridge" />
<path value="$PROJECT_DIR$/skolehjem/vendor/lcobucci/jwt" />
<path value="$PROJECT_DIR$/skolehjem/vendor/php-http/message-factory" />
<path value="$PROJECT_DIR$/skolehjem/vendor/symfony/http-client-contracts" />
<path value="$PROJECT_DIR$/skolehjem/vendor/phpunit/php-timer" />
<path value="$PROJECT_DIR$/skolehjem/vendor/phpunit/php-file-iterator" />
<path value="$PROJECT_DIR$/skolehjem/vendor/nesbot/carbon" />
<path value="$PROJECT_DIR$/skolehjem/vendor/league/commonmark" />
<path value="$PROJECT_DIR$/skolehjem/vendor/sabberworm/php-css-parser" />
<path value="$PROJECT_DIR$/skolehjem/vendor/filp/whoops" />
<path value="$PROJECT_DIR$/skolehjem/vendor/facade/ignition" />
<path value="$PROJECT_DIR$/skolehjem/vendor/fgrosse/phpasn1" />
<path value="$PROJECT_DIR$/skolehjem/vendor/fideloper/proxy" />
<path value="$PROJECT_DIR$/skolehjem/vendor/guzzlehttp/promises" />
<path value="$PROJECT_DIR$/skolehjem/vendor/mobiledetect/mobiledetectlib" />
<path value="$PROJECT_DIR$/skolehjem/vendor/jaybizzle/crawler-detect" />
<path value="$PROJECT_DIR$/skolehjem/vendor/jenssegers/agent" />
<path value="$PROJECT_DIR$/skolehjem/vendor/web-token/jwt-util-ecc" />
<path value="$PROJECT_DIR$/skolehjem/vendor/spomky-labs/base64url" />
<path value="$PROJECT_DIR$/skolehjem/vendor/web-token/jwt-core" />
<path value="$PROJECT_DIR$/skolehjem/vendor/web-token/jwt-signature" />
<path value="$PROJECT_DIR$/skolehjem/vendor/web-token/jwt-signature-algorithm-ecdsa" />
<path value="$PROJECT_DIR$/skolehjem/vendor/league/mime-type-detection" />
<path value="$PROJECT_DIR$/skolehjem/vendor/scrivo/highlight.php" />
<path value="$PROJECT_DIR$/skolehjem/vendor/thecodingmachine/safe" />
<path value="$PROJECT_DIR$/skolehjem/vendor/facade/flare-client-php" />
<path value="$PROJECT_DIR$/skolehjem/vendor/psy/psysh" />
<path value="$PROJECT_DIR$/skolehjem/vendor/postcss/postcss" />
<path value="$PROJECT_DIR$/skolehjem/vendor/react/promise" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="8.0" />
<component name="PhpProjectSharedConfiguration" php_language_level="7.2" />
<component name="PhpUnit">
<phpunit_settings>
<PhpUnitSettings custom_loader_path="$PROJECT_DIR$/skolehjem/vendor/autoload.php" />

View File

@ -2,25 +2,23 @@
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/skolehjem/app" isTestSource="false" packagePrefix="App\" />
<sourceFolder url="file://$MODULE_DIR$/skolehjem/tests" isTestSource="true" packagePrefix="Tests\" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/skolehjem/app" isTestSource="false" packagePrefix="App\" />
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/asm89/stack-cors" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/barryvdh/laravel-dompdf" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/brick/math" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/defuse/php-encryption" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/dnoegel/php-xdg-base-dir" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/doctrine/inflector" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/doctrine/instantiator" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/doctrine/lexer" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/dompdf/dompdf" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/dragonmantank/cron-expression" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/egulias/email-validator" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/facade/flare-client-php" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/facade/ignition" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/facade/ignition-contracts" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/fgrosse/phpasn1" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/fideloper/proxy" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/filp/whoops" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/firebase/php-jwt" />
@ -32,18 +30,17 @@
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/hamcrest/hamcrest-php" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/jaybizzle/crawler-detect" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/jenssegers/agent" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laravel-notification-channels/webpush" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laminas/laminas-diactoros" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laminas/laminas-zendframework-bridge" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laravel/framework" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laravel/passport" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laravel/tinker" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laravel/ui" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laravelcollective/html" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/lcobucci/jwt" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/league/commonmark" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/league/event" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/league/flysystem" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/league/mime-type-detection" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/league/oauth2-server" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/minishlink/web-push" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/mobiledetect/mobiledetectlib" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/mockery/mockery" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/monolog/monolog" />
@ -56,8 +53,7 @@
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/paragonie/random_compat" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phar-io/manifest" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phar-io/version" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phenx/php-font-lib" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phenx/php-svg-lib" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/php-http/message-factory" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpdocumentor/reflection-common" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpdocumentor/reflection-docblock" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpdocumentor/type-resolver" />
@ -72,7 +68,6 @@
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpunit/phpunit" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/container" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/event-dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/http-client" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/http-factory" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/http-message" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/log" />
@ -81,7 +76,7 @@
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/ralouphie/getallheaders" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/ramsey/collection" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/ramsey/uuid" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sabberworm/php-css-parser" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/scrivo/highlight.php" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/code-unit-reverse-lookup" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/comparator" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/diff" />
@ -95,7 +90,6 @@
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/type" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/version" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/spatie/laravel-permission" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/spomky-labs/base64url" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/swiftmailer/swiftmailer" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/symfony/console" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/symfony/css-selector" />
@ -104,7 +98,6 @@
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/symfony/event-dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/symfony/event-dispatcher-contracts" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/symfony/finder" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/symfony/http-client-contracts" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/symfony/http-foundation" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/symfony/http-kernel" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/symfony/mime" />
@ -129,14 +122,7 @@
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/tijsverkoyen/css-to-inline-styles" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/vlucas/phpdotenv" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/voku/portable-ascii" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/web-token/jwt-core" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/web-token/jwt-key-mgmt" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/web-token/jwt-signature" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/web-token/jwt-signature-algorithm-ecdsa" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/web-token/jwt-util-ecc" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/webmozart/assert" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/postcss/postcss" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/react/promise" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,101 +1,35 @@
package sde.odense.skolehjem;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.Manifest;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.webkit.JavascriptInterface;
import android.webkit.JsResult;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class MainActivity extends AppCompatActivity {
private WebView webView;
private static final String TEL_PREFIX = "tel:";
private static final String TAG = MainActivity.class.getSimpleName();
private final static int FCR = 1;
private String mCM;
private ValueCallback<Uri> mUM;
private ValueCallback<Uri[]> mUMA;
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
if (Build.VERSION.SDK_INT >= 21) {
Uri[] results = null;
//Check if response is positive
if (resultCode == Activity.RESULT_OK) {
if (requestCode == FCR) {
if (null == mUMA) {
return;
}
if (intent == null) {
//Capture Photo if no image available
if (mCM != null) {
results = new Uri[]{Uri.parse(mCM)};
}
} else {
String dataString = intent.getDataString();
if (dataString != null) {
results = new Uri[]{Uri.parse(dataString)};
}
}
}
}
mUMA.onReceiveValue(results);
mUMA = null;
} else {
if (requestCode == FCR) {
if (null == mUM) return;
Uri result = intent == null || resultCode != RESULT_OK ? null : intent.getData();
mUM.onReceiveValue(result);
mUM = null;
}
}
}
@SuppressLint({"SetJavaScriptEnabled", "AddJavascriptInterface"})
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (Build.VERSION.SDK_INT >= 23 && (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED)) {
ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA}, 1);
}
webView = findViewById(R.id.webView);
webView.setWebViewClient(new CustomWebViewClient());
webView.setWebChromeClient(new CustomWebChromeClient(this));
//Settings
WebSettings webSettings = webView.getSettings();
@ -108,141 +42,10 @@ public class MainActivity extends AppCompatActivity {
webSettings.setSupportZoom(true);
webSettings.setDefaultTextEncodingName("utf-8");
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
webSettings.setAllowFileAccess(true);
if (Build.VERSION.SDK_INT >= 21) {
webSettings.setMixedContentMode(0);
webView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
} else if (Build.VERSION.SDK_INT >= 19) {
webView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
} else if (Build.VERSION.SDK_INT < 19) {
webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
webView.setWebViewClient(new CustomWebViewClient());
webView.setWebChromeClient(new WebChromeClient(){
Context myApp = getApplicationContext();
@Override
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
new AlertDialog.Builder(myApp)
.setTitle("Confirm")
.setMessage(message)
.setPositiveButton(android.R.string.ok,
new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int which)
{
result.confirm();
}
})
.setNegativeButton(android.R.string.cancel,
new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int which)
{
result.cancel();
}
})
.create()
.show();
return true;
}
//For Android 3.0+
public void openFileChooser(ValueCallback<Uri> uploadMsg) {
mUM = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("*/*");
MainActivity.this.startActivityForResult(Intent.createChooser(i, "File Chooser"), FCR);
}
// For Android 3.0+, above method not supported in some android 3+ versions, in such case we use this
public void openFileChooser(ValueCallback uploadMsg, String acceptType) {
mUM = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("*/*");
MainActivity.this.startActivityForResult(
Intent.createChooser(i, "File Browser"),
FCR);
}
//For Android 4.1+
public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture) {
mUM = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("*/*");
MainActivity.this.startActivityForResult(Intent.createChooser(i, "File Chooser"), MainActivity.FCR);
}
//For Android 5.0+
public boolean onShowFileChooser(
WebView webView, ValueCallback<Uri[]> filePathCallback,
WebChromeClient.FileChooserParams fileChooserParams) {
if (mUMA != null) {
mUMA.onReceiveValue(null);
}
mUMA = filePathCallback;
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (takePictureIntent.resolveActivity(MainActivity.this.getPackageManager()) != null) {
File photoFile = null;
try {
photoFile = createImageFile();
takePictureIntent.putExtra("PhotoPath", mCM);
} catch (IOException ex) {
Log.e(TAG, "Image file creation failed", ex);
}
if (photoFile != null) {
mCM = "file:" + photoFile.getAbsolutePath();
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));
} else {
takePictureIntent = null;
}
}
Intent contentSelectionIntent = new Intent(Intent.ACTION_GET_CONTENT);
contentSelectionIntent.addCategory(Intent.CATEGORY_OPENABLE);
contentSelectionIntent.setType("*/*");
Intent[] intentArray;
if (takePictureIntent != null) {
intentArray = new Intent[]{takePictureIntent};
} else {
intentArray = new Intent[0];
}
Intent chooserIntent = new Intent(Intent.ACTION_CHOOSER);
chooserIntent.putExtra(Intent.EXTRA_INTENT, contentSelectionIntent);
chooserIntent.putExtra(Intent.EXTRA_TITLE, "Image Chooser");
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, intentArray);
startActivityForResult(chooserIntent, FCR);
return true;
}
});
webView.loadUrl("https://ekapp.sde.dk");
}
// Create an image file
private File createImageFile() throws IOException {
@SuppressLint("SimpleDateFormat") String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
String imageFileName = "img_" + timeStamp + "_";
File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
return File.createTempFile(imageFileName, ".jpg", storageDir);
}
@Override
public void onBackPressed() {
if(webView.canGoBack())
@ -251,33 +54,8 @@ public class MainActivity extends AppCompatActivity {
super.onBackPressed();
}
@Override
public boolean onKeyDown(int keyCode, @NonNull KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
switch (keyCode) {
case KeyEvent.KEYCODE_BACK:
if (webView.canGoBack()) {
webView.goBack();
} else {
finish();
}
return true;
}
}
return super.onKeyDown(keyCode, event);
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
private class CustomWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView wv, String url) {
if(url.startsWith(TEL_PREFIX)) {
@ -288,9 +66,40 @@ public class MainActivity extends AppCompatActivity {
}
return false;
}
}
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
Toast.makeText(getApplicationContext(), "Failed loading app!", Toast.LENGTH_SHORT).show();
static final class CustomWebChromeClient extends WebChromeClient {
Context myApp;
CustomWebChromeClient(Context mContext){
myApp = mContext;
}
@Override
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
new AlertDialog.Builder(myApp)
.setTitle("Confirm")
.setMessage(message)
.setPositiveButton(android.R.string.ok,
new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int which)
{
result.confirm();
}
})
.setNegativeButton(android.R.string.cancel,
new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int which)
{
result.cancel();
}
})
.create()
.show();
return true;
}
}
}

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<androidx.appcompat>
<appcompat versions="1.0.0-alpha1,1.0.0-alpha3,1.0.0-beta01,1.0.0-rc01,1.0.0-rc02,1.0.0,1.0.1,1.0.2,1.1.0-alpha01,1.1.0-alpha02,1.1.0-alpha03,1.1.0-alpha04,1.1.0-alpha05,1.1.0-beta01,1.1.0-rc01,1.1.0,1.2.0-alpha01,1.2.0-alpha02,1.2.0-alpha03,1.2.0-beta01,1.2.0-rc01,1.2.0-rc02,1.2.0,1.3.0-alpha01"/>
<appcompat-resources versions="1.1.0-alpha03,1.1.0-alpha04,1.1.0-alpha05,1.1.0-beta01,1.1.0-rc01,1.1.0,1.2.0-alpha01,1.2.0-alpha02,1.2.0-alpha03,1.2.0-beta01,1.2.0-rc01,1.2.0-rc02,1.2.0,1.3.0-alpha01"/>
<appcompat versions="1.0.0-alpha1,1.0.0-alpha3,1.0.0-beta01,1.0.0-rc01,1.0.0-rc02,1.0.0,1.0.1,1.0.2,1.1.0-alpha01,1.1.0-alpha02,1.1.0-alpha03,1.1.0-alpha04,1.1.0-alpha05,1.1.0-beta01,1.1.0-rc01,1.1.0,1.2.0-alpha01,1.2.0-alpha02,1.2.0-alpha03,1.2.0-beta01,1.2.0-rc01,1.2.0-rc02,1.3.0-alpha01"/>
<appcompat-resources versions="1.1.0-alpha03,1.1.0-alpha04,1.1.0-alpha05,1.1.0-beta01,1.1.0-rc01,1.1.0,1.2.0-alpha01,1.2.0-alpha02,1.2.0-alpha03,1.2.0-beta01,1.2.0-rc01,1.2.0-rc02,1.3.0-alpha01"/>
</androidx.appcompat>

View File

@ -1,10 +1,10 @@
<?xml version='1.0' encoding='UTF-8'?>
<androidx.test.espresso>
<espresso-accessibility versions="3.1.0-alpha1,3.1.0-alpha2,3.1.0-alpha3,3.1.0-alpha4,3.1.0-beta01,3.1.0-beta02,3.1.0,3.1.1-alpha01,3.1.1-beta01,3.1.1,3.1.2-alpha01,3.2.0-alpha02,3.2.0-alpha03,3.2.0-alpha04,3.2.0-alpha05,3.2.0-beta01,3.2.0,3.3.0-alpha01,3.3.0-alpha02,3.3.0-alpha03,3.3.0-alpha04,3.3.0-alpha05,3.3.0-beta01,3.3.0-beta02,3.3.0-rc01,3.3.0-rc02,3.3.0-rc03"/>
<espresso-contrib versions="3.1.0-alpha1,3.1.0-alpha2,3.1.0-alpha3,3.1.0-alpha4,3.1.0-beta01,3.1.0-beta02,3.1.0,3.1.1-alpha01,3.1.1-beta01,3.1.1,3.1.2-alpha01,3.2.0-alpha02,3.2.0-alpha03,3.2.0-alpha04,3.2.0-alpha05,3.2.0-beta01,3.2.0,3.3.0-alpha01,3.3.0-alpha02,3.3.0-alpha03,3.3.0-alpha04,3.3.0-alpha05,3.3.0-beta01,3.3.0-beta02,3.3.0-rc01,3.3.0-rc02,3.3.0-rc03"/>
<espresso-core versions="3.1.0-alpha1,3.1.0-alpha2,3.1.0-alpha3,3.1.0-alpha4,3.1.0-beta01,3.1.0-beta02,3.1.0,3.1.1-alpha01,3.1.1-beta01,3.1.1,3.1.2-alpha01,3.2.0-alpha02,3.2.0-alpha03,3.2.0-alpha04,3.2.0-alpha05,3.2.0-beta01,3.2.0,3.3.0-alpha01,3.3.0-alpha02,3.3.0-alpha03,3.3.0-alpha04,3.3.0-alpha05,3.3.0-beta01,3.3.0-beta02,3.3.0-rc01,3.3.0-rc02,3.3.0-rc03"/>
<espresso-idling-resource versions="3.1.0-alpha1,3.1.0-alpha2,3.1.0-alpha3,3.1.0-alpha4,3.1.0-beta01,3.1.0-beta02,3.1.0,3.1.1-alpha01,3.1.1-beta01,3.1.1,3.1.2-alpha01,3.2.0-alpha02,3.2.0-alpha03,3.2.0-alpha04,3.2.0-alpha05,3.2.0-beta01,3.2.0,3.3.0-alpha01,3.3.0-alpha02,3.3.0-alpha03,3.3.0-alpha04,3.3.0-alpha05,3.3.0-beta01,3.3.0-beta02,3.3.0-rc01,3.3.0-rc02,3.3.0-rc03"/>
<espresso-intents versions="3.1.0-alpha1,3.1.0-alpha2,3.1.0-alpha3,3.1.0-alpha4,3.1.0-beta01,3.1.0-beta02,3.1.0,3.1.1-alpha01,3.1.1-beta01,3.1.1,3.1.2-alpha01,3.2.0-alpha02,3.2.0-alpha03,3.2.0-alpha04,3.2.0-alpha05,3.2.0-beta01,3.2.0,3.3.0-alpha01,3.3.0-alpha02,3.3.0-alpha03,3.3.0-alpha04,3.3.0-alpha05,3.3.0-beta01,3.3.0-beta02,3.3.0-rc01,3.3.0-rc02,3.3.0-rc03"/>
<espresso-remote versions="3.1.0-alpha1,3.1.0-alpha2,3.1.0-alpha3,3.1.0-alpha4,3.1.0-beta01,3.1.0-beta02,3.1.0,3.1.1-alpha01,3.1.1-beta01,3.1.1,3.1.2-alpha01,3.2.0-alpha02,3.2.0-alpha03,3.2.0-alpha04,3.2.0-alpha05,3.2.0-beta01,3.2.0,3.3.0-alpha01,3.3.0-alpha02,3.3.0-alpha03,3.3.0-alpha04,3.3.0-alpha05,3.3.0-beta01,3.3.0-beta02,3.3.0-rc01,3.3.0-rc02,3.3.0-rc03"/>
<espresso-web versions="3.1.0-alpha1,3.1.0-alpha2,3.1.0-alpha3,3.1.0-alpha4,3.1.0-beta01,3.1.0-beta02,3.1.0,3.1.1-alpha01,3.1.1-beta01,3.1.1,3.1.2-alpha01,3.2.0-alpha02,3.2.0-alpha03,3.2.0-alpha04,3.2.0-alpha05,3.2.0-beta01,3.2.0,3.3.0-alpha01,3.3.0-alpha02,3.3.0-alpha03,3.3.0-alpha04,3.3.0-alpha05,3.3.0-beta01,3.3.0-beta02,3.3.0-rc01,3.3.0-rc02,3.3.0-rc03"/>
<espresso-accessibility versions="3.1.0-alpha1,3.1.0-alpha2,3.1.0-alpha3,3.1.0-alpha4,3.1.0-beta01,3.1.0-beta02,3.1.0,3.1.1-alpha01,3.1.1-beta01,3.1.1,3.1.2-alpha01,3.2.0-alpha02,3.2.0-alpha03,3.2.0-alpha04,3.2.0-alpha05,3.2.0-beta01,3.2.0,3.3.0-alpha01,3.3.0-alpha02,3.3.0-alpha03,3.3.0-alpha04,3.3.0-alpha05,3.3.0-beta01,3.3.0-beta02,3.3.0-rc01,3.3.0-rc02"/>
<espresso-contrib versions="3.1.0-alpha1,3.1.0-alpha2,3.1.0-alpha3,3.1.0-alpha4,3.1.0-beta01,3.1.0-beta02,3.1.0,3.1.1-alpha01,3.1.1-beta01,3.1.1,3.1.2-alpha01,3.2.0-alpha02,3.2.0-alpha03,3.2.0-alpha04,3.2.0-alpha05,3.2.0-beta01,3.2.0,3.3.0-alpha01,3.3.0-alpha02,3.3.0-alpha03,3.3.0-alpha04,3.3.0-alpha05,3.3.0-beta01,3.3.0-beta02,3.3.0-rc01,3.3.0-rc02"/>
<espresso-core versions="3.1.0-alpha1,3.1.0-alpha2,3.1.0-alpha3,3.1.0-alpha4,3.1.0-beta01,3.1.0-beta02,3.1.0,3.1.1-alpha01,3.1.1-beta01,3.1.1,3.1.2-alpha01,3.2.0-alpha02,3.2.0-alpha03,3.2.0-alpha04,3.2.0-alpha05,3.2.0-beta01,3.2.0,3.3.0-alpha01,3.3.0-alpha02,3.3.0-alpha03,3.3.0-alpha04,3.3.0-alpha05,3.3.0-beta01,3.3.0-beta02,3.3.0-rc01,3.3.0-rc02"/>
<espresso-idling-resource versions="3.1.0-alpha1,3.1.0-alpha2,3.1.0-alpha3,3.1.0-alpha4,3.1.0-beta01,3.1.0-beta02,3.1.0,3.1.1-alpha01,3.1.1-beta01,3.1.1,3.1.2-alpha01,3.2.0-alpha02,3.2.0-alpha03,3.2.0-alpha04,3.2.0-alpha05,3.2.0-beta01,3.2.0,3.3.0-alpha01,3.3.0-alpha02,3.3.0-alpha03,3.3.0-alpha04,3.3.0-alpha05,3.3.0-beta01,3.3.0-beta02,3.3.0-rc01,3.3.0-rc02"/>
<espresso-intents versions="3.1.0-alpha1,3.1.0-alpha2,3.1.0-alpha3,3.1.0-alpha4,3.1.0-beta01,3.1.0-beta02,3.1.0,3.1.1-alpha01,3.1.1-beta01,3.1.1,3.1.2-alpha01,3.2.0-alpha02,3.2.0-alpha03,3.2.0-alpha04,3.2.0-alpha05,3.2.0-beta01,3.2.0,3.3.0-alpha01,3.3.0-alpha02,3.3.0-alpha03,3.3.0-alpha04,3.3.0-alpha05,3.3.0-beta01,3.3.0-beta02,3.3.0-rc01,3.3.0-rc02"/>
<espresso-remote versions="3.1.0-alpha1,3.1.0-alpha2,3.1.0-alpha3,3.1.0-alpha4,3.1.0-beta01,3.1.0-beta02,3.1.0,3.1.1-alpha01,3.1.1-beta01,3.1.1,3.1.2-alpha01,3.2.0-alpha02,3.2.0-alpha03,3.2.0-alpha04,3.2.0-alpha05,3.2.0-beta01,3.2.0,3.3.0-alpha01,3.3.0-alpha02,3.3.0-alpha03,3.3.0-alpha04,3.3.0-alpha05,3.3.0-beta01,3.3.0-beta02,3.3.0-rc01,3.3.0-rc02"/>
<espresso-web versions="3.1.0-alpha1,3.1.0-alpha2,3.1.0-alpha3,3.1.0-alpha4,3.1.0-beta01,3.1.0-beta02,3.1.0,3.1.1-alpha01,3.1.1-beta01,3.1.1,3.1.2-alpha01,3.2.0-alpha02,3.2.0-alpha03,3.2.0-alpha04,3.2.0-alpha05,3.2.0-beta01,3.2.0,3.3.0-alpha01,3.3.0-alpha02,3.3.0-alpha03,3.3.0-alpha04,3.3.0-alpha05,3.3.0-beta01,3.3.0-beta02,3.3.0-rc01,3.3.0-rc02"/>
</androidx.test.espresso>

View File

@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<androidx.test.ext>
<junit versions="1.0.0-beta01,1.0.0-beta02,1.0.0,1.1.0-alpha01,1.1.0-beta01,1.1.0,1.1.1-alpha01,1.1.1-alpha02,1.1.1-alpha03,1.1.1-alpha04,1.1.1-alpha05,1.1.1-beta01,1.1.1,1.1.2-alpha01,1.1.2-alpha02,1.1.2-alpha03,1.1.2-alpha04,1.1.2-alpha05,1.1.2-beta01,1.1.2-beta02,1.1.2-rc01,1.1.2-rc02,1.1.2-rc03"/>
<junit-ktx versions="1.1.0-alpha01,1.1.0-beta01,1.1.0,1.1.1-alpha01,1.1.1-alpha02,1.1.1-alpha03,1.1.1-alpha04,1.1.1-alpha05,1.1.1-beta01,1.1.1,1.1.2-alpha01,1.1.2-alpha02,1.1.2-alpha03,1.1.2-alpha04,1.1.2-alpha05,1.1.2-beta01,1.1.2-beta02,1.1.2-rc01,1.1.2-rc02,1.1.2-rc03"/>
<truth versions="1.0.0-alpha2,1.0.0-alpha3,1.0.0-alpha4,1.0.0-beta01,1.0.0-beta02,1.0.0,1.1.0-alpha01,1.1.0-beta01,1.1.0,1.1.1-alpha01,1.2.0-alpha02,1.2.0-alpha03,1.2.0-alpha04,1.2.0-alpha05,1.2.0-beta01,1.2.0,1.3.0-alpha01,1.3.0-alpha02,1.3.0-alpha03,1.3.0-alpha04,1.3.0-alpha05,1.3.0-beta01,1.3.0-beta02,1.3.0-rc01,1.3.0-rc02,1.3.0-rc03"/>
<junit versions="1.0.0-beta01,1.0.0-beta02,1.0.0,1.1.0-alpha01,1.1.0-beta01,1.1.0,1.1.1-alpha01,1.1.1-alpha02,1.1.1-alpha03,1.1.1-alpha04,1.1.1-alpha05,1.1.1-beta01,1.1.1,1.1.2-alpha01,1.1.2-alpha02,1.1.2-alpha03,1.1.2-alpha04,1.1.2-alpha05,1.1.2-beta01,1.1.2-beta02,1.1.2-rc01,1.1.2-rc02"/>
<junit-ktx versions="1.1.0-alpha01,1.1.0-beta01,1.1.0,1.1.1-alpha01,1.1.1-alpha02,1.1.1-alpha03,1.1.1-alpha04,1.1.1-alpha05,1.1.1-beta01,1.1.1,1.1.2-alpha01,1.1.2-alpha02,1.1.2-alpha03,1.1.2-alpha04,1.1.2-alpha05,1.1.2-beta01,1.1.2-beta02,1.1.2-rc01,1.1.2-rc02"/>
<truth versions="1.0.0-alpha2,1.0.0-alpha3,1.0.0-alpha4,1.0.0-beta01,1.0.0-beta02,1.0.0,1.1.0-alpha01,1.1.0-beta01,1.1.0,1.1.1-alpha01,1.2.0-alpha02,1.2.0-alpha03,1.2.0-alpha04,1.2.0-alpha05,1.2.0-beta01,1.2.0,1.3.0-alpha01,1.3.0-alpha02,1.3.0-alpha03,1.3.0-alpha04,1.3.0-alpha05,1.3.0-beta01,1.3.0-beta02,1.3.0-rc01,1.3.0-rc02"/>
</androidx.test.ext>

View File

@ -42,7 +42,6 @@
<androidx.enterprise/>
<androidx.exifinterface/>
<androidx.fragment/>
<androidx.games/>
<androidx.gaming/>
<androidx.gridlayout/>
<androidx.heifwriter/>

View File

@ -1,338 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
63D90CA924EFD14600E5833A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63D90CA824EFD14600E5833A /* AppDelegate.swift */; };
63D90CAB24EFD14600E5833A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63D90CAA24EFD14600E5833A /* ViewController.swift */; };
63D90CAE24EFD14600E5833A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 63D90CAC24EFD14600E5833A /* Main.storyboard */; };
63D90CB024EFD16000E5833A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 63D90CAF24EFD16000E5833A /* Assets.xcassets */; };
63D90CB324EFD16100E5833A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 63D90CB124EFD16100E5833A /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
63D90CA524EFD14600E5833A /* skolehjem.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = skolehjem.app; sourceTree = BUILT_PRODUCTS_DIR; };
63D90CA824EFD14600E5833A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
63D90CAA24EFD14600E5833A /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
63D90CAD24EFD14600E5833A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
63D90CAF24EFD16000E5833A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
63D90CB224EFD16100E5833A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
63D90CB424EFD16300E5833A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
63D90CA224EFD14600E5833A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
63D90C9C24EFD14600E5833A = {
isa = PBXGroup;
children = (
63D90CA724EFD14600E5833A /* skolehjem */,
63D90CA624EFD14600E5833A /* Products */,
);
sourceTree = "<group>";
};
63D90CA624EFD14600E5833A /* Products */ = {
isa = PBXGroup;
children = (
63D90CA524EFD14600E5833A /* skolehjem.app */,
);
name = Products;
sourceTree = "<group>";
};
63D90CA724EFD14600E5833A /* skolehjem */ = {
isa = PBXGroup;
children = (
63D90CA824EFD14600E5833A /* AppDelegate.swift */,
63D90CAA24EFD14600E5833A /* ViewController.swift */,
63D90CAC24EFD14600E5833A /* Main.storyboard */,
63D90CAF24EFD16000E5833A /* Assets.xcassets */,
63D90CB124EFD16100E5833A /* LaunchScreen.storyboard */,
63D90CB424EFD16300E5833A /* Info.plist */,
);
path = skolehjem;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
63D90CA424EFD14600E5833A /* skolehjem */ = {
isa = PBXNativeTarget;
buildConfigurationList = 63D90CB724EFD16400E5833A /* Build configuration list for PBXNativeTarget "skolehjem" */;
buildPhases = (
63D90CA124EFD14600E5833A /* Sources */,
63D90CA224EFD14600E5833A /* Frameworks */,
63D90CA324EFD14600E5833A /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = skolehjem;
productName = skolehjem;
productReference = 63D90CA524EFD14600E5833A /* skolehjem.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
63D90C9D24EFD14600E5833A /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1010;
LastUpgradeCheck = 1010;
TargetAttributes = {
63D90CA424EFD14600E5833A = {
CreatedOnToolsVersion = 10.1;
};
};
};
buildConfigurationList = 63D90CA024EFD14600E5833A /* Build configuration list for PBXProject "skolehjem" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 63D90C9C24EFD14600E5833A;
productRefGroup = 63D90CA624EFD14600E5833A /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
63D90CA424EFD14600E5833A /* skolehjem */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
63D90CA324EFD14600E5833A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
63D90CB324EFD16100E5833A /* LaunchScreen.storyboard in Resources */,
63D90CB024EFD16000E5833A /* Assets.xcassets in Resources */,
63D90CAE24EFD14600E5833A /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
63D90CA124EFD14600E5833A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
63D90CAB24EFD14600E5833A /* ViewController.swift in Sources */,
63D90CA924EFD14600E5833A /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
63D90CAC24EFD14600E5833A /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
63D90CAD24EFD14600E5833A /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
63D90CB124EFD16100E5833A /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
63D90CB224EFD16100E5833A /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
63D90CB524EFD16300E5833A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
63D90CB624EFD16300E5833A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
63D90CB824EFD16400E5833A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 3ZZXP29LWT;
INFOPLIST_FILE = skolehjem/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = sde.odense.skolehjem;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
63D90CB924EFD16400E5833A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 3ZZXP29LWT;
INFOPLIST_FILE = skolehjem/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = sde.odense.skolehjem;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
63D90CA024EFD14600E5833A /* Build configuration list for PBXProject "skolehjem" */ = {
isa = XCConfigurationList;
buildConfigurations = (
63D90CB524EFD16300E5833A /* Debug */,
63D90CB624EFD16300E5833A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
63D90CB724EFD16400E5833A /* Build configuration list for PBXNativeTarget "skolehjem" */ = {
isa = XCConfigurationList;
buildConfigurations = (
63D90CB824EFD16400E5833A /* Debug */,
63D90CB924EFD16400E5833A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 63D90C9D24EFD14600E5833A /* Project object */;
}

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:skolehjem.xcodeproj">
</FileRef>
</Workspace>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildLocationStyle</key>
<string>UseAppPreferences</string>
<key>CustomBuildLocationType</key>
<string>RelativeToDerivedData</string>
<key>DerivedDataLocationStyle</key>
<string>Default</string>
<key>EnabledFullIndexStoreVisibility</key>
<false/>
<key>IssueFilterStyle</key>
<string>ShowActiveSchemeOnly</string>
<key>LiveSourceIssuesEnabled</key>
<true/>
</dict>
</plist>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>skolehjem.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>

View File

@ -1,45 +0,0 @@
//
// AppDelegate.swift
// skolehjem
//
// Created by macuser on 21/08/2020.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}

View File

@ -1,116 +0,0 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "ic_launcher.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "ic_launcher-1.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "ic_launcher-2.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "ic_launcher-3.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "ic_launcher-12.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "ic_launcher-13.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "ic_launcher-4.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "ic_launcher-5.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "ic_launcher-7.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "ic_launcher-6.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "ic_launcher-8.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "ic_launcher-9.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "ic_launcher-10.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "ic_launcher-11.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "ic_launcher-16.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "ic_launcher-15.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "ic_launcher-17.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "ic_launcher-14.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -1,6 +0,0 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -1,55 +0,0 @@
{
"images" : [
{
"orientation" : "portrait",
"idiom" : "ipad",
"filename" : "ic_launcher.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"filename" : "ic_launcher-4.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"filename" : "ic_launcher-1.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"filename" : "ic_launcher-5.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "ic_launcher-2.png",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "ic_launcher-3.png",
"minimum-system-version" : "7.0",
"subtype" : "retina4",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -1,55 +0,0 @@
{
"images" : [
{
"orientation" : "portrait",
"idiom" : "ipad",
"filename" : "ic_launcher-playstore-1.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"filename" : "ic_launcher-playstore-2.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"filename" : "ic_launcher-playstore.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"filename" : "ic_launcher-playstore-3.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "ic_launcher-playstore-4.png",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "ic_launcher-playstore-5.png",
"minimum-system-version" : "7.0",
"subtype" : "retina4",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -1,21 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_launcher-playstore.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

View File

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>

View File

@ -1,52 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="skolehjem" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<wkWebView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dOs-vr-ypo">
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
<color key="backgroundColor" red="0.36078431370000003" green="0.38823529410000002" blue="0.4039215686" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" id="Pfe-Cd-k86"/>
<constraint firstAttribute="height" id="hew-AW-sXK"/>
</constraints>
<wkWebViewConfiguration key="configuration">
<audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
<wkPreferences key="preferences"/>
</wkWebViewConfiguration>
</wkWebView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="dOs-vr-ypo" secondAttribute="trailing" id="Aoi-yr-vW8"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="bottom" secondItem="dOs-vr-ypo" secondAttribute="bottom" id="bNv-IA-yjS"/>
<constraint firstItem="dOs-vr-ypo" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" id="gQ6-h0-DTj"/>
<constraint firstItem="dOs-vr-ypo" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" id="vWk-bF-fhF"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<connections>
<outlet property="webview" destination="dOs-vr-ypo" id="ORa-um-VSy"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="133.59999999999999" y="133.5832083958021"/>
</scene>
</scenes>
</document>

View File

@ -1,49 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>SDE Skolehjem</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIcons</key>
<dict/>
<key>CFBundleIcons~ipad</key>
<dict/>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>Main</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View File

@ -1,27 +0,0 @@
//
// ViewController.swift
// skolehjem
//
// Created by macuser on 21/08/2020.
//
import UIKit
import WebKit
class ViewController: UIViewController {
@IBOutlet weak var webview: WKWebView!
override func viewDidLoad() {
super.viewDidLoad();
let url = URL(string: "https://ekapp.sde.dk");
let request = URLRequest(url: url!);
webview.scrollView.isMultipleTouchEnabled = false;
webview.load(request);
}
}

3
package-lock.json generated
View File

@ -1,3 +0,0 @@
{
"lockfileVersion": 1
}

View File

@ -1,29 +0,0 @@
#!/bin/sh
set -e
echo "Deploying application ..."
# Enter maintenance mode
(php artisan down --message 'The app is being (quickly!) updated. Please try again in a minute.') || true
# Update codebase
git fetch origin deploy
git reset --hard origin/deploy
# Install dependencies based on lock file
composer install --no-interaction --prefer-dist --optimize-autoloader
# Migrate database
php artisan migrate --force
# Note: If you're using queue workers, this is the place to restart them.
# ...
# Clear cache
php artisan optimize
# Reload PHP to update opcache
echo "" | sudo -S service php7.4-fpm reload
# Exit maintenance mode
php artisan up
echo "Application deployed!"

View File

@ -1,6 +1,6 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:xxOWN1DEzzMxOUEi981cuqkLQs68/dnw2vmv4JtNXjA=
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
@ -9,8 +9,8 @@ LOG_CHANNEL=stack
DB_CONNECTION=sqlite
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=/home/user/Documents/PhpstormProjects/skolehjem-webapp/skolehjem/database/laravel.sqlite
DB_USERNAME=
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
@ -44,16 +44,3 @@ PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
LDAP_LOGGING=true
LDAP_CONNECTION=default
LDAP_HOST=127.0.0.1
LDAP_USERNAME="cn=user,dc=local,dc=com"
LDAP_PASSWORD=secret
LDAP_PORT=389
LDAP_BASE_DN="dc=local,dc=com"
LDAP_TIMEOUT=5
LDAP_SSL=false
LDAP_TLS=false
HTTPS_ONLY=false

View File

@ -12,4 +12,3 @@ npm-debug.log
yarn-error.log
/public/css/app.css
/public/js/app.js
/public/uploads/

View File

@ -1,3 +0,0 @@
RewriteEngine On
RewriteRule ^/((?!\.well-known)(/.*)?)$ [L]
RewriteRule ^(.*)$ public/$1 [L]

View File

@ -1,12 +0,0 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class AllowAction extends Model
{
protected $fillable = [
'action', 'allow'
];
}

View File

@ -20,6 +20,6 @@ class Event extends Model
*/
//protected variable which contains name of database field(s) to be filled.
protected $fillable = [
"name", "accountable", "description", "date", "resource_id"
"name", "description", "date"
];
}

View File

@ -50,10 +50,6 @@ class Handler extends ExceptionHandler
*/
public function render($request, Throwable $exception)
{
// Otherwise display internal error message
if(app()->environment() === 'production') {
return view('errors.500');
}
return parent::render($request, $exception);
}
}

View File

@ -7,6 +7,6 @@ use Illuminate\Database\Eloquent\Model;
class Guide extends Model
{
protected $fillable = [
'name', 'guide_articles', 'guide_category_id', 'resource_id'
'name', 'guide_articles'
];
}

View File

@ -1,12 +0,0 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class GuidesCategory extends Model
{
protected $fillable = [
'guidesCategoryName'
];
}

View File

@ -1,51 +0,0 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Collection;
class Helpers
{
public static function closetags($html) {
preg_match_all('#<(?!meta|img|br|hr|input\b)\b([a-z]+)(?: .*)?(?<![/|/ ])>#iU', $html, $result);
$openedtags = $result[1];
preg_match_all('#</([a-z]+)>#iU', $html, $result);
$closedtags = $result[1];
$len_opened = count($openedtags);
if (count($closedtags) == $len_opened) {
return $html;
}
$openedtags = array_reverse($openedtags);
for ($i=0; $i < $len_opened; $i++) {
if (!in_array($openedtags[$i], $closedtags)) {
$html .= '</'.$openedtags[$i].'>';
} else {
unset($closedtags[array_search($openedtags[$i], $closedtags)]);
}
}
return $html;
}
public static function sendNewsNotification(News $news, Collection $users){
$headers = 'Content-Transfer-Encoding: 8bit'. "\r\n".
'Content-Type: text/html; charset="UTF-8"';
foreach ($users as $user) {
$email = $user->email;
if($news->name !== "")
$subject = $news->name;
else
$subject = $news->subname;
$msg = "Hej " . $user->name_first . " ". $user->name_last . ".\n\nDer er kommet en ny nyhed i skolehjems appen! ";
//Hello, im here to help the future developer that has this problem,
//you have to open up you installed php version, find and
//open your php.ini and search for [mail function] and enter the
// right information and enable some stuff - Big Smoke
mail($email, $subject, $msg, $headers);
}
}
}

View File

@ -3,7 +3,9 @@
namespace App\Helpers;
use Illuminate\Support\Facades\Auth;
use Jenssegers\Agent\Agent;
class Detector
@ -14,13 +16,7 @@ class Detector
if($agent->isMobile()) {
return view(config("detector.mobilePath") . "." . $viewName, $args);
} else if(Auth()->user() !== null) {
if (Auth()->user()->can('admin.panel.show') == true)
return view(config("detector.defaultPath") . "." . $viewName, $args);
}
if($viewName == "users.login" || $viewName == "users.logout")
return view(config("detector.mobilePath") . "." . $viewName, $args);
return view("errors.403", $args);
return view(config("detector.defaultPath") . "." . $viewName, $args);
}
}

View File

@ -1,38 +0,0 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class AboutController extends Controller
{
//Check authentication and languages settings
public function __construct()
{
//The middleware is being run just before the pages is getting loaded
$this->middleware(["auth"]);
$this->middleware(["lang"]);
}
/*
Index controller, all backend work for the about index
pages is done here.
*/
public function index(Request $request)
{
/*
Response::detect is a library that we use to
detect if you are on mobile or desktop.
If you are on mobile it sends you to the
/resources/views/app/about/index
and if you are on desktop it sends you to
/resources/views/admin/about/index (There is no "about" on desktop view).
Normally the index pages only contain the return of the index pages
but you are allowed to modify the index function to how may like.
*/
return Response::detect("about.index");
}
}

View File

@ -1,26 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\AllowAction;
use Illuminate\Http\Request;
class AllowActionController extends Controller
{
/*We use $request to get the data from the HTMl pages*/
function AllowActionRegistering(Request $request) {
/*
Here we use our model AllowAction and the Laravel function "find",
in the "find" functions parameter we pass "$request->id" to find out what
number the it contains.
*/
$action = AllowAction::find($request->id);
/*Call the Laravel "update" function to update number in the database
If the allow column in the database is equal to 1 there is open for registration
If the allow column is equal to 0 there is closed for registration
*/
$action->update([ 'allow' => $request->allow ]);
}
}

View File

@ -12,14 +12,10 @@ class ContactController extends Controller
{
public function __construct()
{
//Check authentication and languages settings
$this->middleware([ "auth" ]);
$this->middleware([ "lang" ]);
//The middleware is being run just before the pages is getting loaded.
//We use this middleware to chek if a user has the right permission/authentication to view the pages
$this->middleware([ "check.auth:contact.show" ])->only("show", "index");
$this->middleware([ "check.auth:contact.list" ])->only("index");
$this->middleware([ "check.auth:contact.show" ])->only("show");
$this->middleware([ "check.auth:contact.create" ])->only("create", "store");
$this->middleware([ "check.auth:contact.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:contact.delete" ])->only("delete");
@ -30,19 +26,11 @@ class ContactController extends Controller
*
* @return \Illuminate\Http\Response
*/
//Controller for the contact index pages, all backend work for the contact index pages is done here.
public function index(Request $request)
{
//We use the Contact model to query all information from the contact form in the database
$contact = Contact::query()->get();
/*
Here we return/pass the contact variable containing all the database information to the
contacts.index pages as a parameter. The "contacts" in green text is the name you have to use
on the index pages to get the data from the database, you can name it what ever you want, but its best
best practice to give it a describing name.
*/
$contact = Contact::query()->paginate($request->input("limit", 20));
return Response::detect("contacts.index", [ "contacts" => $contact]);
}
@ -51,11 +39,10 @@ class ContactController extends Controller
*
* @return \Illuminate\Http\Response
*/
/*The create controller, all it has to do is redirect you to the contacts create pages*/
public function create()
{
return Response::detect("contacts.create");
}
/**
@ -64,33 +51,23 @@ class ContactController extends Controller
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
//The store controller is used to store user data.
public function store(Request $request)
{
//Validate that the user gave a contactname, title, email, phone and make sure its required and only contains max 255.
$requestContact = $request->validate([
"contactname" => "required|max:255",
"title" => "required|max:255",
"email" => "required|max:255",
"phone" => "max:255",
"phone" => "required|max:255",
]);
//Make a new instance of the contact modal and pass $requestContact to be saved in the database
$contact = new Contact($requestContact);
//Set phonetimes to what the user entered, we dont validate thats why it has its on "save" function .
$contact->phonetimes = $request->phonetimes;
//Call the save function.
$saved = $contact->save();
//If it couldn't save redirect to the contacts.store view
if(!$saved){
return redirect()->route("contacts.store");
}else{
/*If it did get saved query all information from the database and redirect to contacts.index with the parameter
contacts
*/
$contact = Contact::query()->get();
$contact = Contact::query()->paginate($request->input("limit", 20));
return redirect()->route("contacts.index", ['contacts' => $contact]);
}
@ -102,8 +79,6 @@ class ContactController extends Controller
* @param int $id
* @return \Illuminate\Http\Response
*/
//The show controller is used to show a single entity from the database based on the id its get
public function show($id)
{
return Response::detect("contacts.show", [ "contacts" => $id]);
@ -116,10 +91,6 @@ class ContactController extends Controller
* @param int $id
* @return \Illuminate\Http\Response
*/
/*Edit controller finds all the data on the specific id passed to it, finds that entity from the database and
that match with the id and redirect you to the edit pages.
*/
public function edit($id)
{
$contact = Contact::find($id);
@ -133,27 +104,18 @@ class ContactController extends Controller
* @param int $id
* @return \Illuminate\Http\Response
*/
//Update controller
public function update(Request $request, $id)
{
//request all the data from the database
$data = $request->all();
//Find the entity in the database that match the id
$contact = Contact::find($id);
//Call the update function
$contact->update($data);
//Call the save function
$saved = $contact->save();
//If it couldn't save redirect to the contacts.update view
if(!$saved){
return redirect()->route("contacts.update", [ "contacts" => $contact ]);
}else{
/*If it did get saved query all information from the database and redirect to contacts.index with the parameter
contacts
*/
$contact = Contact::query()->get();
$contact = Contact::query()->paginate($request->input("limit", 20));
return redirect()->route("contacts.index", ['contacts' => $contact]);
}
@ -166,11 +128,75 @@ class ContactController extends Controller
* @return \Illuminate\Http\RedirectResponse
* @throws \Exception
*/
//The destroy controller finds the id and calls a delete function, after that it redirects to contact index.
public function destroy($id)
{
$contact = Contact::find($id);
$contact->delete();
return redirect()->route("contacts.index");
}
public function search(Request $request){
if($request->ajax()){
$output = "<tr>".
"<th>Kontakt Navn</th>".
"<th>Titel</th>".
"<th>E-mail</th>".
"<th>Tlf</th>".
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/pencil.svg\" alt=\"Update\"></th>".
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/trashcan.svg\" alt=\"Delete\"></th>".
"</tr>";
if($request->isCheck === "navn")
$users = Contact::query()->where('contactname', 'LIKE',$request->search.'%')->get();
elseif ($request->isCheck === "titel")
$users = Contact::query()->where('title', 'LIKE',$request->search.'%')->get();
elseif ($request->isCheck === "email")
$users = Contact::query()->where('email', 'LIKE',$request->search.'%')->get();
elseif ($request->isCheck === "tf")
$users = Contact::query()->where('phone', 'LIKE',$request->search.'%')->get();
else
$users = DB::table('contacts')->where('contactname', 'LIKE',$request->search.'%')
->orWhere('title','LIKE', $request->search.'%')
->orWhere('phone','LIKE', $request->search.'%')
->orWhere('email','LIKE',$request->search. '%')->get();
if(count($users) !== 0){
foreach ($users as $key => $user){
$output.='<tr>'.
'<td>' . $user->contactname . '</td>'.
'<td>' . $user->title . '</td>'.
'<td>' . $user->email . '</td>'.
'<td>' . $user->phone .'</td>'.
'<td><a href="'. route("contacts.edit", [ "contact" => $user->id ]) . '"><img class="w-100" src="'. asset('/images/icons/pencil-dark.svg') . '" alt="Update"></a></td>'.
'<td><form method="post" action="' .route("contacts.destroy", [ "contact" => $user->id ]). '" class="w-100 nostyle">'.
csrf_field().
method_field("delete").
'<button class="w-100 nostyle" onclick="return confirm(\'Are you sure you want to delete?\');" type="submit"><img class="w-100 cursor-pointer" src="'. asset('/images/icons/trashcan-dark.svg') . '" alt="Delete"></button>'.
'</form>'.
'</td>'.
'</tr>';
}
}else{
$output.='<tr>'.
'<td>Intet match</td>'.
'<td></td>'.
'<td></td>'.
'<td></td>'.
'<td></td>'.
'<td></td>'.
'</tr>';
}
return Response($output);
}
}
}

View File

@ -3,25 +3,21 @@
namespace App\Http\Controllers;
use App\Event;
use App\News;
use App\Notification;
use App\Resource;
use App\UserEvent;
use App\User;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\DB;
date_default_timezone_set('Europe/Copenhagen');
class EventController extends Controller
{
public function __construct()
{
$this->middleware([ "auth" ]);
$this->middleware([ "lang" ]);
$this->middleware([ "check.auth:event.show" ])->only("show", "index");
$this->middleware([ "check.auth:event.list" ])->only("index");
$this->middleware([ "check.auth:event.show" ])->only("show");
$this->middleware([ "check.auth:event.create" ])->only("create", "store");
$this->middleware([ "check.auth:event.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:event.delete" ])->only("delete");
@ -34,7 +30,9 @@ class EventController extends Controller
*/
public function index(Request $request)
{
$events = Event::query()->orderBY('date' , 'asc')->get();
$events = Event::query()->orderBY('date' , 'asc')->paginate($request->input("limit", 20));
//returns the function with events index page and a parameter of events.
//also Response::detect checks screen size to determine if user is on a computer or mobile.
return Response::detect("events.index", [ "events" => $events]);
@ -55,14 +53,13 @@ class EventController extends Controller
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\RedirectResponse
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function store(Request $request)
{
$requestBody = $request->validate([
"name" => "required|max:255",
"accountable" => "required|max:255",
"description" => "required",
"description" => "required|max:255",
"date" => "required"
]);
@ -71,38 +68,14 @@ class EventController extends Controller
$allEvents = Event::query()->where('name', '=', $request->name)->get();
if(count($allEvents) > 0) {
return redirect()->route("events.index", ['events' => $event]);
} else {
if($request->file("resource")) {
$event->resource_id = ResourceController::store($request)->id;
}
if(count($allEvents) > 0)
return redirect()->route("events.index", ['events' => $event])->with('EventNameExists', '<p><b>Der findes allerede et event med det navn!</b></p>');
else {
$event->save();
$events = Event::query()->get();
//If the check on the create pages that is was a news and has to be displayed on the news pages
if($request->newsoption == true){
//Get all events from the database
$events = Event::query()->get();
//make a new object of the news calls
$news = new News();
//Get and save the data
$news->name = "Ny aktivitet";
$news->subname = $event->name;
$news->arrangement_id = $event->id;
$news->type_id = '3';
$news->content = $event->description;
$news->resource_id = $event->resource_id;
$news->news_expiration_date = $events[0]->date;
//Call the news controller function store and get, pass $news to be saved
NewsController::storeAndGet($news);
}
return redirect()->route('events.index', ['events' => $events]);
$event = Event::query()->paginate($request->input("limit", 20));
return redirect()->route("events.index", ['events' => $event]);
}
}
/**
@ -111,12 +84,9 @@ class EventController extends Controller
* @param Event $id
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function show($id)
public function show(Event $id)
{
//Get the entity that match with the passed id.
$event = Event::query()->where("id", "=", $id)->first();
//return the fetch data to the show pages
return Response::detect("events.show", [ "event" => $event ]);
return Response::detect("events.show", [ "event" => $id ]);
}
/**
@ -128,7 +98,7 @@ class EventController extends Controller
public function signups(Request $request)
{
// Find every event you have clicked on. And find all users to that event, and the event name itself.
$events = UserEvent::join('users', 'users.id', '=', 'user_events.user_id')->join('events', 'events.id', '=', 'user_events.event_id')->where('event_id', $request->event)->select('user_events.*', 'users.name_first', 'users.name_last', 'users.phone')->get();
$events = UserEvent::join('users', 'users.id', '=', 'user_events.user_id')->join('events', 'events.id', '=', 'user_events.event_id')->where('event_id', $request->event)->get();
if (count($events) == 0)
$events = Event::where('id', $request->event)->get();
@ -136,20 +106,6 @@ class EventController extends Controller
return Response::detect("events.signups", [ "events" => $events ]);
}
/**
* Display signups for event.
*
* @param int $id
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function accountsignups(Request $request)
{
// Find every event you have clicked on. And find all users to that event, and the event name itself. - This is only being showed on App
$events = UserEvent::join('users', 'users.id', '=', 'user_events.user_id')->join('events', 'events.id', '=', 'user_events.event_id')->where('event_id', $request->event)->get();
return Response::detect("events.signups", [ "events" => $events ]);
}
/**
* Show the form for editing the specified resource.-
*
@ -171,46 +127,20 @@ class EventController extends Controller
*/
public function update(Request $request, $id)
{
//Set $data to holde the value of request->all
$data = $request->all();
//Get the event with matching id
$event = Event::find($id);
//get all events that has a match with the passed id
$allEvents = Event::query()->where('name', '=', $request->name)->where('id', '!=', $id)->get();
//If the amount of $allevents is equal to 0 redirect to index
if(count($allEvents) > 0){
return redirect()->route("events.index", ['events' => $event]);
return redirect()->route("events.index", ['events' => $event])->with('EventNameExists', '<p><b>Der findes allerede et event med det navn!</b></p>');
}else{
//Call the update function
$event->update($data);
//If the events has a images call the Resource Controllers store function
if($request->file("resource")) {
$event->resource_id = ResourceController::store($request)->id;
}
$event->save();
$events = Event::query()->get();
if($request->newsoption == true){
$news = new News();
$news->name = "Aktivitet opdateret";
$news->subname = $event->name;
$news->arrangement_id = $event->id;
$news->type_id = '3';
$news->resource_id = $event->resource_id;
$news->content = "<p>" . $this->closetags(substr($event->description, 0, 300));
$news->news_expiration_date = $event->date;
NewsController::storeAndGet($news);
}
return redirect()->route("events.index", ['events' => $events]);
$event = Event::query()->paginate($request->input("limit", 20));
return redirect()->route("events.index", ['events' => $event]);
}
}
@ -225,91 +155,66 @@ class EventController extends Controller
public function destroy(Request $request, $id)
{
if ($request->signup != null) { // If input signup is not empty, which has been set when you look at the individuel signup, then delete the user who have signed up for the event
$UserEvent = UserEvent::find($id);
$UserEvent = UserEvent::where('user_id', $request->signup)->where('event_id', $id);
$UserEvent->delete();
return redirect()->route("events.signups", [ "event" => $id ]);
} else { // Else if you are deleting an event. Then delete all the sign ups AND the event
$UserEvent = UserEvent::where('event_id', $id);
$UserEvent->delete();
return 1;
} else { // Else if you are deleting an event. Then delete all the sign ups AND the event
$userEvents = UserEvent::query()->where('event_id', "=", $id)->get();
$event = Event::query()->find($id);
foreach ($userEvents as $userEvent) {
$notification = new Notification();
$notification->user_id = $userEvent->user_id;
$notification->message = $event->name . " - ";
$notification->save();
$userEvent->delete();
}
$news = News::query()->join('news_types', 'news_types.id', '=', 'news.type_id')->where("type", "=", "Activity")->where("arrangement_id", "=", $id);
$news->delete();
$event = Event::find($id);
$event->delete();
return redirect()->route("events.index");
}
}
//Fixes tags that have been substringed
//idk yoink this bitch from stackoverflow, you never going to use it, trust me.
public function closetags($html) {
preg_match_all('#<(?!meta|img|br|hr|input\b)\b([a-z]+)(?: .*)?(?<![/|/ ])>#iU', $html, $result);
$openedtags = $result[1];
preg_match_all('#</([a-z]+)>#iU', $html, $result);
$closedtags = $result[1];
$len_opened = count($openedtags);
if (count($closedtags) == $len_opened) {
return $html;
}
$openedtags = array_reverse($openedtags);
for ($i=0; $i < $len_opened; $i++) {
if (!in_array($openedtags[$i], $closedtags)) {
$html .= '</'.$openedtags[$i].'>';
} else {
unset($closedtags[array_search($openedtags[$i], $closedtags)]);
}
}
return $html;
}
public function deleteNotifications(Request $request){
//If the request is equal to ajax, delete every notification where the user_id is = to the $request->user_id
public function search(Request $request){
if($request->ajax()){
foreach (Notification::query()->where("user_id", "=", $request->user_id)->get() as $notification) {
$notification->delete();
$output = "<tr>".
"<th>Event Navn</th>".
"<th>Event Beskrivelse</th>".
"<th>Event Dato</th>".
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/eye.svg\" alt=\"Update\"></th>".
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/pencil.svg\" alt=\"Update\"></th>".
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/trashcan.svg\" alt=\"Delete\"></th>".
"</tr>";
$events = DB::table('events')->orderBY('date' , 'asc')->where('name', 'LIKE',$request->search.'%')
->orWhere('date','LIKE', $request->search.'%')
->get();//Job is here dude :9
if(count($events) !== 0){
foreach ($events as $key => $event){
$output.='<tr>'.
'<td>' . $event->name . '</td>'.
'<td>' . $event->description .'</td>'.
'<td>' . $event->date .'</td>'.
'<td><a href="'. route("events.signups", [ "event" => $event->id ]).'"><img class="w-100" src="'. asset('/images/icons/eye-dark.svg') .'" alt="Update"></a></td>'.
'<td><a href="'. route("events.edit", [ "event" => $event->id ]) . '"><img class="w-100" src="'. asset('/images/icons/pencil-dark.svg') . '" alt="Update"></a></td>'.
'<td><form method="post" action="' .route("events.destroy", [ "event" => $event->id ]). '" class="w-100 nostyle">'.
csrf_field().
method_field("delete").
'<button class="w-100 nostyle" onclick="return confirm(\'Are you sure you want to delete?\');" type="submit"><img class="w-100 cursor-pointer" src="'. asset('/images/icons/trashcan-dark.svg') . '" alt="Delete"></button>'.
'</form>'.
'</td>'.
'</tr>';
}
}else{
$output.='<tr>'.
'<td>Intet match</td>'.
'<td></td>'.
'<td></td>'.
'<td></td>'.
'<td></td>'.
'<td></td>'.
'</tr>';
}
return "Done";
} else {
return "ERROR";
return Response($output);
}
}
//Used for checking if the currently typed event name is unique. Create version
public function nameCheck(Request $request){
//Search the database to check that the name they are typing is uniq
$event = Event::query()->where('name', 'LIKE',$request->nameCheck)->get();
if(count($event) > 0 && $request->nameCheck !== NULL){
return 1;
}
}
//Used for checking if the currently typed event name is unique. Edit version
public function nameCheckUpdate(Request $request){
$event = Event::query()->where('name', 'LIKE',$request->nameCheck)->where('id', '!=', $request->id)->get();
if(count($event) > 0 && $request->nameCheck !== NULL){
return 1;
}
}
public function previewPages(Request $request){
//get the data from the database that match the request and leftjoin the resources table
$event = Event::where('events.id', '=', $request->preview)->leftJoin('resources', 'resources.id', '=', 'events.resource_id')->first();
//convert dababy to a convertible
$convertToJsonArray = json_encode($event);
return $convertToJsonArray;
}
}

View File

@ -13,9 +13,9 @@ class FeedbackController extends Controller
public function __construct()
{
$this->middleware([ "auth" ]);
$this->middleware([ "lang" ]);
$this->middleware([ "check.auth:feedback.show" ])->only("show", "index");
$this->middleware([ "check.auth:feedback.list" ])->only("index");
$this->middleware([ "check.auth:feedback.show" ])->only("show");
$this->middleware([ "check.auth:feedback.create" ])->only("create", "store");
$this->middleware([ "check.auth:feedback.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:feedback.delete" ])->only("delete");
@ -29,7 +29,7 @@ class FeedbackController extends Controller
*/
public function index(Request $request)
{
$feedback = Feedbacks::query()->orderBy('created_at', 'desc')->get();
$feedback = Feedbacks::query()->orderBy('created_at', 'desc')->paginate($request->input("limit", 20));
return Response::detect("feedbacks.index", [ "feedback" => $feedback ]);
}
@ -124,16 +124,37 @@ class FeedbackController extends Controller
$feedback = Feedbacks::find($id);
$feedback->delete();
return redirect()->route("feedbacks.index");
return Response::detect("feedbacks.destroy");
}
public function storeajax(Request $request) {
$requestBody = $request->validate([
"message" => "required",
"suggestion_form" => "required|max:255"
]);
$feedbacks = new Feedbacks($requestBody);
$feedbacks->save();
public function search(Request $request){
if($request->ajax()){
$output = "<tr>".
"<th>Feedback Besked</th>".
"<th>Ris el. Ros</th>".
"</tr>";
//$value = Feedbacks::query('feedbacks')->select('suggestion_form ')->dump();
//$value = DB::table('feedbacks')->select('suggestion_form ')->dump();
if($request->option === "Ris" || $request->option === "Ros")
$feedbacks = Feedbacks::query()->orderBy('created_at', 'desc')->where('suggestion_form', '=', $request->option)
->get();
else
$feedbacks = Feedbacks::all();
if(count($feedbacks) !== 0){
foreach ($feedbacks as $key => $feedback){
$output.='<tr>'.
'<td>' . $feedback->message . '</td>'.
'<td>' . $feedback->suggestion_form . '</td>'.
'</tr>';
}
}
return Response($output);
}
}
}

View File

@ -3,25 +3,24 @@
namespace App\Http\Controllers;
use App\Guide;
use App\News;
use App\Resource;
use Illuminate\Http\Response;
use Illuminate\Http\Request;
use tidy;
class GuideController extends Controller
{
/*
public function __construct()
{
$this->middleware([ "auth" ]);
$this->middleware([ "lang" ]);
$this->middleware([ "check.auth:guides.show" ])->only("show", "index");
$this->middleware([ "check.auth:guides.create" ])->only("create", "store");
$this->middleware([ "check.auth:guides.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:guides.delete" ])->only("delete");
$this->middleware([ "check.auth:contact.list" ])->only("index");
$this->middleware([ "check.auth:contact.show" ])->only("show");
$this->middleware([ "check.auth:contact.create" ])->only("create", "store");
$this->middleware([ "check.auth:contact.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:contact.delete" ])->only("delete");
}
*/
/**
@ -31,7 +30,7 @@ class GuideController extends Controller
*/
public function index(Request $request)
{
$guides = Guide::query()->orderBy("created_at", "desc")->get();
$guides = Guide::query()->paginate($request->input("limit", 20));
return Response::detect("guides.index", [ "guides" => $guides]);
}
@ -54,44 +53,21 @@ class GuideController extends Controller
*/
public function store(Request $request)
{
//Me no sure what to store mester big smoke :)
$requestGuide = $request->validate([
"name" => "required|max:255",
"guide_articles" => "required",
"guide_category_id" => "required",
]);
$guide = new Guide($requestGuide);
//If an image has been uploaded, store the file
if($request->file("resource")) {
$guide->resource_id = ResourceController::store($request)->id;
}
$saved = $guide->save();
if(!$saved) {
if(!$saved){
return redirect()->route("guides.store");
} else {
$guides = Guide::query()->get();
if($request->newsoption == true){
$news = new News();
$news->name = "Ny vejledning";
$news->subname = $guide->name;
$news->arrangement_id = $guide->id;
$news->type_id = '4';
$news->news_expiration_date = $request->input("news_expiration_date");
$news->content = $guide->guide_articles;
if($guide->resource_id !== null)
$news->resource_id = $guide->resource_id;
NewsController::storeAndGet($news);
}
return redirect()->route("guides.index", ['guides' => $guides]);
}else{
$guide = Guide::query()->paginate($request->input("limit", 20));
return redirect()->route("guides.index", ['guides' => $guide]);
}
}
@ -127,164 +103,33 @@ class GuideController extends Controller
*/
public function update(Request $request, Guide $guide)
{
$data = $request->all();
$data = $request->validate([
"name" => "required|max:255",
"guide_articles" => "required",
]);
$guidee = Guide::query()->where("id", "=", $guide->id)->first();
$guidee->update($data);
//If an image has been uploaded, store the file
if($request->file("resource")) {
$guidee->resource_id = ResourceController::store($request)->id;
}
$saved = $guidee->save();
if(!$saved){
return redirect()->route("guides.update", [ "guide" => $guide ]);
}else{
$guides = Guide::query()->get();
if($request->newsoption == true){
$news = new News();
$news->name = "Vejledning opdateret";
$news->subname = $guidee->name;
$news->arrangement_id = $guide->id;
$news->type_id = '4';
if($guide->resource_id !== null)
$news->resource_id = $guide->resource_id;
$news->content = $this->closetags(substr($guidee->guide_articles, 0, 300));
NewsController::storeAndGet($news);
}
return redirect()->route("guides.index", ['guides' => $guides]);
$guide = Guide::query()->paginate($request->input("limit", 20));
return redirect()->route("guides.index", ['guides' => $guide]);
}
}
/**
* Remove the specified resource from storage.
*
* @param Guide $id
* @param \App\Guide $guide
* @return \Illuminate\Http\Response
*/
public function destroy($id)
public function destroy(Guide $guide)
{
// Find the guide you want to remove
$guide = Guide::find($id);
// Find the news the you made when creating the guide (if there is a news)
$news = News::query()->join('news_types', 'news_types.id', '=', 'news.type_id')->where("type", "=", "Guide")->where("arrangement_id", "=", $id);
//Delete the news or/and guide
$news->delete();
$guide = MenuPlan::find($guide);
$guide->delete();
return redirect()->route("guides.index");
}
//Used to fix html, that have been substringed
public function closetags($html) {
preg_match_all('#<(?!meta|img|br|hr|input\b)\b([a-z]+)(?: .*)?(?<![/|/ ])>#iU', $html, $result);
$openedtags = $result[1];
preg_match_all('#</([a-z]+)>#iU', $html, $result);
$closedtags = $result[1];
$len_opened = count($openedtags);
if (count($closedtags) == $len_opened) {
return $html;
}
$openedtags = array_reverse($openedtags);
for ($i=0; $i < $len_opened; $i++) {
if (!in_array($openedtags[$i], $closedtags)) {
$html .= '</'.$openedtags[$i].'>';
} else {
unset($closedtags[array_search($openedtags[$i], $closedtags)]);
}
}
return $html;
}
//Used for checking if the currently typed guide name is unique. Create version
public function nameCheck(Request $request) {
$guide = Guide::query()->where('name', 'LIKE',$request->nameCheck)->get();
if(count($guide) > 0 && $request->nameCheck !== NULL){
return 1;
}
}
//Used for checking if the currently typed guide name is unique. Edit version
public function nameCheckUpdate(Request $request) {
$guide = Guide::query()->where('name', 'LIKE',$request->nameCheck)->where('id', '!=', $request->id)->get();
if(count($guide) > 0 && $request->nameCheck !== NULL){
return 1;
}
}
// Runs the ajax call when changing the select field in guides.index (app)
public function showCategory(Request $request){
if($request->ajax()) {
// Get all guides where the category is what you want
if ($request->category != 'All')
$guides = Guide::query()->orderBy("created_at", "desc")->where('guide_category_id', '=', $request->category)->get();
else
$guides = Guide::query()->orderBy("created_at", "desc")->get();
$output = '';
// Begin showing all guides with the given category
if(!$guides->isEmpty()) {
foreach ($guides as $guide) {
$output .= '<div class="card">';
if ($guide->resource_id !== null) {
$output .= '<div class="header bs-cover bp-center" style="background-image: url(' . asset(\App\Resource::query()->where("id", "=", $guide->resource_id)->first()->filename) . ');">' .
'</div>';
} else {
$output .= '<div class="header d-flex justify-content-center">' .
'<img alt="Image" src="'. asset('/images/icons/image.svg') . '" style="width: calc(100% - 20px)">' .
'</div>';
}
$output .= '<div class="container">' .
'<div class="row justify-content-center">'.
'<h4>'. $guide->name .'</h4>'.
'</div>'.
'<div class="row justify-content-center">';
if (request()->cookie('languagesSetting') == "dk")
$output .= '<a class="text-center m-none p-none bold sde-blue" href="'. route("guides.show", ["guide" => $guide->id ]) .'">Læs mere</a>';
elseif (request()->cookie('languagesSetting') == "en")
$output .= '<a class="text-center m-none p-none bold sde-blue" href="'. route("guides.show", ["guide" => $guide->id ]) .'">Read more</a>';
else
$output .= '<a class="text-center m-none p-none bold sde-blue" href="'. route("guides.show", ["guide" => $guide->id ]) .'">Læs mere</a>';
$output .= '</div>'.
'</div>'.
'</div>';
}
} else { // If there are no guides with the given category, then display error message
if (request()->cookie('languagesSetting') == "dk")
$output .= '<p class="mb-auto text-center">Der er ingen vejledninger af denne kategori</p>';
elseif (request()->cookie('languagesSetting') == "en")
$output .= '<p class="mb-auto text-center">There are no guides of this category</p>';
else
$output .= '<p class="mb-auto text-center">Der er ingen vejledninger af denne kategori</p>';
}
return Response($output);
}
}
public function previewPages(Request $request){
if(!Resource::find($request->preview)){
$event = Guide::find($request->preview);
}else{
$event = Guide::where('guides.id', '=', $request->preview)->join('resources', 'resources.id', '=', 'guides.resource_id')->first();
}
$convertToJsonArray = json_encode($event);
return $convertToJsonArray;
}
}

View File

@ -1,167 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\GuidesCategory;
use App\Guide;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class GuidesCategoryController extends Controller
{
public function __construct()
{
$this->middleware([ "auth" ]);
$this->middleware([ "lang" ]);
$this->middleware([ "check.auth:guides.show" ])->only("show", "index");
$this->middleware([ "check.auth:guides.create" ])->only("create", "store");
$this->middleware([ "check.auth:guides.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:guides.delete" ])->only("delete");
}
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$guideCate = GuidesCategory::query()->get();
return Response::detect("guides-category.index", [ "guidesCategory" => $guideCate]);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return Response::detect("guides-category.create");
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$requestGuideCategory = $request->validate([
"guidesCategoryName" => "required|max:255",
]);
$guideCate = new GuidesCategory($requestGuideCategory);
$saved = $guideCate->save();
if(!$saved) {
return redirect()->route("guides-category.store");
} else {
$guides = Guide::query()->get();
return redirect()->route("guides.index", ['guides' => $guides]);
}
}
/**
* Display the specified resource.
*
* @param int $id
*/
public function show($id)
{
return Response::detect("guides-category.show", $id);
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$guideCate = GuidesCategory::query()->where("id", "=", $id)->first();
return Response::detect("guides-category.edit", [ "guideCategory" => $guideCate]);
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$data = $request->validate([
"guidesCategoryName" => "required|max:255",
]);
$guideCate = GuidesCategory::query()->where("id", "=", $id)->first();
$guideCate->update($data);
$saved = $guideCate->save();
if(!$saved){
return redirect()->route("guides-category.edit", $id);
}else{
$guides = Guide::query()->get();
return redirect()->route("guides.index", ['guides' => $guides]);
}
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$guideCategory = GuidesCategory::find($id);
$guides = Guide::query()->where('guide_category_id', '=', $id);
$guides->delete();
$guideCategory->delete();
return redirect()->route("guides.index");
}
//Used for checking if the currently typed Guide Category name is unique. Create version
public function nameCheck(Request $request) {
$guide = GuidesCategory::query()->where('guidesCategoryName', 'LIKE',$request->nameCheck)->get();
if(count($guide) > 0 && $request->nameCheck !== NULL){
return 1;
}
}
//Used for checking if the currently typed Guide Category name is unique. Edit version
public function nameCheckUpdate(Request $request) {
$guide = GuidesCategory::query()->where('guidesCategoryName', 'LIKE',$request->nameCheck)->where('id', '!=', $request->id)->get();
if(count($guide) > 0 && $request->nameCheck !== NULL){
return 1;
}
}
public function guideCategoryCreate(Request $request){
$data = $request->validate([
"guidesCategoryName" => "required",
]);
$category = new GuidesCategory($data);
$categories = GuidesCategory::query()->where('guidesCategoryName', 'LIKE', $request->guidesCategoryName)->get();
if(count($categories) > 0 && $request->guidesCategoryName !== NULL){
return 1;
} else {
$category->save();
}
}
}

View File

@ -1,167 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\Location;
use App\WashingMachine;
use App\WashingReservation;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\DB;
use function GuzzleHttp\Promise\all;
class LocationController extends Controller
{
public function __construct()
{
$this->middleware([ "auth" ]);
$this->middleware([ "lang" ]);
$this->middleware([ "check.auth:locations.show" ])->only("show", "index");
$this->middleware([ "check.auth:locations.create" ])->only("create", "store");
$this->middleware([ "check.auth:locations.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:locations.delete" ])->only("delete");
}
/**
* Display a listing of the resource.
*
* @param Request $request
* @return \Illuminate\Http\Response
*/
public function index(Request $request)
{
$locations = Location::query()->get();
return Response::detect("locations.index", [ "locations" => $locations ]);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return Response::detect("locations.create");
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$data = $request->validate([
"name" => "required",
]);
$location = new Location($data);
$locations = Location::query()->where('name', '=', $request->name)->get();
// If there already is a washing machine with that name, then don't add it
if (count($locations) > 0)
return redirect()->route("washing-machines.index");
else { // Else - Add it
$location->save();
$locations = Location::query()->get();
return redirect()->route("washing-machines.index", ['locations' => $locations]);//washing-machines.index kan byttes ud med locations.index
}
}
/**
* Display the specified resource.
*
* @param \App\Location $location
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function show(Location $location)
{
return view("admin.locations.show", [ "location" => $location]);
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Location $location
* @return \Illuminate\Http\Response
*/
public function edit(Location $location)
{
return Response::detect("locations.edit", [ "location" => $location] );
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Location $location
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$data = $request->validate([
"name" => "required",
]);
$location = Location::find($id);
$allMachines = Location::query()->where('name', '=', $request->name)->where('id', '!=', $id)->get();
// If there already is a washing machine with that name, then don't change it
if (count($allMachines) > 0)
return redirect()->route("washing-machines.index");
else { // Else - Change the name
$location->update($data);
$location->save();
$locations = Location::query()->get();
return redirect()->route("washing-machines.index", ["locations" => $locations]); //washing-machines.index kan byttes ud med locations.index
}
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$location = Location::find($id);
$washingMachines = WashingMachine::query()->where('location_id', '=', $id)->get();
foreach ($washingMachines as $machine) {
$washingReservations = WashingReservation::query()->where('machine_id', '=', $machine->id)->get();
foreach ($washingReservations as $reservation)
{
$reservation->delete();
}
$machine->delete();
}
$location->delete();
return redirect()->route("washing-machines.index");//washing-machines.index kan byttes ud med locations.index
}
public function nameCheck(Request $request){
$locations = Location::query()->where('name', 'LIKE',$request->nameCheck)->get();
if(count($locations) > 0 && $request->nameCheck !== NULL){
return 1;
}
}
public function nameCheckUpdate(Request $request){
$locations = Location::query()->where('name', 'LIKE',$request->nameCheck)->where('id', '!=', $request->id)->get();
if(count($locations) > 0 && $request->nameCheck !== NULL){
return 1;
}
}
}

View File

@ -2,12 +2,9 @@
namespace App\Http\Controllers;
use App;
use App\ExternalLink;
use App\MenuPlan;
use App\News;
use App\User;
use Barryvdh\DomPDF\Facade as PDF;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\DB;
@ -20,9 +17,9 @@ class MenuPlanController extends Controller
public function __construct()
{
$this->middleware([ "auth" ]);
$this->middleware([ "lang" ]);
$this->middleware([ "check.auth:menuplan.show" ])->only("show", "index");
$this->middleware([ "check.auth:menuplan.list" ])->only("index");
$this->middleware([ "check.auth:menuplan.show" ])->only("show");
$this->middleware([ "check.auth:menuplan.create" ])->only("create", "store");
$this->middleware([ "check.auth:menuplan.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:menuplan.delete" ])->only("delete");
@ -35,7 +32,7 @@ class MenuPlanController extends Controller
*/
public function index(Request $request)
{
$menuPlans = MenuPlan::query()->get();
$menuPlans = MenuPlan::query()->paginate($request->input("limit", 20));
return Response::detect("menuplans.index", [ "menuPlans" => $menuPlans]);
}
@ -59,50 +56,22 @@ class MenuPlanController extends Controller
public function store(Request $request)
{
$requestMenuPlanCreate = $request->validate([
"week" => "required",
"monday" => "required",
"tuesday" => "required",
"wednesday" => "required",
"thursday" => "required",
"week" => "required|max:2",
"monday" => "required|max:255",
"tuesday" => "required|max:255",
"wednesday" => "required|max:255",
"thursday" => "required|max:255"
]);
$menuPlan = new MenuPlan($requestMenuPlanCreate);
$menuPlans = new MenuPlan($requestMenuPlanCreate);
$allMenuPlans = MenuPlan::query()->where('week', '=', $request->week)->get();
if(count($allMenuPlans) > 0)
return redirect()->route("menu-plans.index");
return redirect()->route("menu-plans.index")->with('WeekExists', '<p><b>Der findes allerede en menuplan for den uge!</b></p>');
else {
$menuPlan->save();
$menuPlans = MenuPlan::query()->get();
if($request->newsoption == true){
$news = new News();
$news->name = "Ny menuplan";
$news->subname = "Menuplan for uge " . $menuPlan->week;
$news->content =
'<h2 class="ql-align-center"><strong>Mandag:</strong></h2>'.
'<p class="ql-align-center">'.$menuPlan->monday.'</p><p class="ql-align-center"><br></p>'.
'<h2 class="ql-align-center"><strong>Tirsdag:</strong></h2>'.
'<p class="ql-align-center">'.$menuPlan->tuesday.'</p><p class="ql-align-center"><br></p>'.
'<h2 class="ql-align-center"><strong>Onsdag:</strong></h2>'.
'<p class="ql-align-center">'.$menuPlan->wednesday.'</p><p class="ql-align-center"><br></p>'.
'<h2 class="ql-align-center"><strong>Torsdag:</strong></h2>'.
'<p class="ql-align-center">'.$menuPlan->thursday.'</p>';
$news->type_id = '2';
$news->arrangement_id = $menuPlan->id;
if($request->file("resource")) {
$news->resource_id = ResourceController::store($request)->id;
}
NewsController::storeAndGet($news);
}
$menuPlans->save();
$menuPlans = MenuPlan::query()->paginate($request->input("limit", 20));
return redirect()->route("menu-plans.index", ['menuPlans' => $menuPlans]);
}
}
@ -147,42 +116,12 @@ class MenuPlanController extends Controller
$allMenuPlans = MenuPlan::query()->where('week', '=', $request->week)->where('id', '!=', $id)->get();
if(count($allMenuPlans) > 0){
return redirect()->route("menu-plans.index");
return redirect()->route("menu-plans.index")->with('WeekExists', '<p><b>Der findes allerede en menuplan for den uge!</b></p>');
}else{
$menuplan->update($data);
$menuplan->save();
$menuPlans = MenuPlan::query()->get();
//Create news
if($request->newsoption == true){
$news = new News();
$news->name = "Opdateret menuplan";
$news->subname = "Opdateret menuplan for uge " . $menuplan->week;
$news->arrangement_id = $menuplan->id;
$news->type_id = '2';
$news->content =
'<h2 class="ql-align-center"><strong>Mandag:</strong></h2>'.
'<p class="ql-align-center">'.$menuplan->monday.'</p><p class="ql-align-center"><br></p>'.
'<h2 class="ql-align-center"><strong>Tirsdag:</strong></h2>'.
'<p class="ql-align-center">'.$menuplan->tuesday.'</p><p class="ql-align-center"><br></p>'.
'<h2 class="ql-align-center"><strong>Onsdag:</strong></h2>'.
'<p class="ql-align-center">'.$menuplan->wednesday.'</p><p class="ql-align-center"><br></p>'.
'<h2 class="ql-align-center"><strong>Torsdag:</strong></h2>'.
'<p class="ql-align-center">'.$menuplan->thursday.'</p>';
$oldResourceID = News::query()->where('arrangement_id', '=', $menuplan->id)->first();
if ($oldResourceID != null)
$news->resource_id = $oldResourceID->resource_id;
NewsController::storeAndGet($news);
}
$menuPlans = MenuPlan::query()->paginate($request->input("limit", 20));
return redirect()->route("menu-plans.index", ['menuPlans' => $menuPlans]);
}
@ -192,70 +131,61 @@ class MenuPlanController extends Controller
* Remove the specified resource from storage.
* Test delete return index function.
* @param int $id
* @return RedirectResponse
* @return \Illuminate\Http\RedirectResponse
*/
public function destroy($id)
{
// Find the menu you want to remove
$menuplan = MenuPlan::find($id);
// Find the news the you made when creating the menu (if there is a news)
$news = News::query()->join('news_types', 'news_types.id', '=', 'news.type_id')->where('type', '=', 'Menu')->where('arrangement_id', '=', $id);
//Delete the news or/and menu
$news->delete();
$menuplan->delete();
return redirect()->route("menu-plans.index");
}
/**
* Remove the specified resource from storage.
* Test delete return index function.
* @param $Id
* @return RedirectResponse
*/
public function genPDF($Id){
//get the menuplan with the matching id
$menuPlan = MenuPlan::query()->where("id", "=", $Id)->first();
//Sub string cap
$var = 250;
public function search(Request $request){
if($request->ajax()){
$output = "<tr>".
"<th>Uge</th>".
"<th>Mandag</th>".
"<th>Tirsdag</th>".
"<th>Onsdag</th>".
"<th>Torsdag</th>".
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/pencil.svg\" alt=\"Update\"></th>".
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/trashcan.svg\" alt=\"Delete\"></th>".
"</tr>";
$menuplans = DB::table('menu_plans')->where('week', 'LIKE',$request->search.'%')->get();
//Substring the data
$menuPlan->monday = substr($menuPlan->monday, 0, $var);
$menuPlan->tuesday = substr($menuPlan->tuesday, 0, $var);
$menuPlan->wednesday = substr($menuPlan->wednesday, 0, $var);
$menuPlan->thursday = substr($menuPlan->thursday, 0, $var);
if(count($menuplans) !== 0){
foreach ($menuplans as $key => $menuplan){
$output.='<tr>'.
'<td>' . $menuplan->week . '</td>'.
'<td>' . $menuplan->monday . '</td>'.
'<td>' . $menuplan->tuesday . '</td>'.
'<td>' . $menuplan->wednesday .'</td>'.
'<td>' . $menuplan->thursday .'</td>'.
'<td><a href="'. route("menu-plans.edit", [ "menu_plan" => $menuplan->id ]) . '"><img class="w-100" src="'. asset('/images/icons/pencil-dark.svg') . '" alt="Update"></a></td>'.
'<td><form method="post" action="' .route("menu-plans.destroy", [ "menu_plan" => $menuplan->id ]). '" class="w-100 nostyle">'.
csrf_field().
method_field("delete").
//Pass the substring data to the genPDF pages
$pdf = PDF::loadView('pdf.menuplan', ["menuPlan" => $menuPlan]);
//PDF config
$pdf->setPaper('A4', 'portrait');
//return the pdf
return $pdf->stream("menuplan_uge_".$menuPlan->week.".pdf");
}
public function nameCheck(Request $request){
$menuplan = MenuPlan::query()->where('week', 'LIKE',$request->nameCheck)->get();
if(count($menuplan) > 0 && $request->nameCheck !== NULL){
return 1;
'<button class="w-100 nostyle" onclick="return confirm(\'Are you sure you want to delete?\');" type="submit"><img class="w-100 cursor-pointer" src="'. asset('/images/icons/trashcan-dark.svg') . '" alt="Delete"></button>'.
'</form>'.
'</td>'.
'</tr>';
}
}else{
$output.='<tr>'.
'<td>Intet match</td>'.
'<td></td>'.
'<td></td>'.
'<td></td>'.
'<td></td>'.
'<td></td>'.
'<td></td>'.
'</tr>';
}
return Response($output);
}
}
public function nameCheckUpdate(Request $request){
$menuplan = MenuPlan::query()->where('week', 'LIKE',$request->nameCheck)->where('id', '!=', $request->id)->get();
if(count($menuplan) > 0 && $request->nameCheck !== NULL){
return 1;
}
}
public function previewPages(Request $request){
$event = MenuPlan::find($request->preview);
$convertToJsonArray = json_encode($event);
return $convertToJsonArray;
}
}

View File

@ -1,316 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\MultipleEvents;
use App\MultipleEventsParent;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Barryvdh\DomPDF\Facade as PDF;
//Not in use yet
use App\Event;
use App\News;
use App\Notification;
use App\Resource;
use App\UserEvent;
class MultipleEventsController extends Controller
{
public function __construct()
{
$this->middleware([ "auth" ]);
$this->middleware([ "lang" ]);
$this->middleware([ "check.auth:event.show" ])->only("show", "index");
$this->middleware([ "check.auth:event.create" ])->only("create", "store");
$this->middleware([ "check.auth:event.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:event.delete" ])->only("delete");
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$multiEvents = MultipleEventsParent::join("multiple_events", "multiple_events.multiple_events_parent_id", '=', 'multiple_events_parent.id')->groupBy('multiple_events.multiple_events_parent_id', 'multiple_events_parent.id', 'multiple_events_parent.week', 'multiple_events_parent.resource_id', 'multiple_events_parent.created_at', 'multiple_events_parent.updated_at')->selectRaw('multiple_events_parent.*, max(date) as date')->get();
/*
$multiEvents = MultipleEventsParent::join("multiple_events", "multiple_events.multiple_events_parent_id", '=', 'multiple_events_parent.id')
->groupBy('multiple_events_parent_id')->orderBy('multiple_events.date', 'desc')
->selectRaw('multiple_events_parent.*, max(date) as date')
->get();
*/
return Response::detect("multiple-events.index", [ "multiEvents" => $multiEvents]);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//returns create multiple events blade file from the view folder
return Response::detect("multiple-events.create");
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$requestBody = $request->validate([
"week" => "required",
"name" => "array",
"description" => "array",
"accountable" => "array",
"date" => "array",
]);
$multipleParent = new MultipleEventsParent();
$multipleParent->week = $request->week;
if($request->file("resource")) {
$multipleParent->resource_id = ResourceController::store($request)->id;
}
$multipleParent->save();
for ($i = 0; $i < count($requestBody["name"]); $i++) {
$multi_event = new MultipleEvents();
$multi_event->date = $requestBody['date'][$i];
$multi_event->description = $requestBody['description'][$i];
$multi_event->accountable = $requestBody['accountable'][$i];
$multi_event->name = $requestBody['name'][$i];
$multi_event->multiple_events_parent_id = $multipleParent->id;
$multi_event->save();
}
//creates a new Event model with the given parameter
$multiEventsGetEndDate = MultipleEventsParent::join("multiple_events", "multiple_events.multiple_events_parent_id", '=', 'multiple_events_parent.id')
->groupBy('multiple_events_parent_id')
->orderBy('multiple_events.date', 'desc')
->selectRaw('multiple_events_parent.*, max(date) as date')
->get();
$multiEvents = MultipleEventsParent::query()->get();
if($request->newsoption == true){
$news = new News();
$news->name = "Ny ugentlig aktivitet";
$news->subname = $request->week;
$news->arrangement_id = $multipleParent->id;
$news->type_id = '5';
$news->content = "Den ugentlige aktivitets plan for uge ".$request->week." er her!";
$news->resource_id = $request->resource_id;
$news->news_expiration_date = $multiEventsGetEndDate[0]->date;
NewsController::storeAndGet($news);
}
return redirect()->route('events.index', ['multiEvents' => $multiEvents]);
}
/**
* Display the specified resource.
*
* @param \App\MultipleEvents $multipleeventsController
* @return \Illuminate\Http\Response
*/
public function show($id)
{
$multiEvents = MultipleEvents::where('multiple_events.multiple_events_parent_id', '=', $id)->orderBy('date')->get();
$multiEventParent = MultipleEventsParent::find($id);
return Response::detect("multiple-events.show", [ "week" => $multiEventParent->week, "multiEvents" => $multiEvents]);
}
/**
* Display signups for event.
*
* @param int $id
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function accountsignups(Request $request)
{
// Find every event you have clicked on. And find all users to that event, and the event name itself.
$events = UserEvent::join('users', 'users.id', '=', 'user_events.user_id')->where('multiple_event_id', $request->multiEvent)->select('user_events.*', 'users.name_first', 'users.name_last', 'users.phone')->get();
if (count($events) == 0)
$events = Event::where('id', $request->event)->get();
return Response::detect("multiple-events.signups", [ "multiEvent" => $events ]);
}
/**
* Show the form for editing the specified resource.-
*
* @param int $id
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function edit($id)
{
$multiEvents = MultipleEvents::where('multiple_events_parent_id', '=', $id)->get();
$parentEvent = MultipleEventsParent::find($id);
return Response::detect("multiple-events.edit", ["multiEvents" => $multiEvents, "parentEvent" => $parentEvent]);
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$requestBody = $request->validate([
"week" => "required",
"name" => "array",
"description" => "array",
"accountable" => "array",
"date" => "array",
]);
$parentEvent = MultipleEventsParent::find($id);
if($request->file("resource")) {
$parentEvent->update(["week" => $request->week, "resource_id" => ResourceController::store($request)->id]) ;
} else
$parentEvent->update(["week" => $request->week]);
if (!empty($requestBody["name"])) {
foreach ($requestBody["name"] as $key => $singleEvent) {
if ($key == "new") {
//dd(count($s));
for ($i = 0; $i < count($singleEvent); $i++) {
$multi_event = new MultipleEvents();
$multi_event->name = $requestBody["name"]["new"][$i];
$multi_event->description = $requestBody["description"]["new"][$i];
$multi_event->accountable = $requestBody["accountable"]["new"][$i];
$multi_event->date = $requestBody["date"]["new"][$i];
$multi_event->multiple_events_parent_id = $id;
$multi_event->save();
}
} else {
$event = MultipleEvents::find($key);
$event->update(["name" => $requestBody["name"][$key][0], "description" => $requestBody["description"][$key][0], "accountable" => $requestBody["accountable"][$key][0], "date" => date("Y-m-d H:i:s", strtotime($requestBody["date"][$key][0]))]);
}
}
$multiEventsGetEndDate = MultipleEventsParent::join("multiple_events", "multiple_events.multiple_events_parent_id", '=', 'multiple_events_parent.id')
->groupBy('multiple_events_parent_id')
->orderBy('multiple_events.date', 'desc')
->selectRaw('multiple_events_parent.*, max(date) as date')
->get();
if ($request->newsoption == true) {
$news = new News();
$news->name = "Opdateret ugentlig aktivitet";
$news->subname = $request->week;
$news->arrangement_id = $parentEvent->id;
$news->type_id = '5';
$news->content = "Den ugentlige aktivitets plan for uge " . $request->week . " er opdateret!";
$news->resource_id = $request->resource_id;
$news->news_expiration_date = $multiEventsGetEndDate[0]->date;
NewsController::storeAndGet($news);
}
}
$events = Event::query()->orderBY('date' , 'asc')->get();
return Response::detect("events.index", [ "events" => $events]);
}
/**
* Remove the specified resource from storage.
*
* @param \App\MultipleEvents $multipleeventsController
* @return \Illuminate\Http\Response
*/
public function destroy(Request $request, $id)
{
if ($request->signup != null) { // If input signup is not empty, which has been set when you look at the individuel signup, then delete the user who have signed up for the specific week event
$UserEvent = UserEvent::find($id);
$UserEvent->delete();
return 1;
} elseif ($request->onlyMultiEvent != null) { // Delete a single event from multiple events, and all its signups
$userEvents = UserEvent::where('multiple_event_id', '=', $id)->get();
$multiEvent = MultipleEvents::find($id);
foreach ($userEvents as $ue) {
$ue->delete();
}
$multiEvent->delete();
return 1;
} else { // Delete all multiple events and signups, from the parent/weekly event
$multiparent = MultipleEventsParent::find($id);
$multievent = MultipleEvents::where('multiple_events_parent_id', '=', $id)->get();
foreach ($multievent as $me) {
foreach (UserEvent::where('multiple_event_id', '=', $me->id)->get() as $ue) {
$ue->delete();
}
$me->delete();
}
$news = News::query()->join('news_types', 'news_types.id', '=', 'news.type_id')->where("type", "=", "MultipleEvent")->where("arrangement_id", "=", $id);
$news->delete();
$multiparent->delete();
return 1;
}
}
public function previewPages(Request $request){
/*if(!Resource::find($request->preview)){
$multipleEventsParent = MultipleEventsParent::find($request->preview);
$multipleEvents = MultipleEvents::where('multiple_events_parent_id', '=', $multipleEventsParent->id)->get();
} else {*/
//$multipleEventsParent = MultipleEventsParent::find($request->preview);
$multipleEventsParent = MultipleEventsParent::leftJoin('resources', 'resources.id', '=', 'multiple_events_parent.resource_id')->where('multiple_events_parent.id', '=', $request->preview)->select('multiple_events_parent.*', 'resources.filename')->first();
$multipleEvents = MultipleEvents::where('multiple_events_parent_id', '=', $multipleEventsParent->id)->get();
//}
return [$multipleEventsParent, $multipleEvents];
}
public function genPDF($Id){
$multiEvent = MultipleEventsParent::query()->join("multiple_events", "multiple_events.multiple_events_parent_id", "=", "multiple_events_parent.id")->where("multiple_events_parent.id", "=", $Id)->orderBy('multiple_events.date', 'asc')->get();
$pdf = PDF::loadView('multipdf.multipleevent', ["multiEvent" => $multiEvent]);
$pdf->setPaper('A4', 'landscape');
return $pdf->stream("ugentligt_aktivitet_uge_".$multiEvent[0]->week.".pdf");
}
public function signups(Request $request)
{
// Find every event you have clicked on. And find all users to that event, and the event name itself.
//$multiEvents = UserEvent::join('users', 'users.id', '=', 'user_events.user_id')->join('multiple_events', 'multiple_events.id', '=', 'user_events.multiple_event_id')->where('multiple_event_id', '=', $request->multipleEvent)->get();
$multiEvents = MultipleEvents::where('multiple_events_parent_id', '=', $request->multipleEvent)->get();
//if (count($multiEvents) == 0)
// $multiEvents = MultipleEvents::where('id', '=', $request->multipleEvent)->get();
return Response::detect("multiple-events.signups", [ "multiEvent" => $multiEvents ]);
}
}

Some files were not shown because too many files have changed in this diff Show More