Commit 1e4d51e1 by fezrul

update requested

parent 8a56fae4
......@@ -128,7 +128,7 @@ class HomeController extends Controller
$uid = $user->id;
$events = MasterEvent::where('fk_user',$uid)->first();
$eventid = $events->id;
$list = DB::SELECT("SELECT a.*,b.time FROM event_participant a,event_attendance b WHERE b.`fk_event_participant` = a.`id` and a.fk_master_event = $eventid");
$list = DB::SELECT("SELECT a.*,b.time,(select name from users where id = $uid) as 'by' FROM event_participant a,event_attendance b WHERE b.`fk_event_participant` = a.`id` and a.fk_master_event = $eventid");
return view('admin.list', compact('events','list'));
......@@ -175,6 +175,60 @@ class HomeController extends Controller
}
public function registration($id,$eventid)
{
$info = EventParticipant::where('id', $id)->where('fk_master_event',$eventid)->first();
$info->registration_status = 1;
$info->save();
$event = MasterEvent::where('id', $eventid)->first();
$slug = $event->event_slug;
$message='Guest has successfully registered for the event ';
return view('admin.attendance.adminaction',compact('eventid','slug','info','message'));
}
public function eventattendance($id,$eventid)
{
$info = EventParticipant::where('id', $id)->where('fk_master_event',$eventid)->first();
$info->attendance_status = 1;
$info->save();
$event = MasterEvent::where('id', $eventid)->first();
$slug = $event->event_slug;
$message='Event attendance successfully saved';
return view('admin.attendance.adminaction',compact('eventid','slug','info','message'));
}
public function lunch($id,$eventid)
{
$info = EventParticipant::where('id', $id)->where('fk_master_event',$eventid)->first();
$info->lunch_status = 1;
$info->save();
$event = MasterEvent::where('id', $eventid)->first();
$slug = $event->event_slug;
$message='Guest has checked for lunch ';
return view('admin.attendance.adminaction',compact('eventid','slug','info','message'));
}
public function checkUser(Request $request) {
......
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class UpdateEventParticipantTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('event_participant', function (Blueprint $table) {
$table->unsignedInteger('registration_status');
$table->unsignedInteger('attendance_status');
$table->unsignedInteger('lunch_status');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
......@@ -119,9 +119,21 @@
<br><br>
</div>
<div id="form_register_btn" class="col-md-12">
<a href="/goodies/{{$info->id}}/{{$eventid}}" class="btn btn-medium btn-blue">Give goodies </a>
<a href="/goodies/{{$info->id}}/{{$eventid}}" class="btn btn-medium btn-blue">Goodies </a>
<br><br>
</div>
</div>
<div id="form_register_btn" class="col-md-12">
<a href="/registration/{{$info->id}}/{{$eventid}}" class="btn btn-medium btn-blue">Registration </a>
<br><br>
</div>
<div id="form_register_btn" class="col-md-12">
<a href="/eventattendance/{{$info->id}}/{{$eventid}}" class="btn btn-medium btn-green">Attendance Event </a>
<br><br>
</div>
<div id="form_register_btn" class="col-md-12">
<a href="/lunch/{{$info->id}}/{{$eventid}}" class="btn btn-medium btn-orange">Lunch Event </a>
<br><br>
</div>
</div>
......
......@@ -17,6 +17,10 @@
<th>{{ __("Email") }}</th>
<th>{{ __("Date and time") }}</th>
<th>{{ __("Goodies") }}</th>
<th>{{ __("Scan By") }}</th>
<th>{{ __("Registration") }}</th>
<th>{{ __("Attendance Event") }}</th>
<th>{{ __("Lunch Event") }}</th>
</tr>
......@@ -29,7 +33,12 @@
<td>{{ $list->fullname }}</td>
<td>{{ $list->email }}</td>
<td>{{ $list->time }}</td>
<td>@if($list->goodies_status == 1) Taken @else Not Yet @endif</td>
<td>@if($list->goodies_status == 1) Yes @else Not Yet @endif</td>
<td>{{ $list->by }}</td>
<td>@if($list->registration_status == 1) Yes @else Not Yet @endif</td>
<td>@if($list->attendance_status == 1) Yes @else Not Yet @endif</td>
<td>@if($list->lunch_status == 1) Yes @else Not Yet @endif</td>
</tr>
@endforeach
......
......@@ -86,7 +86,10 @@ Route::group(
Route::get('guest', 'HomeController@manageguest')->name('guest');
Route::get('attendancelist', 'HomeController@attendancelist')->name('guest');
Route::get('guest/save', 'HomeController@addguest')->name('guest');
Route::get('attendance/{id}/{eventid}', 'HomeController@attendance')->name('scan');
Route::get('goodies/{id}/{eventid}', 'HomeController@goodies')->name('scan');
Route::get('attendance/{id}/{eventid}', 'HomeController@attendance')->name('scanattendance');
Route::get('goodies/{id}/{eventid}', 'HomeController@goodies')->name('scangoodies');
Route::get('registration/{id}/{eventid}', 'HomeController@registration')->name('scanregistration');
Route::get('eventattendance/{id}/{eventid}', 'HomeController@eventattendance')->name('scaneventattendance');
Route::get('lunch/{id}/{eventid}', 'HomeController@lunch')->name('scanlunch');
});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment