Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 4 additions & 5 deletions app/Http/Controllers/CalendarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\Event;
use Carbon\Carbon;
use Illuminate\Http\Request;

class CalendarController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
* @return array
*/
public function index()
{
$calendar_events = array();
$events = Event::all();
$category_array =['#A8D8B9', '#7DB9DE','#E6E5A3', '#9B90C2', '#E87A90']; // 0 => 爬山(綠色), 1 => 溯溪(藍色), 2 => 社課(黃色), 3 => 開會(紫色), 4' => 山防(紅色)
$category = ['0' => "出隊 | ", '1' => "出隊 | ", '2' => "社課 | ", '3' => "討論 | ", '4' => "山防 | "];
$category = ['0' => "出隊 | ", '1' => "溯溪 | ", '2' => "社課 | ", '3' => "討論 | ", '4' => "山防 | "];
foreach ($events as $event) {
$calendar_events[] = [
'id' => $event->id,
Expand All @@ -28,7 +27,7 @@ public function index()
'color' => $category_array[$event->category],
];
}

return $calendar_events;
}
/**
Expand Down
10 changes: 10 additions & 0 deletions app/Http/Controllers/JudgementController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,14 @@ public function rule()
return view('judgement.rule');
}

/**
* 顯示評分紀錄規則
*
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View
*/
public function pointRule()
{
return view('judgement.pointRule');
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AddCreateUserAndModifyUserToJudgementsTable extends Migration
public function up()
{
Schema::table('judgements', function (Blueprint $table) {
$table->unsignedBigInteger('create_user')->nullable()->after('created_at'); // 假設 'id' 是表中的第一個欄位
$table->unsignedBigInteger('create_user')->nullable()->after('created_at');
$table->unsignedBigInteger('modify_user')->nullable()->after('create_user');
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddCommentsToCourseRecordsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('course_records', function (Blueprint $table) {
$table->comment = '社課登記表,紀錄有誰報名過社課';
$table->unsignedBigInteger('user_id')->comment('使用者 ID')->change();
$table->unsignedBigInteger('course_id')->comment('社課 ID')->change();
$table->unsignedBigInteger('create_user')->after('updated_at')->nullable()->comment('建立者 ID');
$table->unsignedBigInteger('modify_user')->after('create_user')->nullable()->comment('更新者 ID');
});

}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('course_records', function (Blueprint $table) {
// Remove added columns
$table->dropColumn('create_user');
$table->dropColumn('modify_user');

// Remove comments
$table->unsignedBigInteger('user_id')->comment(null)->change();
$table->unsignedBigInteger('course_id')->comment(null)->change();
$table->timestamp('created_at')->nullable()->comment(null)->change();
$table->timestamp('updated_at')->nullable()->comment(null)->change();
$table->comment = null;
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddCommentsToCoursesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('courses', function (Blueprint $table) {
$table->unsignedBigInteger('create_user')->nullable()->comment('建立者 ID');
$table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID');

$table->comment = '社課資訊表,紀錄社課詳細資訊';
$table->string('title', 50)->comment('標題')->change();
$table->string('videoURL', 255)->nullable()->comment('影片 URL')->change();
$table->string('pptURL', 255)->nullable()->comment('PPT URL')->change();
$table->string('image', 255)->comment('圖片路徑')->change();
$table->date('date')->comment('社課日期')->change();
$table->string('speaker', 255)->comment('講者')->change();
$table->string('location', 255)->comment('地點')->change();
$table->text('description')->comment('社課簡介')->change();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('courses', function (Blueprint $table) {
$table->dropColumn('create_user');
$table->dropColumn('modify_user');
$table->string('title', 50)->comment(null)->change();
$table->string('videoURL', 255)->nullable()->comment(null)->change();
$table->string('pptURL', 255)->nullable()->comment(null)->change();
$table->string('image', 255)->comment(null)->change();
$table->date('date')->comment(null)->change();
$table->string('speaker', 255)->comment(null)->change();
$table->string('location', 255)->comment(null)->change();
$table->text('description')->comment(null)->change();
$table->comment = null;
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddCommentsToEquipmentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('equipments', function (Blueprint $table) {
$table->unsignedBigInteger('create_user')->nullable()->comment('建立者 ID');
$table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID');

$table->comment = '裝備資訊表';
$table->string('name', 255)->nullable()->comment('裝備種類:大背包、睡袋、睡墊 ...')->change();
$table->string('description', 255)->comment('裝備簡介')->change();
$table->string('image', 255)->nullable()->comment('圖片路徑')->change();
$table->date('bought_date')->nullable()->comment('購買日期')->change();
$table->smallInteger('status')->default(0)->comment('是否出租(0 = 未借出, 1 = 借出, 2 = 遺失)')->change();
$table->integer('size')->nullable()->comment('裝備尺寸')->change();
$table->integer('member_price')->comment('社員租借費用')->change();
$table->integer('normal_price')->comment('非社員租借非用')->change();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('equipments', function (Blueprint $table) {
$table->dropColumn('create_user');
$table->dropColumn('modify_user');
$table->comment = null;
$table->string('name', 255)->nullable()->comment(null)->change();
$table->string('description', 255)->comment(null)->change();
$table->string('image', 255)->nullable()->comment(null)->change();
$table->date('bought_date')->nullable()->comment(null)->change();
$table->smallInteger('status')->default(0)->comment(null)->change();
$table->integer('size')->nullable()->comment(null)->change();
$table->integer('member_price')->comment(null)->change();
$table->integer('normal_price')->comment(null)->change();
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddCommentsToEventsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('events', function (Blueprint $table) {
// Add comments to existing columns
$table->comment = '行事曆活動記錄表';
$table->string('title')->comment('活動名稱')->change();
$table->datetime('start')->comment('開始時間')->change();
$table->datetime('end')->comment('結束時間')->change();
$table->integer('category')->comment('活動種類(0 = 出隊, 1 = 溯溪, 2 = 社課, 3 = 討論, 4 = 山防')->change();
$table->unsignedBigInteger('create_user')->nullable()->comment('建立者 ID');
$table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('events', function (Blueprint $table) {
$table->dropColumn('create_user');
$table->dropColumn('modify_user');
$table->comment = null;
$table->string('title')->comment(null)->change();
$table->datetime('start')->comment(null)->change();
$table->datetime('end')->comment(null)->change();
$table->integer('category')->comment(null)->change();
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddCommentsToFaqsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('faqs', function (Blueprint $table) {
$table->comment = 'QA 紀錄表'; // Table comment
$table->string('question')->comment('問題')->change();
$table->longText('answer')->comment('答案')->change();
$table->unsignedBigInteger('create_user')->nullable()->comment('建立者 ID');
$table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('faqs', function (Blueprint $table) {
$table->dropColumn('create_user');
$table->dropColumn('modify_user');
$table->comment = null;
$table->string('question')->comment(null)->change();
$table->longText('answer')->comment(null)->change();
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddCommentsToJudgementsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('judgements', function (Blueprint $table) {
// Comments for the table
$table->comment = '隊伍難度評分表';
$table->string('name')->comment('隊伍名稱')->change();
$table->integer('normal_day')->comment('傳統路天數')->change();
$table->integer('abnormal_day')->comment('非傳統路天數')->change();
$table->integer('level')->comment('路況分級')->change();
$table->integer('road')->comment('路跡級別')->change();
$table->integer('terrain')->comment('地形級別')->change();
$table->integer('plant')->comment('植被級別')->change();
$table->integer('energy')->comment('體力級別')->change();
$table->integer('water')->comment('多背水天數')->change();
$table->string('result_level')->comment('難度等級')->change();
$table->integer('score')->comment('難度總分')->change();
$table->integer('trip_tag')->default(0)->comment('行程(0 = 一般行程, 1 = 壓縮行程, 2 = 寬鬆行程')->change();
$table->unsignedBigInteger('create_user')->nullable()->comment('建立者 ID')->change();
$table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID')->change();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('judgements', function (Blueprint $table) {
$table->comment = null;
$table->string('name')->comment(null)->change();
$table->integer('normal_day')->comment(null)->change();
$table->integer('abnormal_day')->comment(null)->change();
$table->integer('level')->comment(null)->change();
$table->integer('road')->comment(null)->change();
$table->integer('terrain')->comment(null)->change();
$table->integer('plant')->comment(null)->change();
$table->integer('energy')->comment(null)->change();
$table->integer('water')->comment(null)->change();
$table->string('result_level')->comment(null)->change();
$table->integer('score')->comment(null)->change();
$table->integer('trip_tag')->comment(null)->change();
$table->unsignedBigInteger('create_user')->comment(null)->change();
$table->unsignedBigInteger('modify_user')->comment(null)->change();
});
}
}
Loading