diff --git a/app/Http/Controllers/LabController.php b/app/Http/Controllers/LabController.php index 36bf611..36ae014 100644 --- a/app/Http/Controllers/LabController.php +++ b/app/Http/Controllers/LabController.php @@ -55,7 +55,8 @@ public function show(Lab $lab) { $labs = Lab::all(); $timeMappings = TimeMappings::$timeMappings; - return view('home.lab', compact('lab', 'labs', 'timeMappings')); + $title = $lab->name; + return view('home.lab', compact('lab', 'labs', 'timeMappings', 'title')); } /** diff --git a/app/Livewire/Counter.php b/app/Livewire/Counter.php new file mode 100644 index 0000000..7cf50c0 --- /dev/null +++ b/app/Livewire/Counter.php @@ -0,0 +1,59 @@ +count += 5; + } + + public function cancelBooking($id) + { + $booking = LabsBooking::find($id); + $booking->delete(); + } + + public function render() + { + + $now = Carbon::now(); + + $upcomingHistories = LabsBooking::with('lab') + ->where('user_id', auth()->user()->id) + ->where(function ($query) use ($now) { + $query->where('booking_date', '>=', $now->format('Y-m-d')) + ->orWhere(function ($subquery) use ($now) { + $subquery->where('booking_date', '=', $now->format('Y-m-d')) + ->where('start_time', '>', $now->format('H:i:s')); + }); + }) + ->orderBy('booking_date', 'asc') + ->get(); + + $expiredHistories = LabsBooking::with('lab') + ->where('user_id', auth()->user()->id) + ->where(function ($query) use ($now) { + $query->where('booking_date', '<', $now->format('Y-m-d')) + ->orWhere(function ($subquery) use ($now) { + $subquery->whereDate('booking_date', '=', $now->format('Y-m-d')) + ->whereTime('start_time', '<', $now->format('H:i:s')); + }); + }) + ->orderBy('booking_date', 'desc') + ->take($this->count)->get(); + + + return view('livewire.counter', compact('upcomingHistories', 'expiredHistories')); + } +} diff --git a/app/Livewire/Navbar.php b/app/Livewire/Navbar.php index 7505035..077814a 100644 --- a/app/Livewire/Navbar.php +++ b/app/Livewire/Navbar.php @@ -3,9 +3,7 @@ namespace App\Livewire; use Carbon\Carbon; -use App\Models\Lab; use Livewire\Component; -use Livewire\Attributes\On; class Navbar extends Component { @@ -17,6 +15,16 @@ public function mount() $this->startDate = Carbon::now()->startOfWeek()->addWeeks($this->currentWeek - 1); } + public function getAllRoom() + { + $this->dispatch('getAllRoom'); + } + + public function getRoom($bulding) + { + $this->dispatch('getRoom', ['bulding' => $bulding]); + } + public function prevWeek() { $this->dispatch('prevWeek'); diff --git a/app/Livewire/ScheduleCalendar.php b/app/Livewire/ScheduleCalendar.php index eb9590c..6be4064 100644 --- a/app/Livewire/ScheduleCalendar.php +++ b/app/Livewire/ScheduleCalendar.php @@ -69,6 +69,20 @@ public function getLabScheduleDetail($labId, $date, $day) $this->dispatch('show-detail-schedule', $labId, $date, $day, $data); } + #[On('getRoom')] + public function getRoom($bulding) + { + $this->labs = Lab::where('description', $bulding)->get(); + $this->mount(); + } + + #[On('getAllRoom')] + public function getAllRoom() + { + $this->labs = Lab::all(); + $this->mount(); + } + public function render() { return view('livewire.schedule-calendar'); diff --git a/composer.json b/composer.json index 8168f7e..434f583 100644 --- a/composer.json +++ b/composer.json @@ -7,6 +7,7 @@ "require": { "php": "^8.1", "guzzlehttp/guzzle": "^7.2", + "hisorange/browser-detect": "^5.0", "itsgoingd/clockwork": "^5.1", "laravel/framework": "^10.10", "laravel/sanctum": "^3.2", diff --git a/composer.lock b/composer.lock index 96feb80..7b629f3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3e9315005255e9f6946759dc121ed7b1", + "content-hash": "bae021e0562b470b2b7ce7e725bd93b7", "packages": [ { "name": "brick/math", @@ -130,6 +130,82 @@ ], "time": "2023-12-11T17:09:12+00:00" }, + { + "name": "composer/ca-bundle", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "b66d11b7479109ab547f9405b97205640b17d385" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/b66d11b7479109ab547f9405b97205640b17d385", + "reference": "b66d11b7479109ab547f9405b97205640b17d385", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.55", + "psr/log": "^1.0", + "symfony/phpunit-bridge": "^4.2 || ^5", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues", + "source": "https://github.com/composer/ca-bundle/tree/1.4.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-12-18T12:05:55+00:00" + }, { "name": "composer/semver", "version": "3.4.0", @@ -1187,6 +1263,78 @@ ], "time": "2023-12-03T19:50:20+00:00" }, + { + "name": "hisorange/browser-detect", + "version": "5.0.2", + "source": { + "type": "git", + "url": "https://github.com/hisorange/browser-detect.git", + "reference": "eb884eaca7ebcda4192a150a72962558bc5a048e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hisorange/browser-detect/zipball/eb884eaca7ebcda4192a150a72962558bc5a048e", + "reference": "eb884eaca7ebcda4192a150a72962558bc5a048e", + "shasum": "" + }, + "require": { + "jaybizzle/crawler-detect": "~1.2", + "league/pipeline": "^1.0", + "matomo/device-detector": "^6.0", + "mobiledetect/mobiledetectlib": "~3.74", + "php": "^8.1", + "ua-parser/uap-php": "~3.9" + }, + "require-dev": { + "orchestra/testbench": "~7.0 || ~8.0", + "php-coveralls/php-coveralls": "~2.0", + "phpunit/phpunit": "~9.0 || ~10.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "hisorange\\BrowserDetect\\ServiceProvider" + ], + "aliases": { + "Browser": "hisorange\\BrowserDetect\\Facade" + } + } + }, + "autoload": { + "psr-4": { + "hisorange\\BrowserDetect\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Varga Zsolt", + "email": "hello@hisorange.me" + } + ], + "description": "Browser & Mobile detection package for Laravel.", + "homepage": "https://github.com/hisorange/browser-detect", + "keywords": [ + "analyse", + "browser", + "detect", + "hisorange", + "laravel", + "mobile", + "tablet", + "user agent", + "user-agent" + ], + "support": { + "issues": "https://github.com/hisorange/browser-detect/issues", + "source": "https://github.com/hisorange/browser-detect/tree/5.0.2" + }, + "time": "2024-01-06T02:38:08+00:00" + }, { "name": "itsgoingd/clockwork", "version": "v5.1.12", @@ -1255,6 +1403,58 @@ ], "time": "2022-12-13T00:04:12+00:00" }, + { + "name": "jaybizzle/crawler-detect", + "version": "v1.2.116", + "source": { + "type": "git", + "url": "https://github.com/JayBizzle/Crawler-Detect.git", + "reference": "97e9fe30219e60092e107651abb379a38b342921" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/97e9fe30219e60092e107651abb379a38b342921", + "reference": "97e9fe30219e60092e107651abb379a38b342921", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8|^5.5|^6.5|^9.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Jaybizzle\\CrawlerDetect\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Beech", + "email": "m@rkbee.ch", + "role": "Developer" + } + ], + "description": "CrawlerDetect is a PHP class for detecting bots/crawlers/spiders via the user agent", + "homepage": "https://github.com/JayBizzle/Crawler-Detect/", + "keywords": [ + "crawler", + "crawler detect", + "crawler detector", + "crawlerdetect", + "php crawler detect" + ], + "support": { + "issues": "https://github.com/JayBizzle/Crawler-Detect/issues", + "source": "https://github.com/JayBizzle/Crawler-Detect/tree/v1.2.116" + }, + "time": "2023-07-21T15:49:49+00:00" + }, { "name": "laravel/framework", "version": "v10.38.1", @@ -2106,6 +2306,63 @@ ], "time": "2023-10-17T14:13:20+00:00" }, + { + "name": "league/pipeline", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/pipeline.git", + "reference": "aa14b0e3133121f8be39e9a3b6ddd011fc5bb9a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/pipeline/zipball/aa14b0e3133121f8be39e9a3b6ddd011fc5bb9a8", + "reference": "aa14b0e3133121f8be39e9a3b6ddd011fc5bb9a8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "leanphp/phpspec-code-coverage": "^4.2", + "phpspec/phpspec": "^4.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Pipeline\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frenky.net", + "role": "Author" + }, + { + "name": "Woody Gilk", + "email": "woody.gilk@gmail.com", + "role": "Maintainer" + } + ], + "description": "A plug and play pipeline implementation.", + "keywords": [ + "composition", + "design pattern", + "pattern", + "pipeline", + "sequential" + ], + "support": { + "issues": "https://github.com/thephpleague/pipeline/issues", + "source": "https://github.com/thephpleague/pipeline/tree/master" + }, + "time": "2018-06-05T21:06:51+00:00" + }, { "name": "livewire/livewire", "version": "v3.3.3", @@ -2448,6 +2705,139 @@ }, "time": "2022-12-02T22:17:43+00:00" }, + { + "name": "matomo/device-detector", + "version": "6.2.1", + "source": { + "type": "git", + "url": "https://github.com/matomo-org/device-detector.git", + "reference": "19138b0c4b9ddf4ffd8e423d6af3764b7317cb0b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/matomo-org/device-detector/zipball/19138b0c4b9ddf4ffd8e423d6af3764b7317cb0b", + "reference": "19138b0c4b9ddf4ffd8e423d6af3764b7317cb0b", + "shasum": "" + }, + "require": { + "mustangostang/spyc": "*", + "php": "^7.2|^8.0" + }, + "replace": { + "piwik/device-detector": "self.version" + }, + "require-dev": { + "matthiasmullie/scrapbook": "^1.4.7", + "mayflower/mo4-coding-standard": "^v9.0.0", + "phpstan/phpstan": "^1.10.44", + "phpunit/phpunit": "^8.5.8", + "psr/cache": "^1.0.1", + "psr/simple-cache": "^1.0.1", + "symfony/yaml": "^5.1.7" + }, + "suggest": { + "doctrine/cache": "Can directly be used for caching purpose", + "ext-yaml": "Necessary for using the Pecl YAML parser" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeviceDetector\\": "" + }, + "exclude-from-classmap": [ + "Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "The Matomo Team", + "email": "hello@matomo.org", + "homepage": "https://matomo.org/team/" + } + ], + "description": "The Universal Device Detection library, that parses User Agents and detects devices (desktop, tablet, mobile, tv, cars, console, etc.), clients (browsers, media players, mobile apps, feed readers, libraries, etc), operating systems, devices, brands and models.", + "homepage": "https://matomo.org", + "keywords": [ + "devicedetection", + "parser", + "useragent" + ], + "support": { + "forum": "https://forum.matomo.org/", + "issues": "https://github.com/matomo-org/device-detector/issues", + "source": "https://github.com/matomo-org/matomo", + "wiki": "https://dev.matomo.org/" + }, + "time": "2024-01-05T09:03:21+00:00" + }, + { + "name": "mobiledetect/mobiledetectlib", + "version": "3.74.3", + "source": { + "type": "git", + "url": "https://github.com/serbanghita/Mobile-Detect.git", + "reference": "39582ab62f86b40e4edb698159f895929a29c346" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/39582ab62f86b40e4edb698159f895929a29c346", + "reference": "39582ab62f86b40e4edb698159f895929a29c346", + "shasum": "" + }, + "require": { + "php": ">=7.4" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.14", + "phpunit/phpunit": "^9.6", + "squizlabs/php_codesniffer": "^3.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Detection\\": "src/" + }, + "classmap": [ + "src/MobileDetect.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Serban Ghita", + "email": "serbanghita@gmail.com", + "homepage": "https://mobiledetect.net", + "role": "Developer" + } + ], + "description": "Mobile_Detect is a lightweight PHP class for detecting mobile devices. It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.", + "homepage": "https://github.com/serbanghita/Mobile-Detect", + "keywords": [ + "detect mobile devices", + "mobile", + "mobile detect", + "mobile detector", + "php mobile detect" + ], + "support": { + "issues": "https://github.com/serbanghita/Mobile-Detect/issues", + "source": "https://github.com/serbanghita/Mobile-Detect/tree/3.74.3" + }, + "funding": [ + { + "url": "https://github.com/serbanghita", + "type": "github" + } + ], + "time": "2023-10-27T16:28:04+00:00" + }, { "name": "monolog/monolog", "version": "3.5.0", @@ -2549,6 +2939,56 @@ ], "time": "2023-10-27T15:32:31+00:00" }, + { + "name": "mustangostang/spyc", + "version": "0.6.3", + "source": { + "type": "git", + "url": "git@github.com:mustangostang/spyc.git", + "reference": "4627c838b16550b666d15aeae1e5289dd5b77da0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mustangostang/spyc/zipball/4627c838b16550b666d15aeae1e5289dd5b77da0", + "reference": "4627c838b16550b666d15aeae1e5289dd5b77da0", + "shasum": "" + }, + "require": { + "php": ">=5.3.1" + }, + "require-dev": { + "phpunit/phpunit": "4.3.*@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.5.x-dev" + } + }, + "autoload": { + "files": [ + "Spyc.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "mustangostang", + "email": "vlad.andersen@gmail.com" + } + ], + "description": "A simple YAML loader/dumper class for PHP", + "homepage": "https://github.com/mustangostang/spyc/", + "keywords": [ + "spyc", + "yaml", + "yml" + ], + "time": "2019-09-10T13:16:29+00:00" + }, { "name": "nesbot/carbon", "version": "2.72.1", @@ -6153,6 +6593,69 @@ }, "time": "2023-12-08T13:03:43+00:00" }, + { + "name": "ua-parser/uap-php", + "version": "v3.9.14", + "source": { + "type": "git", + "url": "https://github.com/ua-parser/uap-php.git", + "reference": "b796c5ea5df588e65aeb4e2c6cce3811dec4fed6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ua-parser/uap-php/zipball/b796c5ea5df588e65aeb4e2c6cce3811dec4fed6", + "reference": "b796c5ea5df588e65aeb4e2c6cce3811dec4fed6", + "shasum": "" + }, + "require": { + "composer/ca-bundle": "^1.1", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.33", + "phpunit/phpunit": "^8 || ^9", + "symfony/console": "^3.4 || ^4.2 || ^4.3 || ^5.0", + "symfony/filesystem": "^3.4 || ^4.2 || ^4.3 || ^5.0", + "symfony/finder": "^3.4 || ^4.2 || ^4.3 || ^5.0", + "symfony/yaml": "^3.4 || ^4.2 || ^4.3 || ^5.0", + "vimeo/psalm": "^3.12" + }, + "suggest": { + "symfony/console": "Required for CLI usage - ^3.4 || ^4.3 || ^5.0", + "symfony/filesystem": "Required for CLI usage - ^3.4 || ^4.3 || ^5.0", + "symfony/finder": "Required for CLI usage - ^3.4 || ^4.3 || ^5.0", + "symfony/yaml": "Required for CLI usage - ^3.4 || ^4.3 || ^5.0" + }, + "bin": [ + "bin/uaparser" + ], + "type": "library", + "autoload": { + "psr-4": { + "UAParser\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dave Olsen", + "email": "dmolsen@gmail.com" + }, + { + "name": "Lars Strojny", + "email": "lars@strojny.net" + } + ], + "description": "A multi-language port of Browserscope's user agent parser.", + "support": { + "issues": "https://github.com/ua-parser/uap-php/issues", + "source": "https://github.com/ua-parser/uap-php/tree/v3.9.14" + }, + "time": "2020-10-02T23:36:20+00:00" + }, { "name": "vlucas/phpdotenv", "version": "v5.6.0", diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 86725b3..29e3622 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -66,8 +66,8 @@ class="mb-4 rounded-lg bg-green-100 px-6 py-5 text-base text-dark-700 w-[70%] mx -
Untuk pengguna dari luar Undiksha, silakan membuat akun di bawah ini
-Daftar
+ diff --git a/resources/views/dashboard/reports/excel.blade.php b/resources/views/dashboard/reports/excel.blade.php index 7160920..976f59f 100644 --- a/resources/views/dashboard/reports/excel.blade.php +++ b/resources/views/dashboard/reports/excel.blade.php @@ -5,7 +5,6 @@