Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
f55117f
add 404.blade.php
dianaanaana Jul 17, 2024
8c58988
Merge remote-tracking branch 'refs/remotes/ncumt/main' into feature/N…
dianaanaana Jul 17, 2024
913adb7
404page_v0
dianaanaana Jul 23, 2024
829b41a
分離css
dianaanaana Jul 23, 2024
9e4821c
img optimization and bug fix
dianaanaana Jul 24, 2024
586d02e
feat: 個人資料頁面增加側邊選單功能
LinChloe Aug 6, 2024
bd104b1
feat: 個人資料頁面增加側邊選單功能
LinChloe Aug 6, 2024
4639c14
feat: 個人資料頁面增加側邊選單功能
LinChloe Aug 6, 2024
180a6ba
feat: 個人資料頁面增加側邊選單功能
LinChloe Aug 7, 2024
a2a9f08
Merge remote-tracking branch 'refs/remotes/ncumt/main' into feature/N…
LinChloe Aug 7, 2024
45ab784
feat: 登山研討會報名
Ben901227 Aug 10, 2024
034b778
feat: 查詢與編輯報名資訊
Ben901227 Aug 10, 2024
d0aa01a
feat: 更新報名資訊驗證調整
Ben901227 Aug 10, 2024
5e46e9f
feat: 調整查詢報名資訊前端頁面
Ben901227 Aug 10, 2024
cfefce3
refactor: 社課報名發送 email 調整
Ben901227 Aug 11, 2024
dd596c8
feat: 發送報名 or 編輯成功 email
Ben901227 Aug 11, 2024
12e3394
chore: 修改使用的縮圖
Ben901227 Aug 11, 2024
71cbc6f
feat: 發送提醒研討會報名 email
Ben901227 Aug 11, 2024
59f8a8d
feat: 顯示登山研討會報名結果
Ben901227 Aug 11, 2024
e218202
feat: user role 改成用 enum
Ben901227 Aug 11, 2024
b8bf895
feat: 可以編輯 user list 的 role 以及 conference result 的權限控制
Ben901227 Aug 11, 2024
aedbbe8
fix: navbar user->role NPE issue
Ben901227 Aug 11, 2024
4eb86e9
feat: 資料庫同步(仍有錯誤)
LinChloe Aug 13, 2024
1bb414b
feat: 前端畫面調整
Ben901227 Aug 14, 2024
7027c73
feat: 報名查詢加上 email 驗證碼
Ben901227 Aug 16, 2024
304a456
feat: 資料庫同步(修正錯誤)
LinChloe Aug 20, 2024
51c5224
feat: 上傳修改者置資料庫(登山事蹟null錯誤)
LinChloe Aug 20, 2024
e22a938
Merge pull request #58 from dianaanaana/feature/NCUMT-42
Ben901227 Aug 20, 2024
30718d8
feat: 個人資料已完成(加入登山社時間)
LinChloe Aug 20, 2024
7fcd18e
feat: 報名加上手機號碼驗證
Ben901227 Aug 20, 2024
8073313
Merge pull request #65 from Ben901227/feature/NCUMT-47
Ben901227 Aug 20, 2024
73cedac
Merge remote-tracking branch 'ncumt/feature/NCUMT-42'
Ben901227 Aug 20, 2024
d7deae3
Merge remote-tracking branch 'ncumt/feature/NCUMT-47'
Ben901227 Aug 20, 2024
ccbf5d9
Merge pull request #66 from Ben901227/main
Ben901227 Aug 20, 2024
6335983
fix: 404.css 引用
Ben901227 Aug 20, 2024
4e779f7
Merge pull request #67 from Ben901227/main
Ben901227 Aug 20, 2024
98df4fe
fix: user/list
Ben901227 Jul 31, 2024
58b5de2
chore: add images
Ben901227 Aug 20, 2024
ebede7a
rebase commits
Ben901227 Aug 20, 2024
403649f
Revert "rebase commits"
Ben901227 Aug 20, 2024
31e7e1c
Revert "Revert "rebase commits""
Ben901227 Aug 20, 2024
f5b56a8
Revert "rebase commits"
Ben901227 Aug 20, 2024
754ae54
chore: image optimize
Ben901227 Aug 20, 2024
c989134
Merge pull request #68 from Ben901227/release/20240820
Ben901227 Aug 20, 2024
384454e
feat: 個人資料網頁(提示使用者必須填寫)
LinChloe Aug 21, 2024
e2108c0
feat: 個人資料網頁(提示使用者必須填寫)
LinChloe Aug 21, 2024
0898b48
Merge pull request #69 from ncumtweb/release/20240820
Ben901227 Aug 21, 2024
338cbb2
feat: 個人資料網頁(更正不必要的程式和錯誤)
LinChloe Aug 21, 2024
a75af4c
紀錄加分頁
dianaanaana Aug 21, 2024
0c9125b
NCUMT-51 登山研討會報名結果權限調整
Ben901227 Aug 21, 2024
b557916
Merge pull request #71 from Ben901227/feature/NCUMT-51
Ben901227 Aug 21, 2024
254bd89
Merge pull request #72 from ncumtweb/feature/NCUMT-51
Ben901227 Aug 21, 2024
436b05f
調整圖片及排版
dianaanaana Aug 21, 2024
d8ba501
美化
dianaanaana Sep 3, 2024
7120fba
review
dianaanaana Sep 3, 2024
bbca5b6
feat: 個人資料網頁(更正錯誤)
LinChloe Sep 4, 2024
27c98fa
NCUMT-52 Portal Oauth 調整
Ben901227 Sep 4, 2024
2723187
NCUMT-52 Portal Oauth 調整
Ben901227 Sep 4, 2024
dc0f625
Merge pull request #75 from Ben901227/feature/NCUMT-52
Ben901227 Sep 4, 2024
296b8bd
Merge pull request #76 from ncumtweb/feature/NCUMT-52
Ben901227 Sep 4, 2024
f4ade2e
chore: update gitignore
Ben901227 Sep 4, 2024
54ead3d
Merge pull request #73 from ncumtweb/release/20240820
Ben901227 Sep 4, 2024
34d1c0f
fix: user mobilePhone NPE
Ben901227 Sep 5, 2024
65bd1ef
NCUMT-52 Portal Oauth 調整
Ben901227 Sep 7, 2024
b891eef
Merge pull request #77 from Ben901227/feature/NCUMT-52
Ben901227 Sep 7, 2024
f815cb3
NCUMT-53 社課報名調整
Ben901227 Sep 7, 2024
247dc64
Merge pull request #79 from Ben901227/feature/NCUMT-53
Ben901227 Sep 7, 2024
2bbdc08
Merge pull request #78 from ncumtweb/feature/NCUMT-52
Ben901227 Sep 7, 2024
6751f6d
Merge pull request #80 from ncumtweb/feature/NCUMT-53
Ben901227 Sep 7, 2024
f60256e
Merge pull request #74 from dianaanaana/feature/NCUMT-3
Ben901227 Sep 8, 2024
39c2259
Merge pull request #81 from ncumtweb/feature/NCUMT-3
Ben901227 Sep 9, 2024
db600af
feat: 個人資料(新增三筆資料—未完成)
LinChloe Sep 9, 2024
f561c51
Merge branch 'refs/heads/main' into feature/NCUMT-41
LinChloe Sep 9, 2024
07ce494
feat: 個人資料(新增三筆資料,const POSITION = 'general_user';)
LinChloe Oct 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/node_modules
/public/hot
/public/storage
/public/uploads
/storage/*.key
/vendor
.env
Expand Down
33 changes: 14 additions & 19 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,32 @@

namespace App\Console;

use App\Mail\Conference\ConferenceReminder;
use App\Mail\Course\CourseReminder;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use App\Models\CourseRecord;
use App\Models\Course;
use Illuminate\Support\Facades\Mail;
use App\Mail\CourseReminder;

class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @param Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
protected function schedule(Schedule $schedule): void
{
$schedule->command('queue:work --tries=3 --stop-when-empty')->withoutOverlapping()->everyMinute();
$schedule->call(function () {
$course = Course::where('date', now()->addDay()->toDateString())->first();
if($course) {
foreach($course->users as $user) {
Mail::to($user->email)->send(new CourseReminder($course, $user));
}
}
})->daily()
CourseReminder::sendEmail();
})->dailyAt('19:00');

// 登山研討會前一天晚上七點發送 email 提醒報名者
$schedule->call(function () {
ConferenceReminder::sendEmail();
})->dailyAt('19:00')
->when(function () {
$course = Course::where('date', '>', now()->toDateString())->first();
if($course) {
return $course->date === now()->addDay()->toDateString();
}
return now()->format('Y-m-d') === '2024-10-25';
});
}

Expand All @@ -41,9 +36,9 @@ protected function schedule(Schedule $schedule)
*
* @return void
*/
protected function commands()
protected function commands(): void
{
$this->load(__DIR__.'/Commands');
$this->load(__DIR__ . '/Commands');

require base_path('routes/console.php');
}
Expand Down
5 changes: 4 additions & 1 deletion app/Enums/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
namespace App\Enums;
enum Common: int
{
case SYSTEM = 0;
/**
* 系統寫入的使用者
*/
case SYSTEM_USER = 0;
}
29 changes: 29 additions & 0 deletions app/Enums/Gender.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace App\Enums;

enum Gender: int
{
/**
* 男
*/
case MALE = 1;

/**
* 女
*/
case FEMALE = 2;

/**
* 将性别转换为对应的中文描述
*
* @return string
*/
public function toChinese(): string
{
return match ($this) {
self::MALE => '男',
self::FEMALE => '女',
};
}
}
32 changes: 32 additions & 0 deletions app/Enums/Identity.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace App\Enums;

/**
* conference 裡面的身份
*/
enum Identity: string {

/**
* 學生
*/
case STUDENT = 'student';

/**
* 社會人士
*/
case SOCIAL = 'social';

/**
* 將身份轉換成中文
*
* @return string
*/
public function toChinese(): string
{
return match ($this) {
self::STUDENT => '學生',
self::SOCIAL => '社會人士',
};
}
}
11 changes: 11 additions & 0 deletions app/Enums/LoginMethod.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App\Enums;

enum LoginMethod: string
{
/**
* portal 登入
*/
case PORTAL = 'portal';
}
16 changes: 16 additions & 0 deletions app/Enums/Mode.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace App\Enums;

/**
* 表單的模式
*/
enum Mode: string
{
/**
* 建立
*/
case CREATE = 'create';

case EDIT = 'edit';
}
125 changes: 125 additions & 0 deletions app/Enums/Role.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<?php

namespace App\Enums;

enum Role: int
{
/**
* 非社員
*/
case NON_MEMBER = -1;
/**
* 社員
*/
case MEMBER = 0;

/**
* 社長
*/
case CLUB_LEADER = 1;

/**
* 副社長
*/
case VICE_CLUB_LEADER = 2;

/**
* 嚮導組組長
*/
case GUIDE_LEADER = 3;

/**
* 嚮導組組員
*/
case GUIDE_MEMBER = 4;

/**
* 技術組組長
*/
case TECH_LEADER = 5;

/**
* 技術組組員
*/
case TECH_MEMBER = 6;

/**
* 器材組組長
*/
case EQUIPMENT_LEADER = 7;

/**
* 器材組組員
*/
case EQUIPMENT_MEMBER = 8;

/**
* 醫藥組組長
*/
case MEDICAL_LEADER = 9;

/**
* 醫藥組組員
*/
case MEDICAL_MEMBER = 10;

/**
* 文書組組長
*/
case SECRETARY_LEADER = 11;

/**
* 文書組組員
*/
case SECRETARY_MEMBER = 12;

/**
* 美宣
*/
case DESIGN = 13;

/**
* 網管
*/
case WEB_ADMIN = 14;

/**
* 財務長
*/
case TREASURER = 15;

/**
* 山防組組長
*/
case SAFETY_LEADER = 16;

/**
* 山防組組員
*/
case SAFETY_MEMBER = 17;

public function toChinese(): string
{
return match($this) {
self::NON_MEMBER => '非社員',
self::MEMBER => '社員',
self::CLUB_LEADER => '社長',
self::VICE_CLUB_LEADER => '副社長',
self::GUIDE_LEADER => '嚮導組組長',
self::GUIDE_MEMBER => '嚮導組組員',
self::TECH_LEADER => '技術組組長',
self::TECH_MEMBER => '技術組組員',
self::EQUIPMENT_LEADER => '器材組組長',
self::EQUIPMENT_MEMBER => '器材組組員',
self::MEDICAL_LEADER => '醫藥組組長',
self::MEDICAL_MEMBER => '醫藥組組員',
self::SECRETARY_LEADER => '文書組組長',
self::SECRETARY_MEMBER => '文書組組員',
self::DESIGN => '美宣',
self::WEB_ADMIN => '網管',
self::TREASURER => '財務長',
self::SAFETY_LEADER => '山防組組長',
self::SAFETY_MEMBER => '山防組組員',
};
}
}
19 changes: 13 additions & 6 deletions app/Http/Controllers/CourseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

namespace App\Http\Controllers;

use App\Mail\Course\CourseRegister;
use App\Models\Course;
use App\Models\CourseRecord;
use App\Traits\ImageTrait;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Mail;

Expand All @@ -19,7 +21,7 @@ class CourseController extends Controller
*/
public function index()
{
$courses = Course::whereNotNull('videoURL')->orderBy('date','desc')->get();
$courses = Course::whereNotNull('videoURL')->orderBy('start_date','desc')->get();
return view('course.course', ['courses' => $courses]);
}

Expand Down Expand Up @@ -50,7 +52,8 @@ public function store(Request $request)
$course = new Course();
$course->title = $request->input('title');
$course->description = $request->input('description');
$course->date = $request->input('date');
$course->start_date = $request->input('start_date');
$course->end_date = $request->input('end_date');
$course->speaker = $request->input('speaker');
$course->location = $request->input('location');
$course->image = $this->storeImage($file, $folder_name, $name);
Expand All @@ -60,6 +63,8 @@ public function store(Request $request)
if($request->input('pptURL')) {
$course->pptURL = $request->input('pptURL');
}
$course->create_user = Auth::user()->id;
$course->modify_user = Auth::user()->id;

$course->save();

Expand All @@ -77,8 +82,8 @@ public function showRegister()
{

$courses = Course::where('videoURL', null)
->whereDate('date', '>=' , now()->toDateString())
->orderBy('date','asc')
->whereDate('start_date', '>=' , now()->toDateString())
->orderBy('start_date','asc')
->get();


Expand All @@ -96,7 +101,7 @@ public function register($id) {
$msg = auth()->user()->name . '「' . $courseRecord->course->title. '」' . '社課報名完成';

Mail::to($courseRecord->user->email)
->later(now()->addSeconds(5), new \App\Mail\Course($courseRecord));
->later(now()->addSeconds(5), new CourseRegister($courseRecord));

return redirect()->back()->with('status', $msg);
}
Expand Down Expand Up @@ -145,7 +150,8 @@ public function update(Request $request, $id)

$course->title = $request->input('title');
$course->description = $request->input('description');
$course->date = $request->input('date');
$course->start_date = $request->input('start_date');
$course->end_date = $request->input('end_date');
$course->speaker = $request->input('speaker');
$course->location = $request->input('location');

Expand All @@ -155,6 +161,7 @@ public function update(Request $request, $id)
if($request->input('pptURL')) {
$course->pptURL = $request->input('pptURL');
}
$course->modify_user = Auth::user()->id;
$course->update();

return redirect()->route('course.showRegister')->with('status','社課更新成功');
Expand Down
Loading