Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
namespace App\Http\Controllers; use App\Models\RubricGrades; use App\Models\PartGrades; u..
Decoded Output download
<? namespace App\Http\Controllers; use App\Models\RubricGrades; use App\Models\PartGrades; use App\Models\CriteriaGrades; use App\Models\Classes; use App\Models\ClassesAsign; use App\Models\classEx; use App\Models\ExperimentGrades; use App\Models\ExperimentReport; use App\Models\HomePage; use App\Models\Notifications; use App\Models\ScheduleAuth; use App\Models\SmartlabApps; use App\Models\UpdatesTable; use App\Models\Users; use App\Models\weekDays; use App\Models\rubrics; use App\Models\rubric_parts; use App\Models\rubric_criterias; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Validator; use Yajra\DataTables\DataTables; use Illuminate\Support\Str; use PhpParser\Node\Expr\FuncCall; use Image; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Hash; use function PHPUnit\Framework\isEmpty; use Illuminate\Validation\Rule; use League\Csv\Reader; use League\Csv\Statement; use Carbon\Carbon; use PDF; use Illuminate\Support\Facades\Response; class AdminController extends Controller { public function downloadPDF(Request $request) { $content = $request->input("content"); $styles = $request->input("styles"); $pdfContent = $styles . $content; $pdf = PDF::loadHTML($pdfContent); return $pdf->download("downloaded.pdf"); } public function downloadCsv() { $filePath = public_path("csv/bulk-register-format.csv"); if (file_exists($filePath)) { return Response::download($filePath, "bulk-register-format.csv", array("Content-Type" => "text/csv")); } else { return redirect()->back()->withErrors(array("csv_file" => "File not Found")); } } public function getDashboard() { if (Session::get("admin") == "admin" || Session::get("admin") == "low_admin") { return view("systempages.devices"); } else { $currentDay = strtolower(Carbon::now("Asia/Manila")->format("l")); $dayMapping = array("monday" => "M", "tuesday" => "T", "wednesday" => "W", "thursday" => "Th", "friday" => "F", "saturday" => "Sat", "sunday" => "S"); $shortDay = $dayMapping[$currentDay]; $currentHour = Carbon::now("Asia/Manila")->format("H:i:s"); $ongoingData = DB::table("classes_asigns")->select("classes_asigns.*", "classes.*")->join("classes", "classes_asigns.class_id", "=", "classes.id")->where("classes_asigns.user_id", Session::get("username"))->where("classes." . $shortDay, "true")->where("classes.start", "<=", $currentHour)->where("classes.end", ">=", $currentHour)->get(); $ClassesData = DB::table("classes_asigns")->select("classes_asigns.*", "classes.*")->join("classes", "classes_asigns.class_id", "=", "classes.id")->where("classes_asigns.user_id", Session::get("username"))->get(); $studentRowCount = array(); foreach ($ClassesData as $rowData) { $studentCount = ClassesAsign::join("users", "users.id", "=", "classes_asigns.user_id")->where("classes_asigns.class_id", $rowData->class_id)->where("users.role", "student")->groupBy("classes_asigns.class_id")->select("classes_asigns.class_id", DB::raw("COUNT(*) AS row_count"))->first(); if ($studentCount) { $studentRowCount[] = $studentCount->row_count; } else { $studentRowCount[] = 0; } } return view("systempages.dashboard", array("ClassesData" => $ClassesData, "ongoingData" => $ongoingData, "studentCount" => $studentRowCount)); } } public function studentList($class_id) { $className = Classes::find($class_id)->classname; $classData = ClassesAsign::join("users", "users.id", "=", "classes_asigns.user_id")->where("classes_asigns.class_id", $class_id)->where("users.role", "=", "student")->select("classes_asigns.*", "users.*", "classes_asigns.created_by as enrolled_by", "classes_asigns.updated_at as date")->get(); $experimentData = classEx::where("class_id", $class_id)->whereNull("status")->get(); return view("systempages.student-list", array("data" => $classData, "class_name" => $className, "exData" => $experimentData)); } public function activityList($class_id) { $className = DB::table("classes")->where("id", $class_id)->first(); $hasRubric = DB::table("classes")->select("rubric_assigned")->where("id", $class_id)->whereNotNull("rubric_assigned")->first(); if ($hasRubric) { $classData = ClassEx::join("classes", "classes.id", "=", "class_exes.class_id")->join("rubric_grades", "class_exes.id", "=", "rubric_grades.act_id")->where("class_exes.class_id", $class_id)->where("rubric_grades.u_id", Session::get("username"))->select("class_exes.*", "classes.*", "rubric_grades.*", "rubric_grades.updated_at as date_graded")->get(); return view("systempages.activity-list", array("data" => $classData, "className" => $className)); } else { $standardGrade = DB::table("class_exes")->join("experiment_reports", "class_exes.id", "=", "experiment_reports.Experiment_id")->where("class_exes.class_id", $class_id)->where("experiment_reports.user_id", Session::get("username"))->where("experiment_reports.total_score", "<>", "N/A")->select("class_exes.*", "experiment_reports.*")->get(); return view("systempages.activity-list", array("standardData" => $standardGrade, "className" => $className)); } } public function enrolledList($class_id) { $classData = DB::table("classes_asigns")->join("users", "classes_asigns.user_id", "=", "users.id")->where("classes_asigns.class_id", $class_id)->select("users.name", "users.role", "users.username", "classes_asigns.*")->get(); return view("systempages.enrolled-list", array("classData" => $classData)); } public function insertnewUser(Request $request) { $validated = Validator::make($request->all(), array("name" => "required", "role" => "required", "email" => array("required", "email", Rule::unique("users", "user_email"))), array("name.required" => "The Name field is required", "role.required" => "The Role field is required", "email.required" => "The Email field is required")); if ($validated->fails()) { return response()->json(array("errors" => $validated->errors()->first())); } else { $NewUser = new Users(); $NewUser->username = $request->email; $NewUser->name = $request->name; $NewUser->role = $request->role; $NewUser->user_email = $request->email; $NewUser->password = bcrypt("Smartlab2023!"); $NewUser->pass_string = "Smartlab2023!"; $NewUser->created_by = Session::get("name"); if (Session::get("admin") == "admin") { $NewUser->status = ''; } else { $NewUser->status = "pending"; } $NewUser->save(); return response()->json(array("inserted" => "New User Account has been created.")); } } public function updateRubric(Request $request) { $id = $request->input("id"); $part = $request->input("part"); $rName = $request->input("rubric_name"); $weight = $request->input("weight"); $rubric = rubrics::find($id); $rubricPart = rubric_parts::where("rubric_id", $id)->get(); if ($rubric) { $rubric->rubric_name = $rName; $rubric->save(); } if ($rubricPart) { foreach ($rubricPart as $index => $rp) { $rp->part_no = $part[$index]; $rp->weight = $weight[$index]; $rp->save(); } } return response()->json(array("updated" => "Rubric has been updated successfully.")); } public function assignRubric(Request $request) { $data = $request->input("classes"); $rubricID = $request->input("rubric_id"); $rubric = rubrics::find($rubricID); if ($rubric) { $rubricName = $rubric->rubric_name; } else { $rubricName = "Rubric not found"; } $validated = Validator::make($request->all(), array("classes" => "required|array|min:1"), array("classes.required" => "Select at least one class.")); if ($validated->fails()) { return response()->json(array("error" => $validated->errors()->first())); } else { foreach ($data as $class_id) { $updateClass = Classes::find($class_id); if ($updateClass) { $updateClass->rubric_assigned = $rubricID; $updateClass->save(); } $checkRubricGrade = RubricGrades::where("class_id", $class_id)->get(); foreach ($checkRubricGrade as $class_data) { $class_data->id_rubric = $rubricID; $class_data->save(); } } return response()->json(array("assigned" => "Rubric '{$rubricName}' successfully assigned to selected classes.")); } } public function previewRubric(Request $request) { $data = $request->input("parts"); $rName = $request->input("rubric_name"); $validated = Validator::make($request->all(), array("rubric_name" => array("required", "string", "max:255", Rule::unique("rubrics", "rubric_name")), "parts.*.part_no" => "required|string|max:255", "parts.*.weight" => "required|numeric|min:1|max:100", "parts.*.criteria.*" => "required|string"), array("rubric_name.required" => "The Rubric Name field is required.", "rubric_name.string" => "The Rubric Name must be a string.", "rubric_name.max" => "The Rubric Name may not be greater than :max characters.", "parts.*.part_no.required" => "The Part No. field is required.", "parts.*.part_no.string" => "The Part No. must be a string.", "parts.*.part_no.max" => "The Part No. may not be greater than :max characters.", "parts.*.weight.required" => "The Weight field is required.", "parts.*.weight.numeric" => "The Weight must be a number.", "parts.*.weight.min" => "The Weight must be at least :min.", "parts.*.weight.max" => "The Weight may not be greater than :max.", "parts.*.criteria.*.required" => "The Criteria field is required.", "parts.*.criteria.*.string" => "The Criteria must be a string.")); if ($validated->fails()) { return response()->json(array("errors" => $validated->errors()->first())); } else { $totalWeight = 0; foreach ($data as $part) { $totalWeight += $part["weight"]; } if ($totalWeight > 100) { return response()->json(array("errors" => "Total weight of parts must not exceed 100.")); } return response()->json(array("success" => true, "data" => $data, "rName" => $rName)); } } public function publishRubric(Request $request) { $data = $request->input("parts"); $rName = $request->input("rubric_name"); $validated = Validator::make($request->all(), array("rubric_name" => array("required", "string", "max:255", Rule::unique("rubrics", "rubric_name")), "parts.*.part_no" => "required|string|max:255", "parts.*.weight" => "required|numeric|min:1|max:100"), array("rubric_name.required" => "The Rubric Name field is required.", "rubric_name.string" => "The Rubric Name must be a string.", "rubric_name.max" => "The Rubric Name may not be greater than :max characters.", "parts.*.part_no.required" => "The Part No. field is required.", "parts.*.part_no.string" => "The Part No. must be a string.", "parts.*.part_no.max" => "The Part No. may not be greater than :max characters.", "parts.*.weight.required" => "The Weight field is required.", "parts.*.weight.numeric" => "The Weight must be a number.", "parts.*.weight.min" => "The Weight must be at least :min.", "parts.*.weight.max" => "The Weight may not be greater than :max.")); if ($validated->fails()) { return response()->json(array("errors" => $validated->errors()->first())); } else { $totalWeight = 0; foreach ($data as $part) { $totalWeight += $part["weight"]; } if ($totalWeight > 100) { return response()->json(array("errors" => "Total weight of parts must not exceed 100.")); } $rubric = new rubrics(); $rubric->rubric_name = $rName; $rubric->created_by = Session::get("name"); $rubric->save(); foreach ($data as $partIndex => $part) { if (isset($part["part_no"])) { $rubricPart = new rubric_parts(); $rubricPart->rubric_id = $rubric->id; $rubricPart->part_no = $part["part_no"]; $rubricPart->weight = $part["weight"]; $rubricPart->save(); } } return response()->json(array("published" => "Rubric paublished successfully.")); } } public function previewUsers(Request $request) { $request->validate(array("csv_file" => "required|mimes:csv,txt")); $csv_file = $request->file("csv_file"); $csv = Reader::createFromPath($csv_file->getPathname()); $header = $csv->fetchOne(0); $requiredColumns = array("name", "email", "role"); if ($header !== $requiredColumns) { return redirect()->back()->withErrors(array("csv_file" => "Invalid CSV format detected. The header row should be: " . implode(", ", $requiredColumns))); } $csv->setHeaderOffset(0); $data = Statement::create()->process($csv); return view("systempages.preview", array("data" => $data)); } public function uploadUsers(Request $request) { $fnames = $request->input("fname"); $femails = $request->input("femail"); $froles = $request->input("frole"); $count = count($fnames); for ($i = 0; $i < $count; $i++) { $existingUser = DB::table("users")->where("user_email", $femails[$i])->first(); if (!$existingUser) { $user = new Users(); $user->name = $fnames[$i]; $user->username = $femails[$i]; $user->user_email = $femails[$i]; $user->role = $froles[$i]; $user->password = Hash::make("Smartlab2023!"); $user->status = ''; $user->pass_string = "Smartlab2023!"; $user->created_by = Session::get("name"); $user->save(); } } return response()->json(array("registered" => "Users registered successfully")); } public function insertnewClass(Request $request) { $validated = Validator::make($request->all(), array("classname" => "required", "classinfo" => "required", "start" => "required", "end" => "required", "m" => "required_without_all:t,w,th,f,sat,s", "t" => "required_without_all:m,w,th,f,sat,s", "w" => "required_without_all:m,t,th,f,sat,s", "th" => "required_without_all:m,t,w,f,sat,s", "f" => "required_without_all:m,t,w,th,sat,s", "sat" => "required_without_all:m,t,w,th,f,s", "s" => "required_without_all:m,t,w,th,f,sat"), array("classname.required" => "The Class Name field is required", "classinfo.required" => "The Class Info field is required", "start.required" => "The From field is required", "end.required" => "The To field is required", "required_without_all" => "At least one of the days (m, t, w, th, f, sat, s) must have a value.")); if ($validated->fails()) { return response()->json(array("errors" => $validated->errors()->first())); } else { if ($request->m == '') { $m = "false"; } else { $m = $request->m; } if ($request->t == '') { $t = "false"; } else { $t = $request->t; } if ($request->w == '') { $w = "false"; } else { $w = $request->w; } if ($request->th == '') { $th = "false"; } else { $th = $request->th; } if ($request->f == '') { $f = "false"; } else { $f = $request->f; } if ($request->sat == '') { $sat = "false"; } else { $sat = $request->sat; } if ($request->s == '') { $s = "false"; } else { $s = $request->s; } $ref_id = str::random(40); $NewClass = new Classes(); $NewClass->classname = $request->classname; $NewClass->classinfo = $request->classinfo; $NewClass->m = $m; $NewClass->t = $t; $NewClass->w = $w; $NewClass->th = $th; $NewClass->f = $f; $NewClass->sat = $sat; $NewClass->s = $s; $NewClass->schedule_id = $ref_id; $NewClass->owner_id = Session::get("username"); $NewClass->created_by = Session::get("name"); $NewClass->start = $request->start; $NewClass->end = $request->end; $NewClass->status = ''; $NewClass->save(); if ($request->m != '') { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "Monday"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } if ($request->t != '') { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "Tuesday"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } if ($request->w != '') { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "Wednesday"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } if ($request->th != '') { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "Thursday"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } if ($request->f != '') { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "Friday"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } if ($request->sat != '') { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "Saturday"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } if ($request->s != '') { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "Sunday"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } return response()->json(array("inserted" => "New Class has been created.")); } } public function assignStudent(Request $request) { $data = $request->input("mergedCheckboxes"); $responses = array(); $validated = Validator::make($request->all(), array("Classname" => "required", "mergedCheckboxes" => "required|array|min:1"), array("Classname.required" => "The Class Name field is required", "mergedCheckboxes.required" => "At least one checkbox must be checked.")); if ($validated->fails()) { return response()->json(array("errors" => $validated->errors()->first())); } else { foreach ($data as $account_id) { $check_assigness = DB::table("classes_asigns")->where("class_id", $request->Classname)->where("user_id", $account_id)->first(); if ($check_assigness) { $responses[] = array("found" => "Account already enrolled."); } else { $assign = new ClassesAsign(); $assign->user_id = $account_id; $assign->class_id = $request->Classname; $assign->created_by = Session::get("name"); $assign->save(); $notify = new Notifications(); $check_class = DB::table("classes")->where("id", $request->Classname)->first(); $notify->notification_text = "You have been Enrolled to {$check_class->classname}"; $notify->user_id_notify = $account_id; $notify->status = "unread"; $notify->save(); $responses[] = array("success" => "Enrolled successfully."); } } } return response()->json($responses); } public function newapp(Request $request) { $validated = Validator::make($request->all(), array("ExperimentID" => "required", "appname" => "required", "access_link" => "required", "appaccess" => "required"), array("appname.required" => "The App Name field is required", "appaccess.required" => "The App Access field is required", "access_link.required" => "The Access Link field is required", "ExperimentID.required" => "The Experiment Name field is required")); if ($validated->fails()) { return response()->json(array("errors" => $validated->errors()->first())); } else { $newapp = new SmartlabApps(); $newapp->app_name = $request->appname; $newapp->app_access = $request->appaccess; $newapp->classEx_id = $request->ExperimentID; $newapp->access_link = $request->access_link; $newapp->save(); return response()->json(array("inserted" => "App has been submitted successfully.")); } } public function SchedulesRequestedGet() { $ScheduleData = DB::table("schedule_auths")->select("users.*", "schedule_auths.*")->join("users", "schedule_auths.userID", "=", "users.id")->where("schedule_auths.status", "approval")->get(); return DataTables::of($ScheduleData)->addIndexColumn()->addColumn("action", function ($row) { $btn = "<div class="btn-group dropleft">\xa <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\xa Settings\xa </button>\xa <div class="dropdown-menu dropleft">\xa <a class="dropdown-item approve" href="#" data-id="" . $row->id . "">Approve Schedule</a>\xa <a class="dropdown-item deleteASBtn" href="#" data-id="" . $row->id . "">Disapprove Schedule</a>
</div>\xa </div>"; return $btn; })->rawColumns(array("action"))->make(true); } public function ArticleGet(Request $request) { $ArticleData = DB::table("updates_tables")->get(); return DataTables::of($ArticleData)->addIndexColumn()->addColumn("action", function ($row) { $btn = "<button class="btn btn-sm deleteBtn approve" style="background-color: gold; color: white;" data-id="" . $row->id . "">Edit</button>"; $btn .= " <button class="btn btn-primary btn-sm deleteASBtn" data-id="" . $row->id . "">Delete</button>"; return $btn; })->rawColumns(array("action"))->make(true); } public function ScheduleAproveAction(Request $request) { $id = $request->approve; $Approveupdate = ScheduleAuth::find($id); $Approveupdate->status = "valid"; $Approveupdate->save(); $check_class = DB::table("schedule_auths")->where("id", $id)->first(); $notify = new Notifications(); $notify->notification_text = "Your requested schedule for {$check_class->labname} has been approved"; $notify->user_id_notify = $check_class->userID; $notify->status = "unread"; $notify->save(); return response()->json(array("approved" => "Schedule has been approved successfully.")); } public function DisScheduleAproveAction(Request $request) { $id = $request->disapproveID; $check_class = DB::table("schedule_auths")->where("id", $id)->first(); ScheduleAuth::where("id", $id)->delete(); $notify = new Notifications(); $notify->notification_text = "Your requested schedule for {$check_class->labname} has been Disapproved"; $notify->user_id_notify = $check_class->userID; $notify->status = "unread"; $notify->save(); return response()->json(array("approved" => "Schedule has been disapproved successfully.")); } public function insertnewUpdate(Request $request) { $validated = Validator::make($request->all(), array("updatetitle" => "required", "body" => "required", "postdes" => "required", "updatepic" => "required"), array("updatetitle.required" => "The Title field is required", "body.required" => "The Body field is required", "updatepic.required" => "The Picture field is required", "postdes.required" => "The Description field is required")); if ($validated->fails()) { return response()->json(array("errors" => $validated->errors()->first())); } else { if ($pic = $request->file("updatepic")) { $filename = $pic->getClientOriginalName(); if ($pic->move("update/updatePics", $filename)) { $NewUpdate = new UpdatesTable(); $NewUpdate->title = $request->updatetitle; $NewUpdate->body = $request->body; $NewUpdate->updatepic = $filename; $NewUpdate->description = $request->postdes; $NewUpdate->save(); return response()->json(array("inserted" => "New Update Post has been created.")); } } } } public function insertnewClassEx(Request $request) { $validated = Validator::make($request->all(), array("exName" => "required", "exid" => "required", "exfile" => "required|mimes:pdf"), array("exName.required" => "The Experiment Name field is required", "exid.required" => "Error Reload the page", "exfile.required" => "The Experiment file field is required", "exfile.mimes" => "The Experiment file must be a PDF file")); if ($validated->fails()) { return response()->json(array("errors" => $validated->errors()->first())); } else { if ($pdf = $request->file("exfile")) { $filename = $pdf->getClientOriginalName(); if ($pdf->move("ClassEx", $filename)) { $newEx = new classEx(); $newEx->class_id = $request->exid; $newEx->ex_name = $request->exName; $newEx->ex_file = $filename; $newEx->created_by = Session::get("name"); if (Session::get("admin") == "prof") { $newEx->status = "pending"; } $newEx->save(); return response()->json(array("inserted" => "New Experiment has been submitted.")); } } } } public function UserEdit() { $UsersData = DB::table("users")->where("status", '')->get(); return DataTables::of($UsersData)->addIndexColumn()->addColumn("action", function ($row) { $btn = "<div class="btn-group dropleft">\xa <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\xa Settings\xa </button>\xa <div class="dropdown-menu dropleft">
<a class="dropdown-item resetPwBtn" href="#" data-id="" . $row->id . "">Reset Password</a>\xa <a class="dropdown-item usereditbtn" href="#" data-id="" . $row->id . "">Edit User Account</a>
<a class="dropdown-item archiveBtn" href="#" data-id="" . $row->id . "">Archive User Account</a>\xa </div>
</div>"; return $btn; })->rawColumns(array("action"))->make(true); } public function ProfFetch() { $UsersData = DB::table("users")->where("status", '')->where("role", "prof")->get(); return DataTables::of($UsersData)->addIndexColumn()->addColumn("select", function ($row) { $btn = "<input type = "checkbox" data-id = "" . $row->id . "" class = "checkbox" name="accountEnroll[]" value = "" . $row->id . "">"; return $btn; })->rawColumns(array("select"))->make(true); } public function StudentFetch() { $UsersData = DB::table("users")->where("status", '')->where("role", "student")->get(); return DataTables::of($UsersData)->addIndexColumn()->addColumn("select", function ($row) { $btn = "<input type = "checkbox" data-id = "" . $row->id . "" class = "checkbox" name="accountEnroll[]" value = "" . $row->id . "">"; return $btn; })->rawColumns(array("select"))->make(true); } public function ExperimentPending() { $ExperimentData = DB::table("class_exes")->join("classes", "class_exes.class_id", "=", "classes.id")->whereNotNull("class_exes.status")->select("classes.classname", "class_exes.*")->get(); return DataTables::of($ExperimentData)->addIndexColumn()->addColumn("file", function ($row) { $file = "<a href="/ExperimentReport/" . $row->ex_file . "">" . $row->ex_file . "</a>"; return $file; })->addColumn("action", function ($row) { $btn = "<div class="btn-group dropleft">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Settings
</button>
<div class="dropdown-menu dropleft">\xa <a class="dropdown-item activateBtn" href="#" data-id="" . $row->id . "">Activate Experiment</a>\xa <a class="dropdown-item deleteBtn" href="#" data-id="" . $row->id . "">Dismiss Experiment</a>
</div>\xa </div>"; return $btn; })->rawColumns(array("file", "action"))->make(true); } public function UserPending() { $UsersData = DB::table("users")->where("status", "pending")->get(); return DataTables::of($UsersData)->addIndexColumn()->addColumn("action", function ($row) { $btn = "<div class="btn-group dropleft">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Settings\xa </button>
<div class="dropdown-menu dropleft">
<a class="dropdown-item activateBtn" href="#" data-id="" . $row->id . "">Activate Account</a>\xa <a class="dropdown-item deleteBtn" href="#" data-id="" . $row->id . "">Dismiss Account</a>
</div>\xa </div>"; return $btn; })->rawColumns(array("action"))->make(true); } public function RubricArchiveList() { $archiveData = DB::table("rubrics")->where("status", "archive")->get(); return DataTables::of($archiveData)->addIndexColumn()->addColumn("action", function ($row) { $btn = "<div class="btn-group dropleft">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\xa Settings\xa </button>\xa <div class="dropdown-menu dropleft">
<a class="dropdown-item restoreBtn" href="#" data-id="" . $row->id . "">Restore Rubric</a>\xa </div>
</div>"; return $btn; })->rawColumns(array("action"))->make(true); } public function UserArchive() { $UsersData = DB::table("users")->where("status", "archive")->get(); return DataTables::of($UsersData)->addIndexColumn()->addColumn("action", function ($row) { $btn = "<div class="btn-group dropleft">\xa <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\xa Settings\xa </button>
<div class="dropdown-menu dropleft">
<a class="dropdown-item restoreBtn" href="#" data-id="" . $row->id . "">Restore Account</a>\xa <a class="dropdown-item deleteBtn" href="#" data-id="" . $row->id . "">Delete Account</a>
</div>\xa </div>"; return $btn; })->rawColumns(array("action"))->make(true); } public function ClassArchiveList() { $ClassesData = DB::table("classes")->where("status", "archive")->get(); return DataTables::of($ClassesData)->addIndexColumn()->addColumn("action", function ($row) { $btn = "<div class="btn-group dropleft">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\xa Settings\xa </button>\xa <div class="dropdown-menu dropleft">\xa <a class="dropdown-item restoreBtn" href="#" data-id="" . $row->id . "">Restore Class</a>\xa <a class="dropdown-item deleteBtn" href="#" data-id="" . $row->id . "">Delete Class</a>\xa </div>\xa </div>"; return $btn; })->addColumn("schedule", function ($row) { $d1 = $row->m === "true"; $d2 = $row->t === "true"; $d3 = $row->w === "true"; $d4 = $row->th === "true"; $d5 = $row->f === "true"; $d6 = $row->sat === "true"; $d7 = $row->s === "true"; $start = date("h:iA", strtotime($row->start)); $end = date("h:iA", strtotime($row->end)); $schedule = ''; if ($d1) { $schedule .= "M "; } if ($d2) { $schedule .= "T "; } if ($d3) { $schedule .= "W "; } if ($d4) { $schedule .= "TH "; } if ($d5) { $schedule .= "F "; } if ($d6) { $schedule .= "Sat "; } if ($d7) { $schedule .= "S "; } return $schedule . $start . " - " . $end; })->rawColumns(array("action"))->make(true); } public function UserAccountDeleteAction(Request $request) { $id = $request->UserID; Users::where("id", $id)->delete(); return response()->json(array("approved" => "Account has been deleted successfully.")); } public function RubricArchive(Request $request) { try { $id = $request->UserID; $user = rubrics::findOrFail($id); $user->status = "archive"; $user->updated_by = Session::get("name"); $user->save(); return response()->json(array("archived" => "Rubric has been archived successfully.")); } catch (ModelNotFoundException $exception) { return response()->json(array("error" => "Rubric not found.")); } } public function UserAccountArchive(Request $request) { try { $id = $request->UserID; $user = Users::findOrFail($id); $user->status = "archive"; $user->updated_by = Session::get("name"); $user->save(); return response()->json(array("archived" => "Account has been archived successfully.")); } catch (ModelNotFoundException $exception) { return response()->json(array("error" => "User not found.")); } } public function ClassArchive(Request $request) { try { $id = $request->UserID; $user = Classes::findOrFail($id); $user->status = "archive"; $user->updated_by = Session::get("name"); $user->save(); return response()->json(array("archived" => "Class has been archived successfully.")); } catch (ModelNotFoundException $exception) { return response()->json(array("error" => "Class not found.")); } } public function UnenrollAccount(Request $request) { try { $id = $request->UserID; $data = DB::table("classes_asigns")->select("class_id", "user_id")->where("id", $id)->first(); $class_id = $data->class_id; $user_id = $data->user_id; $experiment = ExperimentReport::where("user_id", $user_id)->where("class_id", $class_id)->delete(); $user = ClassesAsign::where("id", $id)->delete(); return response()->json(array("unenrolled" => "Account has been unenrolled successfully.")); } catch (ModelNotFoundException $exception) { return response()->json(array("error" => "Class not found.")); } } public function UnenrollClass(Request $request) { try { $id = $request->classID; $class = ClassesAsign::where("class_id", $id)->delete(); $experiment = ExperimentReport::where("class_id", $id)->delete(); return response()->json(array("unenrolled" => "All Accounts Successfully Unenrolled.")); } catch (ModelNotFoundException $exception) { return response()->json(array("error" => "Class not found.")); } } public function ExperimentActivation(Request $request) { try { $id = $request->UserID; $user = classEx::findOrFail($id); $user->status = null; $user->updated_by = Session::get("name"); $user->save(); return response()->json(array("restored" => "Experiment has been activated successfully.")); } catch (ModelNotFoundException $exception) { return response()->json(array("error" => "Experiment not found.")); } } public function AccountActivation(Request $request) { try { $id = $request->UserID; $user = Users::findOrFail($id); $user->status = ''; $user->updated_by = Session::get("name"); $user->save(); return response()->json(array("restored" => "Account has been activated successfully.")); } catch (ModelNotFoundException $exception) { return response()->json(array("error" => "User not found.")); } } public function RubricRestoration(Request $request) { try { $id = $request->UserID; $user = rubrics::findOrFail($id); $user->status = null; $user->updated_by = Session::get("name"); $user->save(); return response()->json(array("restored" => "Rubric has been restored successfully.")); } catch (ModelNotFoundException $exception) { return response()->json(array("error" => "User not found.")); } } public function AccountRestoration(Request $request) { try { $id = $request->UserID; $user = Users::findOrFail($id); $user->status = ''; $user->updated_by = Session::get("name"); $user->save(); return response()->json(array("restored" => "Account has been restored successfully.")); } catch (ModelNotFoundException $exception) { return response()->json(array("error" => "User not found.")); } } public function ClassRestoration(Request $request) { try { $id = $request->UserID; $user = Classes::findOrFail($id); $user->status = ''; $user->updated_by = Session::get("name"); $user->save(); return response()->json(array("restored" => "Account has been restored successfully.")); } catch (ModelNotFoundException $exception) { return response()->json(array("error" => "User not found.")); } } public function UserPasswordReset(Request $request) { try { $id = $request->UserID; $user = Users::findOrFail($id); $user->password = Hash::make("Smartlab2023!"); $user->pass_string = "Smartlab2023!"; $user->save(); return response()->json(array("resetted" => "Password reset successfully!")); } catch (ModelNotFoundException $exception) { return response()->json(array("error" => "User not found.")); } } public function UserEditbtnFetch(Request $request) { $data = Users::find($request->Uupdatebutton); return response()->json(array("UserData" => $data)); } public function EditUserAccount(Request $request) { $validated = Validator::make($request->all(), array("username" => "required", "name" => "required", "role" => "required", "userID" => "required", "email" => "required"), array("username.required" => "The Username field is required", "name.required" => "The Name field is required", "role.required" => "The Role field is required", "email.required" => "The Email field is required", "userID.required" => "There was no account highlighted, Please reclick the Edit button")); if ($validated->fails()) { return response()->json(array("errors" => $validated->errors()->first())); } else { $editUser = Users::find($request->userID); $editUser->username = $request->username; $editUser->name = $request->name; $editUser->role = $request->role; $editUser->user_email = $request->email; $editUser->save(); return response()->json(array("UserEdited" => "User Account has been updated.")); } } public function getClass() { $data = DB::table("classes")->whereNull("rubric_assigned")->get(); return view("systempages.rubric-book", array("classData" => $data)); } public function displayRubric($rubric_id, $class_id, $act_id, $user_id) { $checkIfGrade = DB::table("rubric_grades")->where("id_rubric", $rubric_id)->where("u_id", $user_id)->where("class_id", $class_id)->where("act_id", $act_id)->where("total_score", "!=", "N/A")->first(); $activityData = DB::table("class_exes")->where("class_id", $class_id)->where("id", $act_id)->first(); $rubricData = DB::table("rubrics")->where("id", $rubric_id)->get(); $partData = DB::table("rubric_parts")->where("rubric_id", $rubric_id)->get(); $criteriaData = DB::table("rubric_criterias")->where("rubric_id", $rubric_id)->get(); $classData = Classes::find($class_id); $userData = Users::find($user_id); $checkUserIDClass = ClassesAsign::where("class_id", $class_id)->where("user_id", $user_id)->first(); if ($checkIfGrade) { return redirect("/preview-grade/" . $rubric_id . "/" . $class_id . "/" . $act_id . "/" . $user_id); } else { if (!$classData) { return redirect("/dashboard"); } else { if (!$checkUserIDClass) { return redirect("/dashboard"); } else { if (!$rubricData->isEmpty()) { return view("systempages.rubric-grade", array("data" => $rubricData, "rubric_id" => $rubric_id, "partData" => $partData, "criteriaData" => $criteriaData, "fullname" => $userData->name, "studentID" => $userData->id, "classname" => $classData->classname, "activityName" => $activityData->ex_name)); } else { return redirect("/dashboard"); } } } } } public function displayRubricDB($id) { $rubricData = DB::table("rubrics")->where("id", $id)->get(); $partData = DB::table("rubric_parts")->where("rubric_id", $id)->get(); $criteriaData = DB::table("rubric_criterias")->where("rubric_id", $id)->get(); if (!$rubricData->isEmpty()) { return view("systempages.rubric-preview", array("data" => $rubricData, "partData" => $partData, "criteriaData" => $criteriaData)); } else { return redirect("/dashboard"); } } public function editRubricDB($id) { $rubricData = DB::table("rubrics")->where("id", $id)->get(); $partData = DB::table("rubric_parts")->where("rubric_id", $id)->get(); $criteriaData = DB::table("rubric_criterias")->where("rubric_id", $id)->get(); if (!$rubricData->isEmpty()) { return view("systempages.edit-rubric", array("data" => $rubricData, "partData" => $partData, "criteriaData" => $criteriaData, "id" => $id)); } else { return redirect("/dashboard"); } } public function publishGrade(Request $request) { $totalPart = $request->input("pttotal"); $score = $request->input("final_score"); $feedback = $request->input("feedback_"); $u_id = $request->input("student_id"); $r_id = $request->input("rubric_id"); $class_id = $request->input("class_id"); $act_id = $request->input("act_id"); $act_name = $request->input("activity_name"); $check_weight = $request->input("weightCheck"); $validated = Validator::make($request->all(), array("pttotal.*" => "required"), array("pttotal.*.required" => "The Criteria field is required.")); $checkIfGrade = DB::table("rubric_grades")->where("id_rubric", $r_id)->where("u_id", $u_id)->where("class_id", $class_id)->where("act_id", $act_id)->where("total_score", "!=", "N/A")->first(); if ($validated->fails()) { return response()->json(array("errors" => $validated->errors()->first())); } else { if ($checkIfGrade) { return redirect("/preview-grade/" . $r_id . "/" . $class_id . "/" . $act_id . "/" . $u_id); } else { $conditions = array("u_id" => $u_id, "id_rubric" => $r_id, "class_id" => $class_id, "act_id" => $act_id); RubricGrades::where($conditions)->update(array("total_score" => $score, "rank" => '', "feedback" => $feedback, "act_name" => $act_name, "created_by" => Session::get("name"))); foreach ($totalPart as $tpindex => $tp) { $savePart = new PartGrades(); $savePart->u_id = $u_id; $savePart->id_rubric = $r_id; $savePart->id_part = $tpindex; $savePart->act_id = $act_id; $savePart->total_pts = $tp; $savePart->avg_pts = null; $savePart->weighted_avg = null; $savePart->save(); } return response()->json(array("success" => "Grade of Student published successfully.")); } } } public function gradePreview($rubric_id, $class_id, $act_id, $user_id) { $rubricData = RubricGrades::join("rubrics", "rubric_grades.id_rubric", "=", "rubrics.id")->where("rubrics.id", $rubric_id)->where("rubric_grades.u_id", $user_id)->where("act_id", $act_id)->get(); $partData = PartGrades::join("rubric_parts", function ($join) { $join->on("part_grades.id_rubric", "=", "rubric_parts.rubric_id")->on("part_grades.id_part", "=", "rubric_parts.id"); })->where("rubric_parts.rubric_id", $rubric_id)->where("part_grades.u_id", $user_id)->where("act_id", $act_id)->get(); $criteriaData = DB::table("rubric_criterias")->where("rubric_id", $rubric_id)->get(); $scoreData = DB::table("criteria_grades")->where("id_rubric", $rubric_id)->where("u_id", $user_id)->where("act_id", $act_id)->get(); $classData = Classes::find($class_id); $userData = Users::find($user_id); $checkUserIDClass = ClassesAsign::where("class_id", $class_id)->where("user_id", $user_id)->first(); if (!$classData) { return redirect("/dashboard"); } else { if (!$checkUserIDClass) { return redirect("/dashboard"); } else { if (!$rubricData->isEmpty()) { return view("systempages.grade-preview", array("data" => $rubricData, "rubric_id" => $rubric_id, "partData" => $partData, "criteriaData" => $criteriaData, "scoreData" => $scoreData, "fullname" => $userData->name, "studentID" => $userData->id, "classname" => $classData->classname)); } else { return redirect("/dashboard"); } } } } public function ClassEditFetch() { if (Session::get("admin") == "admin" || Session::get("admin") == "low_admin") { $ClassData = DB::table("classes")->where("status", '')->get(); } elseif (Session::get("admin") == "prof") { $ClassData = DB::table("classes")->where("owner_id", Session::get("username"))->where("status", '')->get(); } return DataTables::of($ClassData)->addIndexColumn()->addColumn("Schedule", function ($row) { $class_time = DB::table("week_days")->where("class_id", $row->schedule_id)->get(); $dataPassed = array(); $currentS = ''; $currentE = ''; foreach ($class_time as $timeData) { $timeS = date("h:iA", strtotime($timeData->start)); $timeE = date("h:iA", strtotime($timeData->end)); $currentS = $timeS; $currentE = $timeE; $day = $timeData->day; switch ($day) { case "Monday": $dayString = "M"; break; case "Tuesday": $dayString = "T"; break; case "Wednesday": $dayString = "W"; break; case "Thursday": $dayString = "TH"; break; case "Friday": $dayString = "F"; break; case "Saturday": $dayString = "Sat"; break; case "Sunday": $dayString = "S"; break; } $dataPassed[] = '' . $dayString; } $dataPassed[] = " " . $currentS . " - " . $currentE . " "; if ($dataPassed) { return $dataPassed; } })->addColumn("rubric", function ($row) { $rubricName = DB::table("rubrics")->where("id", $row->rubric_assigned)->value("rubric_name"); return "<td> {$rubricName} </td>"; })->addColumn("action", function ($row) { if (Session::get("admin") == "admin" || Session::get("admin") == "low_admin") { $btn = "<div class="btn-group dropleft">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\xa Settings\xa </button>\xa <div class="dropdown-menu dropleft">\xa <a class="dropdown-item ClassEditBtn" data-id="" . $row->id . "" href="#">Edit Class Schedule</a>
<a class="dropdown-item AddNewExperiment" href="#" data-id="" . $row->id . "">Upload New Experiment</a>\xa <a class="dropdown-item" href="/enrolled-list/" . $row->id . "" data-id="" . $row->id . "" target = "_blank" >View Accounts Enrolled</a>
<a class="dropdown-item viewExperiments" href="#" data-id="" . $row->id . "">View Class Experiments</a>
<a class="dropdown-item removeRubric" href="#" data-id="" . $row->id . "">Remove Rubric</a>
<a class="dropdown-item archiveBtn" href="#" data-id="" . $row->id . "">Archive Class</a>
<a class="dropdown-item massUnenrollBtn" href="#" data-id="" . $row->id . "">Mass Unenrollment</a>
</div>
</div>"; } else { $btn = "<div class="btn-group dropleft">\xa <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Settings
</button>
<div class="dropdown-menu dropleft">\xa <a class="dropdown-item ClassEditBtn" data-id="" . $row->id . "" href="#">Edit Class Schedule</a>
<a class="dropdown-item AddNewExperiment" href="#" data-id="" . $row->id . "">Upload New Module</a>
<a class="dropdown-item createNewExperiment" href="#" data-id="" . $row->id . "">Create New Module</a>
<a class="dropdown-item viewExperiments" href="#" data-id="" . $row->id . "">View Class Experiments</a>
</div>
</div>"; } return $btn; })->rawColumns(array("action", "rubric", "Schedule"))->make(true); } public function RubricBookFetch() { $RubricBook = DB::table("rubrics")->whereNull("status")->get(); return DataTables::of($RubricBook)->addIndexColumn()->addColumn("action", function ($row) { $btn = "<div class="btn-group dropleft">\xa \x9 \x9\x9<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
\x9\x9 \x9 \x9Settings\xa \x9 \x9\x9</button>
\x9\x9\x9<div class="dropdown-menu dropleft">\xa \x9 \x9 <a class="dropdown-item rubricAssignClick" data-id="" . $row->id . "" href="#" data-toggle="modal" data-target="#assignRubricModal">Assign Rubric to Class</a>
\x9 <a class="dropdown-item" href="/rubric-preview/" . $row->id . "" target="_blank">Preview Rubric</a>
\x9 \x9\x9 <a class="dropdown-item" href="/edit-rubric/" . $row->id . "" target="_blank">Edit Rubric</a>\xa\x9\x9\x9\x9 \x9<a class="dropdown-item rubricArchive" data-id="" . $row->id . "" href="#">Archive Rubric</a>\xa \x9 \x9 </div>\xa \x9\x9</div>"; return $btn; })->rawColumns(array("action"))->make(true); } public function ClassAccountDeleteAction(Request $request) { $id = $request->UserID; Classes::where("id", $id)->delete(); return response()->json(array("approved" => "Class has been deleted successfully.")); } public function UnassignRubric(Request $request) { $id = $request->UserID; $result = Classes::where("id", $id)->update(array("rubric_assigned" => null)); if ($result) { return response()->json(array("unassigned" => "Rubric has been removed successfully.")); } } public function ClassEditbtnFetch(Request $request) { $data = Classes::find($request->Cupdatebutton); $week_days = DB::table("week_days")->where("class_id", $data->schedule_id)->get(); return response()->json(array("ClassData" => $data, "WeekDays_data" => $week_days)); } public function fetchClass() { $data = DB::table("classes")->get(); return response()->json(array("classData" => $data)); } public function EditClassData(Request $request) { $validated = Validator::make($request->all(), array("classname" => "required", "classinfo" => "required", "classID" => "required"), array("classname.required" => "The Class Name field is required", "classinfo.required" => "The Class Info field is required", "pic.required" => "The Picture field is required", "pic.mimes" => "The Class Picture must be a file of type: jpeg, gif, png, JPEG, GIF, PNG.")); if ($validated->fails()) { return response()->json(array("errors" => $validated->errors()->first())); } else { if ($request->m == '') { $day_check = DB::table("week_days")->where("class_id", $request->classID)->where("day", "Monday")->first(); if ($day_check) { DB::table("week_days")->where("class_id", $request->classID)->where("day", "Monday")->delete(); } $m = "false"; } else { $m = $request->m; } if ($request->t == '') { $day_check = DB::table("week_days")->where("class_id", $request->classID)->where("day", "Tuesday")->first(); if ($day_check) { DB::table("week_days")->where("class_id", $request->classID)->where("day", "Tuesday")->delete(); } $t = "false"; } else { $t = $request->t; } if ($request->w == '') { $day_check = DB::table("week_days")->where("class_id", $request->classID)->where("day", "Wednesday")->first(); if ($day_check) { DB::table("week_days")->where("class_id", $request->classID)->where("day", "Wednesday")->delete(); } $w = "false"; } else { $w = $request->w; } if ($request->th == '') { $day_check = DB::table("week_days")->where("class_id", $request->classID)->where("day", "Thursday")->first(); if ($day_check) { DB::table("week_days")->where("class_id", $request->classID)->where("day", "Thursday")->delete(); } $th = "false"; } else { $th = $request->th; } if ($request->f == '') { $day_check = DB::table("week_days")->where("class_id", $request->classID)->where("day", "Friday")->first(); if ($day_check) { DB::table("week_days")->where("class_id", $request->classID)->where("day", "Friday")->delete(); } $f = "false"; } else { $f = $request->f; } if ($request->sat == '') { $day_check = DB::table("week_days")->where("class_id", $request->classID)->where("day", "Saturday")->first(); if ($day_check) { DB::table("week_days")->where("class_id", $request->classID)->where("day", "Saturday")->delete(); } $sat = "false"; } else { $sat = $request->sat; } if ($request->s == '') { $day_check = DB::table("week_days")->where("class_id", $request->classID)->where("day", "Sunday")->first(); if ($day_check) { DB::table("week_days")->where("class_id", $request->classID)->where("day", "Sunday")->delete(); } $s = "false"; } else { $s = $request->s; } $ref_id = $request->classID; $class_id_fetch = DB::table("classes")->where("schedule_id", $request->classID)->first(); $editClass = Classes::find($class_id_fetch->id); $editClass->classname = $request->classname; $editClass->classinfo = $request->classinfo; $editClass->updated_by = Session::get("name"); $editClass->m = $m; $editClass->t = $t; $editClass->w = $w; $editClass->th = $th; $editClass->f = $f; $editClass->sat = $sat; $editClass->s = $s; $editClass->start = $request->start; $editClass->end = $request->end; $editClass->save(); if ($request->m != '') { $day_check = DB::table("week_days")->where("class_id", $request->classID)->where("day", "Monday")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "Monday"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } if ($request->t != '') { $day_check = DB::table("week_days")->where("class_id", $request->classID)->where("day", "Tuesday")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "Tuesday"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } if ($request->w != '') { $day_check = DB::table("week_days")->where("class_id", $request->classID)->where("day", "Wednesday")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "Wednesday"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } if ($request->th != '') { $day_check = DB::table("week_days")->where("class_id", $request->classID)->where("day", "Thursday")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "Thursday"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } if ($request->f != '') { $day_check = DB::table("week_days")->where("class_id", $request->classID)->where("day", "Friday")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "Friday"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } if ($request->sat != '') { $day_check = DB::table("week_days")->where("class_id", $request->classID)->where("day", "Saturday")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "Saturday"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } if ($request->s != '') { $day_check = DB::table("week_days")->where("class_id", $request->classID)->where("day", "Sunday")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "Sunday"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } $all_day_check = DB::table("week_days")->where("class_id", $request->classID)->get(); foreach ($all_day_check as $data) { $updateTime = weekDays::find($data->id); $updateTime->start = $request->start; $updateTime->end = $request->end; $updateTime->save(); } return response()->json(array("inserted" => "Class Data has been updated.")); } } public function store(Request $request) { $file = $request->upload; $fileName = $file->getClientOriginalName(); $New_name = time() . $fileName; $dir = "storage/HomePagePictures/"; $file->move($dir, $New_name); $url = asset("storage/HomePagePictures/" . $New_name); $CkeditorFuncNum = $request->input("CKEditorFuncNum"); $status = "<script>window.parent.CKEDITOR.tools.callFunction('{$CkeditorFuncNum}', '{$url}', 'File has been uploaded.')</script>"; echo $status; } public function HomePageUpdate(Request $request) { $validated = Validator::make($request->all(), array("HomeEditor" => "required"), array("HomeEditor.required" => "The Editor field is required")); if ($validated->fails()) { return redirect()->back()->withErrors(array("empty_error" => $validated->errors()->first())); } else { $HomeEdit = HomePage::find("1"); $HomeEdit->HomeContent = $request->HomeEditor; $HomeEdit->save(); return redirect()->back()->with(array("success" => "The Home Page has been updated.")); } } public function insertnewClassExWithEditor(Request $request) { $validated = Validator::make($request->all(), array("exNameEditor" => "required", "exidEditor" => "required", "ExEditor" => "required"), array("exNameEditor.required" => "The Experiment Name field is required", "exidEditor.required" => "Error Reload the page", "ExEditor.required" => "The Experiment`s Editor field is required")); if ($validated->fails()) { return response()->json(array("errors" => $validated->errors()->first())); } else { $newEx = new classEx(); $newEx->class_id = $request->exidEditor; $newEx->ex_name = $request->exNameEditor; $newEx->ExCreated = $request->ExEditor; $newEx->save(); return response()->json(array("inserted" => "New Experiment has been submitted.")); } } public function ViewExperiment(Request $request) { $apps_check = DB::table("smartlab_apps")->where("classEx_id", $request->ID)->get(); if ($apps_check->isNotEmpty()) { $data = DB::table("class_exes")->select("class_exes.*", "smartlab_apps.*", "class_exes.id as linkName")->join("smartlab_apps", "class_exes.id", "=", "smartlab_apps.classEx_id")->where("class_exes.class_id", $request->ID)->get(); $data_score = DB::table("experiment_reports")->where("Experiment_id", $request->ID)->where("user_id", Session::get("username"))->first(); return response()->json(array("DataEX" => $data, "Data_score" => $data_score)); } else { $data = DB::table("class_exes")->select("class_exes.*", "smartlab_apps.*", "class_exes.id as linkName")->join("smartlab_apps", "class_exes.id", "=", "smartlab_apps.classEx_id")->where("class_exes.class_id", $request->ID)->get(); $data_score = DB::table("experiment_reports")->where("Experiment_id", $request->ID)->where("user_id", Session::get("username"))->first(); return response()->json(array("DataEX" => $data, "Data_score" => $data_score)); } } public function AppsFetch(Request $request) { $data = DB::table("class_exes")->select("class_exes.*", "smartlab_apps.*", "class_exes.id as linkName")->leftJoin("smartlab_apps", "class_exes.id", "=", "smartlab_apps.classEx_id")->where("class_exes.id", $request->ID)->get(); return DataTables::of($data)->addIndexColumn()->addColumn("ExperimentName", function ($row) { if (!empty($row->ex_file)) { $btn = "<a target="_blank" href="ClassEx/" . $row->ex_file . "">" . $row->ex_name . "</a>"; return $btn; } else { if (!empty($row->ExCreated)) { $btn = "<a target="_blank" href="experiment/" . $row->linkName . "">" . $row->ex_name . "</a>"; return $btn; } } })->addColumn("App", function ($row) { if ($row->app_name == "Digital Circuit") { $btn = "<a target="_blank" href="/simulator?app=DC" class="btn btn-danger">" . $row->app_name . "</a>"; return $btn; } if ($row->app_name == "Digital Arduino") { $btn = "<a target="_blank" href="/simulator?app=DA" class="btn btn-danger">" . $row->app_name . "</a>"; return $btn; } })->rawColumns(array("App", "ExperimentName"))->make(true); } public function insertnewExperimentReport(Request $request) { $classID = $request->class_id; $validated = Validator::make($request->all(), array("ExperimentID" => "required", "ReportFile" => "required", "ReportFile" => "required|mimes:pdf"), array("ExperimentID.required" => "The Experiment Name field is required", "exid.required" => "Error Reload the page", "ReportFile.required" => "The Experiment Report file field is required", "ReportFile.mimes" => "The Experiment Report file must be a PDF file")); if ($validated->fails()) { return response()->json(array("errors" => $validated->errors()->first())); } else { $check_if_labReport_submitted = DB::table("experiment_reports")->where("Experiment_id", $request->ExperimentID)->where("user_id", Session::get("username"))->first(); if ($check_if_labReport_submitted) { if ($pdf = $request->file("ReportFile")) { $filename = $pdf->getClientOriginalName(); if ($pdf->move("ExperimentReport", $filename)) { DB::table("experiment_reports")->where("Experiment_id", $request->ExperimentID)->where("user_id", Session::get("username"))->update(array("Report_file" => $filename)); return response()->json(array("inserted" => "Lab Report has been updated.")); } } } else { if ($pdf = $request->file("ReportFile")) { $filename = $pdf->getClientOriginalName(); if ($pdf->move("ExperimentReport", $filename)) { $check = DB::table("classes")->select("rubric_assigned")->where("id", $classID)->get(); $newEx = new ExperimentReport(); $newEx->Experiment_id = $request->ExperimentID; $newEx->Report_file = $filename; $newEx->user_id = Session::get("username"); $newEx->class_id = $classID; $newEx->save(); $act_name = DB::table("class_exes")->select("ex_name")->where("id", $request->ExperimentID)->get(); $saveGrade = new RubricGrades(); $saveGrade->u_id = Session::get("username"); $saveGrade->total_score = "N/A"; $saveGrade->rank = "N/A"; $saveGrade->id_rubric = $check[0]->rubric_assigned; $saveGrade->feedback = "N/A"; $saveGrade->class_id = $classID; $saveGrade->act_id = $request->ExperimentID; $saveGrade->act_name = $act_name[0]->ex_name; $saveGrade->report_file = $filename; $saveGrade->created_by = "N/A"; $saveGrade->save(); return response()->json(array("inserted" => "New Lab Report has been submitted.")); } } } } } public function ReportsSubmitted(Request $request) { $classID = Classes::find(classEx::find($request->ID)->class_id)->id; $check = DB::table("classes")->select("rubric_assigned")->where("id", $classID)->get(); $hasRubric = DB::table("classes")->select("rubric_assigned")->where("id", $classID)->whereNotNull("rubric_assigned")->first(); if ($hasRubric) { $data = DB::table("users")->select("users.*", "rubric_grades.*", "users.id as UserID")->join("rubric_grades", "users.id", "=", "rubric_grades.u_id")->where("rubric_grades.act_id", $request->ID)->get(); return DataTables::of($data)->addIndexColumn()->addColumn("action", function ($row) { $rubricID = Classes::find(classEx::find($row->act_id)->class_id)->rubric_assigned; $classID1 = Classes::find(classEx::find($row->act_id)->class_id)->id; $userID = $row->u_id; $btn = "<a href = "/rubric-grade/" . $rubricID . "/" . $classID1 . "/" . $row->act_id . "/" . $userID . "" target = "_blank" class="btn btn-sm" style="background-color: gold; color: white;">Rubric Grade</a>"; return $btn; })->addColumn("FileSubmitted", function ($row) { $btn = "<a target="_blank" href="ExperimentReport/" . $row->report_file . "">View LAB Report</a>"; return $btn; })->rawColumns(array("action", "FileSubmitted"))->make(true); } else { $data = DB::table("users")->select("users.*", "experiment_reports.*", "experiment_reports.Experiment_id as ExperimentID", "users.id as UserID", "experiment_reports.id as Experiment_ID")->join("experiment_reports", "users.id", "=", "experiment_reports.user_id")->where("experiment_reports.Experiment_id", $request->ID)->get(); return DataTables::of($data)->addIndexColumn()->addColumn("action", function ($row) { $btn = "<button class="btn btn-sm AddGradeBtn" style="background-color: gold; color: white; " data-id="" . $row->Experiment_ID . "">Grade</button>"; return $btn; })->addColumn("FileSubmitted", function ($row) { $btn = "<a target="_blank" href="ExperimentReport/" . $row->Report_file . "">View LAB Report</a>"; return $btn; })->rawColumns(array("action", "FileSubmitted"))->make(true); } } public function aDDnewGradeToExperiment(Request $request) { $Experiment_Data = DB::table("experiment_reports")->where("id", $request->ID)->first(); return response()->json(array("Experiment_ID_Fetched" => $Experiment_Data)); } public function NewGrade(Request $request) { $validated = Validator::make($request->all(), array("Experiment_id_data" => "required", "user_id_grade" => "required", "grade" => "required"), array("username.required" => "The Grade Scoure field is required", "Experiment_id_data.required" => "System Error. Please reload the page or conntact system administrator.", "user_id_grade.required" => "System Error. Please reload the page or conntact system administrator.")); if ($validated->fails()) { return response()->json(array("errors" => $validated->errors()->first())); } else { $check_grade = DB::table("experiment_reports")->where("id", $request->Experiment_id_o)->first(); if ($request->grade_feedback == '') { if ($check_grade->feedback == "N/A") { $New_grade = ExperimentReport::find($request->Experiment_id_o); $New_grade->total_score = $request->grade; $New_grade->feedback = "N/A"; $New_grade->save(); $check_report = DB::table("experiment_reports")->where("id", $request->Experiment_id_o)->first(); $check_experiment = DB::table("class_exes")->where("id", $check_report->Experiment_id)->first(); $notify = new Notifications(); $notify->notification_text = "Your Grade of {$check_experiment->ex_name} has been updated. "; $notify->user_id_notify = $check_report->user_id; $notify->status = "unread"; $notify->save(); return response()->json(array("inserted" => "Grade score has been updated.")); } else { $New_grade = ExperimentReport::find($request->Experiment_id_o); $New_grade->total_score = $request->grade; $New_grade->save(); $check_report = DB::table("experiment_reports")->where("id", $request->Experiment_id_o)->first(); $check_experiment = DB::table("class_exes")->where("id", $check_report->Experiment_id)->first(); $notify = new Notifications(); $notify->notification_text = "Your Grade of {$check_experiment->ex_name} has been updated. "; $notify->user_id_notify = $check_report->user_id; $notify->status = "unread"; $notify->save(); return response()->json(array("inserted" => "Grade score has been updated.")); } } else { $New_grade = ExperimentReport::find($request->Experiment_id_o); $New_grade->total_score = $request->grade; $New_grade->feedback = $request->grade_feedback; $New_grade->save(); $check_report = DB::table("experiment_reports")->where("id", $request->Experiment_id_o)->first(); $check_experiment = DB::table("class_exes")->where("id", $check_report->Experiment_id)->first(); $notify = new Notifications(); $notify->notification_text = "Your Grade of {$check_experiment->ex_name} has been updated. "; $notify->user_id_notify = $check_report->user_id; $notify->status = "unread"; $notify->save(); return response()->json(array("inserted" => "Grade score and Feedback have been updated.")); } } } public function ExperimentsViewDetails(Request $request) { $class_Experiments_view = DB::table("class_exes")->where("class_id", $request->classID); return DataTables::of($class_Experiments_view)->addIndexColumn()->addColumn("Action", function ($row) { $btn = "<div class="btn-group dropleft">\xa <button type="button" class="btn btn-dark dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Settings\xa </button>
<div class="dropdown-menu dropleft">\xa <a class="dropdown-item AddExperimentAppBtn" href="#" data-id="" . $row->id . "">Add New App</a>
<a class="dropdown-item ExperimentViewAppBtn" data-id="" . $row->id . "" href="#">View Experiment Apps</a>\xa <a class="dropdown-item ViewExperimentSubmissionsBtn" data-id="" . $row->id . "" href="#">View Submissions</a>\xa <a class="dropdown-item deleteExperimentBtn" href="#" data-id="" . $row->id . "">Delete Experiment</a>
</div>
</div>"; return $btn; })->addColumn("ExperimentName", function ($row) { if ($row->ex_file > '') { $btn = "<a target="_blank" href="ClassEx/" . $row->ex_file . "">" . $row->ex_name . "</a>"; return $btn; } else { if ($row->ExCreated > '') { $btn = "<a target="_blank" href="experiment/" . $row->id . "">" . $row->ex_name . "</a>"; return $btn; } } })->rawColumns(array("ExperimentName", "Action"))->make(true); } public function ExperimentDeleted(Request $request) { $id = $request->ExperimentID; $deletedRows = classEx::where("id", $id)->delete(); if ($deletedRows > 0) { return response()->json(array("approved" => "Experiment has been deleted successfully.")); } else { return response()->json(array("approved" => "Experiment with ID {$id} not found."), 404); } } public function ExperimentsAppsViewDetails(Request $request) { $class_Experiments_app_view = DB::table("smartlab_apps")->where("classEx_id", $request->experimentID); return DataTables::of($class_Experiments_app_view)->addIndexColumn()->addColumn("Action", function ($row) { $btn = "<div class="btn-group dropleft">
<button type="button" class="btn btn-dark dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\xa Settings
</button>\xa <div class="dropdown-menu dropleft">
<a class="dropdown-item deleteExperimentAppBtn" href="#" data-id="" . $row->id . "">Delete App</a>\xa </div>\xa </div>"; return $btn; })->rawColumns(array("Action"))->make(true); } public function ExperimentAPPDeleted(Request $request) { $id = $request->ExperimentAPPID; SmartlabApps::where("id", $id)->delete(); return response()->json(array("approved" => "Application has been deleted successfully.")); } public function ExperimentIDfetch(Request $request) { $dataexperiment = DB::table("class_exes")->where("id", $request->ExperimentIDFetched)->first(); return response()->json(array("dataexperiment" => $dataexperiment)); } public function usercontrolPC(Request $request) { $datausers = DB::table("users")->where("id", $request->userID)->first(); return response()->json(array("datausers" => $datausers)); } public function AssignControlPC(Request $request) { $assignPC = Users::find($request->userIDPCAssign); $assignPC->control_PC = $request->control_PC; $assignPC->save(); return response()->json(array("updated" => "Control PC has been assigned successfully.")); } public function searchlab(Request $request) { $input = $request->labname; $ClassData = Classes::where("classname", "LIKE", "%{$input}%")->get(); return DataTables::of($ClassData)->addIndexColumn()->addColumn("Schedule", function ($row) { $class_time = DB::table("week_days")->where("class_id", $row->schedule_id)->get(); foreach ($class_time as $timeData) { $dataPassed[] = '' . $timeData->day . " " . $timeData->start . " - " . $timeData->end . " "; } if ($dataPassed) { return $dataPassed; } })->rawColumns(array("Schedule"))->make(true); } public function updateProfile(Request $request, $id) { $user = Users::findOrFail($id); if (!empty($request->input("password"))) { $user->password = Hash::make($request->input("password")); $user->pass_string = $request->input("password"); } $user->save(); return response()->json(array("profileUpdated" => "Account has been updated successfully!")); } } ?>
Did this file decode correctly?
Original Code
namespace App\Http\Controllers; use App\Models\RubricGrades; use App\Models\PartGrades; use App\Models\CriteriaGrades; use App\Models\Classes; use App\Models\ClassesAsign; use App\Models\classEx; use App\Models\ExperimentGrades; use App\Models\ExperimentReport; use App\Models\HomePage; use App\Models\Notifications; use App\Models\ScheduleAuth; use App\Models\SmartlabApps; use App\Models\UpdatesTable; use App\Models\Users; use App\Models\weekDays; use App\Models\rubrics; use App\Models\rubric_parts; use App\Models\rubric_criterias; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Validator; use Yajra\DataTables\DataTables; use Illuminate\Support\Str; use PhpParser\Node\Expr\FuncCall; use Image; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Hash; use function PHPUnit\Framework\isEmpty; use Illuminate\Validation\Rule; use League\Csv\Reader; use League\Csv\Statement; use Carbon\Carbon; use PDF; use Illuminate\Support\Facades\Response; class AdminController extends Controller { public function downloadPDF(Request $request) { $content = $request->input("\x63\157\x6e\164\x65\x6e\x74"); $styles = $request->input("\163\164\x79\x6c\145\x73"); $pdfContent = $styles . $content; $pdf = PDF::loadHTML($pdfContent); return $pdf->download("\144\157\167\156\154\157\141\144\145\144\56\x70\x64\146"); } public function downloadCsv() { $filePath = public_path("\143\163\166\57\x62\x75\154\x6b\x2d\x72\145\x67\x69\x73\x74\x65\162\x2d\146\157\162\x6d\x61\164\x2e\143\x73\x76"); if (file_exists($filePath)) { return Response::download($filePath, "\x62\x75\154\x6b\55\x72\x65\x67\151\163\x74\x65\x72\x2d\x66\x6f\x72\155\x61\164\x2e\143\163\x76", array("\103\x6f\x6e\x74\x65\x6e\x74\x2d\124\x79\x70\145" => "\164\x65\x78\164\x2f\x63\163\166")); } else { return redirect()->back()->withErrors(array("\x63\x73\166\x5f\x66\x69\154\145" => "\106\151\154\x65\40\x6e\157\164\x20\106\x6f\x75\x6e\144")); } } public function getDashboard() { if (Session::get("\x61\144\x6d\151\x6e") == "\x61\x64\155\151\x6e" || Session::get("\x61\x64\x6d\x69\x6e") == "\x6c\x6f\167\x5f\x61\144\155\151\156") { return view("\163\171\163\164\x65\155\x70\141\147\x65\x73\x2e\144\x65\x76\x69\x63\x65\163"); } else { $currentDay = strtolower(Carbon::now("\x41\163\151\x61\57\115\x61\x6e\151\154\141")->format("\x6c")); $dayMapping = array("\x6d\x6f\156\x64\141\x79" => "\115", "\164\165\x65\163\144\141\x79" => "\x54", "\x77\x65\x64\156\x65\163\144\x61\x79" => "\127", "\x74\150\165\162\x73\x64\141\171" => "\x54\150", "\x66\x72\151\144\141\171" => "\106", "\x73\141\164\x75\x72\144\141\x79" => "\x53\x61\x74", "\163\165\156\144\141\x79" => "\123"); $shortDay = $dayMapping[$currentDay]; $currentHour = Carbon::now("\101\x73\x69\x61\x2f\115\141\156\151\154\x61")->format("\110\x3a\151\72\163"); $ongoingData = DB::table("\143\x6c\141\x73\x73\145\163\x5f\x61\x73\151\147\x6e\163")->select("\x63\x6c\x61\163\x73\x65\x73\x5f\x61\x73\x69\147\156\x73\56\x2a", "\143\154\x61\x73\163\x65\163\x2e\52")->join("\x63\154\x61\163\x73\145\x73", "\143\154\141\x73\163\x65\x73\137\141\163\151\147\x6e\x73\56\143\154\x61\163\x73\x5f\x69\144", "\x3d", "\x63\x6c\141\163\163\x65\x73\56\151\x64")->where("\143\x6c\141\163\163\x65\x73\137\141\x73\151\147\x6e\163\x2e\x75\163\x65\x72\137\x69\144", Session::get("\165\163\145\x72\156\x61\x6d\145"))->where("\143\154\x61\x73\x73\145\163\x2e" . $shortDay, "\x74\x72\x75\x65")->where("\143\x6c\x61\163\x73\145\163\56\163\x74\141\x72\164", "\x3c\75", $currentHour)->where("\x63\154\141\163\163\x65\x73\56\145\x6e\x64", "\76\x3d", $currentHour)->get(); $ClassesData = DB::table("\143\x6c\141\x73\163\145\x73\137\x61\x73\151\147\x6e\163")->select("\x63\154\x61\x73\163\145\x73\137\x61\x73\151\x67\156\163\x2e\x2a", "\143\154\141\163\x73\x65\163\56\x2a")->join("\143\154\141\163\x73\145\163", "\143\154\x61\x73\x73\x65\163\x5f\x61\163\151\147\x6e\163\x2e\143\154\141\x73\x73\137\151\144", "\x3d", "\143\x6c\141\163\x73\x65\163\56\151\144")->where("\x63\x6c\x61\163\163\145\163\x5f\x61\x73\151\147\x6e\163\x2e\165\x73\145\x72\x5f\x69\x64", Session::get("\165\163\145\x72\156\141\155\145"))->get(); $studentRowCount = array(); foreach ($ClassesData as $rowData) { $studentCount = ClassesAsign::join("\x75\163\145\162\163", "\x75\163\145\x72\x73\x2e\151\144", "\75", "\143\154\x61\x73\163\x65\x73\x5f\141\x73\x69\147\x6e\x73\x2e\165\163\145\x72\x5f\151\144")->where("\143\x6c\x61\163\x73\x65\x73\137\141\163\151\147\x6e\163\56\143\154\141\163\163\137\151\x64", $rowData->class_id)->where("\x75\x73\x65\162\163\x2e\162\x6f\x6c\x65", "\x73\164\x75\144\x65\156\164")->groupBy("\x63\x6c\x61\x73\x73\x65\x73\x5f\141\x73\x69\x67\x6e\163\56\x63\x6c\141\163\163\x5f\x69\144")->select("\143\x6c\141\x73\163\145\x73\137\141\x73\x69\x67\x6e\163\56\143\x6c\141\163\163\137\151\144", DB::raw("\103\x4f\x55\116\124\50\x2a\51\40\x41\x53\x20\x72\x6f\167\137\143\x6f\x75\156\164"))->first(); if ($studentCount) { $studentRowCount[] = $studentCount->row_count; } else { $studentRowCount[] = 0; } } return view("\x73\171\163\x74\x65\155\160\141\147\x65\163\56\x64\x61\x73\x68\142\x6f\x61\162\144", array("\103\x6c\x61\x73\x73\145\x73\104\x61\x74\141" => $ClassesData, "\x6f\x6e\147\x6f\151\x6e\x67\104\141\x74\141" => $ongoingData, "\163\164\165\144\145\156\x74\103\157\165\x6e\x74" => $studentRowCount)); } } public function studentList($class_id) { $className = Classes::find($class_id)->classname; $classData = ClassesAsign::join("\x75\163\x65\162\163", "\x75\163\x65\162\x73\x2e\x69\144", "\75", "\x63\154\x61\163\x73\145\x73\137\x61\x73\x69\147\156\163\x2e\165\163\x65\x72\x5f\x69\x64")->where("\143\154\x61\x73\163\145\163\x5f\141\163\151\147\x6e\x73\56\x63\154\x61\x73\163\137\x69\x64", $class_id)->where("\165\x73\145\162\163\56\162\x6f\154\x65", "\75", "\163\164\x75\x64\x65\156\x74")->select("\x63\154\x61\163\163\x65\x73\x5f\x61\163\151\147\156\x73\x2e\52", "\x75\x73\145\162\x73\56\x2a", "\x63\154\x61\x73\x73\x65\x73\137\141\x73\x69\x67\x6e\163\x2e\x63\162\x65\141\x74\x65\144\x5f\x62\x79\40\x61\163\40\145\x6e\x72\x6f\x6c\x6c\145\144\137\142\171", "\143\x6c\x61\163\x73\145\x73\x5f\x61\x73\x69\x67\156\163\x2e\x75\160\x64\x61\x74\x65\x64\x5f\141\x74\x20\141\x73\40\x64\x61\x74\145")->get(); $experimentData = classEx::where("\143\x6c\x61\x73\163\137\x69\144", $class_id)->whereNull("\163\164\141\164\165\163")->get(); return view("\163\171\x73\164\x65\155\x70\x61\147\x65\163\x2e\163\164\165\144\x65\156\x74\x2d\154\x69\163\164", array("\x64\141\164\x61" => $classData, "\x63\154\141\163\163\x5f\x6e\x61\x6d\x65" => $className, "\145\x78\x44\141\x74\141" => $experimentData)); } public function activityList($class_id) { $className = DB::table("\143\154\x61\x73\163\x65\163")->where("\151\144", $class_id)->first(); $hasRubric = DB::table("\x63\x6c\141\x73\163\x65\x73")->select("\x72\x75\142\162\151\x63\x5f\x61\x73\163\x69\x67\156\145\x64")->where("\151\x64", $class_id)->whereNotNull("\x72\x75\142\162\x69\143\137\141\163\x73\151\x67\x6e\x65\x64")->first(); if ($hasRubric) { $classData = ClassEx::join("\x63\x6c\x61\x73\x73\x65\x73", "\x63\x6c\x61\x73\x73\145\163\56\151\144", "\75", "\x63\154\141\163\x73\x5f\145\170\x65\x73\56\143\154\x61\163\x73\137\151\144")->join("\x72\x75\x62\162\151\143\137\147\x72\x61\x64\145\163", "\x63\x6c\141\163\x73\x5f\x65\x78\145\163\56\151\x64", "\x3d", "\x72\x75\142\x72\151\x63\137\x67\162\141\x64\x65\x73\56\141\143\x74\x5f\151\x64")->where("\x63\x6c\141\x73\163\137\145\170\145\163\x2e\x63\154\x61\163\163\137\x69\144", $class_id)->where("\x72\x75\x62\x72\151\143\137\x67\x72\141\x64\x65\x73\x2e\165\137\x69\144", Session::get("\x75\163\x65\162\x6e\141\x6d\x65"))->select("\143\x6c\x61\163\163\137\x65\x78\x65\163\x2e\x2a", "\x63\154\141\x73\163\x65\163\x2e\x2a", "\x72\165\142\162\x69\x63\x5f\x67\162\x61\144\145\163\56\x2a", "\x72\x75\142\162\x69\143\x5f\147\x72\x61\x64\x65\x73\56\165\160\x64\x61\164\x65\x64\x5f\x61\x74\40\141\x73\40\x64\x61\x74\x65\x5f\x67\x72\141\144\x65\x64")->get(); return view("\163\x79\163\x74\x65\x6d\160\141\x67\145\x73\x2e\x61\x63\164\151\x76\x69\x74\x79\x2d\154\x69\163\x74", array("\x64\x61\164\x61" => $classData, "\143\x6c\x61\163\163\116\141\x6d\145" => $className)); } else { $standardGrade = DB::table("\143\x6c\141\163\x73\137\x65\x78\x65\x73")->join("\x65\170\x70\x65\162\x69\x6d\x65\x6e\x74\x5f\x72\145\x70\157\x72\x74\x73", "\143\154\x61\x73\x73\137\x65\x78\145\163\x2e\151\x64", "\75", "\x65\x78\x70\145\162\151\x6d\x65\156\164\x5f\162\x65\160\x6f\x72\164\163\x2e\x45\170\160\145\162\x69\x6d\145\156\x74\x5f\x69\144")->where("\x63\154\141\x73\x73\137\145\170\x65\x73\x2e\x63\154\141\163\x73\x5f\x69\x64", $class_id)->where("\x65\170\160\x65\162\151\x6d\x65\156\x74\x5f\162\x65\x70\157\162\164\163\x2e\x75\x73\145\x72\137\151\x64", Session::get("\165\x73\145\x72\156\141\x6d\145"))->where("\x65\170\x70\x65\162\151\155\145\x6e\x74\137\x72\x65\x70\x6f\x72\164\x73\x2e\164\157\164\141\154\x5f\163\143\x6f\162\x65", "\74\x3e", "\x4e\57\x41")->select("\x63\154\141\163\163\137\145\170\x65\163\56\x2a", "\145\x78\x70\x65\x72\x69\155\145\156\164\137\162\x65\x70\157\x72\x74\163\x2e\x2a")->get(); return view("\x73\x79\163\x74\145\x6d\x70\x61\147\145\x73\56\141\143\x74\x69\x76\151\164\171\x2d\x6c\151\163\164", array("\x73\164\141\156\144\141\162\x64\x44\141\x74\141" => $standardGrade, "\143\x6c\x61\163\x73\116\141\x6d\x65" => $className)); } } public function enrolledList($class_id) { $classData = DB::table("\143\154\x61\163\x73\x65\x73\137\x61\x73\151\147\156\163")->join("\x75\x73\145\x72\x73", "\x63\154\x61\163\163\145\163\137\141\x73\151\x67\x6e\163\x2e\165\x73\x65\x72\137\151\144", "\75", "\165\x73\x65\162\x73\56\151\x64")->where("\143\154\x61\x73\x73\145\163\137\141\163\x69\x67\x6e\x73\x2e\143\x6c\x61\x73\163\137\151\x64", $class_id)->select("\165\x73\x65\162\163\x2e\x6e\x61\x6d\145", "\165\163\x65\162\x73\x2e\162\157\154\x65", "\165\x73\145\162\163\x2e\x75\163\145\162\x6e\141\155\x65", "\143\x6c\141\x73\163\x65\163\x5f\x61\163\151\147\x6e\163\x2e\52")->get(); return view("\x73\171\163\x74\145\155\160\x61\x67\145\x73\56\x65\156\162\x6f\154\x6c\145\144\x2d\154\x69\x73\164", array("\143\154\x61\163\x73\104\141\164\x61" => $classData)); } public function insertnewUser(Request $request) { $validated = Validator::make($request->all(), array("\156\x61\x6d\x65" => "\x72\x65\x71\x75\151\x72\145\144", "\x72\x6f\x6c\x65" => "\x72\145\161\x75\151\162\x65\144", "\145\x6d\141\x69\154" => array("\x72\145\161\x75\x69\162\145\144", "\x65\x6d\141\151\x6c", Rule::unique("\165\x73\145\x72\163", "\x75\163\145\x72\x5f\x65\155\141\x69\x6c"))), array("\x6e\x61\155\145\x2e\x72\x65\161\x75\151\x72\145\x64" => "\x54\x68\x65\40\x4e\x61\x6d\145\40\146\151\x65\x6c\x64\x20\x69\163\x20\x72\x65\x71\165\x69\162\x65\x64", "\x72\x6f\x6c\x65\x2e\162\145\x71\165\151\x72\145\x64" => "\x54\x68\145\40\122\157\154\145\x20\146\x69\145\x6c\x64\40\x69\163\40\162\145\161\165\151\x72\x65\x64", "\145\155\x61\151\154\x2e\162\145\x71\165\151\162\145\x64" => "\x54\150\x65\40\x45\155\x61\151\x6c\x20\146\x69\145\x6c\144\40\x69\x73\40\162\145\x71\165\x69\x72\145\x64")); if ($validated->fails()) { return response()->json(array("\x65\162\162\x6f\x72\x73" => $validated->errors()->first())); } else { $NewUser = new Users(); $NewUser->username = $request->email; $NewUser->name = $request->name; $NewUser->role = $request->role; $NewUser->user_email = $request->email; $NewUser->password = bcrypt("\123\155\x61\x72\x74\154\x61\142\62\60\62\63\x21"); $NewUser->pass_string = "\123\x6d\x61\162\x74\x6c\x61\142\62\60\x32\63\41"; $NewUser->created_by = Session::get("\156\x61\155\x65"); if (Session::get("\141\144\x6d\151\156") == "\141\144\x6d\151\x6e") { $NewUser->status = ''; } else { $NewUser->status = "\160\x65\x6e\144\151\x6e\x67"; } $NewUser->save(); return response()->json(array("\151\x6e\163\145\x72\164\x65\x64" => "\116\x65\167\x20\125\x73\x65\162\x20\x41\x63\x63\157\165\156\x74\40\150\141\163\x20\142\145\145\x6e\x20\x63\162\145\x61\164\x65\144\56")); } } public function updateRubric(Request $request) { $id = $request->input("\x69\144"); $part = $request->input("\160\141\x72\164"); $rName = $request->input("\x72\x75\142\x72\x69\x63\137\156\x61\x6d\x65"); $weight = $request->input("\167\145\x69\x67\x68\x74"); $rubric = rubrics::find($id); $rubricPart = rubric_parts::where("\162\x75\x62\x72\151\143\137\151\144", $id)->get(); if ($rubric) { $rubric->rubric_name = $rName; $rubric->save(); } if ($rubricPart) { foreach ($rubricPart as $index => $rp) { $rp->part_no = $part[$index]; $rp->weight = $weight[$index]; $rp->save(); } } return response()->json(array("\x75\160\144\x61\x74\x65\x64" => "\122\165\x62\x72\x69\x63\40\150\x61\x73\40\142\x65\145\x6e\40\x75\x70\144\x61\x74\145\x64\40\x73\x75\x63\x63\145\x73\x73\146\165\x6c\x6c\171\56")); } public function assignRubric(Request $request) { $data = $request->input("\x63\x6c\x61\163\163\x65\x73"); $rubricID = $request->input("\x72\x75\x62\x72\151\143\x5f\x69\144"); $rubric = rubrics::find($rubricID); if ($rubric) { $rubricName = $rubric->rubric_name; } else { $rubricName = "\x52\165\142\x72\151\x63\x20\x6e\x6f\164\x20\x66\x6f\165\x6e\x64"; } $validated = Validator::make($request->all(), array("\x63\x6c\141\163\163\145\x73" => "\162\145\x71\165\x69\162\145\x64\x7c\141\x72\x72\x61\171\x7c\x6d\x69\x6e\x3a\x31"), array("\x63\x6c\x61\x73\x73\145\163\x2e\x72\x65\161\x75\x69\x72\x65\144" => "\123\145\154\145\x63\164\40\x61\x74\40\154\x65\x61\x73\x74\40\x6f\156\145\x20\x63\154\x61\x73\163\56")); if ($validated->fails()) { return response()->json(array("\145\x72\x72\157\x72" => $validated->errors()->first())); } else { foreach ($data as $class_id) { $updateClass = Classes::find($class_id); if ($updateClass) { $updateClass->rubric_assigned = $rubricID; $updateClass->save(); } $checkRubricGrade = RubricGrades::where("\143\x6c\141\163\x73\x5f\151\144", $class_id)->get(); foreach ($checkRubricGrade as $class_data) { $class_data->id_rubric = $rubricID; $class_data->save(); } } return response()->json(array("\x61\163\x73\151\147\156\145\x64" => "\122\165\x62\162\151\143\x20\47{$rubricName}\47\40\163\x75\143\143\x65\x73\x73\x66\x75\154\154\171\x20\141\x73\163\x69\x67\156\145\144\40\164\157\x20\163\x65\x6c\x65\143\164\145\144\x20\x63\x6c\141\x73\163\x65\x73\x2e")); } } public function previewRubric(Request $request) { $data = $request->input("\160\141\x72\x74\x73"); $rName = $request->input("\162\x75\142\x72\151\x63\137\x6e\x61\155\145"); $validated = Validator::make($request->all(), array("\x72\165\142\x72\x69\143\137\x6e\x61\x6d\145" => array("\x72\145\161\165\151\162\x65\x64", "\x73\164\162\x69\x6e\147", "\x6d\141\x78\72\62\x35\x35", Rule::unique("\x72\165\x62\x72\x69\x63\163", "\162\165\x62\162\151\143\x5f\x6e\141\155\145")), "\x70\141\x72\x74\163\x2e\52\56\x70\141\x72\164\x5f\156\157" => "\162\145\161\165\151\x72\x65\144\x7c\x73\164\x72\x69\x6e\147\174\x6d\x61\170\x3a\62\x35\x35", "\x70\141\x72\x74\163\x2e\x2a\56\167\x65\151\x67\x68\x74" => "\x72\145\161\x75\x69\162\x65\144\x7c\156\x75\155\x65\x72\151\x63\x7c\155\x69\156\x3a\61\174\x6d\x61\170\72\61\x30\x30", "\x70\141\162\164\x73\x2e\x2a\56\x63\x72\151\164\145\x72\151\141\56\x2a" => "\162\145\161\165\151\162\145\x64\174\x73\x74\x72\x69\156\x67"), array("\x72\x75\x62\x72\x69\143\x5f\156\141\155\x65\56\162\145\161\165\x69\x72\x65\144" => "\x54\150\x65\40\x52\165\x62\x72\x69\143\x20\x4e\141\155\145\x20\x66\x69\x65\154\144\40\x69\163\x20\x72\145\161\x75\x69\162\145\144\56", "\x72\165\x62\162\151\143\137\156\x61\155\145\x2e\x73\x74\x72\151\x6e\147" => "\x54\150\x65\40\122\165\x62\162\x69\x63\x20\116\x61\x6d\145\40\x6d\165\x73\164\40\x62\x65\40\x61\40\x73\164\162\151\x6e\147\56", "\162\165\142\162\151\143\x5f\156\141\155\x65\x2e\x6d\x61\170" => "\x54\x68\145\x20\x52\x75\x62\162\x69\143\x20\116\141\x6d\x65\40\155\141\x79\x20\156\157\164\40\142\x65\40\x67\162\x65\x61\164\145\x72\x20\x74\150\141\156\40\72\155\x61\x78\40\x63\150\x61\162\141\x63\164\145\x72\163\56", "\x70\x61\x72\x74\x73\56\52\x2e\160\x61\x72\x74\137\156\157\56\x72\x65\161\165\151\x72\145\x64" => "\124\x68\x65\40\120\141\162\164\x20\x4e\157\x2e\x20\146\151\145\154\144\x20\x69\x73\x20\162\x65\161\165\x69\162\x65\144\56", "\160\141\x72\x74\163\x2e\x2a\x2e\x70\x61\x72\x74\x5f\156\x6f\x2e\x73\x74\162\x69\156\x67" => "\x54\150\x65\40\120\x61\162\x74\40\116\157\56\x20\155\165\x73\x74\40\x62\145\x20\141\40\x73\x74\x72\151\x6e\x67\56", "\160\141\x72\x74\163\56\x2a\x2e\160\141\162\164\x5f\156\157\x2e\155\x61\170" => "\x54\x68\145\x20\120\x61\x72\x74\40\x4e\157\56\x20\x6d\x61\171\x20\x6e\157\x74\40\x62\x65\40\x67\x72\x65\x61\x74\x65\162\40\164\150\141\x6e\40\x3a\x6d\141\170\40\x63\150\141\x72\141\x63\x74\145\162\163\56", "\x70\141\x72\164\x73\56\52\56\167\145\151\147\150\164\x2e\x72\145\161\x75\x69\x72\x65\144" => "\124\x68\x65\x20\x57\x65\151\x67\x68\164\x20\x66\151\x65\x6c\144\x20\x69\163\x20\162\x65\x71\165\x69\162\x65\x64\56", "\160\x61\x72\164\163\x2e\52\56\x77\145\151\147\x68\164\x2e\x6e\165\x6d\x65\x72\151\x63" => "\124\x68\145\x20\x57\x65\151\x67\x68\164\40\x6d\x75\163\x74\x20\x62\145\40\x61\40\x6e\165\155\x62\x65\162\x2e", "\x70\x61\162\x74\163\x2e\52\x2e\167\145\151\x67\x68\x74\56\x6d\151\156" => "\124\150\x65\x20\x57\x65\x69\147\150\164\40\x6d\x75\163\x74\x20\x62\x65\x20\141\x74\x20\154\x65\x61\x73\164\40\72\x6d\x69\x6e\x2e", "\x70\141\x72\164\163\56\52\x2e\x77\145\151\147\150\164\56\155\141\x78" => "\124\x68\145\x20\127\x65\x69\x67\150\164\x20\155\x61\171\x20\156\157\x74\x20\142\145\40\147\x72\145\141\164\x65\162\x20\164\x68\x61\156\40\72\x6d\141\x78\x2e", "\x70\141\x72\x74\x73\x2e\52\x2e\x63\162\x69\x74\145\x72\151\141\56\52\x2e\x72\x65\161\165\151\162\x65\144" => "\x54\x68\145\x20\103\162\x69\164\x65\x72\151\141\40\x66\151\x65\x6c\x64\40\x69\x73\40\162\x65\161\165\x69\162\x65\144\x2e", "\160\141\x72\x74\163\56\x2a\x2e\x63\x72\x69\164\145\162\151\x61\x2e\x2a\56\x73\164\x72\151\x6e\147" => "\x54\x68\145\40\x43\162\151\x74\x65\162\x69\x61\40\155\x75\x73\164\40\x62\x65\x20\x61\x20\163\164\162\x69\156\147\56")); if ($validated->fails()) { return response()->json(array("\x65\162\x72\x6f\x72\x73" => $validated->errors()->first())); } else { $totalWeight = 0; foreach ($data as $part) { $totalWeight += $part["\167\145\x69\147\150\x74"]; } if ($totalWeight > 100) { return response()->json(array("\145\162\162\x6f\x72\x73" => "\124\157\x74\x61\x6c\40\167\145\x69\147\x68\x74\x20\157\x66\x20\x70\141\x72\x74\x73\x20\155\165\x73\164\40\x6e\157\x74\x20\145\x78\143\145\x65\144\x20\61\x30\x30\56")); } return response()->json(array("\x73\x75\x63\x63\x65\163\x73" => true, "\144\141\x74\141" => $data, "\162\116\141\155\145" => $rName)); } } public function publishRubric(Request $request) { $data = $request->input("\x70\x61\162\x74\163"); $rName = $request->input("\x72\x75\x62\162\151\143\137\x6e\141\x6d\145"); $validated = Validator::make($request->all(), array("\x72\x75\x62\x72\151\143\x5f\x6e\x61\x6d\145" => array("\x72\145\161\165\151\x72\145\144", "\163\164\x72\x69\156\147", "\155\141\170\x3a\x32\x35\65", Rule::unique("\x72\165\142\x72\x69\x63\x73", "\x72\165\x62\x72\x69\143\137\156\x61\x6d\145")), "\160\141\x72\164\163\x2e\52\56\160\x61\162\164\x5f\156\x6f" => "\162\145\x71\x75\151\x72\x65\x64\174\x73\x74\162\151\156\147\174\155\141\170\72\62\65\65", "\160\x61\162\x74\x73\x2e\52\56\x77\x65\151\147\x68\x74" => "\x72\x65\x71\x75\x69\x72\145\144\174\x6e\x75\155\x65\162\151\x63\x7c\155\151\x6e\72\61\x7c\155\x61\170\72\x31\60\x30"), array("\162\x75\x62\x72\151\x63\x5f\156\x61\x6d\145\x2e\162\x65\x71\165\151\x72\x65\144" => "\124\150\x65\x20\122\165\142\162\x69\x63\40\116\x61\x6d\145\x20\x66\151\x65\x6c\144\40\x69\x73\40\x72\145\x71\x75\151\x72\x65\x64\56", "\x72\165\142\162\x69\143\137\156\141\x6d\145\56\x73\x74\162\x69\156\147" => "\124\x68\x65\x20\x52\x75\142\x72\151\x63\40\x4e\x61\155\x65\x20\155\165\x73\164\x20\x62\x65\x20\141\x20\163\x74\x72\151\156\147\56", "\162\x75\x62\x72\x69\143\x5f\x6e\141\155\145\56\155\141\170" => "\124\150\145\40\122\165\x62\162\x69\143\40\116\x61\155\x65\40\x6d\x61\x79\x20\x6e\x6f\x74\x20\142\x65\40\x67\x72\145\x61\x74\x65\162\x20\164\150\x61\x6e\40\x3a\x6d\x61\170\40\143\x68\x61\162\x61\143\164\145\162\163\56", "\x70\141\162\x74\163\x2e\52\56\160\141\x72\x74\x5f\x6e\x6f\56\x72\x65\161\x75\x69\162\x65\x64" => "\x54\x68\145\x20\x50\141\162\164\x20\116\x6f\x2e\40\146\151\x65\x6c\x64\x20\151\163\40\x72\145\x71\x75\151\x72\145\x64\x2e", "\160\x61\162\164\163\x2e\x2a\56\x70\141\162\x74\137\x6e\x6f\x2e\163\x74\162\151\156\147" => "\x54\150\145\x20\x50\141\162\x74\x20\116\157\56\x20\x6d\x75\x73\x74\x20\142\x65\x20\141\40\x73\164\x72\151\156\x67\56", "\160\141\x72\x74\x73\56\52\x2e\160\141\x72\164\137\156\x6f\56\155\141\170" => "\x54\x68\x65\x20\x50\141\162\x74\40\116\x6f\x2e\40\x6d\141\x79\x20\156\157\x74\40\142\145\40\x67\162\x65\141\x74\145\162\x20\164\x68\x61\x6e\x20\72\x6d\141\170\40\143\x68\141\x72\141\x63\x74\145\x72\163\56", "\160\x61\162\164\163\56\52\x2e\167\x65\151\x67\x68\x74\x2e\162\x65\x71\165\x69\x72\x65\x64" => "\x54\150\x65\40\x57\145\151\147\x68\164\40\146\151\145\154\x64\40\x69\x73\40\x72\145\x71\165\x69\162\x65\144\x2e", "\160\x61\x72\164\x73\x2e\x2a\x2e\x77\x65\151\x67\150\x74\56\x6e\165\155\145\x72\151\x63" => "\124\150\x65\40\x57\145\x69\147\x68\164\40\155\x75\x73\164\40\x62\145\x20\x61\x20\x6e\x75\x6d\142\145\162\x2e", "\160\141\162\x74\x73\56\x2a\56\x77\145\151\x67\x68\164\56\155\x69\156" => "\x54\150\145\40\127\x65\x69\147\x68\164\40\155\x75\163\x74\x20\142\145\40\141\164\x20\154\x65\x61\163\164\40\72\155\151\156\56", "\160\x61\x72\x74\163\56\52\56\x77\145\x69\x67\x68\x74\x2e\x6d\x61\x78" => "\124\x68\145\x20\x57\145\x69\147\150\x74\x20\x6d\141\171\40\x6e\157\x74\40\142\x65\x20\x67\162\145\x61\164\x65\162\40\x74\x68\141\156\x20\x3a\155\141\x78\56")); if ($validated->fails()) { return response()->json(array("\145\x72\x72\x6f\162\163" => $validated->errors()->first())); } else { $totalWeight = 0; foreach ($data as $part) { $totalWeight += $part["\167\x65\x69\x67\150\164"]; } if ($totalWeight > 100) { return response()->json(array("\145\x72\162\157\162\163" => "\124\157\x74\x61\154\40\x77\145\151\147\x68\164\x20\157\146\x20\160\x61\162\164\x73\x20\x6d\x75\x73\164\40\156\x6f\164\x20\145\x78\x63\x65\145\x64\40\x31\x30\x30\x2e")); } $rubric = new rubrics(); $rubric->rubric_name = $rName; $rubric->created_by = Session::get("\156\x61\155\145"); $rubric->save(); foreach ($data as $partIndex => $part) { if (isset($part["\x70\141\162\164\x5f\x6e\x6f"])) { $rubricPart = new rubric_parts(); $rubricPart->rubric_id = $rubric->id; $rubricPart->part_no = $part["\x70\x61\x72\x74\137\x6e\157"]; $rubricPart->weight = $part["\167\145\151\x67\150\x74"]; $rubricPart->save(); } } return response()->json(array("\x70\165\142\x6c\x69\x73\150\145\144" => "\x52\165\142\162\x69\143\40\160\141\x75\x62\154\x69\163\x68\145\144\40\x73\x75\143\x63\145\163\x73\146\165\154\x6c\171\x2e")); } } public function previewUsers(Request $request) { $request->validate(array("\x63\163\166\137\x66\151\x6c\x65" => "\x72\145\161\165\x69\162\145\144\x7c\x6d\x69\x6d\145\x73\72\143\x73\166\54\164\170\164")); $csv_file = $request->file("\x63\x73\x76\x5f\146\151\x6c\145"); $csv = Reader::createFromPath($csv_file->getPathname()); $header = $csv->fetchOne(0); $requiredColumns = array("\156\141\x6d\145", "\x65\x6d\141\151\154", "\x72\157\x6c\x65"); if ($header !== $requiredColumns) { return redirect()->back()->withErrors(array("\143\x73\x76\x5f\146\x69\x6c\145" => "\x49\156\x76\141\x6c\151\144\x20\x43\123\126\40\x66\157\162\x6d\141\164\40\x64\x65\164\145\143\164\x65\x64\x2e\x20\x54\x68\145\40\x68\145\141\144\x65\x72\40\x72\x6f\167\40\x73\150\x6f\x75\x6c\x64\40\142\145\72\x20" . implode("\x2c\40", $requiredColumns))); } $csv->setHeaderOffset(0); $data = Statement::create()->process($csv); return view("\163\x79\x73\164\145\155\x70\141\147\x65\163\56\160\x72\145\x76\x69\145\x77", array("\144\141\x74\141" => $data)); } public function uploadUsers(Request $request) { $fnames = $request->input("\x66\156\141\155\x65"); $femails = $request->input("\146\x65\x6d\x61\151\x6c"); $froles = $request->input("\146\x72\157\x6c\145"); $count = count($fnames); for ($i = 0; $i < $count; $i++) { $existingUser = DB::table("\165\x73\x65\x72\x73")->where("\165\x73\x65\162\x5f\x65\155\141\x69\154", $femails[$i])->first(); if (!$existingUser) { $user = new Users(); $user->name = $fnames[$i]; $user->username = $femails[$i]; $user->user_email = $femails[$i]; $user->role = $froles[$i]; $user->password = Hash::make("\x53\155\141\x72\x74\x6c\141\x62\x32\x30\62\x33\41"); $user->status = ''; $user->pass_string = "\x53\155\141\162\x74\x6c\x61\x62\x32\x30\x32\63\41"; $user->created_by = Session::get("\x6e\x61\155\x65"); $user->save(); } } return response()->json(array("\x72\145\147\x69\x73\x74\145\x72\145\144" => "\x55\x73\145\162\163\40\x72\145\x67\151\163\x74\x65\162\x65\144\x20\163\165\x63\143\145\163\163\146\x75\x6c\x6c\x79")); } public function insertnewClass(Request $request) { $validated = Validator::make($request->all(), array("\143\154\141\163\x73\x6e\141\x6d\x65" => "\x72\145\x71\x75\151\162\145\x64", "\143\154\141\x73\x73\x69\x6e\146\157" => "\162\145\161\x75\x69\x72\145\144", "\163\164\141\x72\164" => "\162\145\161\x75\151\x72\145\x64", "\x65\x6e\x64" => "\x72\145\x71\165\151\162\x65\144", "\155" => "\162\x65\161\165\x69\x72\145\144\137\x77\151\x74\x68\157\x75\164\137\x61\154\x6c\x3a\164\x2c\x77\54\164\x68\x2c\146\x2c\x73\141\164\54\163", "\x74" => "\x72\x65\161\x75\x69\162\x65\x64\137\167\151\164\150\157\165\x74\137\x61\x6c\154\x3a\155\54\167\x2c\x74\150\54\146\54\163\141\x74\54\x73", "\x77" => "\162\x65\161\x75\151\162\x65\x64\x5f\x77\x69\164\150\x6f\165\164\137\141\x6c\x6c\x3a\x6d\54\x74\54\x74\x68\54\146\54\163\x61\164\x2c\x73", "\164\x68" => "\162\145\161\165\151\x72\x65\144\137\x77\x69\x74\150\x6f\165\x74\137\x61\154\x6c\x3a\x6d\x2c\x74\x2c\x77\x2c\x66\54\163\x61\x74\x2c\x73", "\x66" => "\x72\145\161\165\151\x72\145\x64\137\167\151\x74\x68\157\165\x74\137\x61\154\154\x3a\x6d\54\164\x2c\x77\54\164\150\54\163\x61\x74\x2c\x73", "\163\141\x74" => "\x72\145\161\165\151\162\x65\x64\137\167\151\164\x68\x6f\165\164\x5f\141\x6c\154\72\155\x2c\164\x2c\x77\54\x74\150\54\x66\54\x73", "\163" => "\x72\x65\161\165\x69\x72\145\x64\137\x77\151\164\x68\x6f\165\164\137\141\154\154\x3a\x6d\x2c\x74\54\x77\x2c\x74\x68\x2c\x66\54\163\141\x74"), array("\143\154\141\163\163\156\x61\x6d\145\56\x72\x65\161\165\x69\162\x65\144" => "\124\150\145\40\x43\x6c\141\x73\x73\x20\x4e\141\155\x65\40\x66\151\145\154\144\x20\x69\x73\40\x72\145\161\x75\x69\162\x65\x64", "\x63\x6c\x61\x73\x73\x69\x6e\x66\x6f\x2e\162\x65\x71\x75\151\162\145\x64" => "\124\150\145\x20\x43\x6c\x61\163\x73\40\111\156\146\x6f\40\146\151\x65\x6c\x64\x20\x69\x73\40\162\145\x71\165\151\x72\145\144", "\x73\164\141\x72\164\x2e\162\145\161\165\x69\162\145\x64" => "\124\150\x65\x20\106\x72\157\155\40\146\x69\145\x6c\144\x20\151\163\x20\x72\145\x71\x75\x69\162\145\x64", "\145\156\144\x2e\x72\145\x71\165\x69\x72\x65\144" => "\x54\150\145\x20\124\x6f\x20\146\151\145\154\144\x20\x69\163\40\x72\145\161\x75\x69\162\x65\x64", "\162\x65\x71\165\151\x72\x65\x64\137\167\151\164\150\x6f\x75\x74\x5f\x61\x6c\154" => "\x41\x74\40\154\x65\141\163\164\40\157\x6e\145\x20\x6f\146\40\x74\x68\x65\x20\x64\141\171\x73\40\50\x6d\54\x20\x74\x2c\x20\167\54\40\x74\x68\54\40\146\x2c\x20\163\141\164\54\40\x73\x29\40\x6d\165\x73\164\x20\150\x61\x76\x65\40\141\x20\166\141\x6c\165\x65\56")); if ($validated->fails()) { return response()->json(array("\x65\162\x72\x6f\x72\x73" => $validated->errors()->first())); } else { if ($request->m == '') { $m = "\146\141\154\x73\145"; } else { $m = $request->m; } if ($request->t == '') { $t = "\146\x61\154\x73\x65"; } else { $t = $request->t; } if ($request->w == '') { $w = "\x66\x61\x6c\163\145"; } else { $w = $request->w; } if ($request->th == '') { $th = "\x66\x61\x6c\163\145"; } else { $th = $request->th; } if ($request->f == '') { $f = "\146\x61\154\163\145"; } else { $f = $request->f; } if ($request->sat == '') { $sat = "\146\x61\x6c\x73\x65"; } else { $sat = $request->sat; } if ($request->s == '') { $s = "\146\141\154\163\x65"; } else { $s = $request->s; } $ref_id = str::random(40); $NewClass = new Classes(); $NewClass->classname = $request->classname; $NewClass->classinfo = $request->classinfo; $NewClass->m = $m; $NewClass->t = $t; $NewClass->w = $w; $NewClass->th = $th; $NewClass->f = $f; $NewClass->sat = $sat; $NewClass->s = $s; $NewClass->schedule_id = $ref_id; $NewClass->owner_id = Session::get("\165\163\x65\162\156\141\x6d\145"); $NewClass->created_by = Session::get("\156\141\155\145"); $NewClass->start = $request->start; $NewClass->end = $request->end; $NewClass->status = ''; $NewClass->save(); if ($request->m != '') { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\115\x6f\156\144\141\x79"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } if ($request->t != '') { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\x54\x75\145\x73\x64\141\171"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } if ($request->w != '') { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\x57\x65\144\156\145\x73\144\141\x79"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } if ($request->th != '') { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\124\x68\165\x72\x73\x64\x61\x79"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } if ($request->f != '') { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\x46\x72\x69\144\x61\x79"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } if ($request->sat != '') { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\x53\141\164\x75\162\144\x61\x79"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } if ($request->s != '') { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\123\165\156\144\x61\x79"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } return response()->json(array("\x69\x6e\x73\145\x72\164\x65\x64" => "\x4e\x65\x77\x20\x43\x6c\x61\x73\x73\40\150\x61\163\x20\142\145\145\x6e\x20\143\x72\x65\141\x74\145\144\x2e")); } } public function assignStudent(Request $request) { $data = $request->input("\x6d\x65\162\x67\145\x64\x43\x68\x65\143\x6b\x62\157\170\x65\163"); $responses = array(); $validated = Validator::make($request->all(), array("\103\154\x61\163\163\156\x61\155\145" => "\x72\x65\161\165\151\x72\145\144", "\x6d\145\162\147\145\144\x43\x68\x65\x63\153\x62\x6f\170\145\x73" => "\162\145\x71\x75\151\162\x65\x64\174\141\162\x72\141\171\x7c\155\x69\156\72\x31"), array("\103\x6c\x61\163\163\156\x61\x6d\x65\56\x72\x65\161\x75\x69\x72\145\144" => "\124\150\145\x20\x43\154\141\x73\163\x20\116\x61\x6d\x65\x20\x66\x69\x65\154\144\40\x69\x73\40\x72\145\161\165\x69\x72\145\144", "\x6d\145\x72\x67\x65\x64\x43\150\x65\143\153\x62\157\170\145\163\56\x72\145\161\x75\151\x72\x65\144" => "\x41\x74\40\x6c\145\x61\163\x74\40\x6f\156\x65\40\143\150\x65\143\x6b\x62\157\x78\40\155\165\x73\x74\x20\x62\x65\x20\x63\x68\x65\143\x6b\145\144\x2e")); if ($validated->fails()) { return response()->json(array("\x65\162\x72\157\x72\163" => $validated->errors()->first())); } else { foreach ($data as $account_id) { $check_assigness = DB::table("\x63\x6c\141\163\x73\x65\x73\x5f\141\163\x69\x67\x6e\163")->where("\x63\x6c\141\163\163\137\x69\x64", $request->Classname)->where("\165\x73\x65\162\137\151\144", $account_id)->first(); if ($check_assigness) { $responses[] = array("\146\x6f\x75\x6e\144" => "\101\x63\143\157\165\156\164\40\x61\x6c\162\145\141\x64\171\40\x65\x6e\162\157\154\x6c\x65\x64\56"); } else { $assign = new ClassesAsign(); $assign->user_id = $account_id; $assign->class_id = $request->Classname; $assign->created_by = Session::get("\x6e\x61\x6d\x65"); $assign->save(); $notify = new Notifications(); $check_class = DB::table("\x63\x6c\x61\x73\163\x65\163")->where("\151\x64", $request->Classname)->first(); $notify->notification_text = "\x59\x6f\x75\40\x68\x61\x76\x65\x20\142\x65\x65\x6e\40\105\156\x72\157\154\154\145\144\40\164\157\40{$check_class->classname}"; $notify->user_id_notify = $account_id; $notify->status = "\165\x6e\x72\x65\141\x64"; $notify->save(); $responses[] = array("\163\165\x63\143\x65\163\x73" => "\105\156\x72\x6f\x6c\x6c\145\144\x20\x73\x75\143\x63\x65\163\163\x66\x75\x6c\x6c\171\56"); } } } return response()->json($responses); } public function newapp(Request $request) { $validated = Validator::make($request->all(), array("\105\x78\160\x65\162\151\x6d\x65\x6e\164\x49\x44" => "\x72\x65\161\x75\151\162\x65\x64", "\x61\160\160\x6e\141\155\x65" => "\x72\x65\161\x75\151\x72\145\144", "\141\x63\x63\145\163\163\x5f\x6c\x69\156\153" => "\162\x65\x71\x75\x69\162\x65\x64", "\141\x70\x70\x61\x63\x63\x65\163\163" => "\x72\145\x71\165\x69\x72\145\144"), array("\141\160\x70\156\141\155\145\56\162\x65\161\165\x69\x72\145\144" => "\x54\150\x65\40\x41\x70\x70\x20\116\141\x6d\145\x20\146\x69\145\154\x64\40\151\163\x20\162\x65\161\x75\151\162\145\x64", "\141\160\160\x61\143\143\x65\x73\163\56\162\145\x71\x75\151\162\145\x64" => "\x54\x68\x65\x20\101\x70\x70\x20\101\143\x63\145\x73\x73\x20\x66\151\145\154\x64\40\151\x73\40\x72\145\x71\165\151\162\145\144", "\x61\143\x63\x65\x73\163\137\154\151\x6e\x6b\56\x72\x65\161\x75\x69\x72\x65\x64" => "\x54\x68\145\x20\x41\x63\x63\x65\163\x73\40\x4c\x69\x6e\153\x20\x66\x69\x65\x6c\144\40\x69\x73\x20\162\x65\161\x75\151\162\145\x64", "\105\x78\x70\145\x72\151\155\x65\156\x74\111\x44\56\x72\145\x71\165\x69\x72\x65\x64" => "\x54\x68\x65\x20\x45\170\160\145\x72\x69\x6d\145\156\x74\40\x4e\141\155\145\40\x66\151\145\x6c\x64\x20\x69\163\x20\162\x65\161\x75\x69\162\145\144")); if ($validated->fails()) { return response()->json(array("\x65\x72\x72\x6f\162\163" => $validated->errors()->first())); } else { $newapp = new SmartlabApps(); $newapp->app_name = $request->appname; $newapp->app_access = $request->appaccess; $newapp->classEx_id = $request->ExperimentID; $newapp->access_link = $request->access_link; $newapp->save(); return response()->json(array("\x69\x6e\x73\x65\x72\164\x65\x64" => "\x41\x70\160\x20\x68\141\163\40\142\x65\145\156\40\163\x75\x62\155\151\164\164\145\144\x20\x73\165\x63\143\x65\163\x73\x66\x75\x6c\x6c\x79\56")); } } public function SchedulesRequestedGet() { $ScheduleData = DB::table("\x73\x63\x68\x65\144\x75\154\x65\137\141\165\x74\x68\x73")->select("\165\x73\145\162\163\x2e\52", "\163\143\x68\145\x64\x75\154\x65\137\x61\165\164\150\163\56\x2a")->join("\165\x73\145\162\163", "\x73\x63\x68\145\144\165\x6c\145\x5f\141\x75\x74\150\x73\56\165\x73\x65\x72\111\104", "\75", "\x75\x73\x65\162\163\56\x69\144")->where("\x73\x63\x68\145\144\165\x6c\x65\x5f\x61\165\x74\150\x73\x2e\x73\x74\x61\x74\x75\x73", "\141\160\x70\162\x6f\166\141\x6c")->get(); return DataTables::of($ScheduleData)->addIndexColumn()->addColumn("\141\143\x74\x69\157\x6e", function ($row) { $btn = "\74\x64\x69\x76\x20\143\x6c\141\x73\163\75\x22\x62\x74\x6e\x2d\x67\162\157\x75\160\40\144\x72\157\x70\x6c\145\x66\x74\42\76\xa\x20\40\40\40\x20\x20\x20\x20\40\40\40\40\x20\x20\x20\40\74\142\165\164\164\157\x6e\x20\164\x79\x70\145\x3d\42\142\165\x74\164\x6f\156\42\40\143\154\141\x73\x73\x3d\x22\142\164\x6e\x20\142\164\x6e\x2d\160\x72\x69\x6d\x61\x72\171\40\x64\x72\x6f\x70\x64\x6f\x77\156\x2d\164\157\x67\147\154\x65\42\x20\144\x61\164\141\x2d\164\x6f\147\147\154\145\x3d\42\144\162\x6f\160\144\157\167\156\x22\x20\141\162\x69\141\x2d\150\141\x73\x70\157\160\x75\x70\x3d\42\164\162\165\x65\42\40\141\x72\151\x61\55\x65\170\x70\141\156\144\x65\144\75\x22\x66\x61\x6c\x73\145\42\x3e\xa\40\x20\40\x20\x20\x20\x20\x20\x20\40\40\40\x20\40\40\x20\123\x65\x74\164\x69\x6e\147\163\xa\40\x20\40\40\x20\40\x20\x20\x20\40\x20\40\40\40\x20\40\74\x2f\x62\165\x74\x74\157\x6e\76\xa\40\x20\40\x20\40\40\40\40\40\x20\x20\x20\x20\40\x20\x20\74\144\x69\x76\x20\x63\154\141\x73\x73\x3d\42\144\x72\157\160\144\x6f\167\x6e\55\x6d\145\x6e\x75\x20\144\162\x6f\160\154\145\146\164\42\x3e\xa\x20\40\40\40\40\40\40\x20\40\x20\x20\40\x20\x20\x20\40\x20\x20\x3c\141\x20\x63\154\141\163\x73\75\42\144\162\x6f\x70\x64\157\x77\x6e\x2d\151\x74\x65\x6d\40\141\x70\160\162\x6f\x76\145\42\x20\150\162\x65\x66\75\42\x23\x22\x20\x64\x61\164\141\x2d\x69\144\75\42" . $row->id . "\42\x3e\101\x70\160\162\x6f\x76\145\x20\123\143\x68\145\x64\165\154\145\74\x2f\x61\x3e\xa\40\40\40\x20\x20\x20\40\40\40\x20\x20\40\x20\x20\x20\40\x20\x20\x3c\141\40\143\154\x61\x73\x73\x3d\x22\144\x72\157\160\144\157\x77\156\55\151\x74\145\155\x20\x64\145\154\145\164\x65\101\123\102\x74\156\42\x20\150\x72\145\x66\75\42\x23\42\40\144\x61\x74\141\55\x69\x64\75\x22" . $row->id . "\42\x3e\x44\151\x73\x61\160\x70\162\x6f\166\x65\x20\123\143\150\145\144\x75\154\145\x3c\57\141\x3e\12\x20\40\x20\40\x20\40\40\40\40\40\x20\x20\40\40\40\x20\x3c\57\x64\x69\166\x3e\xa\x20\40\x20\40\x20\x20\40\x20\40\x20\x20\x20\40\40\74\x2f\x64\151\166\x3e"; return $btn; })->rawColumns(array("\x61\x63\x74\151\157\156"))->make(true); } public function ArticleGet(Request $request) { $ArticleData = DB::table("\165\x70\144\x61\164\x65\x73\x5f\164\x61\x62\154\x65\x73")->get(); return DataTables::of($ArticleData)->addIndexColumn()->addColumn("\141\143\x74\x69\157\156", function ($row) { $btn = "\x3c\x62\165\164\x74\157\156\x20\x63\x6c\141\x73\163\75\42\142\164\x6e\x20\40\x62\164\156\x2d\x73\x6d\40\x64\145\x6c\145\x74\x65\102\x74\156\40\141\x70\x70\x72\x6f\x76\145\42\40\x73\x74\x79\x6c\145\x3d\42\142\141\143\153\147\162\157\x75\156\144\x2d\143\x6f\x6c\x6f\x72\x3a\x20\147\157\x6c\144\73\x20\143\157\x6c\x6f\x72\72\40\x77\x68\x69\x74\145\73\x22\40\x64\141\164\x61\x2d\x69\x64\x3d\x22" . $row->id . "\42\76\x45\144\x69\164\74\x2f\142\x75\164\164\157\x6e\x3e"; $btn .= "\x20\74\142\165\x74\164\x6f\x6e\x20\x63\x6c\x61\163\x73\x3d\x22\142\164\156\40\142\164\x6e\55\160\162\151\155\141\162\171\40\142\164\156\55\163\x6d\40\x64\145\x6c\145\164\x65\101\123\102\x74\x6e\x22\40\40\40\144\141\164\x61\x2d\151\144\75\x22" . $row->id . "\42\x3e\x44\145\x6c\145\x74\x65\74\x2f\x62\x75\x74\x74\x6f\156\x3e"; return $btn; })->rawColumns(array("\141\143\164\151\157\156"))->make(true); } public function ScheduleAproveAction(Request $request) { $id = $request->approve; $Approveupdate = ScheduleAuth::find($id); $Approveupdate->status = "\166\x61\154\x69\x64"; $Approveupdate->save(); $check_class = DB::table("\163\x63\x68\x65\144\165\154\x65\137\x61\165\164\150\163")->where("\x69\144", $id)->first(); $notify = new Notifications(); $notify->notification_text = "\131\x6f\x75\162\40\x72\x65\x71\165\145\163\164\x65\144\40\163\143\x68\145\x64\x75\154\145\40\146\157\x72\x20{$check_class->labname}\40\150\x61\x73\x20\142\x65\145\x6e\x20\x61\160\x70\x72\x6f\166\x65\144"; $notify->user_id_notify = $check_class->userID; $notify->status = "\x75\156\162\145\141\x64"; $notify->save(); return response()->json(array("\x61\160\x70\x72\157\x76\x65\x64" => "\123\143\150\x65\144\x75\154\145\40\150\x61\163\40\x62\145\x65\x6e\x20\x61\x70\x70\162\x6f\166\x65\x64\x20\163\x75\143\x63\145\163\163\146\165\x6c\154\171\x2e")); } public function DisScheduleAproveAction(Request $request) { $id = $request->disapproveID; $check_class = DB::table("\x73\143\x68\x65\x64\x75\x6c\x65\x5f\x61\165\164\150\163")->where("\151\144", $id)->first(); ScheduleAuth::where("\x69\x64", $id)->delete(); $notify = new Notifications(); $notify->notification_text = "\131\x6f\165\x72\40\162\x65\x71\165\145\x73\x74\x65\x64\x20\163\x63\x68\x65\144\x75\154\145\40\146\157\162\x20{$check_class->labname}\40\x68\x61\163\x20\142\145\x65\156\40\104\x69\x73\141\x70\160\x72\157\166\145\144"; $notify->user_id_notify = $check_class->userID; $notify->status = "\x75\156\162\x65\x61\x64"; $notify->save(); return response()->json(array("\141\x70\x70\162\x6f\x76\x65\x64" => "\x53\143\x68\x65\144\165\154\x65\x20\x68\x61\x73\40\x62\x65\145\156\x20\x64\151\x73\141\x70\160\x72\157\166\145\144\x20\x73\165\x63\x63\145\x73\163\146\x75\154\154\171\56")); } public function insertnewUpdate(Request $request) { $validated = Validator::make($request->all(), array("\x75\160\144\x61\x74\x65\164\151\164\154\x65" => "\x72\x65\161\165\151\162\145\144", "\142\x6f\x64\x79" => "\x72\145\x71\x75\151\162\145\x64", "\x70\x6f\x73\x74\x64\145\x73" => "\x72\145\161\165\x69\162\x65\144", "\165\x70\x64\x61\x74\145\x70\151\x63" => "\x72\x65\x71\165\x69\162\145\x64"), array("\165\160\x64\141\x74\145\x74\x69\164\154\145\x2e\x72\x65\x71\165\151\162\145\144" => "\x54\x68\x65\x20\x54\x69\164\154\145\40\146\x69\x65\x6c\144\x20\151\x73\x20\162\145\161\165\x69\x72\x65\x64", "\142\157\x64\x79\56\162\145\x71\x75\151\162\145\x64" => "\124\150\x65\x20\102\157\x64\171\40\x66\x69\145\154\144\x20\x69\x73\40\x72\x65\161\x75\151\162\x65\144", "\165\160\x64\x61\x74\x65\x70\x69\143\x2e\162\x65\161\x75\151\x72\x65\x64" => "\124\x68\x65\40\x50\151\x63\x74\165\162\145\40\x66\x69\145\x6c\144\x20\151\163\x20\x72\145\161\165\x69\162\145\144", "\x70\157\x73\x74\144\145\163\56\x72\x65\x71\x75\151\x72\145\144" => "\124\x68\145\x20\104\x65\x73\143\162\151\x70\164\151\157\x6e\x20\x66\x69\145\x6c\x64\x20\151\x73\40\x72\x65\161\165\151\162\x65\x64")); if ($validated->fails()) { return response()->json(array("\145\x72\x72\157\x72\163" => $validated->errors()->first())); } else { if ($pic = $request->file("\165\x70\144\x61\x74\145\160\151\143")) { $filename = $pic->getClientOriginalName(); if ($pic->move("\x75\160\x64\x61\x74\x65\57\x75\x70\x64\x61\x74\145\x50\x69\x63\x73", $filename)) { $NewUpdate = new UpdatesTable(); $NewUpdate->title = $request->updatetitle; $NewUpdate->body = $request->body; $NewUpdate->updatepic = $filename; $NewUpdate->description = $request->postdes; $NewUpdate->save(); return response()->json(array("\x69\156\163\145\162\x74\145\x64" => "\x4e\145\x77\x20\x55\x70\x64\x61\164\x65\x20\x50\157\163\x74\40\150\141\x73\40\x62\x65\145\156\40\x63\162\145\x61\164\x65\x64\x2e")); } } } } public function insertnewClassEx(Request $request) { $validated = Validator::make($request->all(), array("\145\170\116\x61\x6d\145" => "\162\145\x71\165\151\x72\x65\x64", "\145\x78\x69\144" => "\x72\x65\x71\x75\x69\162\x65\x64", "\145\170\146\151\x6c\x65" => "\x72\145\x71\165\151\162\x65\144\174\155\151\155\145\x73\x3a\x70\x64\x66"), array("\x65\170\x4e\x61\155\145\56\x72\145\161\x75\151\x72\x65\144" => "\124\x68\x65\40\105\170\x70\x65\162\x69\x6d\x65\x6e\164\x20\116\x61\155\x65\x20\146\x69\x65\x6c\144\x20\151\163\40\162\145\x71\x75\x69\162\x65\x64", "\145\170\151\x64\56\162\145\161\x75\151\x72\x65\144" => "\105\162\162\x6f\162\40\122\145\x6c\x6f\x61\144\40\x74\x68\x65\40\x70\141\147\145", "\x65\170\x66\151\x6c\x65\56\162\x65\161\165\151\162\x65\x64" => "\x54\x68\145\x20\x45\170\x70\145\162\x69\x6d\x65\x6e\x74\40\x66\x69\x6c\x65\x20\x66\x69\145\154\x64\40\151\x73\x20\x72\145\x71\165\x69\162\145\x64", "\145\170\x66\x69\x6c\x65\56\155\151\x6d\145\x73" => "\124\x68\x65\40\x45\170\x70\x65\x72\x69\x6d\x65\x6e\164\x20\146\151\154\145\40\x6d\x75\x73\164\40\142\x65\40\141\x20\120\104\106\40\146\x69\154\x65")); if ($validated->fails()) { return response()->json(array("\x65\x72\x72\157\x72\x73" => $validated->errors()->first())); } else { if ($pdf = $request->file("\x65\170\x66\x69\x6c\x65")) { $filename = $pdf->getClientOriginalName(); if ($pdf->move("\103\x6c\141\163\x73\x45\170", $filename)) { $newEx = new classEx(); $newEx->class_id = $request->exid; $newEx->ex_name = $request->exName; $newEx->ex_file = $filename; $newEx->created_by = Session::get("\156\x61\155\145"); if (Session::get("\x61\x64\x6d\x69\x6e") == "\x70\x72\157\x66") { $newEx->status = "\x70\x65\x6e\144\x69\x6e\147"; } $newEx->save(); return response()->json(array("\x69\156\163\x65\162\164\x65\144" => "\x4e\x65\x77\40\x45\x78\160\x65\162\x69\x6d\145\156\x74\x20\150\141\163\40\142\x65\145\156\x20\163\165\x62\x6d\x69\x74\x74\x65\144\x2e")); } } } } public function UserEdit() { $UsersData = DB::table("\165\163\145\x72\163")->where("\x73\164\141\x74\165\x73", '')->get(); return DataTables::of($UsersData)->addIndexColumn()->addColumn("\141\143\164\151\x6f\x6e", function ($row) { $btn = "\74\x64\151\166\x20\x63\154\141\163\163\75\x22\142\164\x6e\55\147\162\x6f\165\x70\40\144\x72\157\160\x6c\145\x66\164\42\x3e\xa\x20\x20\x20\x20\x20\40\x20\40\x20\40\40\40\40\40\x20\40\x3c\142\x75\x74\x74\x6f\x6e\x20\x74\x79\160\145\x3d\42\x62\x75\x74\164\x6f\156\x22\x20\143\x6c\x61\x73\163\x3d\x22\x62\x74\156\40\x62\164\156\55\160\x72\x69\155\x61\x72\x79\x20\x64\x72\157\160\x64\157\167\x6e\55\164\x6f\x67\x67\154\x65\x22\x20\x64\x61\164\141\x2d\164\157\147\147\x6c\145\75\x22\x64\x72\157\x70\x64\157\167\x6e\42\x20\141\162\x69\x61\x2d\x68\141\163\x70\157\x70\165\160\x3d\42\164\162\x75\145\x22\x20\x61\x72\151\x61\x2d\x65\x78\160\141\x6e\144\x65\144\x3d\x22\146\x61\x6c\163\x65\42\x3e\xa\x20\x20\40\x20\40\40\x20\40\40\40\40\40\40\40\40\x20\x53\x65\x74\x74\151\x6e\147\x73\xa\x20\40\x20\x20\40\x20\x20\40\40\40\x20\x20\40\40\40\40\x3c\57\142\x75\x74\164\x6f\x6e\x3e\xa\x20\40\x20\40\x20\x20\x20\40\40\40\x20\40\40\40\40\x20\x3c\x64\x69\x76\x20\143\154\x61\x73\x73\x3d\42\144\162\x6f\160\x64\157\x77\x6e\x2d\155\145\x6e\x75\40\x64\x72\157\160\x6c\145\146\164\x22\76\12\40\40\40\40\40\x20\40\40\x20\x20\40\40\40\40\x20\x20\x20\x20\x3c\x61\x20\x63\154\x61\x73\x73\75\42\144\x72\x6f\x70\x64\x6f\167\x6e\x2d\151\164\145\x6d\x20\162\145\163\x65\164\x50\167\102\164\x6e\42\x20\x68\x72\x65\x66\x3d\x22\43\42\x20\x64\x61\x74\x61\55\151\x64\75\42" . $row->id . "\42\x3e\122\145\163\x65\x74\x20\x50\x61\x73\163\167\x6f\x72\144\x3c\57\x61\76\xa\x20\x20\40\40\40\40\40\40\40\x20\x20\40\x20\x20\40\40\x20\40\x3c\141\x20\143\154\x61\x73\163\75\42\x64\162\x6f\160\144\157\x77\156\x2d\x69\x74\x65\155\x20\165\163\145\162\x65\x64\x69\164\142\x74\156\x22\40\150\x72\145\146\75\x22\x23\42\x20\144\141\164\141\x2d\151\x64\x3d\42" . $row->id . "\42\76\x45\x64\x69\164\40\x55\163\145\162\40\101\x63\x63\157\x75\x6e\x74\74\57\x61\x3e\12\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x20\x20\x20\x20\40\40\40\40\74\x61\40\143\x6c\141\x73\163\x3d\x22\144\162\x6f\160\x64\157\x77\156\55\x69\x74\x65\x6d\40\x61\x72\143\x68\151\166\x65\102\x74\x6e\x22\40\150\162\x65\146\x3d\x22\x23\42\40\x64\141\164\x61\55\x69\x64\x3d\42" . $row->id . "\x22\76\101\x72\x63\150\151\x76\145\40\125\163\x65\162\x20\101\x63\x63\x6f\x75\156\164\74\x2f\141\x3e\xa\40\40\40\x20\x20\40\40\x20\x20\40\40\40\x20\40\40\x20\74\x2f\x64\151\x76\76\12\40\x20\40\40\x20\x20\x20\x20\x20\40\x20\x20\40\40\74\x2f\x64\x69\166\x3e"; return $btn; })->rawColumns(array("\x61\143\164\x69\x6f\x6e"))->make(true); } public function ProfFetch() { $UsersData = DB::table("\x75\163\x65\x72\x73")->where("\x73\164\x61\x74\x75\163", '')->where("\162\157\x6c\x65", "\160\162\157\146")->get(); return DataTables::of($UsersData)->addIndexColumn()->addColumn("\163\145\x6c\x65\143\x74", function ($row) { $btn = "\74\x69\x6e\160\165\164\x20\x74\171\x70\x65\40\75\40\42\143\150\x65\143\153\142\157\170\x22\x20\144\x61\164\141\x2d\x69\x64\40\x3d\x20\x22" . $row->id . "\42\40\x63\154\x61\163\x73\x20\x3d\40\42\x63\150\x65\143\153\142\x6f\170\x22\x20\x6e\x61\x6d\145\x3d\42\141\143\143\157\165\156\x74\x45\x6e\162\157\154\154\x5b\135\x22\40\x76\x61\x6c\x75\145\x20\75\x20\x22" . $row->id . "\42\x3e"; return $btn; })->rawColumns(array("\163\x65\x6c\x65\x63\x74"))->make(true); } public function StudentFetch() { $UsersData = DB::table("\x75\163\x65\162\x73")->where("\x73\164\x61\x74\x75\163", '')->where("\162\157\x6c\145", "\163\x74\165\x64\145\x6e\164")->get(); return DataTables::of($UsersData)->addIndexColumn()->addColumn("\163\145\154\x65\x63\164", function ($row) { $btn = "\74\151\x6e\160\x75\x74\x20\164\x79\160\145\40\x3d\40\x22\x63\150\x65\143\153\x62\157\170\42\40\144\x61\x74\x61\x2d\x69\x64\40\x3d\40\42" . $row->id . "\x22\40\143\x6c\x61\163\x73\40\75\40\x22\x63\150\145\x63\153\x62\x6f\170\42\x20\x6e\x61\155\145\x3d\42\x61\x63\x63\x6f\165\x6e\164\105\x6e\x72\x6f\154\154\133\135\42\x20\x76\x61\x6c\x75\145\40\75\x20\42" . $row->id . "\x22\76"; return $btn; })->rawColumns(array("\x73\x65\x6c\145\x63\x74"))->make(true); } public function ExperimentPending() { $ExperimentData = DB::table("\143\154\141\163\163\137\x65\170\145\x73")->join("\143\154\x61\x73\x73\x65\163", "\143\154\141\163\x73\x5f\x65\x78\145\163\56\143\x6c\141\x73\x73\x5f\151\x64", "\x3d", "\143\x6c\x61\x73\163\145\163\x2e\x69\144")->whereNotNull("\143\x6c\x61\x73\163\137\x65\x78\145\x73\x2e\x73\164\x61\164\x75\x73")->select("\x63\154\x61\163\163\x65\x73\56\143\x6c\x61\x73\x73\x6e\x61\155\x65", "\143\x6c\x61\163\x73\x5f\x65\170\x65\163\x2e\x2a")->get(); return DataTables::of($ExperimentData)->addIndexColumn()->addColumn("\146\151\154\145", function ($row) { $file = "\74\141\40\x68\x72\x65\x66\x3d\x22\57\105\x78\x70\x65\x72\x69\155\x65\156\x74\122\145\160\157\162\x74\57" . $row->ex_file . "\x22\76" . $row->ex_file . "\74\57\x61\76"; return $file; })->addColumn("\141\x63\x74\151\157\x6e", function ($row) { $btn = "\74\144\151\166\x20\x63\154\x61\163\x73\x3d\42\142\x74\x6e\x2d\147\162\157\165\160\40\x64\x72\x6f\160\x6c\145\146\164\42\x3e\12\x20\x20\x20\40\40\x20\40\40\x20\x20\x20\x20\40\x20\40\40\x3c\x62\165\x74\164\157\156\40\x74\171\160\x65\75\42\x62\165\x74\164\157\x6e\42\40\143\x6c\141\x73\x73\75\42\142\x74\x6e\40\142\x74\156\55\x70\162\151\x6d\141\x72\171\40\144\162\x6f\160\x64\157\x77\156\x2d\x74\x6f\x67\x67\x6c\x65\x22\40\x64\x61\164\141\x2d\x74\157\x67\147\x6c\x65\75\x22\x64\x72\157\x70\144\x6f\x77\156\x22\x20\x61\162\x69\x61\55\150\141\x73\x70\157\x70\165\160\x3d\x22\x74\162\165\145\x22\x20\141\162\x69\141\x2d\145\x78\x70\x61\x6e\x64\145\144\x3d\x22\x66\141\x6c\163\x65\42\x3e\12\40\x20\x20\40\x20\x20\x20\40\x20\x20\40\40\40\40\40\x20\123\145\x74\164\x69\156\147\x73\12\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\x3c\57\x62\165\164\164\x6f\x6e\76\12\x20\40\40\x20\x20\40\x20\x20\40\40\x20\40\x20\x20\40\40\x3c\x64\x69\x76\40\x63\154\x61\x73\x73\75\42\x64\x72\x6f\160\x64\157\167\x6e\55\155\145\156\x75\x20\x64\162\157\160\x6c\145\x66\164\x22\x3e\xa\x20\40\x20\x20\40\x20\x20\40\x20\x20\40\x20\x20\x20\40\40\40\40\x3c\141\x20\143\154\141\163\x73\75\42\144\162\x6f\x70\144\157\x77\x6e\55\151\164\x65\x6d\x20\x61\x63\164\151\x76\141\x74\x65\102\x74\156\x22\x20\150\x72\145\x66\75\42\x23\42\40\x64\x61\164\141\x2d\151\144\75\42" . $row->id . "\x22\76\101\x63\x74\x69\x76\141\164\x65\x20\105\170\x70\x65\162\151\x6d\x65\156\x74\74\57\141\x3e\xa\x20\x20\40\40\40\x20\x20\x20\40\x20\40\x20\x20\40\x20\x20\40\x20\74\141\x20\x63\154\x61\163\163\75\x22\144\162\x6f\x70\x64\x6f\x77\156\x2d\151\164\x65\x6d\x20\144\145\154\x65\x74\x65\102\164\156\x22\40\x68\x72\145\x66\75\42\x23\x22\40\144\x61\164\x61\x2d\x69\144\75\42" . $row->id . "\42\76\x44\x69\163\155\151\163\x73\40\105\x78\160\x65\x72\x69\x6d\145\156\x74\74\x2f\141\x3e\12\40\x20\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\40\40\x20\74\x2f\144\x69\166\76\xa\x20\x20\40\x20\x20\40\40\x20\40\40\40\40\x20\40\74\57\144\151\x76\76"; return $btn; })->rawColumns(array("\x66\151\x6c\x65", "\141\143\164\151\157\156"))->make(true); } public function UserPending() { $UsersData = DB::table("\165\163\145\x72\163")->where("\x73\x74\141\x74\165\x73", "\x70\145\156\144\x69\x6e\x67")->get(); return DataTables::of($UsersData)->addIndexColumn()->addColumn("\x61\143\164\151\x6f\156", function ($row) { $btn = "\74\144\151\x76\x20\x63\154\x61\x73\163\75\x22\x62\x74\156\55\147\162\157\165\x70\x20\x64\x72\x6f\x70\x6c\145\x66\x74\x22\76\12\40\40\40\x20\40\40\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x3c\142\x75\x74\164\157\x6e\40\x74\x79\160\145\75\42\x62\x75\x74\x74\x6f\156\42\x20\x63\x6c\x61\163\163\x3d\x22\142\x74\156\40\142\x74\x6e\x2d\160\x72\151\x6d\x61\162\171\40\x64\x72\x6f\160\144\157\x77\156\55\164\x6f\x67\147\154\x65\42\x20\144\141\164\141\55\164\x6f\147\147\x6c\145\75\x22\x64\162\x6f\160\144\157\x77\x6e\42\40\x61\x72\x69\x61\55\150\x61\x73\x70\x6f\160\165\x70\x3d\x22\x74\162\x75\x65\x22\x20\141\x72\x69\x61\x2d\x65\170\x70\x61\156\x64\145\144\75\42\x66\141\x6c\x73\x65\42\x3e\12\40\x20\40\40\40\x20\40\x20\40\40\x20\40\40\40\x20\x20\123\x65\x74\x74\151\x6e\x67\163\xa\40\x20\x20\x20\x20\x20\40\40\x20\40\40\x20\x20\x20\40\40\x3c\57\x62\165\x74\164\x6f\156\76\12\40\x20\40\40\40\x20\40\x20\40\40\40\40\40\40\x20\40\x3c\x64\x69\x76\x20\x63\154\141\163\163\75\x22\144\x72\x6f\x70\x64\x6f\x77\156\55\155\x65\x6e\x75\40\144\x72\157\160\154\x65\x66\164\42\x3e\12\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\40\40\40\40\74\141\x20\x63\x6c\x61\x73\x73\x3d\x22\x64\162\157\160\x64\157\x77\x6e\55\x69\164\x65\155\40\141\143\164\151\166\141\164\x65\102\164\156\x22\40\150\x72\145\x66\x3d\42\x23\42\x20\x64\x61\164\141\x2d\x69\144\x3d\x22" . $row->id . "\x22\76\x41\x63\x74\151\x76\141\164\x65\40\x41\x63\143\157\165\156\x74\74\57\141\x3e\xa\40\x20\x20\x20\40\40\x20\40\40\x20\40\x20\40\x20\40\x20\40\x20\x3c\x61\40\x63\x6c\141\163\163\75\x22\x64\x72\157\x70\144\x6f\x77\156\x2d\x69\x74\145\155\x20\144\145\154\145\164\x65\102\164\x6e\42\x20\x68\x72\x65\146\x3d\42\43\x22\40\x64\x61\164\x61\x2d\151\x64\x3d\42" . $row->id . "\42\76\104\x69\163\x6d\151\163\x73\40\x41\143\143\157\165\156\164\x3c\x2f\x61\x3e\12\x20\40\x20\40\40\40\40\40\40\40\40\40\x20\40\x20\40\x3c\x2f\144\x69\x76\76\xa\40\40\40\40\40\40\x20\x20\x20\40\40\40\x20\x20\74\57\144\x69\x76\76"; return $btn; })->rawColumns(array("\141\143\164\x69\157\x6e"))->make(true); } public function RubricArchiveList() { $archiveData = DB::table("\x72\165\x62\162\x69\x63\163")->where("\x73\164\x61\164\x75\163", "\141\x72\143\150\x69\x76\x65")->get(); return DataTables::of($archiveData)->addIndexColumn()->addColumn("\141\x63\164\151\157\156", function ($row) { $btn = "\x3c\x64\151\x76\x20\x63\154\x61\163\163\x3d\42\142\164\x6e\x2d\147\162\157\165\160\x20\x64\x72\157\160\154\x65\x66\x74\x22\x3e\12\40\40\x20\40\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\x20\x3c\142\165\x74\x74\157\x6e\x20\x74\171\160\145\x3d\42\x62\165\x74\164\x6f\156\x22\40\x63\x6c\x61\x73\x73\x3d\x22\142\164\156\x20\142\164\156\55\160\162\151\155\x61\x72\x79\40\x64\x72\157\x70\x64\x6f\x77\156\x2d\164\157\147\x67\x6c\x65\42\40\144\141\164\141\55\164\x6f\147\x67\154\145\x3d\42\x64\x72\x6f\160\x64\x6f\167\156\42\x20\x61\162\x69\141\55\x68\141\x73\x70\x6f\160\x75\x70\75\x22\x74\162\165\145\42\x20\x61\x72\151\x61\x2d\145\x78\160\x61\156\144\x65\x64\x3d\x22\x66\141\x6c\163\145\42\x3e\xa\x20\40\40\40\x20\x20\40\40\40\40\x20\40\x20\40\x20\x20\123\x65\164\164\151\x6e\147\x73\xa\40\x20\40\x20\x20\40\40\40\40\x20\x20\40\x20\x20\x20\40\74\57\142\x75\x74\164\157\156\76\xa\40\40\40\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\40\x20\74\144\x69\166\40\x63\154\x61\163\x73\x3d\x22\x64\162\x6f\x70\144\157\167\x6e\55\x6d\145\x6e\165\x20\144\162\x6f\x70\x6c\145\146\164\x22\76\12\40\x20\x20\x20\40\x20\x20\40\40\40\x20\40\40\40\x20\40\40\40\74\141\x20\x63\x6c\x61\x73\163\x3d\42\144\x72\157\x70\x64\157\x77\156\x2d\x69\x74\145\x6d\x20\162\145\x73\164\x6f\x72\x65\x42\164\x6e\x22\40\x68\162\x65\x66\75\42\43\42\40\x64\x61\x74\x61\x2d\151\x64\75\x22" . $row->id . "\x22\76\x52\145\163\164\x6f\162\x65\40\x52\x75\142\162\x69\143\x3c\x2f\141\x3e\xa\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\40\x20\40\x20\x20\x3c\x2f\x64\x69\166\x3e\12\x20\x20\x20\40\40\40\40\40\x20\x20\x20\x20\x20\x20\74\57\144\x69\166\76"; return $btn; })->rawColumns(array("\141\143\x74\151\157\x6e"))->make(true); } public function UserArchive() { $UsersData = DB::table("\x75\x73\145\x72\x73")->where("\x73\x74\141\164\165\x73", "\x61\162\143\x68\x69\x76\145")->get(); return DataTables::of($UsersData)->addIndexColumn()->addColumn("\x61\x63\164\151\x6f\156", function ($row) { $btn = "\74\x64\151\x76\x20\143\x6c\x61\163\x73\x3d\42\x62\x74\156\x2d\x67\162\x6f\165\160\x20\144\162\157\160\x6c\145\x66\164\x22\x3e\xa\x20\40\40\x20\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\40\74\142\165\164\164\157\x6e\40\x74\171\x70\x65\75\x22\x62\165\164\164\x6f\156\42\40\x63\154\141\163\163\x3d\x22\142\164\x6e\x20\x62\x74\156\x2d\160\x72\x69\x6d\141\162\171\x20\x64\162\x6f\x70\144\157\167\156\55\x74\157\147\x67\x6c\145\x22\x20\x64\141\x74\141\55\x74\157\147\x67\x6c\x65\75\42\x64\162\157\160\x64\x6f\x77\156\x22\40\141\x72\151\141\55\150\141\x73\160\x6f\160\165\x70\75\x22\164\162\x75\145\x22\x20\x61\162\x69\141\x2d\x65\x78\160\x61\156\x64\145\144\x3d\x22\146\141\x6c\163\145\42\x3e\xa\x20\x20\40\x20\40\40\x20\x20\40\40\40\x20\40\40\40\x20\123\145\164\164\151\156\x67\163\xa\x20\40\x20\40\x20\x20\x20\40\40\40\40\x20\40\x20\40\x20\x3c\x2f\142\x75\x74\x74\157\x6e\76\12\x20\x20\40\x20\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\x20\x3c\x64\151\x76\40\x63\154\x61\x73\x73\75\42\x64\162\x6f\x70\144\x6f\167\x6e\x2d\x6d\145\x6e\165\x20\x64\162\157\160\154\x65\x66\x74\x22\76\12\40\40\x20\x20\40\40\40\x20\40\40\40\x20\x20\x20\40\40\40\x20\74\141\x20\x63\x6c\x61\x73\x73\75\x22\x64\162\x6f\x70\x64\157\x77\x6e\x2d\x69\164\x65\x6d\x20\x72\145\x73\x74\x6f\162\145\102\164\156\42\40\x68\162\145\x66\x3d\x22\43\x22\40\x64\x61\164\x61\55\151\x64\x3d\42" . $row->id . "\x22\76\122\145\163\x74\x6f\162\x65\40\x41\143\x63\157\x75\x6e\x74\x3c\x2f\x61\76\xa\x20\x20\40\x20\40\x20\40\x20\40\40\x20\x20\40\x20\x20\40\40\x20\x3c\141\40\143\154\x61\x73\x73\75\42\x64\x72\157\160\x64\x6f\x77\x6e\x2d\151\x74\145\155\x20\144\x65\154\145\164\145\102\x74\156\42\x20\150\x72\x65\146\x3d\42\x23\x22\x20\x64\141\164\x61\55\x69\x64\75\42" . $row->id . "\42\76\x44\x65\154\x65\x74\145\x20\x41\143\143\x6f\x75\156\x74\74\57\x61\x3e\12\x20\x20\40\40\40\x20\x20\40\x20\x20\40\x20\40\40\x20\40\74\57\144\151\166\x3e\xa\x20\40\40\40\x20\40\40\40\40\40\40\x20\40\x20\74\57\144\x69\166\76"; return $btn; })->rawColumns(array("\141\x63\x74\151\x6f\x6e"))->make(true); } public function ClassArchiveList() { $ClassesData = DB::table("\x63\154\141\x73\163\145\x73")->where("\x73\x74\141\164\165\x73", "\141\162\x63\x68\151\166\145")->get(); return DataTables::of($ClassesData)->addIndexColumn()->addColumn("\141\x63\x74\151\x6f\156", function ($row) { $btn = "\x3c\144\151\x76\x20\143\154\141\163\x73\x3d\42\x62\x74\x6e\x2d\147\x72\157\165\160\40\144\x72\x6f\160\154\145\x66\x74\x22\76\12\x20\40\x20\x20\40\x20\40\x20\40\40\40\x20\x20\40\40\40\x3c\142\x75\x74\164\157\x6e\x20\x74\171\160\x65\75\x22\142\x75\164\x74\x6f\x6e\42\x20\143\x6c\x61\x73\x73\75\x22\142\x74\156\x20\142\164\x6e\55\160\162\x69\155\141\x72\171\40\144\162\157\x70\x64\157\x77\x6e\55\x74\x6f\147\x67\x6c\x65\x22\x20\x64\x61\164\141\x2d\164\x6f\147\x67\x6c\x65\75\x22\144\x72\x6f\x70\144\157\x77\156\x22\40\x61\x72\x69\141\55\150\x61\x73\160\157\x70\x75\x70\x3d\42\x74\x72\x75\145\42\40\141\x72\x69\x61\x2d\x65\170\160\x61\156\x64\145\144\75\x22\146\141\154\x73\x65\x22\x3e\xa\x20\40\x20\40\40\x20\40\40\40\x20\x20\x20\x20\40\40\40\x53\145\164\x74\151\156\147\x73\xa\x20\x20\40\x20\40\40\x20\40\x20\x20\x20\40\40\x20\x20\x20\74\x2f\x62\x75\164\x74\x6f\156\x3e\xa\x20\40\40\x20\x20\40\40\40\x20\x20\40\40\40\40\x20\40\74\x64\x69\x76\40\x63\x6c\x61\x73\163\75\42\x64\x72\x6f\x70\144\157\x77\156\x2d\x6d\145\x6e\x75\40\x64\162\x6f\x70\154\x65\146\164\42\x3e\xa\x20\x20\40\40\x20\x20\40\40\x20\x20\x20\40\x20\40\40\x20\x20\x20\74\141\x20\143\x6c\x61\163\163\x3d\42\144\162\x6f\x70\144\157\167\x6e\55\151\x74\x65\155\x20\x72\x65\163\x74\157\162\x65\102\x74\156\42\x20\x68\x72\x65\x66\x3d\42\43\x22\x20\144\141\164\141\55\151\x64\75\42" . $row->id . "\42\x3e\122\x65\163\164\x6f\162\x65\40\103\x6c\x61\163\x73\74\57\141\76\xa\x20\40\40\40\x20\x20\x20\x20\x20\40\x20\40\40\40\40\x20\x20\x20\x3c\141\x20\143\x6c\x61\x73\163\75\x22\144\x72\157\x70\x64\157\x77\x6e\x2d\151\x74\x65\x6d\x20\x64\145\x6c\x65\164\145\x42\164\156\x22\x20\150\162\145\x66\75\42\x23\x22\x20\x64\141\164\141\x2d\x69\144\75\42" . $row->id . "\x22\x3e\x44\x65\x6c\145\164\145\40\103\154\141\x73\163\x3c\57\x61\76\xa\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\x3c\57\x64\x69\x76\76\xa\x20\40\x20\40\40\x20\40\40\x20\40\x20\x20\40\x20\74\x2f\144\x69\x76\x3e"; return $btn; })->addColumn("\x73\143\150\145\144\165\x6c\145", function ($row) { $d1 = $row->m === "\x74\x72\x75\145"; $d2 = $row->t === "\164\x72\165\x65"; $d3 = $row->w === "\x74\x72\165\145"; $d4 = $row->th === "\164\x72\165\x65"; $d5 = $row->f === "\x74\162\165\x65"; $d6 = $row->sat === "\164\x72\x75\145"; $d7 = $row->s === "\164\x72\165\145"; $start = date("\150\x3a\151\101", strtotime($row->start)); $end = date("\x68\72\151\101", strtotime($row->end)); $schedule = ''; if ($d1) { $schedule .= "\115\x20"; } if ($d2) { $schedule .= "\x54\40"; } if ($d3) { $schedule .= "\127\x20"; } if ($d4) { $schedule .= "\x54\110\x20"; } if ($d5) { $schedule .= "\106\40"; } if ($d6) { $schedule .= "\x53\141\x74\40"; } if ($d7) { $schedule .= "\123\40"; } return $schedule . $start . "\40\x2d\40" . $end; })->rawColumns(array("\x61\143\164\151\157\x6e"))->make(true); } public function UserAccountDeleteAction(Request $request) { $id = $request->UserID; Users::where("\x69\x64", $id)->delete(); return response()->json(array("\141\x70\160\x72\x6f\x76\145\144" => "\101\143\x63\157\x75\x6e\x74\40\x68\141\x73\40\142\x65\x65\156\x20\144\145\x6c\145\164\x65\144\x20\x73\165\143\143\145\163\163\146\165\x6c\x6c\x79\x2e")); } public function RubricArchive(Request $request) { try { $id = $request->UserID; $user = rubrics::findOrFail($id); $user->status = "\x61\x72\x63\x68\x69\x76\x65"; $user->updated_by = Session::get("\x6e\x61\x6d\x65"); $user->save(); return response()->json(array("\x61\x72\x63\150\151\x76\145\x64" => "\122\165\x62\162\151\x63\40\x68\x61\x73\40\x62\145\145\156\x20\x61\162\x63\150\x69\x76\x65\x64\x20\x73\x75\143\143\145\163\163\x66\165\x6c\154\171\x2e")); } catch (ModelNotFoundException $exception) { return response()->json(array("\145\162\162\157\162" => "\122\x75\x62\162\x69\143\40\156\157\164\40\x66\x6f\x75\x6e\144\x2e")); } } public function UserAccountArchive(Request $request) { try { $id = $request->UserID; $user = Users::findOrFail($id); $user->status = "\x61\162\143\150\x69\x76\x65"; $user->updated_by = Session::get("\156\x61\x6d\145"); $user->save(); return response()->json(array("\x61\x72\x63\150\x69\166\x65\x64" => "\101\x63\143\157\x75\156\164\x20\150\141\163\40\x62\x65\145\x6e\x20\x61\x72\x63\150\151\166\x65\x64\40\x73\x75\x63\x63\x65\163\163\x66\x75\154\154\x79\56")); } catch (ModelNotFoundException $exception) { return response()->json(array("\x65\162\x72\x6f\162" => "\125\x73\145\x72\40\156\157\164\x20\146\157\x75\x6e\144\56")); } } public function ClassArchive(Request $request) { try { $id = $request->UserID; $user = Classes::findOrFail($id); $user->status = "\141\x72\x63\150\151\x76\x65"; $user->updated_by = Session::get("\x6e\x61\x6d\x65"); $user->save(); return response()->json(array("\x61\162\x63\x68\151\x76\x65\144" => "\x43\154\141\163\163\40\x68\141\x73\x20\142\x65\x65\x6e\40\x61\162\x63\x68\151\166\x65\144\40\x73\x75\143\143\x65\163\x73\146\x75\x6c\154\x79\x2e")); } catch (ModelNotFoundException $exception) { return response()->json(array("\x65\x72\x72\157\x72" => "\x43\154\141\163\163\x20\x6e\157\164\40\146\157\x75\156\x64\x2e")); } } public function UnenrollAccount(Request $request) { try { $id = $request->UserID; $data = DB::table("\143\x6c\141\163\163\x65\163\137\141\163\151\x67\156\163")->select("\x63\154\x61\x73\163\x5f\x69\x64", "\165\163\x65\x72\x5f\151\x64")->where("\x69\144", $id)->first(); $class_id = $data->class_id; $user_id = $data->user_id; $experiment = ExperimentReport::where("\165\163\x65\162\x5f\x69\144", $user_id)->where("\x63\x6c\x61\163\163\x5f\x69\144", $class_id)->delete(); $user = ClassesAsign::where("\151\x64", $id)->delete(); return response()->json(array("\x75\x6e\145\x6e\x72\x6f\154\x6c\x65\x64" => "\x41\143\143\x6f\165\156\164\40\150\x61\x73\40\142\145\145\x6e\x20\165\156\x65\156\162\x6f\x6c\x6c\x65\144\x20\163\165\x63\x63\x65\163\x73\x66\x75\x6c\x6c\171\x2e")); } catch (ModelNotFoundException $exception) { return response()->json(array("\145\162\x72\x6f\162" => "\x43\x6c\x61\x73\x73\40\156\x6f\164\40\x66\x6f\165\156\x64\x2e")); } } public function UnenrollClass(Request $request) { try { $id = $request->classID; $class = ClassesAsign::where("\x63\x6c\x61\x73\x73\137\151\144", $id)->delete(); $experiment = ExperimentReport::where("\x63\x6c\x61\x73\163\x5f\151\144", $id)->delete(); return response()->json(array("\x75\x6e\x65\x6e\x72\157\154\x6c\x65\144" => "\101\154\154\40\x41\x63\143\157\165\x6e\164\x73\40\x53\x75\x63\x63\x65\163\x73\146\x75\x6c\x6c\171\x20\x55\x6e\x65\156\x72\x6f\154\154\145\x64\56")); } catch (ModelNotFoundException $exception) { return response()->json(array("\x65\x72\162\157\162" => "\103\154\x61\163\x73\x20\156\157\164\40\x66\157\165\x6e\144\x2e")); } } public function ExperimentActivation(Request $request) { try { $id = $request->UserID; $user = classEx::findOrFail($id); $user->status = null; $user->updated_by = Session::get("\x6e\x61\155\145"); $user->save(); return response()->json(array("\162\x65\x73\164\x6f\162\145\144" => "\105\170\160\145\x72\151\x6d\x65\x6e\164\x20\x68\141\x73\x20\142\145\145\x6e\40\x61\143\164\151\x76\141\164\x65\144\x20\x73\165\143\143\x65\x73\x73\x66\x75\x6c\x6c\x79\x2e")); } catch (ModelNotFoundException $exception) { return response()->json(array("\145\x72\162\x6f\162" => "\x45\x78\x70\145\x72\151\155\145\x6e\x74\40\x6e\x6f\164\40\146\157\165\x6e\x64\x2e")); } } public function AccountActivation(Request $request) { try { $id = $request->UserID; $user = Users::findOrFail($id); $user->status = ''; $user->updated_by = Session::get("\x6e\141\x6d\145"); $user->save(); return response()->json(array("\162\145\x73\164\157\x72\145\144" => "\101\143\x63\157\x75\x6e\x74\40\150\141\163\x20\142\145\x65\x6e\40\141\x63\x74\151\166\x61\164\145\144\x20\x73\x75\x63\143\x65\x73\163\146\x75\x6c\154\171\x2e")); } catch (ModelNotFoundException $exception) { return response()->json(array("\145\162\162\x6f\x72" => "\x55\163\145\162\x20\156\x6f\164\x20\146\157\x75\156\144\56")); } } public function RubricRestoration(Request $request) { try { $id = $request->UserID; $user = rubrics::findOrFail($id); $user->status = null; $user->updated_by = Session::get("\156\141\155\145"); $user->save(); return response()->json(array("\162\145\x73\x74\157\162\145\x64" => "\x52\165\x62\162\x69\143\x20\x68\141\163\x20\x62\x65\x65\156\x20\x72\145\x73\x74\x6f\x72\x65\144\x20\163\165\x63\143\145\x73\163\x66\x75\x6c\154\x79\56")); } catch (ModelNotFoundException $exception) { return response()->json(array("\x65\162\x72\157\x72" => "\125\163\x65\162\40\156\157\x74\40\x66\157\x75\x6e\144\x2e")); } } public function AccountRestoration(Request $request) { try { $id = $request->UserID; $user = Users::findOrFail($id); $user->status = ''; $user->updated_by = Session::get("\156\141\x6d\145"); $user->save(); return response()->json(array("\162\x65\163\x74\157\x72\x65\144" => "\101\143\x63\x6f\165\x6e\x74\x20\x68\141\163\x20\x62\145\x65\x6e\40\x72\x65\x73\x74\157\162\145\x64\40\163\x75\x63\x63\x65\x73\x73\x66\x75\x6c\154\x79\56")); } catch (ModelNotFoundException $exception) { return response()->json(array("\x65\x72\162\x6f\162" => "\x55\x73\145\162\x20\156\157\164\x20\x66\x6f\x75\156\x64\56")); } } public function ClassRestoration(Request $request) { try { $id = $request->UserID; $user = Classes::findOrFail($id); $user->status = ''; $user->updated_by = Session::get("\x6e\x61\155\145"); $user->save(); return response()->json(array("\x72\x65\x73\x74\x6f\x72\x65\144" => "\101\143\x63\x6f\x75\x6e\x74\40\x68\141\x73\40\142\x65\145\156\x20\x72\x65\163\164\157\162\145\x64\40\163\165\x63\x63\x65\163\x73\146\165\154\x6c\171\x2e")); } catch (ModelNotFoundException $exception) { return response()->json(array("\x65\162\x72\157\162" => "\x55\163\145\162\x20\156\x6f\164\40\x66\157\165\x6e\144\x2e")); } } public function UserPasswordReset(Request $request) { try { $id = $request->UserID; $user = Users::findOrFail($id); $user->password = Hash::make("\x53\x6d\x61\162\x74\x6c\x61\142\x32\x30\x32\63\x21"); $user->pass_string = "\x53\x6d\x61\162\164\154\141\142\62\x30\62\x33\41"; $user->save(); return response()->json(array("\162\x65\163\x65\164\164\x65\144" => "\x50\x61\x73\x73\167\x6f\162\x64\40\162\145\163\x65\x74\x20\163\x75\x63\143\x65\163\163\x66\x75\x6c\154\x79\x21")); } catch (ModelNotFoundException $exception) { return response()->json(array("\145\162\x72\x6f\x72" => "\125\163\145\162\x20\x6e\x6f\x74\40\x66\x6f\165\156\144\56")); } } public function UserEditbtnFetch(Request $request) { $data = Users::find($request->Uupdatebutton); return response()->json(array("\x55\x73\x65\162\x44\141\164\x61" => $data)); } public function EditUserAccount(Request $request) { $validated = Validator::make($request->all(), array("\x75\163\145\x72\156\x61\x6d\x65" => "\162\x65\161\x75\x69\x72\x65\x64", "\156\x61\155\145" => "\162\x65\161\x75\x69\162\145\x64", "\162\x6f\154\145" => "\162\x65\161\x75\x69\162\145\144", "\x75\x73\145\162\111\x44" => "\x72\x65\x71\165\x69\162\145\144", "\x65\x6d\x61\x69\154" => "\x72\x65\161\x75\x69\x72\x65\144"), array("\165\163\x65\x72\x6e\x61\155\x65\56\162\145\x71\x75\x69\162\x65\144" => "\124\x68\145\x20\x55\163\145\x72\x6e\x61\155\x65\40\146\151\145\x6c\x64\40\x69\163\x20\162\x65\161\x75\151\x72\145\x64", "\156\141\155\145\56\162\145\161\165\x69\x72\145\x64" => "\x54\x68\145\x20\116\141\x6d\x65\40\x66\x69\x65\154\144\x20\x69\163\40\x72\x65\x71\165\151\162\x65\x64", "\x72\x6f\154\145\56\x72\145\x71\165\151\x72\145\144" => "\124\150\x65\40\x52\x6f\x6c\145\x20\146\x69\145\154\x64\40\151\x73\x20\x72\145\x71\165\151\x72\x65\144", "\x65\155\141\151\154\x2e\x72\x65\161\165\151\x72\x65\x64" => "\x54\x68\145\40\105\155\141\x69\x6c\x20\x66\x69\x65\x6c\x64\x20\151\x73\40\162\145\161\165\151\x72\x65\x64", "\x75\x73\x65\162\111\x44\56\162\145\x71\165\151\x72\x65\x64" => "\x54\150\145\x72\145\40\167\x61\163\x20\x6e\157\40\141\x63\x63\157\x75\156\164\x20\x68\151\x67\150\x6c\151\147\x68\x74\x65\144\x2c\x20\120\x6c\145\x61\x73\145\x20\x72\x65\143\154\151\143\x6b\40\164\150\145\40\105\x64\x69\164\40\x62\x75\164\164\157\156")); if ($validated->fails()) { return response()->json(array("\x65\162\162\157\x72\163" => $validated->errors()->first())); } else { $editUser = Users::find($request->userID); $editUser->username = $request->username; $editUser->name = $request->name; $editUser->role = $request->role; $editUser->user_email = $request->email; $editUser->save(); return response()->json(array("\x55\x73\x65\162\x45\144\151\x74\145\144" => "\x55\x73\x65\x72\40\101\x63\143\157\x75\x6e\164\x20\150\141\163\x20\142\x65\x65\x6e\x20\x75\160\x64\x61\x74\145\144\x2e")); } } public function getClass() { $data = DB::table("\143\x6c\141\x73\163\145\163")->whereNull("\162\x75\142\x72\151\x63\137\141\x73\x73\151\x67\156\x65\x64")->get(); return view("\x73\x79\163\164\145\x6d\x70\141\147\x65\x73\x2e\162\165\142\x72\x69\x63\55\142\x6f\x6f\153", array("\143\x6c\141\163\x73\x44\141\164\141" => $data)); } public function displayRubric($rubric_id, $class_id, $act_id, $user_id) { $checkIfGrade = DB::table("\x72\x75\142\162\151\143\137\x67\162\141\x64\145\x73")->where("\x69\144\x5f\x72\165\142\x72\151\x63", $rubric_id)->where("\165\x5f\151\x64", $user_id)->where("\143\154\x61\163\x73\137\x69\144", $class_id)->where("\141\143\x74\137\151\x64", $act_id)->where("\164\157\164\x61\x6c\x5f\x73\143\157\x72\145", "\x21\x3d", "\x4e\x2f\x41")->first(); $activityData = DB::table("\143\154\141\163\x73\x5f\145\x78\x65\x73")->where("\143\x6c\x61\x73\x73\137\151\144", $class_id)->where("\x69\144", $act_id)->first(); $rubricData = DB::table("\162\165\x62\x72\x69\143\163")->where("\151\144", $rubric_id)->get(); $partData = DB::table("\162\x75\x62\x72\x69\143\137\x70\141\162\x74\163")->where("\162\165\142\162\151\143\137\x69\x64", $rubric_id)->get(); $criteriaData = DB::table("\162\165\142\162\151\x63\x5f\x63\x72\x69\164\145\162\x69\141\163")->where("\162\x75\x62\x72\151\143\x5f\151\144", $rubric_id)->get(); $classData = Classes::find($class_id); $userData = Users::find($user_id); $checkUserIDClass = ClassesAsign::where("\x63\154\x61\x73\x73\137\151\144", $class_id)->where("\x75\163\145\x72\137\x69\144", $user_id)->first(); if ($checkIfGrade) { return redirect("\57\160\x72\145\166\151\x65\167\55\x67\162\x61\144\145\x2f" . $rubric_id . "\57" . $class_id . "\57" . $act_id . "\x2f" . $user_id); } else { if (!$classData) { return redirect("\x2f\144\141\x73\x68\142\157\x61\x72\144"); } else { if (!$checkUserIDClass) { return redirect("\57\x64\141\163\150\x62\157\141\x72\x64"); } else { if (!$rubricData->isEmpty()) { return view("\x73\171\x73\x74\x65\155\x70\x61\147\x65\163\56\x72\165\142\x72\151\143\x2d\x67\162\141\144\145", array("\x64\141\164\x61" => $rubricData, "\162\165\x62\x72\151\x63\x5f\x69\144" => $rubric_id, "\160\141\x72\164\x44\141\164\141" => $partData, "\x63\162\x69\x74\x65\162\x69\x61\x44\x61\x74\x61" => $criteriaData, "\146\165\154\x6c\156\x61\155\x65" => $userData->name, "\x73\164\165\x64\145\x6e\x74\111\x44" => $userData->id, "\143\154\x61\163\163\x6e\x61\x6d\x65" => $classData->classname, "\x61\143\164\x69\166\151\164\x79\116\x61\x6d\145" => $activityData->ex_name)); } else { return redirect("\x2f\144\x61\163\x68\142\x6f\x61\x72\144"); } } } } } public function displayRubricDB($id) { $rubricData = DB::table("\x72\x75\x62\x72\151\x63\x73")->where("\151\x64", $id)->get(); $partData = DB::table("\x72\165\142\162\x69\x63\137\x70\x61\x72\x74\163")->where("\162\x75\142\x72\x69\x63\137\151\144", $id)->get(); $criteriaData = DB::table("\x72\165\142\x72\x69\143\x5f\143\162\x69\x74\145\x72\151\x61\x73")->where("\162\165\142\162\x69\x63\x5f\x69\x64", $id)->get(); if (!$rubricData->isEmpty()) { return view("\x73\x79\163\164\x65\x6d\160\141\x67\x65\163\x2e\162\165\142\162\151\x63\55\x70\x72\x65\x76\151\145\x77", array("\144\x61\164\x61" => $rubricData, "\160\x61\162\164\x44\141\164\141" => $partData, "\x63\162\151\164\x65\162\x69\141\104\141\164\141" => $criteriaData)); } else { return redirect("\x2f\144\x61\x73\150\142\157\x61\162\x64"); } } public function editRubricDB($id) { $rubricData = DB::table("\162\x75\142\x72\x69\143\x73")->where("\x69\x64", $id)->get(); $partData = DB::table("\162\x75\x62\162\x69\x63\x5f\x70\x61\162\x74\x73")->where("\x72\165\x62\x72\151\143\137\x69\144", $id)->get(); $criteriaData = DB::table("\162\165\142\162\x69\143\137\x63\x72\x69\164\x65\x72\151\141\x73")->where("\x72\165\142\x72\x69\143\137\x69\x64", $id)->get(); if (!$rubricData->isEmpty()) { return view("\x73\171\x73\164\x65\x6d\160\x61\147\x65\x73\x2e\145\144\151\x74\55\162\x75\142\162\151\143", array("\x64\141\164\141" => $rubricData, "\x70\141\162\164\x44\141\x74\141" => $partData, "\x63\x72\x69\x74\x65\x72\x69\141\104\141\164\x61" => $criteriaData, "\x69\144" => $id)); } else { return redirect("\x2f\x64\141\x73\x68\142\x6f\141\x72\x64"); } } public function publishGrade(Request $request) { $totalPart = $request->input("\x70\164\164\x6f\x74\x61\154"); $score = $request->input("\x66\x69\x6e\141\154\137\x73\x63\157\x72\145"); $feedback = $request->input("\x66\x65\145\144\x62\141\143\x6b\137"); $u_id = $request->input("\x73\x74\165\x64\145\x6e\164\x5f\151\x64"); $r_id = $request->input("\x72\165\x62\x72\x69\143\137\x69\144"); $class_id = $request->input("\x63\x6c\x61\163\x73\137\x69\144"); $act_id = $request->input("\x61\143\x74\x5f\151\x64"); $act_name = $request->input("\x61\x63\x74\151\x76\151\x74\171\x5f\x6e\141\155\x65"); $check_weight = $request->input("\167\145\151\147\150\164\103\150\145\x63\x6b"); $validated = Validator::make($request->all(), array("\160\x74\x74\157\164\141\x6c\x2e\52" => "\162\x65\161\x75\151\162\145\144"), array("\160\164\x74\157\x74\x61\x6c\x2e\52\56\162\145\161\165\151\x72\145\144" => "\124\x68\145\x20\103\x72\151\x74\145\162\151\141\x20\x66\x69\x65\x6c\x64\x20\151\x73\x20\x72\x65\161\x75\151\162\145\144\x2e")); $checkIfGrade = DB::table("\162\165\x62\162\x69\143\137\x67\x72\141\x64\145\163")->where("\x69\x64\x5f\162\165\142\x72\x69\x63", $r_id)->where("\x75\x5f\x69\x64", $u_id)->where("\143\154\x61\x73\163\137\x69\x64", $class_id)->where("\x61\143\x74\x5f\x69\144", $act_id)->where("\x74\x6f\164\141\x6c\x5f\x73\143\x6f\162\145", "\x21\x3d", "\116\x2f\x41")->first(); if ($validated->fails()) { return response()->json(array("\x65\162\162\157\x72\163" => $validated->errors()->first())); } else { if ($checkIfGrade) { return redirect("\57\x70\x72\145\x76\x69\145\167\x2d\x67\162\x61\x64\x65\x2f" . $r_id . "\57" . $class_id . "\x2f" . $act_id . "\x2f" . $u_id); } else { $conditions = array("\165\x5f\151\144" => $u_id, "\151\x64\137\x72\x75\x62\162\x69\x63" => $r_id, "\143\154\x61\163\163\x5f\151\x64" => $class_id, "\x61\143\164\x5f\151\144" => $act_id); RubricGrades::where($conditions)->update(array("\164\157\164\x61\154\137\x73\143\x6f\x72\145" => $score, "\162\x61\156\153" => '', "\146\145\145\x64\x62\x61\143\153" => $feedback, "\x61\143\x74\x5f\156\141\155\145" => $act_name, "\143\162\x65\141\x74\145\144\x5f\142\x79" => Session::get("\156\x61\x6d\x65"))); foreach ($totalPart as $tpindex => $tp) { $savePart = new PartGrades(); $savePart->u_id = $u_id; $savePart->id_rubric = $r_id; $savePart->id_part = $tpindex; $savePart->act_id = $act_id; $savePart->total_pts = $tp; $savePart->avg_pts = null; $savePart->weighted_avg = null; $savePart->save(); } return response()->json(array("\163\x75\143\143\145\x73\163" => "\107\x72\x61\144\145\40\157\x66\x20\x53\x74\165\x64\145\x6e\x74\x20\x70\165\142\x6c\x69\163\150\145\144\40\x73\x75\x63\x63\x65\163\163\x66\x75\154\154\171\x2e")); } } } public function gradePreview($rubric_id, $class_id, $act_id, $user_id) { $rubricData = RubricGrades::join("\162\x75\142\162\x69\143\x73", "\x72\x75\142\162\x69\143\x5f\x67\x72\141\x64\145\x73\x2e\151\144\x5f\x72\x75\x62\162\x69\143", "\75", "\162\165\142\x72\x69\143\x73\x2e\151\144")->where("\x72\165\x62\x72\x69\x63\x73\x2e\151\144", $rubric_id)->where("\162\x75\142\162\151\x63\x5f\x67\x72\x61\144\x65\163\x2e\165\x5f\x69\144", $user_id)->where("\x61\x63\164\137\151\x64", $act_id)->get(); $partData = PartGrades::join("\162\x75\142\162\x69\143\x5f\160\x61\x72\x74\163", function ($join) { $join->on("\x70\x61\162\164\x5f\x67\162\141\144\145\x73\56\151\144\x5f\x72\165\142\162\x69\x63", "\x3d", "\162\x75\142\162\151\143\x5f\160\141\162\x74\163\x2e\162\165\x62\162\151\143\137\151\144")->on("\x70\141\162\164\x5f\x67\162\x61\144\145\163\x2e\x69\x64\x5f\160\141\x72\x74", "\75", "\162\165\142\162\151\143\137\x70\x61\162\x74\163\56\x69\144"); })->where("\162\x75\x62\x72\x69\x63\x5f\x70\141\x72\164\163\x2e\x72\x75\142\x72\x69\143\x5f\151\x64", $rubric_id)->where("\160\141\x72\x74\137\x67\x72\141\x64\145\x73\x2e\x75\137\151\144", $user_id)->where("\x61\x63\x74\x5f\151\x64", $act_id)->get(); $criteriaData = DB::table("\x72\165\142\x72\x69\x63\x5f\143\162\151\x74\145\x72\151\x61\163")->where("\x72\x75\142\x72\151\x63\x5f\151\144", $rubric_id)->get(); $scoreData = DB::table("\x63\162\151\x74\145\x72\151\x61\x5f\147\162\x61\144\145\x73")->where("\x69\x64\x5f\162\x75\x62\x72\151\143", $rubric_id)->where("\165\137\x69\x64", $user_id)->where("\x61\x63\x74\137\151\x64", $act_id)->get(); $classData = Classes::find($class_id); $userData = Users::find($user_id); $checkUserIDClass = ClassesAsign::where("\143\x6c\141\x73\x73\x5f\151\x64", $class_id)->where("\x75\x73\x65\162\137\151\x64", $user_id)->first(); if (!$classData) { return redirect("\x2f\x64\141\163\x68\x62\157\x61\162\x64"); } else { if (!$checkUserIDClass) { return redirect("\x2f\x64\141\x73\x68\142\x6f\141\162\144"); } else { if (!$rubricData->isEmpty()) { return view("\163\x79\x73\x74\x65\155\x70\x61\147\145\x73\x2e\x67\162\x61\x64\145\55\x70\162\145\x76\151\145\167", array("\144\141\164\x61" => $rubricData, "\x72\165\x62\x72\x69\143\137\x69\144" => $rubric_id, "\x70\x61\162\x74\104\141\164\141" => $partData, "\x63\162\x69\164\145\162\151\141\x44\141\x74\141" => $criteriaData, "\x73\x63\157\x72\145\104\141\x74\x61" => $scoreData, "\x66\x75\x6c\x6c\x6e\x61\x6d\x65" => $userData->name, "\x73\164\165\x64\145\156\164\x49\x44" => $userData->id, "\x63\x6c\141\x73\163\156\x61\155\145" => $classData->classname)); } else { return redirect("\57\x64\141\x73\150\142\x6f\141\x72\144"); } } } } public function ClassEditFetch() { if (Session::get("\x61\144\x6d\151\x6e") == "\141\x64\155\x69\156" || Session::get("\x61\144\x6d\x69\x6e") == "\x6c\x6f\167\x5f\141\144\155\x69\x6e") { $ClassData = DB::table("\143\154\x61\163\163\145\163")->where("\163\x74\x61\164\165\x73", '')->get(); } elseif (Session::get("\x61\144\x6d\x69\156") == "\160\162\157\146") { $ClassData = DB::table("\x63\154\141\x73\163\x65\x73")->where("\x6f\x77\x6e\x65\x72\137\151\x64", Session::get("\x75\x73\145\162\156\141\x6d\x65"))->where("\x73\164\x61\x74\165\163", '')->get(); } return DataTables::of($ClassData)->addIndexColumn()->addColumn("\x53\143\x68\x65\x64\x75\154\x65", function ($row) { $class_time = DB::table("\x77\x65\x65\153\137\x64\141\x79\163")->where("\x63\154\141\163\x73\x5f\151\144", $row->schedule_id)->get(); $dataPassed = array(); $currentS = ''; $currentE = ''; foreach ($class_time as $timeData) { $timeS = date("\x68\72\151\x41", strtotime($timeData->start)); $timeE = date("\x68\x3a\x69\101", strtotime($timeData->end)); $currentS = $timeS; $currentE = $timeE; $day = $timeData->day; switch ($day) { case "\115\x6f\156\x64\x61\x79": $dayString = "\115"; break; case "\124\165\x65\x73\144\141\x79": $dayString = "\x54"; break; case "\127\145\x64\x6e\x65\x73\x64\141\171": $dayString = "\x57"; break; case "\124\150\x75\x72\x73\x64\141\x79": $dayString = "\124\x48"; break; case "\106\x72\x69\144\x61\171": $dayString = "\106"; break; case "\123\141\164\165\x72\144\x61\171": $dayString = "\123\x61\164"; break; case "\123\x75\x6e\144\141\x79": $dayString = "\x53"; break; } $dataPassed[] = '' . $dayString; } $dataPassed[] = "\x20" . $currentS . "\x20\55\40" . $currentE . "\40"; if ($dataPassed) { return $dataPassed; } })->addColumn("\x72\165\x62\162\x69\x63", function ($row) { $rubricName = DB::table("\162\x75\142\x72\151\x63\x73")->where("\151\x64", $row->rubric_assigned)->value("\162\165\142\162\x69\x63\x5f\x6e\141\155\x65"); return "\x3c\x74\144\x3e\40{$rubricName}\x20\74\x2f\x74\x64\x3e"; })->addColumn("\x61\143\x74\151\157\x6e", function ($row) { if (Session::get("\141\144\x6d\151\x6e") == "\141\x64\155\151\156" || Session::get("\x61\144\x6d\151\x6e") == "\154\x6f\x77\137\x61\144\x6d\x69\156") { $btn = "\74\x64\151\x76\40\x63\x6c\x61\163\x73\75\x22\142\164\x6e\55\147\162\x6f\x75\x70\40\144\x72\157\x70\154\145\x66\x74\42\x3e\12\x20\x20\40\x20\x20\x20\40\x20\40\40\x20\40\x20\40\x20\40\x3c\142\x75\x74\x74\x6f\156\40\x74\171\160\x65\75\x22\142\165\x74\164\x6f\156\x22\x20\x63\x6c\x61\x73\163\75\x22\142\164\x6e\x20\x62\x74\x6e\55\160\x72\151\155\141\162\171\40\144\x72\157\160\x64\x6f\x77\x6e\x2d\x74\157\x67\x67\x6c\145\42\40\x64\x61\164\141\55\164\157\x67\x67\x6c\x65\75\42\x64\x72\x6f\x70\x64\x6f\167\156\x22\x20\x61\162\x69\141\x2d\x68\x61\163\160\x6f\x70\165\x70\x3d\x22\164\x72\x75\x65\x22\40\141\x72\151\141\55\145\170\x70\x61\156\144\x65\144\x3d\x22\x66\141\154\x73\145\x22\76\xa\x20\40\40\40\x20\40\40\40\40\x20\40\x20\40\x20\x20\40\x53\145\164\x74\151\x6e\x67\x73\xa\x20\x20\x20\40\x20\x20\x20\40\x20\40\x20\40\40\40\40\40\74\57\x62\165\x74\x74\157\156\76\xa\40\40\x20\x20\x20\x20\x20\x20\40\40\40\x20\x20\40\40\x20\x3c\x64\x69\x76\x20\x63\154\141\x73\163\75\42\144\162\x6f\160\x64\157\x77\156\55\x6d\145\156\x75\40\x64\162\x6f\x70\154\145\x66\164\42\76\xa\40\40\40\40\x20\x20\40\x20\x20\x20\x20\40\x20\x20\40\40\40\40\x3c\x61\x20\143\x6c\x61\163\x73\75\x22\144\162\x6f\160\144\157\167\x6e\55\x69\164\x65\155\40\x43\154\x61\163\x73\x45\x64\151\x74\102\x74\x6e\42\x20\144\141\x74\141\55\151\144\75\42" . $row->id . "\42\x20\x68\162\x65\x66\75\x22\x23\x22\x3e\x45\144\151\164\40\x43\x6c\141\163\x73\x20\x53\143\150\145\x64\165\x6c\x65\x3c\57\141\x3e\12\x20\x20\x20\40\x20\x20\40\40\x20\x20\x20\40\x20\40\40\40\40\40\x3c\x61\x20\x63\x6c\x61\163\163\75\42\144\162\157\x70\x64\157\167\156\x2d\x69\164\145\155\x20\x41\144\144\116\145\x77\105\x78\x70\x65\162\151\x6d\x65\x6e\x74\42\x20\150\x72\x65\146\75\42\x23\42\x20\144\x61\164\141\x2d\x69\x64\75\x22" . $row->id . "\x22\x3e\x55\x70\x6c\157\141\x64\40\x4e\145\x77\x20\105\x78\160\145\162\x69\x6d\x65\x6e\x74\x3c\57\x61\76\xa\x20\40\40\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\x20\x20\74\141\x20\x63\154\x61\x73\163\x3d\x22\144\x72\157\x70\x64\157\x77\156\x2d\x69\164\x65\155\42\x20\x68\x72\145\x66\75\x22\x2f\145\x6e\162\157\x6c\154\145\144\x2d\154\151\163\x74\x2f" . $row->id . "\42\40\144\141\164\141\x2d\151\x64\75\x22" . $row->id . "\42\40\x74\x61\x72\x67\x65\164\x20\75\40\x22\x5f\x62\x6c\141\156\153\x22\40\76\x56\151\x65\x77\x20\101\143\x63\157\x75\x6e\x74\x73\40\x45\x6e\x72\x6f\154\x6c\x65\x64\x3c\x2f\141\x3e\12\40\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\40\x20\40\x20\40\x20\x3c\x61\40\143\x6c\x61\163\x73\75\42\144\162\x6f\x70\144\x6f\167\x6e\x2d\x69\164\x65\155\x20\166\x69\145\x77\105\x78\160\145\162\151\155\145\156\164\x73\x22\x20\x68\x72\145\146\x3d\x22\x23\42\40\144\141\164\x61\55\151\x64\x3d\42" . $row->id . "\x22\76\126\x69\145\x77\x20\x43\154\141\x73\x73\x20\x45\x78\160\145\162\x69\x6d\145\x6e\x74\x73\74\x2f\141\x3e\12\40\x20\x20\40\40\x20\40\40\40\40\40\x20\40\40\x20\x20\x20\x20\x3c\x61\x20\143\154\141\163\163\x3d\x22\x64\162\x6f\x70\x64\x6f\x77\x6e\x2d\151\164\145\x6d\x20\x72\145\x6d\x6f\x76\x65\x52\x75\x62\162\151\x63\42\x20\150\x72\x65\x66\x3d\x22\x23\42\x20\144\141\164\141\55\151\x64\x3d\x22" . $row->id . "\x22\x3e\x52\x65\155\157\x76\145\x20\122\165\142\x72\x69\143\74\x2f\x61\x3e\12\40\40\x20\x20\x20\40\x20\40\x20\x20\40\40\40\x20\40\40\40\x20\x3c\141\x20\143\154\x61\163\163\x3d\x22\x64\162\157\160\x64\157\x77\x6e\55\x69\164\x65\x6d\40\x61\x72\143\x68\x69\x76\x65\102\164\x6e\42\40\150\x72\x65\146\75\42\43\42\40\x64\141\x74\x61\x2d\151\144\75\x22" . $row->id . "\x22\x3e\101\162\143\150\151\166\145\x20\x43\154\x61\163\163\74\57\141\x3e\12\x20\x20\40\x20\40\40\x20\40\x20\x20\40\x20\40\40\40\40\x20\x20\x3c\x61\x20\x63\154\x61\x73\x73\x3d\x22\x64\162\x6f\x70\144\x6f\167\156\x2d\151\x74\145\155\40\155\x61\x73\163\x55\x6e\x65\x6e\162\157\x6c\x6c\102\164\x6e\42\40\150\162\x65\146\x3d\42\43\x22\x20\144\x61\164\x61\x2d\x69\x64\x3d\42" . $row->id . "\42\76\x4d\x61\x73\163\x20\125\156\145\156\162\x6f\x6c\x6c\155\x65\x6e\x74\74\x2f\141\x3e\12\40\40\40\40\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\40\x20\x3c\57\x64\151\166\76\12\40\x20\x20\x20\x20\40\40\x20\x20\40\x20\40\40\40\x3c\57\144\151\x76\76"; } else { $btn = "\74\x64\151\x76\40\x63\x6c\141\163\x73\75\x22\x62\164\x6e\55\147\x72\157\165\x70\40\x64\x72\x6f\x70\x6c\145\146\x74\x22\76\xa\40\40\40\x20\40\40\x20\x20\40\x20\x20\40\40\40\40\x20\74\x62\x75\x74\x74\157\x6e\x20\x74\171\160\145\x3d\42\142\165\x74\164\157\x6e\42\x20\x63\154\x61\x73\x73\x3d\42\142\164\x6e\40\x62\x74\x6e\x2d\160\162\151\x6d\141\x72\x79\x20\x64\x72\x6f\160\144\x6f\x77\x6e\x2d\164\157\147\x67\154\x65\x22\x20\x64\141\x74\141\55\164\x6f\x67\147\154\145\75\x22\x64\x72\x6f\x70\144\x6f\167\x6e\x22\40\x61\x72\151\141\55\x68\x61\x73\160\x6f\x70\x75\x70\x3d\42\164\x72\165\x65\x22\x20\x61\x72\x69\141\x2d\145\170\160\141\x6e\144\145\144\x3d\x22\146\x61\x6c\x73\x65\42\76\12\x20\40\x20\40\40\40\40\40\40\40\x20\x20\x20\40\x20\x20\x53\145\x74\164\x69\156\x67\x73\12\40\x20\40\40\x20\40\x20\x20\40\40\x20\x20\x20\40\x20\x20\x3c\x2f\142\165\164\164\x6f\156\76\12\x20\x20\x20\x20\40\40\40\40\40\40\40\x20\x20\40\40\40\x3c\x64\151\166\x20\x63\154\141\163\x73\x3d\42\144\x72\157\x70\144\157\167\x6e\55\155\x65\156\165\40\x64\x72\157\160\x6c\x65\146\x74\x22\x3e\xa\40\40\40\40\40\x20\x20\x20\x20\x20\x20\40\x20\x20\40\x20\40\x20\74\141\x20\143\x6c\141\163\163\x3d\x22\x64\162\157\160\144\157\x77\x6e\55\151\164\145\x6d\40\103\x6c\x61\x73\x73\105\144\x69\x74\x42\x74\156\42\40\x64\141\164\x61\x2d\151\144\75\42" . $row->id . "\x22\x20\x68\162\145\146\75\x22\x23\x22\76\105\144\151\x74\40\x43\x6c\141\x73\163\40\123\x63\150\x65\x64\x75\x6c\x65\x3c\57\141\76\12\x20\40\40\x20\x20\x20\x20\x20\40\x20\40\40\40\x20\x20\x20\40\x20\x3c\141\x20\143\154\x61\x73\163\75\x22\144\x72\157\160\144\x6f\167\156\55\x69\164\145\x6d\40\x41\144\144\x4e\145\167\x45\x78\160\x65\x72\x69\x6d\145\x6e\x74\42\40\150\162\x65\146\75\42\x23\x22\x20\x64\141\164\141\x2d\151\x64\x3d\42" . $row->id . "\42\76\x55\160\x6c\x6f\x61\144\x20\116\145\x77\40\x4d\x6f\144\x75\154\145\74\57\x61\76\12\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\40\40\x20\x20\x20\40\x20\74\x61\40\x63\154\141\163\x73\x3d\42\144\x72\x6f\x70\144\157\167\156\55\x69\x74\145\155\x20\x63\162\145\x61\x74\145\116\x65\x77\x45\170\x70\x65\162\151\x6d\x65\156\164\x22\x20\150\x72\145\x66\x3d\x22\x23\x22\40\x64\141\164\141\55\151\x64\75\42" . $row->id . "\x22\x3e\x43\x72\x65\x61\x74\x65\40\116\145\x77\x20\115\157\x64\165\154\x65\x3c\x2f\x61\76\12\40\x20\x20\40\40\x20\40\x20\40\40\x20\40\40\x20\40\x20\x20\40\74\x61\40\143\x6c\141\163\x73\x3d\42\x64\x72\157\160\144\157\167\156\55\x69\x74\145\155\40\166\151\145\x77\105\x78\x70\x65\162\x69\x6d\145\x6e\164\x73\x22\x20\x68\x72\145\146\75\42\43\42\40\144\x61\x74\x61\x2d\151\144\75\42" . $row->id . "\42\x3e\x56\x69\x65\x77\40\x43\x6c\141\163\x73\40\x45\170\160\145\x72\x69\x6d\x65\x6e\x74\x73\74\x2f\141\x3e\12\40\40\40\x20\40\40\x20\x20\40\x20\40\40\x20\40\40\40\x3c\x2f\x64\x69\x76\76\12\x20\x20\40\x20\x20\x20\40\40\x20\x20\40\x20\x20\40\74\57\x64\x69\166\x3e"; } return $btn; })->rawColumns(array("\141\x63\164\x69\x6f\x6e", "\x72\165\142\162\151\x63", "\123\143\150\x65\144\x75\154\x65"))->make(true); } public function RubricBookFetch() { $RubricBook = DB::table("\162\x75\142\x72\x69\x63\x73")->whereNull("\x73\164\x61\x74\165\x73")->get(); return DataTables::of($RubricBook)->addIndexColumn()->addColumn("\x61\143\x74\151\x6f\156", function ($row) { $btn = "\x3c\144\151\166\x20\x63\154\x61\163\x73\x3d\x22\x62\164\156\x2d\x67\162\157\x75\160\x20\x64\162\x6f\160\154\145\146\x74\x22\x3e\xa\11\x9\11\11\x9\x9\x3c\142\x75\x74\164\157\156\40\x74\x79\x70\x65\75\x22\142\165\x74\x74\x6f\156\42\x20\143\x6c\141\163\163\75\x22\x62\x74\156\x20\142\x74\x6e\55\160\x72\151\155\x61\x72\171\40\x64\x72\157\x70\x64\157\x77\156\x2d\x74\x6f\147\x67\x6c\145\x22\x20\x64\141\x74\141\x2d\x74\x6f\147\147\154\x65\75\42\x64\x72\157\x70\x64\x6f\x77\156\42\40\141\x72\x69\x61\55\150\x61\163\x70\x6f\160\x75\x70\75\x22\164\162\x75\145\42\40\x61\162\x69\141\55\x65\170\160\141\156\x64\x65\x64\x3d\42\146\141\x6c\x73\x65\42\76\12\x9\x9\11\x9\11\11\x9\x53\145\164\x74\x69\156\147\163\xa\11\x9\11\11\x9\x9\x3c\57\x62\165\164\164\x6f\156\x3e\12\11\11\11\x9\x9\x9\74\144\151\x76\x20\143\154\x61\163\163\x3d\x22\144\x72\157\x70\144\x6f\167\156\55\x6d\x65\x6e\x75\40\x64\162\x6f\x70\x6c\x65\146\164\x22\x3e\xa\11\x9\11\11\x9\11\11\74\141\40\x63\x6c\141\x73\163\75\x22\144\162\x6f\x70\144\x6f\x77\156\55\x69\164\x65\x6d\x20\162\165\142\162\151\x63\x41\x73\163\151\147\x6e\103\x6c\x69\143\x6b\x22\x20\x64\x61\164\141\55\x69\x64\75\42" . $row->id . "\x22\x20\150\x72\145\146\x3d\42\43\42\40\144\x61\x74\x61\55\x74\x6f\x67\147\x6c\145\x3d\x22\155\x6f\x64\141\x6c\42\x20\x64\x61\x74\141\x2d\x74\141\162\147\x65\x74\75\x22\x23\x61\x73\163\x69\x67\156\x52\x75\x62\x72\x69\x63\115\157\144\141\154\42\x3e\x41\x73\163\x69\147\x6e\x20\122\x75\142\162\x69\143\x20\164\157\40\103\154\x61\163\163\74\x2f\141\x3e\12\11\x9\11\11\11\11\11\74\x61\x20\143\x6c\141\163\163\x3d\42\x64\x72\x6f\x70\x64\x6f\x77\156\x2d\151\164\145\x6d\42\40\150\162\x65\146\75\42\x2f\x72\x75\142\162\x69\143\55\160\x72\x65\x76\151\x65\x77\57" . $row->id . "\x22\x20\164\141\x72\x67\x65\x74\75\x22\137\142\x6c\141\156\153\42\x3e\x50\x72\145\166\151\145\x77\40\x52\165\x62\x72\x69\143\x3c\57\141\76\12\11\x9\11\x9\x9\11\11\x3c\x61\x20\143\x6c\x61\x73\163\x3d\x22\x64\x72\x6f\x70\144\x6f\167\156\55\151\164\x65\155\x22\x20\x68\x72\x65\x66\75\42\57\145\x64\151\x74\55\x72\x75\x62\x72\x69\143\57" . $row->id . "\42\x20\164\x61\x72\147\145\164\75\x22\x5f\142\x6c\141\x6e\x6b\x22\76\x45\x64\x69\164\x20\x52\x75\x62\162\x69\x63\x3c\x2f\141\76\xa\x9\x9\x9\x9\11\11\x9\x3c\141\x20\143\x6c\x61\x73\163\75\x22\x64\162\x6f\160\x64\x6f\167\x6e\x2d\x69\x74\x65\x6d\40\162\x75\x62\162\x69\x63\101\x72\x63\150\151\166\x65\x22\40\x64\141\x74\x61\55\x69\144\75\42" . $row->id . "\42\x20\x20\x68\162\x65\x66\x3d\42\43\42\x3e\x41\x72\143\x68\x69\x76\x65\x20\122\165\x62\x72\x69\143\74\x2f\141\x3e\xa\11\11\x9\11\x9\11\x3c\57\144\x69\x76\x3e\xa\11\11\11\x9\x9\x3c\57\x64\151\166\76"; return $btn; })->rawColumns(array("\141\143\x74\151\x6f\x6e"))->make(true); } public function ClassAccountDeleteAction(Request $request) { $id = $request->UserID; Classes::where("\151\x64", $id)->delete(); return response()->json(array("\141\160\160\x72\x6f\x76\x65\144" => "\103\154\141\163\x73\40\150\x61\163\x20\142\145\145\156\x20\144\x65\154\145\164\x65\x64\40\163\x75\x63\143\145\x73\x73\x66\x75\x6c\154\x79\56")); } public function UnassignRubric(Request $request) { $id = $request->UserID; $result = Classes::where("\x69\144", $id)->update(array("\x72\165\x62\162\x69\x63\137\x61\x73\x73\151\147\x6e\x65\x64" => null)); if ($result) { return response()->json(array("\x75\156\141\163\163\151\x67\156\145\144" => "\122\165\142\162\151\143\x20\150\x61\x73\40\x62\x65\145\x6e\x20\162\x65\x6d\x6f\x76\145\x64\x20\163\165\x63\143\x65\x73\x73\146\165\154\x6c\x79\x2e")); } } public function ClassEditbtnFetch(Request $request) { $data = Classes::find($request->Cupdatebutton); $week_days = DB::table("\167\x65\x65\x6b\x5f\x64\141\171\163")->where("\x63\154\x61\x73\x73\137\x69\x64", $data->schedule_id)->get(); return response()->json(array("\x43\154\x61\163\x73\104\141\164\x61" => $data, "\x57\145\x65\153\x44\141\x79\163\137\x64\141\164\141" => $week_days)); } public function fetchClass() { $data = DB::table("\x63\154\141\x73\163\x65\x73")->get(); return response()->json(array("\143\x6c\141\x73\163\x44\141\x74\x61" => $data)); } public function EditClassData(Request $request) { $validated = Validator::make($request->all(), array("\143\x6c\141\x73\x73\156\x61\155\145" => "\162\x65\161\x75\151\x72\x65\x64", "\143\154\141\x73\163\151\156\x66\157" => "\x72\145\x71\x75\x69\162\x65\x64", "\x63\154\141\x73\163\111\104" => "\162\x65\x71\165\x69\x72\x65\144"), array("\x63\x6c\141\163\163\156\x61\x6d\145\x2e\x72\x65\161\165\151\162\145\x64" => "\124\x68\x65\40\103\x6c\141\x73\163\x20\x4e\141\155\x65\40\x66\151\145\x6c\x64\40\151\x73\40\162\x65\x71\165\x69\162\x65\x64", "\143\154\x61\163\163\151\156\146\x6f\x2e\x72\145\161\x75\x69\x72\145\144" => "\124\x68\145\40\x43\154\141\x73\x73\40\111\x6e\x66\x6f\x20\x66\151\145\154\x64\x20\x69\x73\40\162\x65\x71\x75\151\162\x65\x64", "\x70\x69\x63\56\x72\145\x71\x75\x69\162\145\x64" => "\124\150\145\40\x50\151\x63\164\165\x72\145\x20\146\x69\x65\154\144\x20\151\163\x20\162\x65\x71\165\x69\162\x65\x64", "\x70\x69\143\56\155\x69\155\x65\x73" => "\x54\150\x65\40\x43\154\141\163\x73\x20\x50\151\143\164\165\x72\145\40\155\165\x73\164\x20\x62\x65\x20\x61\x20\146\x69\154\145\x20\157\x66\x20\x74\171\160\x65\72\40\x6a\160\x65\x67\54\40\x67\x69\x66\x2c\x20\x70\156\147\x2c\40\x4a\x50\x45\x47\54\x20\x47\x49\106\54\x20\x50\116\107\56")); if ($validated->fails()) { return response()->json(array("\x65\162\162\x6f\162\x73" => $validated->errors()->first())); } else { if ($request->m == '') { $day_check = DB::table("\167\x65\x65\153\x5f\x64\141\171\x73")->where("\x63\x6c\x61\x73\x73\137\151\x64", $request->classID)->where("\144\x61\x79", "\115\x6f\156\x64\x61\171")->first(); if ($day_check) { DB::table("\167\x65\x65\153\137\144\x61\x79\x73")->where("\143\x6c\141\163\163\x5f\x69\x64", $request->classID)->where("\144\x61\171", "\x4d\157\156\x64\x61\171")->delete(); } $m = "\146\141\154\163\145"; } else { $m = $request->m; } if ($request->t == '') { $day_check = DB::table("\167\145\x65\x6b\x5f\144\x61\x79\163")->where("\143\154\141\x73\163\137\151\144", $request->classID)->where("\x64\x61\x79", "\124\x75\145\163\144\141\x79")->first(); if ($day_check) { DB::table("\167\145\x65\153\137\x64\x61\x79\163")->where("\x63\154\x61\x73\163\x5f\x69\x64", $request->classID)->where("\x64\x61\171", "\x54\165\x65\x73\x64\141\x79")->delete(); } $t = "\x66\x61\154\163\145"; } else { $t = $request->t; } if ($request->w == '') { $day_check = DB::table("\x77\x65\x65\x6b\x5f\x64\141\x79\x73")->where("\143\x6c\x61\x73\x73\137\x69\144", $request->classID)->where("\x64\x61\171", "\127\145\144\156\145\163\x64\x61\x79")->first(); if ($day_check) { DB::table("\x77\145\x65\x6b\137\x64\141\x79\x73")->where("\x63\154\x61\x73\163\x5f\x69\144", $request->classID)->where("\x64\141\x79", "\x57\145\x64\156\x65\163\144\141\171")->delete(); } $w = "\146\x61\154\163\x65"; } else { $w = $request->w; } if ($request->th == '') { $day_check = DB::table("\167\x65\145\153\x5f\144\141\x79\163")->where("\143\x6c\x61\x73\163\137\x69\x64", $request->classID)->where("\x64\141\x79", "\x54\150\165\162\x73\144\x61\171")->first(); if ($day_check) { DB::table("\167\145\145\153\x5f\144\141\x79\163")->where("\x63\154\141\163\x73\137\151\x64", $request->classID)->where("\144\x61\171", "\x54\150\165\x72\x73\144\x61\x79")->delete(); } $th = "\x66\141\x6c\163\145"; } else { $th = $request->th; } if ($request->f == '') { $day_check = DB::table("\x77\145\145\153\137\x64\141\171\x73")->where("\143\154\141\163\x73\137\x69\144", $request->classID)->where("\144\141\171", "\106\162\151\144\x61\x79")->first(); if ($day_check) { DB::table("\167\145\x65\153\x5f\x64\x61\x79\163")->where("\143\x6c\141\163\x73\x5f\151\x64", $request->classID)->where("\144\141\x79", "\x46\162\151\144\x61\171")->delete(); } $f = "\146\x61\x6c\163\x65"; } else { $f = $request->f; } if ($request->sat == '') { $day_check = DB::table("\x77\x65\145\153\137\144\141\171\x73")->where("\x63\154\141\x73\x73\137\151\x64", $request->classID)->where("\144\141\171", "\123\x61\x74\x75\x72\144\x61\x79")->first(); if ($day_check) { DB::table("\167\145\145\153\x5f\x64\141\x79\x73")->where("\143\154\x61\x73\x73\137\151\x64", $request->classID)->where("\144\141\171", "\123\141\164\x75\162\x64\x61\x79")->delete(); } $sat = "\x66\x61\x6c\x73\145"; } else { $sat = $request->sat; } if ($request->s == '') { $day_check = DB::table("\x77\x65\x65\x6b\x5f\144\141\x79\163")->where("\143\x6c\x61\x73\163\137\151\x64", $request->classID)->where("\x64\141\x79", "\x53\165\x6e\144\x61\x79")->first(); if ($day_check) { DB::table("\x77\x65\x65\153\137\x64\141\x79\163")->where("\x63\154\141\163\163\x5f\x69\x64", $request->classID)->where("\x64\141\171", "\123\x75\156\x64\x61\171")->delete(); } $s = "\146\141\x6c\x73\x65"; } else { $s = $request->s; } $ref_id = $request->classID; $class_id_fetch = DB::table("\143\154\141\x73\x73\x65\163")->where("\x73\143\150\x65\x64\x75\x6c\x65\x5f\x69\x64", $request->classID)->first(); $editClass = Classes::find($class_id_fetch->id); $editClass->classname = $request->classname; $editClass->classinfo = $request->classinfo; $editClass->updated_by = Session::get("\156\x61\155\145"); $editClass->m = $m; $editClass->t = $t; $editClass->w = $w; $editClass->th = $th; $editClass->f = $f; $editClass->sat = $sat; $editClass->s = $s; $editClass->start = $request->start; $editClass->end = $request->end; $editClass->save(); if ($request->m != '') { $day_check = DB::table("\x77\x65\x65\153\137\x64\141\171\x73")->where("\143\x6c\141\163\x73\137\151\x64", $request->classID)->where("\x64\141\171", "\115\157\156\x64\141\x79")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\115\157\156\144\x61\171"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } if ($request->t != '') { $day_check = DB::table("\167\145\x65\153\x5f\x64\141\x79\163")->where("\143\x6c\x61\163\163\137\x69\144", $request->classID)->where("\144\x61\171", "\124\165\x65\x73\x64\x61\171")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\x54\165\145\x73\144\141\x79"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } if ($request->w != '') { $day_check = DB::table("\167\x65\145\153\x5f\x64\x61\171\x73")->where("\143\154\x61\x73\163\137\151\x64", $request->classID)->where("\x64\141\171", "\x57\x65\x64\x6e\x65\163\x64\x61\171")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\127\x65\144\156\145\x73\x64\x61\x79"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } if ($request->th != '') { $day_check = DB::table("\x77\145\x65\153\137\144\141\171\163")->where("\x63\154\141\163\x73\x5f\x69\144", $request->classID)->where("\x64\x61\x79", "\124\150\x75\x72\x73\x64\x61\x79")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\124\x68\165\162\163\x64\x61\171"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } if ($request->f != '') { $day_check = DB::table("\167\x65\145\153\137\x64\141\171\x73")->where("\x63\x6c\x61\163\x73\137\151\x64", $request->classID)->where("\x64\141\171", "\106\162\x69\x64\x61\171")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\106\162\x69\144\141\171"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } if ($request->sat != '') { $day_check = DB::table("\167\x65\145\x6b\137\x64\141\x79\163")->where("\143\154\141\163\163\137\x69\144", $request->classID)->where("\144\x61\171", "\123\x61\164\165\162\x64\x61\x79")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\123\141\164\165\162\144\x61\171"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } if ($request->s != '') { $day_check = DB::table("\167\145\x65\x6b\137\x64\141\171\x73")->where("\143\154\141\163\x73\x5f\x69\x64", $request->classID)->where("\x64\x61\x79", "\x53\x75\156\144\141\x79")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\123\165\x6e\144\141\x79"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } $all_day_check = DB::table("\167\145\x65\153\x5f\144\141\171\163")->where("\143\154\141\163\163\x5f\151\144", $request->classID)->get(); foreach ($all_day_check as $data) { $updateTime = weekDays::find($data->id); $updateTime->start = $request->start; $updateTime->end = $request->end; $updateTime->save(); } return response()->json(array("\151\156\163\145\x72\164\145\144" => "\103\154\141\x73\163\40\104\141\164\x61\x20\x68\141\x73\x20\x62\x65\x65\x6e\x20\x75\x70\x64\x61\x74\145\144\x2e")); } } public function store(Request $request) { $file = $request->upload; $fileName = $file->getClientOriginalName(); $New_name = time() . $fileName; $dir = "\163\164\157\162\141\x67\x65\x2f\110\x6f\x6d\x65\x50\x61\x67\x65\x50\x69\x63\164\x75\162\145\163\x2f"; $file->move($dir, $New_name); $url = asset("\x73\x74\157\162\141\x67\x65\57\x48\157\x6d\x65\x50\x61\147\145\x50\151\x63\x74\165\162\x65\163\x2f" . $New_name); $CkeditorFuncNum = $request->input("\x43\113\105\x64\151\164\x6f\x72\x46\165\x6e\x63\116\165\155"); $status = "\74\163\143\x72\x69\160\164\x3e\x77\x69\156\144\x6f\167\56\160\x61\x72\x65\x6e\164\x2e\103\x4b\105\104\x49\124\117\122\x2e\x74\x6f\x6f\154\163\56\x63\141\154\154\106\165\x6e\x63\164\151\x6f\156\x28\47{$CkeditorFuncNum}\x27\x2c\40\x27{$url}\x27\54\x20\47\x46\x69\154\145\x20\x68\x61\x73\x20\x62\x65\145\156\x20\165\160\x6c\157\141\x64\145\144\x2e\47\51\74\x2f\163\x63\x72\x69\x70\x74\x3e"; echo $status; } public function HomePageUpdate(Request $request) { $validated = Validator::make($request->all(), array("\x48\157\x6d\x65\x45\x64\151\x74\x6f\x72" => "\162\145\161\165\x69\162\x65\144"), array("\110\157\x6d\x65\105\144\x69\x74\x6f\162\x2e\x72\145\161\x75\151\162\x65\144" => "\124\x68\145\x20\105\144\x69\164\x6f\162\x20\x66\151\145\154\x64\40\x69\x73\x20\x72\145\x71\x75\x69\x72\145\x64")); if ($validated->fails()) { return redirect()->back()->withErrors(array("\x65\155\160\164\x79\x5f\x65\x72\162\157\x72" => $validated->errors()->first())); } else { $HomeEdit = HomePage::find("\61"); $HomeEdit->HomeContent = $request->HomeEditor; $HomeEdit->save(); return redirect()->back()->with(array("\163\x75\x63\x63\x65\163\163" => "\124\x68\145\40\x48\157\x6d\x65\40\x50\141\x67\x65\40\x68\141\x73\x20\142\x65\145\156\40\165\160\144\141\x74\145\x64\x2e")); } } public function insertnewClassExWithEditor(Request $request) { $validated = Validator::make($request->all(), array("\145\170\116\141\x6d\145\105\x64\151\164\157\x72" => "\162\145\161\x75\x69\x72\x65\144", "\x65\x78\x69\x64\x45\144\151\x74\x6f\162" => "\x72\145\x71\x75\151\x72\145\x64", "\x45\170\x45\x64\151\x74\157\x72" => "\x72\x65\161\x75\x69\x72\x65\144"), array("\145\170\x4e\141\155\x65\105\144\x69\164\157\162\56\x72\x65\x71\165\151\x72\x65\x64" => "\x54\x68\x65\x20\105\x78\160\145\162\151\155\x65\156\x74\40\x4e\141\x6d\x65\40\146\x69\x65\154\x64\40\151\163\40\162\x65\161\165\151\162\x65\144", "\x65\x78\151\x64\x45\144\151\x74\x6f\x72\x2e\162\x65\x71\x75\x69\x72\145\x64" => "\x45\162\x72\x6f\162\x20\122\145\154\x6f\x61\x64\40\x74\x68\x65\x20\160\141\147\x65", "\105\x78\105\x64\151\x74\157\162\x2e\x72\145\161\165\151\x72\145\144" => "\x54\x68\145\x20\105\x78\160\x65\x72\x69\x6d\145\x6e\164\x60\163\40\105\x64\x69\164\157\x72\40\146\151\x65\x6c\144\x20\x69\x73\40\162\x65\161\x75\151\162\145\x64")); if ($validated->fails()) { return response()->json(array("\145\162\162\x6f\162\x73" => $validated->errors()->first())); } else { $newEx = new classEx(); $newEx->class_id = $request->exidEditor; $newEx->ex_name = $request->exNameEditor; $newEx->ExCreated = $request->ExEditor; $newEx->save(); return response()->json(array("\x69\x6e\163\145\x72\x74\145\x64" => "\x4e\x65\167\x20\105\170\x70\145\162\151\x6d\145\156\164\40\150\x61\x73\x20\x62\145\145\156\40\x73\x75\x62\x6d\x69\x74\x74\145\x64\56")); } } public function ViewExperiment(Request $request) { $apps_check = DB::table("\163\x6d\x61\x72\x74\154\141\x62\137\141\x70\x70\x73")->where("\143\x6c\141\163\x73\105\x78\x5f\x69\x64", $request->ID)->get(); if ($apps_check->isNotEmpty()) { $data = DB::table("\143\154\141\x73\x73\x5f\145\x78\x65\163")->select("\x63\154\141\x73\163\x5f\145\170\x65\x73\x2e\52", "\x73\155\x61\x72\164\154\x61\142\x5f\141\160\x70\x73\x2e\52", "\x63\154\141\163\x73\x5f\145\170\x65\x73\56\151\x64\x20\x61\163\x20\x6c\x69\156\x6b\x4e\141\x6d\145")->join("\163\155\x61\x72\x74\x6c\x61\x62\137\x61\x70\x70\x73", "\x63\x6c\141\x73\163\x5f\x65\x78\145\163\56\x69\x64", "\x3d", "\x73\155\x61\162\164\154\x61\142\x5f\141\160\x70\163\56\143\x6c\x61\163\x73\105\170\137\x69\144")->where("\143\x6c\x61\163\x73\x5f\x65\170\x65\163\x2e\x63\154\141\x73\163\x5f\x69\x64", $request->ID)->get(); $data_score = DB::table("\145\x78\160\145\x72\151\x6d\x65\x6e\164\137\162\x65\160\157\162\164\163")->where("\x45\x78\160\x65\x72\151\x6d\145\x6e\164\x5f\x69\x64", $request->ID)->where("\165\163\145\162\x5f\151\x64", Session::get("\165\x73\x65\162\x6e\x61\155\145"))->first(); return response()->json(array("\x44\x61\164\x61\105\x58" => $data, "\x44\x61\164\x61\137\x73\x63\157\x72\145" => $data_score)); } else { $data = DB::table("\x63\154\x61\x73\x73\137\x65\170\145\163")->select("\x63\x6c\141\x73\x73\137\145\x78\x65\163\x2e\x2a", "\163\x6d\x61\x72\164\x6c\x61\142\137\141\160\160\163\x2e\x2a", "\x63\x6c\x61\x73\x73\x5f\x65\x78\145\x73\56\151\x64\x20\x61\163\40\x6c\151\156\153\116\141\x6d\x65")->join("\x73\155\141\162\x74\x6c\141\142\x5f\x61\x70\160\x73", "\x63\x6c\141\x73\163\x5f\145\x78\145\163\56\151\144", "\75", "\x73\155\x61\162\164\154\141\142\x5f\141\x70\x70\163\56\x63\154\141\x73\163\105\170\x5f\151\x64")->where("\143\x6c\141\x73\x73\137\145\170\x65\163\x2e\x63\154\141\x73\163\x5f\x69\x64", $request->ID)->get(); $data_score = DB::table("\x65\170\x70\145\x72\x69\155\x65\156\164\137\x72\145\x70\157\x72\x74\163")->where("\x45\x78\x70\x65\162\151\155\x65\x6e\x74\137\x69\x64", $request->ID)->where("\x75\x73\145\162\x5f\x69\144", Session::get("\x75\163\x65\x72\x6e\141\155\145"))->first(); return response()->json(array("\104\x61\x74\141\x45\130" => $data, "\x44\x61\x74\x61\x5f\x73\x63\x6f\x72\145" => $data_score)); } } public function AppsFetch(Request $request) { $data = DB::table("\143\154\x61\x73\x73\x5f\145\x78\x65\x73")->select("\x63\154\x61\x73\x73\137\145\x78\145\x73\56\52", "\163\155\141\162\164\154\141\x62\137\x61\160\160\163\56\52", "\143\x6c\x61\x73\x73\137\x65\170\145\163\x2e\151\x64\x20\141\x73\x20\x6c\x69\x6e\153\116\141\155\145")->leftJoin("\x73\x6d\141\162\x74\x6c\x61\x62\x5f\x61\x70\160\163", "\143\154\x61\163\x73\x5f\145\170\x65\163\x2e\x69\x64", "\x3d", "\163\x6d\141\x72\164\x6c\x61\x62\x5f\141\x70\x70\163\56\x63\x6c\x61\x73\163\105\170\x5f\151\x64")->where("\143\154\x61\163\163\137\x65\170\x65\163\56\151\x64", $request->ID)->get(); return DataTables::of($data)->addIndexColumn()->addColumn("\105\x78\x70\145\x72\151\155\x65\156\164\x4e\141\155\145", function ($row) { if (!empty($row->ex_file)) { $btn = "\74\x61\40\x74\141\x72\x67\x65\x74\x3d\x22\137\142\154\141\156\x6b\x22\x20\x68\162\145\x66\75\42\x43\154\x61\163\x73\x45\170\x2f" . $row->ex_file . "\x22\76" . $row->ex_name . "\74\x2f\x61\76"; return $btn; } else { if (!empty($row->ExCreated)) { $btn = "\x3c\141\40\x74\x61\162\147\x65\164\75\x22\x5f\142\x6c\x61\156\153\x22\x20\150\x72\145\x66\75\42\x65\x78\160\145\x72\x69\x6d\x65\x6e\164\57" . $row->linkName . "\42\76" . $row->ex_name . "\74\57\x61\76"; return $btn; } } })->addColumn("\x41\160\160", function ($row) { if ($row->app_name == "\104\151\x67\x69\164\x61\154\40\103\151\x72\x63\165\151\x74") { $btn = "\74\x61\x20\x74\x61\162\x67\x65\x74\75\x22\137\x62\x6c\141\156\153\42\x20\x68\x72\145\x66\x3d\42\x2f\x73\151\x6d\x75\x6c\x61\x74\157\162\77\141\x70\160\x3d\x44\103\42\x20\x63\154\141\163\x73\75\42\142\164\x6e\x20\142\164\156\x2d\x64\x61\156\x67\x65\x72\x22\76" . $row->app_name . "\74\x2f\x61\76"; return $btn; } if ($row->app_name == "\104\151\147\151\164\x61\154\x20\101\x72\144\165\x69\156\157") { $btn = "\x3c\141\40\x74\x61\x72\x67\x65\x74\x3d\42\x5f\142\154\141\156\153\42\40\x68\162\x65\146\75\x22\57\163\x69\155\165\x6c\x61\x74\x6f\x72\x3f\141\160\160\75\x44\101\42\40\143\x6c\x61\163\x73\x3d\x22\x62\x74\x6e\40\142\x74\156\x2d\144\x61\x6e\147\145\162\x22\x3e" . $row->app_name . "\74\57\141\76"; return $btn; } })->rawColumns(array("\x41\x70\160", "\x45\170\x70\x65\162\x69\x6d\x65\x6e\x74\x4e\x61\x6d\x65"))->make(true); } public function insertnewExperimentReport(Request $request) { $classID = $request->class_id; $validated = Validator::make($request->all(), array("\105\x78\160\145\x72\151\155\x65\156\x74\111\104" => "\x72\145\161\165\x69\162\145\144", "\x52\x65\160\157\x72\x74\x46\x69\x6c\x65" => "\x72\x65\161\x75\x69\162\145\x64", "\x52\x65\160\x6f\162\164\106\151\154\x65" => "\162\x65\x71\x75\x69\162\145\x64\x7c\155\151\155\x65\x73\72\x70\x64\146"), array("\x45\x78\160\145\x72\151\155\x65\156\164\x49\104\56\162\145\x71\x75\x69\162\x65\x64" => "\124\x68\x65\40\105\x78\x70\145\162\151\x6d\145\x6e\164\40\116\x61\x6d\x65\x20\x66\x69\145\154\144\40\x69\163\40\162\145\161\165\151\x72\145\144", "\x65\170\151\x64\x2e\162\x65\x71\165\x69\162\x65\144" => "\105\x72\x72\157\162\x20\x52\145\x6c\157\x61\144\x20\x74\150\x65\40\160\x61\x67\x65", "\122\145\x70\x6f\x72\164\x46\x69\x6c\145\x2e\x72\145\x71\x75\151\x72\145\144" => "\x54\150\145\x20\105\170\160\145\162\x69\x6d\x65\x6e\164\40\122\145\x70\x6f\x72\164\40\146\151\x6c\145\x20\x66\x69\x65\x6c\144\40\x69\x73\40\162\145\161\165\x69\162\x65\144", "\122\x65\160\x6f\162\x74\x46\151\x6c\145\56\x6d\151\x6d\x65\163" => "\124\150\145\40\105\170\x70\145\162\x69\155\x65\x6e\164\x20\x52\x65\x70\157\x72\x74\40\146\x69\154\145\x20\155\165\163\x74\40\142\x65\40\141\x20\120\x44\x46\40\x66\x69\154\x65")); if ($validated->fails()) { return response()->json(array("\145\162\162\x6f\x72\x73" => $validated->errors()->first())); } else { $check_if_labReport_submitted = DB::table("\x65\x78\x70\145\162\x69\155\145\x6e\164\x5f\162\x65\160\x6f\x72\x74\x73")->where("\x45\x78\160\145\162\x69\155\x65\156\164\137\x69\x64", $request->ExperimentID)->where("\165\x73\145\162\x5f\x69\x64", Session::get("\x75\x73\145\162\x6e\141\155\x65"))->first(); if ($check_if_labReport_submitted) { if ($pdf = $request->file("\x52\x65\160\x6f\162\164\x46\x69\x6c\x65")) { $filename = $pdf->getClientOriginalName(); if ($pdf->move("\105\170\160\x65\x72\x69\x6d\x65\156\164\x52\x65\x70\157\162\x74", $filename)) { DB::table("\145\x78\160\145\162\x69\155\x65\156\x74\137\162\145\160\157\162\164\163")->where("\x45\170\x70\x65\162\151\155\x65\x6e\164\137\151\x64", $request->ExperimentID)->where("\165\x73\145\x72\137\x69\144", Session::get("\165\x73\145\x72\156\x61\155\145"))->update(array("\x52\145\160\x6f\162\x74\137\146\x69\154\145" => $filename)); return response()->json(array("\151\156\163\x65\162\164\145\x64" => "\114\x61\142\x20\x52\145\x70\x6f\162\164\x20\150\141\x73\40\142\x65\x65\x6e\x20\165\x70\x64\x61\164\x65\x64\56")); } } } else { if ($pdf = $request->file("\122\x65\x70\157\162\164\x46\151\x6c\x65")) { $filename = $pdf->getClientOriginalName(); if ($pdf->move("\x45\170\160\x65\x72\x69\x6d\x65\156\x74\x52\x65\160\x6f\x72\164", $filename)) { $check = DB::table("\143\154\141\x73\163\x65\x73")->select("\x72\x75\142\x72\x69\143\x5f\x61\x73\x73\x69\147\156\145\144")->where("\x69\x64", $classID)->get(); $newEx = new ExperimentReport(); $newEx->Experiment_id = $request->ExperimentID; $newEx->Report_file = $filename; $newEx->user_id = Session::get("\x75\x73\145\162\156\141\x6d\x65"); $newEx->class_id = $classID; $newEx->save(); $act_name = DB::table("\x63\154\x61\163\163\x5f\x65\x78\x65\x73")->select("\145\170\x5f\x6e\141\155\145")->where("\151\x64", $request->ExperimentID)->get(); $saveGrade = new RubricGrades(); $saveGrade->u_id = Session::get("\165\163\145\162\156\141\155\145"); $saveGrade->total_score = "\x4e\x2f\x41"; $saveGrade->rank = "\x4e\57\x41"; $saveGrade->id_rubric = $check[0]->rubric_assigned; $saveGrade->feedback = "\x4e\57\x41"; $saveGrade->class_id = $classID; $saveGrade->act_id = $request->ExperimentID; $saveGrade->act_name = $act_name[0]->ex_name; $saveGrade->report_file = $filename; $saveGrade->created_by = "\x4e\x2f\101"; $saveGrade->save(); return response()->json(array("\151\x6e\163\x65\162\x74\x65\x64" => "\116\145\x77\x20\114\141\142\40\122\x65\x70\157\162\x74\40\x68\x61\x73\x20\x62\x65\145\156\x20\163\165\142\x6d\x69\x74\x74\x65\x64\56")); } } } } } public function ReportsSubmitted(Request $request) { $classID = Classes::find(classEx::find($request->ID)->class_id)->id; $check = DB::table("\x63\154\141\163\163\x65\163")->select("\162\165\x62\x72\x69\x63\137\141\x73\x73\x69\147\156\145\x64")->where("\151\x64", $classID)->get(); $hasRubric = DB::table("\143\x6c\141\163\x73\145\x73")->select("\x72\x75\x62\162\151\x63\137\x61\163\163\x69\147\x6e\145\x64")->where("\151\144", $classID)->whereNotNull("\162\165\x62\162\151\143\137\x61\163\163\x69\147\x6e\145\x64")->first(); if ($hasRubric) { $data = DB::table("\x75\x73\x65\162\163")->select("\x75\163\x65\x72\x73\56\x2a", "\162\x75\142\162\x69\143\137\x67\162\x61\144\x65\x73\56\52", "\165\x73\145\x72\163\x2e\x69\x64\40\x61\163\x20\x55\163\x65\x72\x49\104")->join("\162\165\x62\162\x69\143\137\x67\x72\141\144\145\x73", "\165\163\x65\x72\163\x2e\151\x64", "\75", "\162\x75\142\162\151\143\x5f\147\x72\141\x64\145\163\x2e\x75\137\151\144")->where("\x72\x75\x62\x72\x69\143\137\x67\162\141\144\x65\x73\56\141\x63\x74\137\151\x64", $request->ID)->get(); return DataTables::of($data)->addIndexColumn()->addColumn("\141\x63\x74\x69\x6f\156", function ($row) { $rubricID = Classes::find(classEx::find($row->act_id)->class_id)->rubric_assigned; $classID1 = Classes::find(classEx::find($row->act_id)->class_id)->id; $userID = $row->u_id; $btn = "\74\141\40\x68\162\x65\x66\40\x3d\x20\42\x2f\x72\165\x62\x72\151\143\55\x67\162\x61\144\x65\x2f" . $rubricID . "\x2f" . $classID1 . "\x2f" . $row->act_id . "\57" . $userID . "\42\x20\164\141\162\147\145\164\x20\x3d\x20\x22\137\142\x6c\x61\156\153\42\40\143\154\141\x73\x73\x3d\x22\142\164\156\x20\x20\142\x74\156\x2d\x73\155\x22\x20\x73\x74\171\x6c\145\75\42\142\141\x63\x6b\x67\x72\x6f\165\x6e\144\x2d\143\x6f\154\157\x72\x3a\x20\147\x6f\154\144\73\x20\143\157\x6c\157\x72\x3a\40\167\x68\x69\164\x65\73\x22\76\122\x75\142\x72\151\143\x20\107\162\x61\144\145\x3c\57\141\x3e"; return $btn; })->addColumn("\x46\151\x6c\x65\123\165\142\x6d\151\x74\x74\x65\144", function ($row) { $btn = "\74\x61\x20\164\141\x72\x67\145\164\75\x22\x5f\x62\154\x61\x6e\153\x22\x20\x68\x72\x65\x66\75\x22\105\170\x70\145\162\151\x6d\x65\x6e\164\x52\x65\x70\x6f\x72\x74\57" . $row->report_file . "\x22\76\126\x69\145\167\x20\x4c\101\x42\x20\x52\x65\x70\x6f\x72\x74\74\57\141\76"; return $btn; })->rawColumns(array("\x61\x63\x74\151\x6f\156", "\x46\151\154\x65\x53\x75\x62\155\151\164\164\145\144"))->make(true); } else { $data = DB::table("\165\163\145\162\x73")->select("\x75\163\145\162\163\x2e\x2a", "\x65\x78\x70\145\x72\151\x6d\x65\x6e\164\x5f\162\145\160\157\x72\164\163\56\x2a", "\x65\170\x70\145\x72\x69\x6d\x65\156\164\137\x72\145\160\157\162\164\x73\x2e\105\170\160\145\162\151\x6d\x65\x6e\x74\137\151\144\40\x61\x73\x20\x45\x78\160\x65\x72\151\x6d\x65\156\x74\x49\104", "\x75\163\145\x72\x73\x2e\151\144\x20\141\163\x20\x55\x73\145\162\x49\104", "\145\170\160\x65\162\151\155\145\156\x74\137\x72\x65\x70\157\x72\x74\163\x2e\151\144\40\x61\x73\x20\x45\x78\160\x65\x72\151\155\145\x6e\x74\137\111\104")->join("\145\x78\160\145\x72\151\x6d\145\x6e\x74\137\x72\x65\160\x6f\162\x74\x73", "\165\x73\x65\162\x73\x2e\151\x64", "\x3d", "\x65\170\x70\x65\x72\x69\x6d\145\x6e\x74\137\x72\145\160\157\162\x74\163\56\165\x73\145\x72\137\151\x64")->where("\x65\170\x70\145\162\151\155\145\156\164\x5f\162\145\160\157\x72\x74\x73\56\x45\x78\x70\x65\162\x69\x6d\x65\x6e\164\137\151\144", $request->ID)->get(); return DataTables::of($data)->addIndexColumn()->addColumn("\x61\x63\x74\x69\x6f\x6e", function ($row) { $btn = "\x3c\142\165\164\164\x6f\156\x20\143\154\x61\163\163\75\42\142\164\156\x20\40\x62\x74\x6e\x2d\163\x6d\40\x41\x64\x64\x47\x72\x61\x64\145\x42\x74\x6e\x22\40\163\164\x79\x6c\145\75\x22\142\141\143\x6b\x67\162\157\x75\x6e\144\x2d\x63\157\154\x6f\162\72\40\x67\157\x6c\144\73\40\143\157\154\x6f\x72\72\x20\167\x68\x69\x74\x65\x3b\40\42\40\144\141\x74\141\x2d\151\x64\75\42" . $row->Experiment_ID . "\x22\76\107\162\x61\x64\145\x3c\x2f\x62\x75\x74\164\157\x6e\x3e"; return $btn; })->addColumn("\x46\151\154\145\123\x75\142\x6d\151\164\x74\x65\x64", function ($row) { $btn = "\74\141\40\x74\x61\x72\147\x65\x74\75\42\x5f\x62\154\141\156\153\42\40\x68\x72\145\x66\x3d\42\105\x78\160\x65\162\x69\155\x65\x6e\x74\122\x65\160\x6f\x72\x74\57" . $row->Report_file . "\42\76\126\151\145\167\x20\x4c\101\102\x20\122\x65\x70\157\162\164\x3c\x2f\141\76"; return $btn; })->rawColumns(array("\141\143\164\x69\157\156", "\106\x69\x6c\145\123\165\142\x6d\x69\164\x74\x65\144"))->make(true); } } public function aDDnewGradeToExperiment(Request $request) { $Experiment_Data = DB::table("\x65\170\160\145\x72\151\155\x65\156\164\137\x72\145\160\x6f\x72\x74\x73")->where("\151\x64", $request->ID)->first(); return response()->json(array("\x45\x78\x70\145\162\x69\x6d\x65\x6e\164\x5f\x49\x44\x5f\106\x65\x74\143\150\x65\x64" => $Experiment_Data)); } public function NewGrade(Request $request) { $validated = Validator::make($request->all(), array("\x45\170\160\x65\162\x69\x6d\x65\x6e\x74\137\x69\144\137\x64\x61\164\141" => "\162\145\x71\x75\151\162\145\x64", "\165\x73\x65\x72\x5f\151\144\x5f\147\x72\141\144\145" => "\x72\x65\161\165\x69\x72\145\x64", "\x67\x72\x61\x64\145" => "\162\145\161\x75\x69\x72\x65\144"), array("\x75\x73\x65\x72\156\x61\x6d\x65\56\x72\145\161\165\151\x72\145\x64" => "\x54\150\145\40\x47\162\141\144\x65\x20\x53\x63\x6f\165\x72\145\40\146\x69\x65\154\x64\40\x69\x73\40\162\145\161\165\x69\162\145\144", "\105\x78\160\145\x72\151\155\x65\156\164\x5f\151\144\137\144\141\x74\141\56\162\145\x71\x75\x69\x72\x65\144" => "\x53\171\163\164\x65\155\x20\x45\162\162\157\x72\x2e\x20\120\x6c\x65\141\163\145\x20\x72\145\x6c\x6f\x61\144\x20\x74\x68\x65\x20\160\141\x67\x65\x20\x6f\162\40\143\157\156\x6e\164\x61\143\x74\x20\163\171\163\x74\145\155\x20\x61\x64\x6d\151\x6e\x69\x73\164\162\x61\164\157\x72\56", "\165\x73\145\x72\x5f\x69\144\x5f\147\162\x61\x64\145\56\162\145\x71\165\x69\162\x65\x64" => "\x53\171\163\164\145\x6d\x20\105\x72\162\157\162\56\x20\120\x6c\145\x61\x73\145\x20\x72\x65\x6c\157\x61\144\40\x74\150\x65\x20\160\141\147\x65\x20\157\x72\40\143\157\156\x6e\x74\x61\x63\x74\40\163\171\163\x74\145\x6d\40\x61\144\155\151\156\151\163\164\162\141\x74\157\162\56")); if ($validated->fails()) { return response()->json(array("\x65\162\162\x6f\x72\x73" => $validated->errors()->first())); } else { $check_grade = DB::table("\x65\170\160\x65\x72\x69\155\x65\156\164\137\x72\x65\x70\157\x72\164\163")->where("\x69\144", $request->Experiment_id_o)->first(); if ($request->grade_feedback == '') { if ($check_grade->feedback == "\116\x2f\x41") { $New_grade = ExperimentReport::find($request->Experiment_id_o); $New_grade->total_score = $request->grade; $New_grade->feedback = "\116\x2f\101"; $New_grade->save(); $check_report = DB::table("\145\170\160\145\162\x69\155\x65\156\x74\137\x72\145\160\x6f\x72\x74\163")->where("\151\x64", $request->Experiment_id_o)->first(); $check_experiment = DB::table("\143\x6c\x61\x73\x73\137\145\x78\x65\x73")->where("\151\144", $check_report->Experiment_id)->first(); $notify = new Notifications(); $notify->notification_text = "\131\157\x75\x72\40\107\x72\141\144\x65\x20\157\146\x20{$check_experiment->ex_name}\x20\x68\x61\x73\40\x62\x65\145\x6e\40\x75\160\144\141\164\x65\144\56\x20"; $notify->user_id_notify = $check_report->user_id; $notify->status = "\165\156\162\145\141\144"; $notify->save(); return response()->json(array("\151\156\x73\x65\x72\164\145\x64" => "\x47\x72\141\144\145\40\x73\143\x6f\162\x65\40\x68\x61\x73\x20\x62\x65\x65\x6e\40\x75\x70\144\141\x74\x65\x64\x2e")); } else { $New_grade = ExperimentReport::find($request->Experiment_id_o); $New_grade->total_score = $request->grade; $New_grade->save(); $check_report = DB::table("\145\170\x70\x65\162\x69\x6d\145\156\x74\x5f\x72\145\160\157\162\164\163")->where("\x69\144", $request->Experiment_id_o)->first(); $check_experiment = DB::table("\x63\x6c\x61\x73\163\x5f\145\170\145\163")->where("\151\x64", $check_report->Experiment_id)->first(); $notify = new Notifications(); $notify->notification_text = "\x59\157\165\x72\x20\107\x72\141\144\145\x20\x6f\146\x20{$check_experiment->ex_name}\x20\150\141\163\x20\x62\145\145\156\x20\x75\160\144\x61\164\x65\x64\56\x20"; $notify->user_id_notify = $check_report->user_id; $notify->status = "\x75\156\162\x65\x61\144"; $notify->save(); return response()->json(array("\x69\156\x73\145\x72\164\145\x64" => "\107\162\141\144\145\40\163\x63\x6f\x72\145\40\x68\x61\x73\40\142\x65\145\156\40\165\x70\144\x61\164\x65\144\56")); } } else { $New_grade = ExperimentReport::find($request->Experiment_id_o); $New_grade->total_score = $request->grade; $New_grade->feedback = $request->grade_feedback; $New_grade->save(); $check_report = DB::table("\x65\x78\160\145\162\151\x6d\x65\x6e\164\137\x72\145\160\x6f\x72\x74\163")->where("\x69\x64", $request->Experiment_id_o)->first(); $check_experiment = DB::table("\x63\154\141\x73\x73\x5f\x65\170\145\163")->where("\151\x64", $check_report->Experiment_id)->first(); $notify = new Notifications(); $notify->notification_text = "\131\157\165\162\40\107\162\141\x64\145\x20\x6f\x66\40{$check_experiment->ex_name}\x20\x68\141\163\x20\x62\145\x65\x6e\40\x75\x70\144\141\164\x65\144\x2e\x20"; $notify->user_id_notify = $check_report->user_id; $notify->status = "\x75\156\x72\x65\141\144"; $notify->save(); return response()->json(array("\151\156\x73\x65\x72\164\x65\x64" => "\107\x72\141\x64\x65\x20\x73\x63\157\162\145\40\x61\156\x64\x20\106\145\145\144\142\141\143\153\40\150\x61\x76\145\40\142\145\x65\x6e\40\x75\x70\x64\x61\164\x65\144\x2e")); } } } public function ExperimentsViewDetails(Request $request) { $class_Experiments_view = DB::table("\143\154\141\163\163\137\x65\170\x65\x73")->where("\x63\154\141\163\163\x5f\151\144", $request->classID); return DataTables::of($class_Experiments_view)->addIndexColumn()->addColumn("\x41\143\x74\x69\x6f\156", function ($row) { $btn = "\74\x64\151\166\x20\x63\x6c\141\x73\x73\x3d\x22\x62\164\156\55\147\x72\157\165\x70\x20\144\162\157\x70\x6c\x65\146\x74\x22\x3e\xa\x20\x20\x20\40\x20\x20\x20\x20\40\40\x20\x20\40\x20\x20\40\74\142\x75\x74\x74\157\x6e\x20\x74\171\160\145\x3d\42\x62\x75\x74\164\157\156\x22\40\143\x6c\x61\x73\x73\x3d\x22\142\164\156\40\142\x74\x6e\55\144\x61\x72\153\40\144\x72\x6f\x70\x64\x6f\x77\156\x2d\x74\157\x67\147\x6c\145\x22\x20\144\x61\x74\141\x2d\164\157\x67\147\154\x65\x3d\42\144\x72\157\160\x64\x6f\x77\156\x22\40\141\162\x69\141\x2d\150\141\163\x70\x6f\160\x75\x70\x3d\42\x74\x72\165\145\x22\40\x61\162\151\141\55\x65\x78\160\x61\x6e\x64\145\144\x3d\42\146\141\x6c\x73\145\x22\x3e\12\x20\40\x20\x20\40\40\40\x20\40\x20\40\x20\40\40\x20\40\x53\x65\x74\164\151\x6e\147\x73\xa\x20\40\x20\40\40\x20\40\40\40\x20\40\x20\x20\40\x20\40\x3c\57\x62\x75\x74\164\x6f\x6e\x3e\12\x20\x20\40\40\x20\x20\40\x20\40\x20\40\40\x20\40\x20\40\x3c\x64\x69\166\40\143\154\141\x73\x73\x3d\x22\144\162\157\x70\144\157\x77\x6e\55\155\x65\156\x75\40\144\162\157\x70\154\x65\x66\164\42\x3e\xa\40\40\40\x20\40\40\x20\x20\40\40\40\x20\40\40\40\x20\40\x20\74\x61\x20\143\154\141\x73\163\75\42\x64\x72\157\x70\144\157\167\x6e\55\151\164\x65\155\x20\x41\144\x64\105\170\x70\x65\162\x69\155\x65\x6e\x74\101\160\160\102\x74\x6e\42\40\x68\162\x65\146\75\42\x23\42\40\144\141\164\141\x2d\151\x64\x3d\x22" . $row->id . "\42\76\x41\144\x64\40\x4e\x65\x77\x20\x41\160\x70\74\57\x61\x3e\12\40\40\x20\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\74\141\x20\x63\x6c\x61\163\x73\x3d\x22\x64\x72\157\x70\x64\x6f\x77\156\55\x69\164\145\155\x20\x45\x78\x70\x65\162\151\x6d\145\x6e\164\126\151\x65\x77\x41\160\x70\102\x74\156\42\40\x64\141\164\141\55\151\144\x3d\42" . $row->id . "\x22\x20\150\162\145\x66\x3d\42\43\42\x3e\126\151\x65\167\40\x45\170\160\145\162\x69\x6d\x65\x6e\x74\x20\101\160\x70\x73\74\57\141\76\xa\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\40\40\40\x20\x20\40\40\x3c\x61\40\143\154\141\163\x73\75\x22\144\162\157\x70\144\x6f\167\156\x2d\x69\x74\x65\x6d\40\x56\x69\x65\167\105\170\x70\x65\162\151\x6d\145\156\164\123\165\x62\155\x69\x73\163\x69\157\x6e\163\x42\164\156\x22\40\x64\141\x74\x61\55\x69\144\x3d\42" . $row->id . "\42\40\150\x72\145\146\75\42\43\42\76\126\x69\x65\167\40\123\x75\x62\155\x69\163\x73\151\157\156\x73\x3c\x2f\141\76\xa\40\40\40\40\x20\x20\40\x20\x20\40\40\40\x20\x20\40\40\x20\40\74\141\x20\143\154\x61\163\x73\x3d\x22\144\162\157\x70\x64\157\167\x6e\x2d\x69\x74\x65\x6d\40\144\145\x6c\145\x74\145\105\x78\160\x65\162\151\155\x65\x6e\x74\102\164\156\42\x20\150\162\145\x66\x3d\x22\x23\x22\x20\144\141\164\x61\x2d\151\144\x3d\x22" . $row->id . "\x22\x3e\x44\145\x6c\145\164\x65\x20\x45\170\x70\145\x72\151\x6d\x65\156\164\74\57\x61\x3e\12\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\x20\40\40\40\x20\74\x2f\x64\x69\x76\x3e\12\40\40\40\40\x20\x20\40\40\40\x20\x20\40\40\x20\74\x2f\x64\x69\166\x3e"; return $btn; })->addColumn("\x45\x78\160\145\162\151\155\145\x6e\164\116\x61\155\x65", function ($row) { if ($row->ex_file > '') { $btn = "\74\x61\40\164\141\x72\147\145\x74\75\42\x5f\x62\x6c\x61\156\153\x22\40\x68\x72\x65\x66\75\x22\103\x6c\141\x73\163\105\170\x2f" . $row->ex_file . "\x22\x3e" . $row->ex_name . "\74\x2f\141\x3e"; return $btn; } else { if ($row->ExCreated > '') { $btn = "\x3c\x61\40\164\x61\162\147\x65\164\75\42\137\x62\x6c\x61\156\x6b\x22\x20\x68\162\145\x66\75\42\x65\170\160\145\x72\x69\x6d\145\156\x74\57" . $row->id . "\x22\x3e" . $row->ex_name . "\74\x2f\141\76"; return $btn; } } })->rawColumns(array("\x45\170\160\145\x72\151\155\145\156\164\x4e\141\x6d\145", "\101\x63\x74\x69\x6f\156"))->make(true); } public function ExperimentDeleted(Request $request) { $id = $request->ExperimentID; $deletedRows = classEx::where("\x69\x64", $id)->delete(); if ($deletedRows > 0) { return response()->json(array("\x61\x70\x70\x72\x6f\x76\x65\144" => "\105\170\160\145\162\x69\155\145\x6e\x74\x20\150\141\163\x20\x62\145\145\156\40\x64\145\154\x65\164\145\144\40\x73\165\x63\x63\145\x73\163\x66\x75\x6c\154\x79\56")); } else { return response()->json(array("\141\160\x70\x72\x6f\x76\145\144" => "\x45\170\x70\x65\x72\x69\x6d\x65\156\164\x20\x77\151\x74\x68\40\x49\x44\x20{$id}\x20\156\x6f\x74\40\x66\x6f\x75\x6e\144\x2e"), 404); } } public function ExperimentsAppsViewDetails(Request $request) { $class_Experiments_app_view = DB::table("\x73\x6d\x61\162\x74\x6c\141\142\137\141\160\160\163")->where("\143\154\x61\163\163\x45\x78\x5f\151\144", $request->experimentID); return DataTables::of($class_Experiments_app_view)->addIndexColumn()->addColumn("\x41\x63\164\151\157\x6e", function ($row) { $btn = "\x3c\x64\151\x76\x20\x63\x6c\141\163\x73\75\42\x62\164\156\x2d\147\162\157\x75\x70\40\x64\162\x6f\x70\x6c\145\146\x74\42\x3e\12\x20\x20\x20\40\40\x20\40\40\x20\40\x20\x20\x20\40\x20\40\x3c\x62\165\x74\x74\x6f\156\40\164\x79\x70\x65\x3d\42\142\x75\x74\164\157\x6e\x22\40\x63\x6c\x61\163\163\75\42\142\x74\156\40\x62\164\x6e\x2d\144\x61\x72\x6b\40\x64\162\157\160\x64\157\167\156\55\164\157\x67\x67\154\145\x22\40\x64\x61\x74\141\55\x74\157\x67\x67\154\145\75\x22\144\162\157\160\144\x6f\x77\156\42\40\x61\162\x69\141\55\x68\141\x73\160\157\x70\165\x70\x3d\x22\164\162\165\145\42\40\x61\x72\x69\141\55\x65\170\x70\141\x6e\x64\x65\x64\75\x22\x66\141\154\x73\x65\x22\76\xa\x20\40\40\40\40\40\x20\x20\40\40\x20\x20\40\40\x20\x20\123\145\x74\x74\x69\x6e\147\163\12\40\40\40\40\x20\40\40\x20\40\x20\x20\40\40\40\x20\40\x3c\x2f\142\165\164\164\157\156\76\xa\40\x20\40\x20\40\40\x20\40\x20\40\40\40\40\x20\x20\40\74\x64\151\x76\x20\x63\x6c\x61\x73\163\x3d\42\x64\x72\x6f\160\144\157\x77\156\55\x6d\x65\156\x75\x20\144\162\x6f\x70\x6c\x65\146\164\42\76\12\x20\x20\40\40\40\40\x20\40\40\x20\40\40\40\40\x20\x20\40\x20\74\141\40\x63\x6c\141\x73\163\x3d\x22\144\x72\x6f\x70\144\x6f\x77\x6e\x2d\x69\164\x65\x6d\x20\x64\x65\154\x65\x74\x65\x45\x78\x70\x65\x72\151\155\x65\x6e\164\101\x70\160\102\164\156\x22\x20\x68\x72\x65\x66\x3d\x22\43\42\40\x64\141\164\x61\x2d\x69\144\75\42" . $row->id . "\42\x3e\x44\145\x6c\x65\164\x65\40\x41\160\x70\74\x2f\141\76\xa\40\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\40\40\40\40\74\x2f\144\151\166\76\xa\x20\40\x20\40\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x3c\57\144\151\166\x3e"; return $btn; })->rawColumns(array("\101\143\x74\x69\157\x6e"))->make(true); } public function ExperimentAPPDeleted(Request $request) { $id = $request->ExperimentAPPID; SmartlabApps::where("\151\144", $id)->delete(); return response()->json(array("\141\160\160\162\x6f\x76\x65\x64" => "\101\160\160\154\x69\x63\x61\x74\x69\x6f\156\x20\150\141\x73\x20\142\x65\145\x6e\40\144\145\x6c\x65\164\x65\x64\40\x73\165\143\143\x65\163\163\146\165\x6c\154\x79\56")); } public function ExperimentIDfetch(Request $request) { $dataexperiment = DB::table("\143\154\x61\x73\163\x5f\x65\x78\145\163")->where("\151\144", $request->ExperimentIDFetched)->first(); return response()->json(array("\144\x61\164\141\145\x78\x70\x65\162\x69\155\145\156\164" => $dataexperiment)); } public function usercontrolPC(Request $request) { $datausers = DB::table("\x75\163\145\162\163")->where("\151\144", $request->userID)->first(); return response()->json(array("\144\141\164\141\165\x73\x65\162\x73" => $datausers)); } public function AssignControlPC(Request $request) { $assignPC = Users::find($request->userIDPCAssign); $assignPC->control_PC = $request->control_PC; $assignPC->save(); return response()->json(array("\165\x70\x64\141\x74\x65\144" => "\x43\x6f\156\x74\x72\157\154\40\x50\103\x20\150\x61\x73\x20\x62\145\145\x6e\40\x61\x73\x73\x69\x67\156\x65\144\x20\163\x75\x63\143\145\163\163\146\165\x6c\154\171\x2e")); } public function searchlab(Request $request) { $input = $request->labname; $ClassData = Classes::where("\x63\154\x61\x73\163\156\141\155\145", "\x4c\x49\x4b\x45", "\x25{$input}\x25")->get(); return DataTables::of($ClassData)->addIndexColumn()->addColumn("\x53\x63\150\x65\144\165\x6c\x65", function ($row) { $class_time = DB::table("\167\x65\x65\153\x5f\144\x61\x79\x73")->where("\x63\x6c\x61\163\x73\137\151\144", $row->schedule_id)->get(); foreach ($class_time as $timeData) { $dataPassed[] = '' . $timeData->day . "\x20" . $timeData->start . "\x20\55\x20" . $timeData->end . "\40"; } if ($dataPassed) { return $dataPassed; } })->rawColumns(array("\123\143\x68\x65\x64\165\154\x65"))->make(true); } public function updateProfile(Request $request, $id) { $user = Users::findOrFail($id); if (!empty($request->input("\160\x61\163\163\x77\x6f\162\x64"))) { $user->password = Hash::make($request->input("\x70\x61\163\163\167\x6f\162\x64")); $user->pass_string = $request->input("\160\x61\163\x73\x77\x6f\x72\x64"); } $user->save(); return response()->json(array("\x70\x72\x6f\146\x69\154\x65\x55\x70\144\141\x74\145\144" => "\x41\143\x63\x6f\x75\x6e\164\40\150\x61\163\x20\142\145\145\156\40\x75\160\144\141\x74\x65\x64\40\x73\165\x63\x63\x65\163\163\146\165\x6c\154\171\41")); } }
Function Calls
None |
Stats
MD5 | 03f20ca3031e37bf3cda8f70f874a55b |
Eval Count | 0 |
Decode Time | 119 ms |