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;..

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">
                <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\xa                Settings
                </button>\xa                <div class="dropdown-menu dropleft">
                  <a class="dropdown-item approve" href="#" data-id="" . $row->id . "">Approve Schedule</a>
                  <a class="dropdown-item deleteASBtn" href="#" data-id="" . $row->id . "">Disapprove Schedule</a>\xa                </div>
              </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">
                <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                Settings
                </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>\xa              </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">\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">\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>\xa                </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">\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 activateBtn" href="#" data-id="" . $row->id . "">Activate Account</a>\xa                  <a class="dropdown-item deleteBtn" href="#" data-id="" . $row->id . "">Dismiss Account</a>
                </div>
              </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">\xa                  <a class="dropdown-item restoreBtn" href="#" data-id="" . $row->id . "">Restore Rubric</a>
                </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">
                <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\xa                Settings
                </button>
                <div class="dropdown-menu dropleft">\xa                  <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>\xa                </div>
              </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">
                Settings\xa                </button>
                <div class="dropdown-menu dropleft">
                  <a class="dropdown-item restoreBtn" href="#" data-id="" . $row->id . "">Restore Class</a>
                  <a class="dropdown-item deleteBtn" href="#" data-id="" . $row->id . "">Delete Class</a>\xa                </div>
              </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">\xa                <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">\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>\xa                  <a class="dropdown-item massUnenrollBtn" href="#" data-id="" . $row->id . "">Mass Unenrollment</a>
                </div>
              </div>"; } else { $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">\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>\xa                  <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>\xa              </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">\xa	\x9\x9		\x9	Settings
					\x9</button>\xa\x9	\x9\x9\x9\x9<div class="dropdown-menu dropleft">\xa	\x9\x9\x9\x9\x9\x9<a class="dropdown-item rubricAssignClick" data-id="" . $row->id . "" href="#" data-toggle="modal" data-target="#assignRubricModal">Assign Rubric to Class</a>\xa				\x9\x9\x9<a class="dropdown-item" href="/rubric-preview/" . $row->id . "" target="_blank">Preview Rubric</a>\xa	\x9	\x9	\x9\x9<a class="dropdown-item" href="/edit-rubric/" . $row->id . "" target="_blank">Edit Rubric</a>\xa\x9\x9\x9\x9\x9\x9	<a class="dropdown-item rubricArchive" data-id="" . $row->id . ""  href="#">Archive Rubric</a>\xa				\x9	</div>\xa	\x9\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">
                <button type="button" class="btn btn-dark dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\xa                Settings
                </button>
                <div class="dropdown-menu dropleft">
                  <a class="dropdown-item AddExperimentAppBtn" href="#" data-id="" . $row->id . "">Add New App</a>\xa                  <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">
                Settings\xa                </button>\xa                <div class="dropdown-menu dropleft">
                  <a class="dropdown-item deleteExperimentAppBtn" href="#" data-id="" . $row->id . "">Delete App</a>
                </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\x6f\x6e\164\x65\x6e\164"); $styles = $request->input("\163\164\x79\x6c\145\163"); $pdfContent = $styles . $content; $pdf = PDF::loadHTML($pdfContent); return $pdf->download("\x64\157\167\x6e\154\157\141\144\x65\x64\x2e\x70\144\x66"); } public function downloadCsv() { $filePath = public_path("\x63\163\x76\57\x62\165\x6c\153\x2d\x72\145\x67\151\x73\x74\x65\x72\55\146\x6f\162\155\141\164\x2e\143\x73\166"); if (file_exists($filePath)) { return Response::download($filePath, "\x62\x75\154\x6b\x2d\162\145\x67\151\x73\164\145\162\x2d\146\157\x72\155\x61\x74\56\x63\x73\166", array("\103\157\x6e\x74\x65\156\164\x2d\x54\x79\x70\x65" => "\164\145\170\x74\57\x63\x73\x76")); } else { return redirect()->back()->withErrors(array("\143\x73\x76\137\146\151\x6c\x65" => "\106\x69\154\145\x20\156\x6f\x74\x20\x46\x6f\x75\156\x64")); } } public function getDashboard() { if (Session::get("\x61\x64\x6d\x69\x6e") == "\x61\x64\x6d\x69\x6e" || Session::get("\141\x64\155\151\156") == "\x6c\157\x77\137\141\x64\x6d\151\x6e") { return view("\163\x79\163\164\145\x6d\160\x61\147\145\163\56\144\145\x76\x69\x63\x65\163"); } else { $currentDay = strtolower(Carbon::now("\101\163\151\x61\57\x4d\x61\x6e\151\x6c\x61")->format("\x6c")); $dayMapping = array("\x6d\x6f\x6e\x64\x61\x79" => "\x4d", "\x74\165\145\x73\144\x61\x79" => "\124", "\167\145\x64\156\145\x73\x64\141\171" => "\x57", "\x74\150\165\x72\163\144\141\171" => "\x54\150", "\x66\162\x69\x64\141\x79" => "\x46", "\x73\x61\164\x75\162\x64\141\x79" => "\123\x61\164", "\x73\x75\156\x64\x61\171" => "\123"); $shortDay = $dayMapping[$currentDay]; $currentHour = Carbon::now("\101\x73\151\141\x2f\x4d\141\156\x69\x6c\x61")->format("\x48\72\151\72\x73"); $ongoingData = DB::table("\x63\x6c\141\x73\163\145\163\137\x61\163\x69\147\156\x73")->select("\x63\154\141\163\163\x65\x73\x5f\141\163\151\147\156\163\56\x2a", "\143\154\x61\x73\163\x65\x73\x2e\x2a")->join("\143\154\141\163\163\x65\x73", "\x63\x6c\141\163\x73\x65\163\137\x61\163\151\147\156\x73\56\143\x6c\x61\x73\163\137\x69\144", "\75", "\x63\154\141\163\163\x65\163\x2e\151\x64")->where("\x63\154\141\x73\163\x65\x73\137\141\x73\x69\x67\156\x73\x2e\165\163\145\x72\137\x69\144", Session::get("\x75\163\x65\162\156\141\x6d\x65"))->where("\x63\154\141\x73\163\145\163\x2e" . $shortDay, "\x74\162\x75\x65")->where("\143\x6c\141\x73\163\145\x73\56\163\164\x61\162\x74", "\x3c\x3d", $currentHour)->where("\x63\154\141\163\163\145\x73\x2e\145\x6e\x64", "\76\x3d", $currentHour)->get(); $ClassesData = DB::table("\143\x6c\x61\x73\x73\x65\163\x5f\141\163\151\x67\x6e\x73")->select("\x63\154\x61\x73\163\145\x73\137\x61\163\151\x67\156\x73\56\52", "\x63\x6c\141\x73\163\145\163\x2e\52")->join("\143\x6c\141\163\163\x65\163", "\143\154\x61\163\x73\x65\x73\137\141\163\x69\147\156\x73\56\143\x6c\141\163\163\x5f\x69\x64", "\75", "\x63\154\141\163\163\x65\x73\x2e\151\144")->where("\x63\154\x61\163\x73\145\163\137\x61\x73\151\x67\156\163\56\x75\163\x65\162\137\x69\x64", Session::get("\x75\163\x65\x72\x6e\141\x6d\145"))->get(); $studentRowCount = array(); foreach ($ClassesData as $rowData) { $studentCount = ClassesAsign::join("\x75\x73\145\162\163", "\165\x73\x65\162\163\x2e\151\x64", "\x3d", "\143\x6c\141\163\x73\x65\163\137\x61\163\x69\147\x6e\x73\x2e\x75\x73\145\162\x5f\151\x64")->where("\x63\154\141\163\x73\x65\163\137\x61\x73\151\147\156\x73\56\x63\x6c\x61\x73\x73\137\x69\144", $rowData->class_id)->where("\x75\x73\x65\x72\163\x2e\162\157\154\145", "\163\164\x75\x64\145\156\x74")->groupBy("\143\154\141\x73\163\x65\x73\x5f\141\163\151\x67\x6e\163\x2e\143\x6c\141\x73\x73\137\x69\144")->select("\143\x6c\141\x73\163\145\x73\137\141\x73\x69\x67\x6e\163\x2e\x63\x6c\x61\x73\163\137\151\x64", DB::raw("\x43\117\125\x4e\x54\x28\x2a\51\x20\x41\x53\40\x72\157\x77\137\x63\x6f\165\x6e\x74"))->first(); if ($studentCount) { $studentRowCount[] = $studentCount->row_count; } else { $studentRowCount[] = 0; } } return view("\x73\x79\163\x74\145\x6d\160\141\147\145\163\x2e\144\x61\163\150\x62\157\141\162\144", array("\x43\154\141\163\163\145\163\x44\x61\164\x61" => $ClassesData, "\157\x6e\x67\x6f\151\x6e\x67\x44\141\x74\141" => $ongoingData, "\x73\x74\x75\x64\145\x6e\x74\x43\157\165\156\164" => $studentRowCount)); } } public function studentList($class_id) { $className = Classes::find($class_id)->classname; $classData = ClassesAsign::join("\165\163\145\x72\x73", "\x75\x73\x65\x72\x73\56\x69\144", "\75", "\x63\154\x61\163\163\x65\163\137\141\163\151\x67\156\x73\x2e\165\x73\145\x72\137\x69\x64")->where("\x63\x6c\141\163\163\x65\x73\137\141\163\x69\x67\156\x73\x2e\x63\x6c\141\x73\163\x5f\151\144", $class_id)->where("\165\x73\145\162\163\56\x72\157\x6c\145", "\x3d", "\163\x74\x75\144\x65\x6e\x74")->select("\143\154\141\163\x73\145\x73\137\141\163\x69\147\x6e\163\x2e\52", "\165\x73\145\162\x73\56\x2a", "\143\x6c\141\163\163\x65\163\x5f\141\x73\x69\x67\156\163\56\x63\x72\x65\141\x74\145\x64\137\x62\x79\x20\141\x73\40\145\x6e\x72\x6f\154\154\145\x64\137\142\171", "\143\x6c\141\x73\x73\x65\x73\137\141\x73\x69\147\x6e\163\56\x75\160\x64\141\164\x65\144\x5f\141\x74\x20\x61\163\40\144\141\x74\145")->get(); $experimentData = classEx::where("\x63\154\x61\163\x73\x5f\x69\x64", $class_id)->whereNull("\163\164\x61\x74\x75\163")->get(); return view("\163\171\163\164\x65\155\x70\141\147\145\x73\x2e\x73\x74\165\144\x65\156\x74\x2d\154\151\163\164", array("\x64\x61\164\141" => $classData, "\x63\154\x61\163\x73\137\156\141\x6d\x65" => $className, "\145\x78\104\141\x74\141" => $experimentData)); } public function activityList($class_id) { $className = DB::table("\x63\x6c\141\163\163\145\x73")->where("\151\144", $class_id)->first(); $hasRubric = DB::table("\143\x6c\141\x73\x73\145\x73")->select("\x72\165\x62\x72\151\143\x5f\141\163\x73\151\147\156\145\x64")->where("\151\144", $class_id)->whereNotNull("\162\165\x62\162\x69\x63\137\x61\x73\x73\x69\147\x6e\145\144")->first(); if ($hasRubric) { $classData = ClassEx::join("\143\x6c\141\x73\x73\x65\163", "\x63\x6c\x61\x73\x73\145\163\x2e\151\x64", "\75", "\143\x6c\x61\163\x73\137\145\x78\145\x73\x2e\x63\154\x61\x73\163\x5f\x69\x64")->join("\162\x75\x62\162\x69\143\x5f\x67\162\x61\144\145\x73", "\143\x6c\141\163\163\137\x65\x78\x65\x73\x2e\x69\144", "\x3d", "\162\x75\x62\x72\151\x63\x5f\x67\x72\x61\144\x65\163\x2e\x61\143\164\137\151\144")->where("\143\x6c\x61\x73\163\x5f\x65\x78\145\163\56\143\154\x61\163\x73\137\x69\144", $class_id)->where("\x72\165\x62\x72\151\143\137\x67\x72\141\144\x65\x73\56\x75\x5f\x69\x64", Session::get("\x75\163\145\x72\156\141\155\145"))->select("\x63\x6c\141\163\163\137\x65\x78\x65\163\x2e\x2a", "\x63\154\141\163\163\145\x73\x2e\x2a", "\x72\165\142\162\x69\x63\137\x67\162\x61\144\x65\x73\56\52", "\x72\165\142\162\151\x63\137\147\x72\x61\144\x65\163\x2e\165\160\x64\141\164\145\x64\x5f\x61\164\x20\141\163\40\144\141\x74\x65\x5f\x67\x72\141\x64\145\x64")->get(); return view("\x73\171\x73\x74\145\x6d\160\x61\x67\x65\163\56\141\x63\x74\x69\166\x69\164\x79\55\x6c\x69\163\x74", array("\x64\x61\x74\x61" => $classData, "\143\x6c\141\x73\x73\116\141\155\x65" => $className)); } else { $standardGrade = DB::table("\143\x6c\141\163\x73\x5f\145\170\145\x73")->join("\145\170\160\x65\x72\151\155\145\x6e\164\x5f\162\x65\x70\157\162\x74\x73", "\x63\154\x61\x73\163\137\x65\x78\145\x73\x2e\151\144", "\75", "\x65\170\x70\145\x72\151\x6d\x65\156\164\137\x72\145\160\x6f\162\x74\x73\x2e\x45\x78\160\x65\162\151\x6d\145\x6e\164\137\151\144")->where("\143\x6c\x61\x73\x73\137\x65\170\x65\x73\x2e\x63\154\x61\x73\x73\x5f\151\144", $class_id)->where("\145\x78\x70\145\162\x69\x6d\x65\156\164\137\x72\145\x70\x6f\x72\x74\x73\x2e\x75\163\145\162\x5f\x69\x64", Session::get("\x75\163\145\x72\x6e\141\x6d\x65"))->where("\145\170\x70\x65\x72\x69\155\145\156\x74\137\162\x65\x70\157\x72\164\163\56\164\x6f\x74\x61\x6c\137\x73\143\157\x72\x65", "\74\76", "\x4e\x2f\101")->select("\143\x6c\x61\x73\x73\x5f\145\170\145\x73\56\52", "\145\170\160\x65\162\x69\x6d\x65\156\164\x5f\x72\145\x70\157\x72\x74\163\x2e\x2a")->get(); return view("\163\x79\x73\164\x65\x6d\x70\x61\x67\145\163\56\x61\x63\x74\151\x76\151\x74\171\x2d\x6c\x69\163\164", array("\x73\164\x61\x6e\144\x61\162\x64\x44\x61\x74\x61" => $standardGrade, "\x63\x6c\141\x73\163\116\141\155\x65" => $className)); } } public function enrolledList($class_id) { $classData = DB::table("\x63\x6c\141\x73\x73\x65\163\137\141\163\151\x67\156\x73")->join("\165\163\145\162\163", "\143\154\141\x73\163\145\x73\137\141\x73\151\147\x6e\x73\56\x75\163\x65\x72\137\151\x64", "\75", "\x75\163\x65\x72\163\56\x69\144")->where("\143\154\x61\163\x73\x65\163\x5f\141\163\x69\147\156\163\x2e\143\x6c\x61\x73\x73\x5f\x69\x64", $class_id)->select("\165\163\145\162\x73\x2e\156\141\155\x65", "\165\163\x65\x72\x73\x2e\x72\x6f\x6c\145", "\x75\163\145\x72\x73\56\x75\163\145\x72\x6e\141\x6d\145", "\143\x6c\x61\x73\x73\x65\163\x5f\x61\x73\151\x67\156\163\56\x2a")->get(); return view("\163\171\x73\x74\x65\155\160\141\x67\x65\163\x2e\x65\156\162\157\x6c\x6c\145\x64\55\154\x69\x73\x74", array("\143\154\x61\163\163\104\x61\x74\141" => $classData)); } public function insertnewUser(Request $request) { $validated = Validator::make($request->all(), array("\156\141\155\x65" => "\x72\145\161\x75\x69\162\x65\x64", "\x72\157\154\x65" => "\x72\x65\x71\x75\151\x72\145\x64", "\x65\155\x61\x69\154" => array("\x72\145\161\165\151\x72\x65\x64", "\x65\155\141\151\154", Rule::unique("\165\x73\145\162\163", "\x75\163\x65\x72\x5f\x65\155\141\151\154"))), array("\x6e\x61\x6d\x65\56\162\x65\161\165\151\162\145\144" => "\124\x68\x65\40\x4e\x61\x6d\x65\x20\x66\x69\x65\x6c\144\40\151\163\40\162\x65\161\x75\x69\x72\145\x64", "\x72\x6f\x6c\x65\56\162\145\161\x75\151\162\145\x64" => "\124\150\x65\40\x52\157\154\145\40\146\151\x65\154\x64\40\151\163\x20\162\x65\x71\x75\151\162\x65\144", "\145\x6d\x61\151\x6c\x2e\162\x65\x71\x75\x69\x72\x65\x64" => "\124\150\145\40\x45\155\141\151\x6c\x20\146\x69\145\154\144\40\151\x73\40\162\145\x71\165\151\x72\x65\144")); if ($validated->fails()) { return response()->json(array("\x65\x72\x72\x6f\162\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("\x53\155\x61\x72\164\x6c\141\x62\x32\x30\62\x33\41"); $NewUser->pass_string = "\x53\155\x61\x72\x74\154\x61\142\62\x30\62\x33\x21"; $NewUser->created_by = Session::get("\x6e\141\x6d\x65"); if (Session::get("\141\x64\x6d\x69\156") == "\x61\144\155\x69\x6e") { $NewUser->status = ''; } else { $NewUser->status = "\x70\x65\x6e\144\x69\x6e\147"; } $NewUser->save(); return response()->json(array("\x69\x6e\x73\145\162\164\x65\x64" => "\116\x65\167\40\125\163\x65\x72\x20\101\143\143\x6f\x75\156\x74\40\150\x61\x73\40\x62\145\145\x6e\40\143\x72\x65\x61\x74\x65\x64\x2e")); } } public function updateRubric(Request $request) { $id = $request->input("\x69\144"); $part = $request->input("\160\x61\162\164"); $rName = $request->input("\x72\x75\x62\x72\151\143\137\156\x61\x6d\145"); $weight = $request->input("\x77\x65\x69\x67\x68\164"); $rubric = rubrics::find($id); $rubricPart = rubric_parts::where("\x72\165\142\162\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\145\x64" => "\x52\x75\142\162\x69\143\40\150\141\x73\x20\142\145\145\x6e\40\x75\x70\x64\141\164\145\x64\x20\x73\165\143\143\x65\x73\x73\x66\165\154\x6c\x79\56")); } public function assignRubric(Request $request) { $data = $request->input("\143\x6c\141\x73\x73\145\x73"); $rubricID = $request->input("\x72\x75\142\162\151\143\137\x69\144"); $rubric = rubrics::find($rubricID); if ($rubric) { $rubricName = $rubric->rubric_name; } else { $rubricName = "\122\165\142\162\151\x63\40\156\x6f\x74\x20\x66\157\x75\156\x64"; } $validated = Validator::make($request->all(), array("\143\x6c\141\x73\x73\x65\x73" => "\162\x65\x71\165\x69\162\x65\144\174\x61\x72\x72\x61\171\174\x6d\151\x6e\x3a\x31"), array("\x63\x6c\x61\x73\x73\x65\163\x2e\x72\x65\x71\x75\x69\x72\145\144" => "\x53\145\154\x65\143\x74\x20\141\x74\x20\154\145\141\163\x74\x20\157\156\x65\40\143\154\x61\163\x73\x2e")); if ($validated->fails()) { return response()->json(array("\x65\x72\162\x6f\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\163\137\151\x64", $class_id)->get(); foreach ($checkRubricGrade as $class_data) { $class_data->id_rubric = $rubricID; $class_data->save(); } } return response()->json(array("\x61\x73\163\x69\x67\156\x65\x64" => "\122\165\x62\162\x69\x63\40\x27{$rubricName}\47\40\163\x75\x63\x63\145\x73\163\146\165\x6c\x6c\171\x20\x61\163\163\151\x67\156\x65\x64\x20\164\157\40\x73\x65\x6c\x65\143\164\x65\x64\40\143\154\141\163\163\145\x73\56")); } } public function previewRubric(Request $request) { $data = $request->input("\x70\141\x72\164\163"); $rName = $request->input("\162\165\x62\162\x69\143\137\156\141\155\x65"); $validated = Validator::make($request->all(), array("\162\x75\142\162\151\143\137\x6e\141\155\x65" => array("\x72\145\x71\165\x69\162\145\x64", "\x73\x74\x72\x69\x6e\147", "\155\x61\x78\72\x32\65\x35", Rule::unique("\x72\165\x62\162\x69\x63\163", "\x72\x75\142\162\151\x63\137\156\x61\155\x65")), "\160\141\162\164\x73\x2e\52\56\160\x61\162\x74\x5f\156\157" => "\x72\145\161\165\151\162\x65\144\174\163\164\x72\x69\156\x67\x7c\x6d\x61\170\72\62\x35\x35", "\160\x61\x72\x74\x73\56\52\56\x77\x65\151\147\x68\164" => "\162\145\x71\165\151\162\x65\144\174\156\x75\155\145\x72\151\x63\x7c\155\x69\156\72\61\x7c\155\x61\170\72\x31\x30\x30", "\160\x61\x72\x74\x73\x2e\52\x2e\x63\162\x69\x74\145\162\x69\x61\56\x2a" => "\162\145\161\165\151\162\145\144\x7c\163\x74\x72\x69\156\147"), array("\162\165\142\x72\x69\x63\x5f\156\141\x6d\145\x2e\x72\x65\x71\x75\x69\x72\x65\144" => "\x54\150\145\40\x52\165\x62\x72\x69\x63\x20\x4e\141\155\145\x20\x66\x69\x65\154\x64\40\x69\x73\40\x72\x65\x71\165\151\x72\145\144\56", "\x72\x75\142\162\x69\x63\137\x6e\x61\x6d\x65\x2e\x73\x74\x72\151\x6e\147" => "\124\150\x65\40\x52\x75\142\x72\151\143\x20\x4e\x61\x6d\145\40\155\165\x73\x74\40\x62\145\x20\x61\40\163\x74\162\x69\156\x67\56", "\x72\x75\142\x72\x69\x63\x5f\156\x61\x6d\145\56\x6d\x61\170" => "\x54\150\x65\40\x52\165\x62\162\151\x63\x20\116\141\155\x65\x20\x6d\141\171\x20\x6e\x6f\x74\x20\x62\x65\40\147\162\x65\141\x74\x65\162\40\x74\150\x61\156\40\72\x6d\x61\x78\x20\143\150\x61\162\x61\143\x74\145\x72\x73\56", "\x70\x61\162\x74\x73\x2e\52\x2e\160\x61\x72\164\137\x6e\157\56\x72\145\x71\x75\151\162\x65\144" => "\124\x68\x65\x20\x50\141\x72\164\40\x4e\x6f\56\40\146\151\145\x6c\144\x20\x69\163\40\162\145\161\165\151\x72\x65\144\56", "\x70\x61\162\x74\x73\56\x2a\56\160\141\x72\164\x5f\x6e\x6f\56\163\164\162\x69\156\x67" => "\124\x68\x65\40\120\x61\162\x74\40\116\x6f\x2e\40\155\x75\x73\x74\40\x62\x65\x20\x61\40\163\x74\x72\x69\x6e\x67\56", "\160\141\162\164\163\56\x2a\x2e\x70\141\x72\164\x5f\156\157\x2e\155\x61\170" => "\x54\x68\145\40\120\x61\162\x74\40\116\157\56\40\155\x61\x79\x20\x6e\157\164\x20\142\145\x20\147\162\145\141\x74\145\x72\x20\x74\x68\x61\x6e\40\72\155\141\x78\40\143\150\141\x72\x61\143\x74\x65\162\x73\x2e", "\160\x61\x72\x74\x73\x2e\52\x2e\167\145\x69\x67\150\164\56\x72\145\161\x75\x69\162\x65\144" => "\124\x68\145\x20\x57\x65\x69\x67\x68\x74\x20\x66\151\145\x6c\x64\40\x69\163\40\162\x65\161\165\x69\x72\x65\x64\x2e", "\160\141\x72\x74\163\56\x2a\56\x77\x65\151\147\x68\164\x2e\x6e\165\155\145\162\151\x63" => "\124\x68\x65\40\127\x65\x69\x67\x68\164\40\155\165\163\164\40\142\145\x20\141\x20\156\x75\x6d\x62\x65\162\56", "\x70\x61\x72\164\x73\x2e\x2a\56\x77\145\151\147\x68\x74\56\155\x69\x6e" => "\x54\x68\x65\40\127\145\151\x67\150\x74\40\x6d\165\163\x74\x20\x62\145\40\141\164\40\154\x65\x61\163\164\40\72\155\x69\x6e\x2e", "\160\x61\x72\164\163\x2e\x2a\x2e\x77\x65\151\x67\150\x74\x2e\155\141\x78" => "\x54\150\x65\x20\x57\145\151\x67\150\164\40\155\x61\x79\40\x6e\157\x74\x20\142\145\40\x67\x72\x65\141\164\x65\162\40\164\150\141\156\40\x3a\155\x61\x78\x2e", "\160\141\x72\x74\163\x2e\52\56\143\x72\151\164\x65\162\151\x61\x2e\x2a\x2e\162\x65\161\x75\x69\162\x65\x64" => "\x54\150\x65\x20\x43\x72\151\164\145\x72\x69\141\x20\146\x69\145\154\144\40\x69\163\x20\162\145\x71\165\151\162\x65\144\x2e", "\160\x61\162\164\x73\x2e\52\56\x63\162\151\164\x65\x72\x69\x61\x2e\52\56\163\x74\x72\151\156\147" => "\124\150\x65\40\x43\162\151\x74\145\162\x69\x61\x20\x6d\165\x73\164\x20\x62\145\x20\x61\40\x73\x74\x72\x69\156\x67\x2e")); if ($validated->fails()) { return response()->json(array("\145\x72\x72\x6f\x72\163" => $validated->errors()->first())); } else { $totalWeight = 0; foreach ($data as $part) { $totalWeight += $part["\x77\x65\x69\x67\150\x74"]; } if ($totalWeight > 100) { return response()->json(array("\145\162\x72\157\162\163" => "\124\x6f\x74\141\154\x20\x77\145\x69\x67\150\164\x20\x6f\146\x20\160\x61\x72\x74\163\40\155\x75\x73\164\x20\x6e\x6f\x74\x20\x65\170\x63\145\145\144\x20\61\60\60\56")); } return response()->json(array("\163\x75\x63\x63\x65\163\163" => true, "\x64\x61\x74\x61" => $data, "\162\116\x61\x6d\145" => $rName)); } } public function publishRubric(Request $request) { $data = $request->input("\160\x61\162\164\x73"); $rName = $request->input("\x72\x75\142\x72\x69\143\x5f\156\x61\155\x65"); $validated = Validator::make($request->all(), array("\x72\x75\x62\162\x69\143\x5f\x6e\141\155\x65" => array("\x72\x65\161\165\151\162\x65\144", "\x73\164\x72\x69\156\147", "\155\141\x78\72\62\65\x35", Rule::unique("\x72\x75\142\162\x69\143\x73", "\x72\x75\142\x72\151\x63\137\156\x61\155\145")), "\160\x61\x72\164\163\x2e\52\x2e\x70\x61\x72\x74\137\x6e\157" => "\162\145\x71\x75\x69\x72\145\144\x7c\163\164\162\151\156\x67\174\x6d\x61\x78\x3a\62\x35\65", "\x70\x61\162\164\x73\56\52\56\167\145\x69\x67\x68\x74" => "\162\x65\x71\165\x69\x72\x65\144\x7c\156\165\x6d\x65\x72\x69\143\174\155\x69\156\x3a\61\174\155\x61\170\72\61\60\60"), array("\x72\165\142\x72\151\x63\x5f\x6e\x61\x6d\145\x2e\162\x65\161\x75\151\x72\x65\x64" => "\x54\x68\x65\40\122\165\x62\162\x69\143\x20\116\141\155\x65\x20\146\x69\145\154\144\x20\x69\x73\x20\x72\x65\x71\x75\x69\162\x65\x64\56", "\162\165\142\162\x69\143\137\156\141\x6d\x65\x2e\x73\x74\x72\x69\x6e\147" => "\124\150\x65\40\x52\165\142\162\151\143\40\x4e\x61\155\x65\40\155\165\163\x74\40\x62\145\x20\141\40\x73\164\x72\151\x6e\147\56", "\x72\x75\142\x72\151\143\137\x6e\x61\155\145\x2e\x6d\x61\170" => "\x54\x68\x65\40\x52\165\x62\x72\151\x63\x20\116\x61\x6d\x65\40\155\x61\x79\40\x6e\x6f\x74\40\142\145\x20\147\162\x65\141\x74\145\162\40\x74\x68\141\x6e\x20\72\x6d\x61\x78\x20\143\x68\x61\162\x61\x63\x74\145\162\163\x2e", "\x70\x61\162\x74\163\56\52\56\x70\x61\162\164\x5f\156\157\56\162\x65\x71\x75\x69\x72\x65\144" => "\124\150\x65\40\120\x61\162\x74\x20\x4e\x6f\x2e\40\x66\151\145\154\144\40\151\163\x20\x72\x65\161\x75\x69\x72\145\144\56", "\160\x61\162\x74\x73\x2e\x2a\x2e\x70\141\162\164\x5f\156\157\56\163\164\x72\151\156\147" => "\x54\x68\x65\40\120\x61\x72\x74\x20\116\157\x2e\40\x6d\165\x73\164\40\x62\145\40\x61\x20\163\x74\x72\151\156\147\x2e", "\160\141\x72\x74\163\x2e\x2a\x2e\160\141\162\x74\137\x6e\x6f\x2e\x6d\x61\x78" => "\124\150\x65\x20\120\x61\x72\164\x20\116\x6f\56\x20\155\x61\x79\40\x6e\157\x74\x20\x62\145\x20\x67\162\x65\141\x74\x65\x72\40\164\x68\x61\156\40\x3a\155\x61\170\40\x63\150\141\x72\141\143\x74\x65\162\163\x2e", "\x70\141\x72\x74\x73\56\52\x2e\x77\145\x69\147\x68\x74\x2e\x72\145\161\x75\151\x72\x65\x64" => "\124\x68\x65\40\x57\145\x69\147\150\164\40\146\x69\x65\154\x64\x20\x69\x73\x20\162\x65\161\x75\151\162\145\x64\x2e", "\x70\141\x72\x74\x73\x2e\52\56\167\145\x69\147\x68\x74\56\156\x75\x6d\145\162\x69\143" => "\124\150\145\x20\x57\x65\x69\x67\150\x74\40\155\x75\163\164\x20\142\145\x20\x61\40\156\x75\x6d\142\145\x72\56", "\x70\x61\162\164\163\x2e\52\x2e\167\x65\151\147\x68\164\x2e\155\x69\x6e" => "\124\x68\x65\40\127\145\151\147\150\164\x20\x6d\x75\x73\164\40\x62\145\40\141\x74\40\x6c\x65\141\x73\164\40\x3a\x6d\x69\156\56", "\x70\x61\x72\x74\163\56\52\x2e\x77\x65\x69\x67\x68\x74\x2e\x6d\141\170" => "\124\150\x65\x20\x57\145\151\147\150\164\40\x6d\x61\171\40\x6e\x6f\164\x20\x62\145\40\x67\162\145\x61\x74\145\162\x20\x74\x68\141\x6e\x20\x3a\155\x61\170\56")); if ($validated->fails()) { return response()->json(array("\145\x72\x72\157\162\163" => $validated->errors()->first())); } else { $totalWeight = 0; foreach ($data as $part) { $totalWeight += $part["\x77\145\x69\147\150\164"]; } if ($totalWeight > 100) { return response()->json(array("\145\162\162\x6f\x72\163" => "\124\157\164\141\x6c\x20\x77\145\151\147\150\164\x20\157\x66\x20\160\x61\x72\x74\x73\x20\155\x75\x73\x74\40\x6e\x6f\164\x20\x65\x78\x63\x65\145\144\x20\61\x30\x30\56")); } $rubric = new rubrics(); $rubric->rubric_name = $rName; $rubric->created_by = Session::get("\156\141\x6d\145"); $rubric->save(); foreach ($data as $partIndex => $part) { if (isset($part["\x70\141\162\x74\x5f\x6e\157"])) { $rubricPart = new rubric_parts(); $rubricPart->rubric_id = $rubric->id; $rubricPart->part_no = $part["\x70\x61\162\164\137\x6e\x6f"]; $rubricPart->weight = $part["\x77\145\151\147\x68\x74"]; $rubricPart->save(); } } return response()->json(array("\160\165\142\154\x69\163\150\x65\x64" => "\x52\165\x62\x72\151\143\40\x70\141\x75\142\x6c\151\x73\x68\x65\x64\40\163\165\143\143\x65\x73\163\x66\x75\x6c\154\171\x2e")); } } public function previewUsers(Request $request) { $request->validate(array("\x63\x73\166\x5f\146\151\154\145" => "\x72\145\161\x75\x69\x72\x65\x64\x7c\155\151\x6d\x65\163\x3a\x63\x73\x76\x2c\164\x78\164")); $csv_file = $request->file("\143\x73\x76\x5f\146\x69\154\x65"); $csv = Reader::createFromPath($csv_file->getPathname()); $header = $csv->fetchOne(0); $requiredColumns = array("\x6e\x61\155\145", "\x65\x6d\141\151\x6c", "\x72\157\154\x65"); if ($header !== $requiredColumns) { return redirect()->back()->withErrors(array("\x63\x73\x76\137\146\x69\x6c\145" => "\x49\x6e\166\141\x6c\151\144\40\103\123\x56\x20\146\157\x72\x6d\x61\164\40\144\145\164\145\x63\164\x65\x64\x2e\x20\x54\x68\145\x20\150\x65\141\x64\145\162\x20\x72\x6f\x77\x20\x73\x68\157\165\x6c\144\x20\142\x65\72\x20" . implode("\54\40", $requiredColumns))); } $csv->setHeaderOffset(0); $data = Statement::create()->process($csv); return view("\163\x79\x73\164\x65\155\160\141\147\145\163\x2e\x70\x72\145\x76\151\x65\167", array("\144\141\164\141" => $data)); } public function uploadUsers(Request $request) { $fnames = $request->input("\x66\x6e\141\x6d\x65"); $femails = $request->input("\146\145\155\141\151\x6c"); $froles = $request->input("\x66\162\x6f\x6c\145"); $count = count($fnames); for ($i = 0; $i < $count; $i++) { $existingUser = DB::table("\x75\163\145\x72\163")->where("\165\x73\145\162\x5f\145\x6d\141\151\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\x61\142\x32\x30\62\63\x21"); $user->status = ''; $user->pass_string = "\x53\155\x61\x72\164\154\x61\142\62\x30\x32\x33\41"; $user->created_by = Session::get("\156\x61\155\x65"); $user->save(); } } return response()->json(array("\x72\x65\147\x69\x73\x74\145\162\145\x64" => "\125\x73\x65\x72\163\40\x72\x65\147\x69\163\x74\145\x72\145\144\x20\163\x75\143\143\145\163\x73\x66\x75\154\154\171")); } public function insertnewClass(Request $request) { $validated = Validator::make($request->all(), array("\x63\x6c\141\163\x73\156\141\155\145" => "\162\145\161\165\x69\162\145\144", "\x63\154\141\163\163\151\x6e\x66\157" => "\162\145\161\165\151\162\145\144", "\x73\164\141\x72\x74" => "\162\145\x71\165\x69\x72\145\144", "\x65\x6e\144" => "\162\145\x71\165\x69\x72\x65\144", "\x6d" => "\x72\x65\x71\165\151\x72\x65\144\x5f\167\x69\x74\150\x6f\x75\x74\137\x61\154\x6c\x3a\x74\54\167\54\164\x68\x2c\146\x2c\163\x61\x74\x2c\x73", "\x74" => "\162\x65\161\x75\x69\x72\x65\x64\137\x77\151\164\x68\157\165\x74\137\x61\154\x6c\x3a\x6d\x2c\167\x2c\164\x68\54\146\54\x73\x61\164\54\163", "\x77" => "\162\x65\x71\x75\x69\x72\x65\144\137\167\x69\x74\150\157\x75\x74\137\x61\x6c\154\72\x6d\x2c\x74\x2c\x74\x68\54\x66\54\x73\x61\164\54\x73", "\x74\x68" => "\x72\145\161\165\x69\x72\145\x64\137\167\151\x74\150\157\165\164\x5f\141\x6c\154\72\155\x2c\164\54\167\x2c\146\54\163\x61\x74\54\163", "\x66" => "\162\145\x71\x75\x69\x72\x65\144\137\x77\x69\x74\x68\x6f\165\164\137\141\x6c\154\x3a\155\54\x74\x2c\167\x2c\164\x68\x2c\163\141\164\54\x73", "\x73\x61\164" => "\x72\145\x71\x75\151\x72\145\x64\x5f\167\x69\x74\x68\x6f\165\x74\137\141\x6c\154\72\155\54\164\54\167\54\x74\x68\x2c\x66\x2c\163", "\163" => "\x72\x65\x71\x75\151\162\145\x64\137\167\x69\x74\x68\157\165\164\137\x61\x6c\x6c\x3a\155\54\164\54\x77\54\164\x68\x2c\x66\x2c\x73\141\x74"), array("\143\x6c\141\x73\x73\x6e\141\155\145\x2e\162\x65\x71\165\x69\162\x65\144" => "\124\150\145\40\x43\154\x61\x73\x73\x20\x4e\x61\x6d\145\40\146\151\145\x6c\x64\x20\x69\163\x20\162\145\x71\165\x69\162\x65\144", "\143\154\141\x73\x73\x69\x6e\x66\x6f\x2e\162\x65\161\x75\151\162\145\x64" => "\124\150\145\40\103\x6c\x61\x73\163\x20\111\156\x66\157\x20\146\x69\x65\154\x64\40\151\163\x20\162\x65\x71\165\x69\x72\x65\144", "\163\164\x61\x72\x74\x2e\162\145\161\x75\x69\x72\145\x64" => "\124\150\145\x20\x46\x72\157\x6d\40\x66\151\x65\x6c\144\40\x69\x73\40\x72\145\x71\x75\x69\x72\x65\x64", "\145\156\144\x2e\x72\145\x71\165\x69\162\x65\x64" => "\x54\150\x65\x20\x54\157\x20\146\x69\145\154\x64\40\x69\163\40\x72\145\x71\165\x69\x72\145\144", "\x72\145\161\165\151\x72\145\x64\x5f\x77\151\164\150\x6f\165\x74\137\x61\x6c\154" => "\x41\164\x20\x6c\145\141\163\164\40\x6f\156\x65\40\157\146\x20\164\150\x65\x20\x64\x61\171\163\x20\50\x6d\54\x20\x74\x2c\40\167\x2c\40\164\150\x2c\x20\146\x2c\x20\x73\141\164\54\x20\x73\51\40\155\x75\x73\x74\40\x68\141\166\145\40\x61\x20\166\141\154\165\x65\56")); if ($validated->fails()) { return response()->json(array("\145\162\x72\157\x72\x73" => $validated->errors()->first())); } else { if ($request->m == '') { $m = "\146\x61\x6c\x73\145"; } else { $m = $request->m; } if ($request->t == '') { $t = "\x66\141\154\163\145"; } else { $t = $request->t; } if ($request->w == '') { $w = "\x66\141\x6c\163\x65"; } else { $w = $request->w; } if ($request->th == '') { $th = "\x66\x61\154\163\145"; } else { $th = $request->th; } if ($request->f == '') { $f = "\146\x61\154\x73\145"; } else { $f = $request->f; } if ($request->sat == '') { $sat = "\x66\141\x6c\163\x65"; } else { $sat = $request->sat; } if ($request->s == '') { $s = "\x66\x61\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("\x75\x73\x65\x72\156\x61\x6d\x65"); $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 = "\x4d\157\x6e\x64\x61\171"; $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\x61\x79"; $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\x61\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\x75\x72\163\144\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\162\151\x64\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 = "\123\141\x74\165\x72\x64\141\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\x75\x6e\144\x61\x79"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } return response()->json(array("\151\x6e\163\x65\x72\164\x65\x64" => "\x4e\145\167\x20\x43\x6c\141\163\163\40\150\x61\x73\40\142\145\x65\156\40\x63\x72\145\x61\164\x65\144\56")); } } public function assignStudent(Request $request) { $data = $request->input("\x6d\x65\162\147\x65\144\103\150\x65\x63\153\x62\x6f\170\x65\163"); $responses = array(); $validated = Validator::make($request->all(), array("\103\154\x61\163\163\x6e\141\155\x65" => "\162\145\161\x75\151\162\x65\144", "\x6d\145\162\147\145\x64\x43\150\x65\x63\x6b\142\157\x78\145\x73" => "\162\x65\161\x75\x69\x72\x65\x64\x7c\141\x72\162\x61\x79\x7c\x6d\151\156\72\61"), array("\x43\x6c\141\x73\163\x6e\x61\x6d\x65\x2e\x72\145\161\x75\151\162\x65\144" => "\124\150\x65\x20\103\x6c\x61\163\163\x20\x4e\x61\155\x65\x20\146\151\x65\x6c\x64\x20\x69\x73\40\162\x65\x71\x75\x69\162\x65\x64", "\155\145\x72\x67\145\144\103\x68\x65\143\x6b\x62\x6f\x78\145\x73\x2e\162\x65\x71\x75\x69\x72\x65\144" => "\x41\x74\40\x6c\145\x61\163\164\x20\x6f\x6e\x65\x20\x63\x68\x65\143\153\142\157\x78\x20\155\x75\163\164\40\x62\145\40\143\x68\145\x63\x6b\x65\x64\x2e")); if ($validated->fails()) { return response()->json(array("\x65\162\x72\157\x72\x73" => $validated->errors()->first())); } else { foreach ($data as $account_id) { $check_assigness = DB::table("\x63\154\141\163\x73\145\163\x5f\141\163\151\x67\156\x73")->where("\x63\154\x61\163\163\x5f\x69\144", $request->Classname)->where("\165\x73\145\162\x5f\151\x64", $account_id)->first(); if ($check_assigness) { $responses[] = array("\146\x6f\x75\156\x64" => "\x41\x63\143\x6f\x75\156\164\x20\141\154\x72\x65\x61\144\171\x20\145\x6e\x72\x6f\x6c\x6c\x65\x64\x2e"); } else { $assign = new ClassesAsign(); $assign->user_id = $account_id; $assign->class_id = $request->Classname; $assign->created_by = Session::get("\x6e\x61\155\x65"); $assign->save(); $notify = new Notifications(); $check_class = DB::table("\143\x6c\141\163\163\145\163")->where("\151\x64", $request->Classname)->first(); $notify->notification_text = "\x59\157\165\x20\150\x61\166\x65\x20\142\145\145\x6e\40\x45\156\162\157\154\x6c\x65\x64\x20\164\157\40{$check_class->classname}"; $notify->user_id_notify = $account_id; $notify->status = "\165\x6e\162\x65\x61\x64"; $notify->save(); $responses[] = array("\x73\x75\x63\x63\145\x73\x73" => "\105\156\162\157\x6c\x6c\x65\144\40\x73\165\143\143\x65\x73\163\x66\x75\x6c\154\171\x2e"); } } } return response()->json($responses); } public function newapp(Request $request) { $validated = Validator::make($request->all(), array("\x45\170\160\145\162\151\155\145\x6e\164\x49\x44" => "\x72\145\161\165\x69\x72\145\144", "\141\x70\x70\x6e\x61\155\x65" => "\x72\x65\161\165\151\162\x65\x64", "\141\143\x63\145\163\x73\137\x6c\151\156\153" => "\162\x65\161\165\151\x72\145\144", "\x61\x70\x70\141\143\143\x65\163\163" => "\x72\145\x71\165\151\162\145\x64"), array("\x61\160\x70\156\141\155\145\x2e\x72\145\x71\x75\x69\x72\145\x64" => "\124\150\x65\40\101\x70\160\40\x4e\141\x6d\145\x20\146\151\x65\x6c\144\x20\151\163\x20\x72\145\161\x75\x69\x72\145\144", "\141\x70\160\141\x63\x63\x65\x73\x73\56\x72\x65\x71\165\x69\x72\x65\x64" => "\x54\150\x65\x20\101\160\160\x20\101\143\x63\145\163\x73\40\x66\x69\x65\x6c\144\x20\x69\x73\x20\162\145\x71\165\x69\x72\x65\x64", "\x61\x63\x63\145\x73\163\137\x6c\x69\156\153\56\162\x65\161\165\151\162\145\x64" => "\x54\x68\x65\x20\101\143\x63\145\x73\163\x20\x4c\151\x6e\x6b\x20\146\x69\x65\154\144\x20\x69\x73\x20\x72\x65\161\x75\x69\162\x65\144", "\x45\170\x70\145\162\151\155\x65\x6e\x74\x49\104\56\x72\145\x71\x75\151\162\145\x64" => "\x54\x68\x65\x20\105\x78\160\145\x72\151\x6d\145\156\164\40\116\x61\155\145\40\146\x69\x65\x6c\x64\x20\151\163\x20\x72\145\161\x75\x69\162\145\x64")); if ($validated->fails()) { return response()->json(array("\145\x72\162\x6f\x72\x73" => $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\156\163\x65\x72\164\x65\144" => "\101\x70\x70\x20\x68\141\163\x20\x62\145\x65\156\x20\163\165\142\155\x69\x74\x74\x65\x64\40\x73\x75\143\x63\x65\163\163\146\165\x6c\154\171\x2e")); } } public function SchedulesRequestedGet() { $ScheduleData = DB::table("\x73\x63\150\145\x64\165\x6c\x65\x5f\x61\x75\x74\150\x73")->select("\x75\163\145\x72\163\x2e\52", "\163\x63\x68\145\x64\165\x6c\145\x5f\x61\165\164\150\x73\x2e\x2a")->join("\165\163\145\x72\x73", "\x73\143\x68\x65\x64\165\x6c\145\137\141\x75\x74\x68\x73\56\x75\163\x65\x72\x49\x44", "\x3d", "\165\163\145\x72\x73\56\x69\x64")->where("\163\143\150\145\144\165\x6c\x65\x5f\141\x75\164\x68\163\x2e\163\x74\x61\x74\165\163", "\x61\x70\x70\162\157\166\x61\x6c")->get(); return DataTables::of($ScheduleData)->addIndexColumn()->addColumn("\x61\143\x74\x69\157\156", function ($row) { $btn = "\x3c\144\x69\166\x20\143\154\141\163\x73\75\42\x62\164\x6e\x2d\x67\x72\x6f\x75\160\40\x64\x72\x6f\x70\154\145\146\164\42\x3e\12\x20\x20\40\40\40\x20\x20\40\40\40\40\x20\x20\40\x20\x20\74\x62\165\164\x74\x6f\156\40\164\171\x70\145\x3d\x22\x62\x75\x74\x74\157\156\x22\x20\x63\154\x61\x73\x73\75\x22\142\164\x6e\40\142\x74\x6e\x2d\x70\162\151\x6d\141\x72\171\40\144\x72\157\x70\144\157\167\x6e\55\164\157\147\x67\x6c\x65\42\x20\144\141\x74\x61\x2d\164\x6f\147\147\154\x65\x3d\42\x64\162\157\x70\x64\x6f\x77\156\x22\40\141\162\151\x61\55\150\141\x73\x70\x6f\160\x75\160\x3d\x22\164\162\x75\x65\42\x20\x61\x72\x69\141\x2d\145\x78\160\x61\156\144\145\x64\x3d\42\146\141\154\163\x65\42\x3e\xa\x20\x20\x20\40\40\40\x20\x20\40\40\40\x20\x20\40\40\x20\123\x65\164\164\x69\x6e\147\x73\12\40\40\x20\x20\40\x20\x20\40\x20\40\x20\40\x20\x20\40\40\x3c\57\142\165\164\164\157\156\x3e\xa\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x3c\x64\x69\166\x20\143\x6c\141\x73\163\75\42\144\x72\x6f\160\144\157\167\x6e\x2d\155\x65\156\x75\40\144\x72\157\x70\154\145\146\x74\42\x3e\12\x20\40\x20\x20\40\x20\40\40\40\x20\x20\40\40\x20\x20\x20\x20\x20\74\141\x20\x63\154\x61\163\163\x3d\x22\144\162\x6f\x70\x64\157\x77\x6e\55\151\164\x65\x6d\40\x61\x70\160\x72\x6f\166\145\42\x20\x68\162\145\146\x3d\x22\43\x22\x20\x64\x61\164\141\55\151\x64\x3d\42" . $row->id . "\42\76\101\x70\x70\162\x6f\166\x65\40\x53\x63\150\x65\144\x75\154\145\74\57\x61\76\12\x20\40\x20\40\x20\40\40\40\x20\40\x20\40\40\40\x20\40\40\40\74\x61\40\143\x6c\141\163\x73\x3d\x22\144\x72\x6f\x70\x64\x6f\167\x6e\55\151\x74\145\x6d\x20\x64\x65\154\145\164\x65\101\x53\x42\164\x6e\42\x20\x68\162\x65\x66\75\42\x23\42\40\144\141\164\141\x2d\x69\144\75\42" . $row->id . "\x22\x3e\104\151\x73\x61\160\x70\x72\157\166\145\40\123\x63\x68\145\x64\165\x6c\x65\74\x2f\141\x3e\xa\x20\40\40\40\40\40\40\40\40\x20\x20\40\40\x20\x20\x20\x3c\57\144\151\166\x3e\12\x20\40\40\40\x20\40\40\x20\40\x20\x20\40\x20\x20\x3c\57\144\x69\x76\76"; return $btn; })->rawColumns(array("\141\x63\x74\x69\x6f\156"))->make(true); } public function ArticleGet(Request $request) { $ArticleData = DB::table("\x75\x70\x64\x61\164\145\x73\x5f\164\141\142\x6c\145\163")->get(); return DataTables::of($ArticleData)->addIndexColumn()->addColumn("\141\143\x74\x69\x6f\x6e", function ($row) { $btn = "\x3c\x62\165\164\164\x6f\x6e\40\x63\154\141\x73\163\75\42\142\164\156\40\x20\142\164\x6e\x2d\163\155\40\144\145\x6c\x65\x74\145\102\x74\x6e\x20\x61\x70\160\162\157\166\145\x22\40\x73\x74\x79\x6c\145\75\42\142\141\x63\153\147\162\157\165\x6e\x64\x2d\143\157\x6c\x6f\x72\72\x20\x67\157\154\x64\x3b\x20\x63\x6f\x6c\157\x72\x3a\40\167\x68\x69\x74\x65\73\42\40\x64\141\164\x61\x2d\151\144\x3d\x22" . $row->id . "\42\76\105\144\151\x74\x3c\x2f\142\x75\164\164\x6f\156\x3e"; $btn .= "\40\74\x62\165\x74\164\157\156\x20\143\154\141\163\x73\75\42\x62\x74\x6e\x20\x62\x74\x6e\x2d\160\162\x69\155\x61\x72\x79\40\x62\164\x6e\x2d\x73\155\40\144\145\x6c\145\x74\x65\101\x53\102\164\x6e\x22\40\x20\x20\144\x61\164\141\55\x69\144\x3d\x22" . $row->id . "\x22\76\x44\x65\x6c\x65\164\145\x3c\x2f\x62\165\164\x74\x6f\x6e\x3e"; return $btn; })->rawColumns(array("\141\x63\x74\151\157\x6e"))->make(true); } public function ScheduleAproveAction(Request $request) { $id = $request->approve; $Approveupdate = ScheduleAuth::find($id); $Approveupdate->status = "\x76\x61\154\151\x64"; $Approveupdate->save(); $check_class = DB::table("\x73\x63\150\x65\x64\165\x6c\145\x5f\141\x75\164\x68\x73")->where("\x69\144", $id)->first(); $notify = new Notifications(); $notify->notification_text = "\131\x6f\x75\x72\40\162\145\161\x75\x65\x73\164\145\144\x20\163\x63\150\145\x64\x75\154\145\40\146\157\x72\40{$check_class->labname}\x20\150\141\163\x20\x62\x65\x65\x6e\x20\141\x70\x70\x72\x6f\x76\x65\x64"; $notify->user_id_notify = $check_class->userID; $notify->status = "\x75\x6e\x72\145\x61\144"; $notify->save(); return response()->json(array("\x61\x70\160\x72\157\166\145\144" => "\x53\x63\x68\x65\144\x75\x6c\x65\40\150\141\163\x20\142\x65\x65\x6e\40\141\160\x70\x72\x6f\x76\x65\144\40\163\x75\143\143\x65\163\x73\146\165\x6c\154\171\56")); } public function DisScheduleAproveAction(Request $request) { $id = $request->disapproveID; $check_class = DB::table("\163\143\x68\x65\x64\x75\x6c\x65\x5f\x61\165\x74\150\x73")->where("\x69\144", $id)->first(); ScheduleAuth::where("\x69\144", $id)->delete(); $notify = new Notifications(); $notify->notification_text = "\x59\x6f\165\162\40\162\x65\161\x75\145\x73\x74\145\144\x20\163\143\x68\145\144\165\154\145\x20\x66\x6f\162\x20{$check_class->labname}\40\x68\x61\x73\40\x62\x65\145\156\40\104\151\163\141\x70\x70\x72\157\166\x65\144"; $notify->user_id_notify = $check_class->userID; $notify->status = "\x75\x6e\x72\145\x61\x64"; $notify->save(); return response()->json(array("\x61\160\160\162\x6f\166\145\x64" => "\x53\143\150\145\144\165\154\145\x20\x68\141\163\x20\142\145\x65\x6e\x20\x64\x69\x73\141\160\x70\162\x6f\x76\x65\144\40\x73\x75\143\x63\x65\163\x73\x66\x75\x6c\x6c\x79\x2e")); } public function insertnewUpdate(Request $request) { $validated = Validator::make($request->all(), array("\x75\160\144\141\164\x65\x74\x69\x74\154\x65" => "\x72\x65\161\165\x69\162\x65\x64", "\142\157\x64\x79" => "\162\x65\x71\165\151\162\x65\x64", "\160\x6f\163\164\x64\x65\x73" => "\x72\145\161\x75\151\x72\145\144", "\165\160\x64\141\164\x65\160\x69\x63" => "\x72\145\161\165\x69\162\145\144"), array("\165\x70\144\141\x74\145\164\151\164\154\x65\x2e\x72\x65\161\165\151\x72\145\144" => "\124\150\145\x20\124\x69\x74\x6c\x65\40\146\151\145\x6c\144\x20\x69\163\40\162\x65\x71\165\x69\162\145\x64", "\142\x6f\144\171\56\162\145\x71\x75\151\x72\145\x64" => "\x54\x68\145\40\x42\157\x64\171\x20\146\151\x65\154\144\x20\x69\163\40\162\x65\x71\x75\151\x72\x65\144", "\x75\x70\144\x61\x74\x65\x70\x69\143\x2e\162\x65\x71\x75\151\x72\x65\x64" => "\124\150\x65\x20\120\151\x63\164\x75\x72\x65\40\x66\151\x65\154\x64\40\151\163\x20\162\145\x71\165\x69\x72\145\x64", "\160\x6f\163\x74\144\145\163\56\162\x65\161\x75\151\162\x65\144" => "\x54\150\x65\40\x44\x65\x73\x63\x72\x69\160\x74\x69\x6f\156\x20\146\151\x65\154\x64\x20\x69\x73\x20\162\x65\x71\x75\x69\162\x65\144")); if ($validated->fails()) { return response()->json(array("\145\x72\162\x6f\x72\163" => $validated->errors()->first())); } else { if ($pic = $request->file("\165\x70\x64\x61\x74\x65\160\151\143")) { $filename = $pic->getClientOriginalName(); if ($pic->move("\165\160\x64\x61\x74\145\x2f\165\x70\144\141\x74\145\120\151\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("\151\156\x73\145\x72\x74\x65\x64" => "\116\x65\x77\x20\x55\x70\144\141\x74\145\40\120\157\x73\x74\40\x68\x61\163\x20\142\145\145\156\40\143\x72\x65\141\164\145\144\x2e")); } } } } public function insertnewClassEx(Request $request) { $validated = Validator::make($request->all(), array("\145\170\x4e\x61\x6d\x65" => "\162\x65\x71\165\151\162\145\144", "\x65\170\151\x64" => "\162\x65\x71\x75\151\162\145\x64", "\x65\x78\x66\151\x6c\145" => "\x72\x65\161\x75\x69\x72\145\x64\x7c\155\151\155\x65\163\72\x70\x64\146"), array("\x65\x78\116\x61\155\x65\x2e\162\145\x71\165\x69\162\x65\x64" => "\124\150\145\x20\105\x78\x70\145\162\151\155\145\x6e\164\40\116\141\155\145\x20\146\151\145\x6c\x64\40\151\163\40\x72\145\161\165\151\x72\x65\x64", "\145\x78\x69\x64\56\x72\x65\x71\165\x69\x72\x65\144" => "\x45\162\x72\x6f\x72\40\x52\145\154\x6f\141\x64\40\x74\150\145\x20\160\141\x67\x65", "\x65\x78\146\151\x6c\x65\56\x72\145\x71\x75\151\162\145\144" => "\x54\150\x65\x20\105\170\x70\x65\x72\151\155\x65\156\x74\x20\146\151\x6c\x65\x20\146\151\145\154\144\x20\x69\x73\x20\162\145\161\x75\151\162\x65\144", "\x65\x78\146\151\154\x65\56\x6d\151\x6d\145\x73" => "\124\x68\x65\x20\x45\x78\x70\x65\x72\151\x6d\x65\x6e\164\x20\x66\151\x6c\145\x20\155\165\x73\164\40\142\x65\40\x61\x20\120\x44\106\x20\x66\151\154\145")); if ($validated->fails()) { return response()->json(array("\x65\x72\x72\157\162\163" => $validated->errors()->first())); } else { if ($pdf = $request->file("\145\170\x66\151\154\x65")) { $filename = $pdf->getClientOriginalName(); if ($pdf->move("\103\154\x61\x73\x73\x45\x78", $filename)) { $newEx = new classEx(); $newEx->class_id = $request->exid; $newEx->ex_name = $request->exName; $newEx->ex_file = $filename; $newEx->created_by = Session::get("\x6e\x61\x6d\145"); if (Session::get("\x61\x64\x6d\151\156") == "\x70\162\157\x66") { $newEx->status = "\160\x65\x6e\144\151\156\x67"; } $newEx->save(); return response()->json(array("\x69\x6e\x73\x65\x72\x74\x65\144" => "\116\x65\x77\x20\x45\170\160\145\x72\x69\x6d\145\x6e\164\x20\x68\x61\x73\x20\142\x65\145\156\40\163\165\x62\155\151\x74\x74\145\x64\56")); } } } } public function UserEdit() { $UsersData = DB::table("\165\x73\x65\162\x73")->where("\163\x74\x61\x74\165\163", '')->get(); return DataTables::of($UsersData)->addIndexColumn()->addColumn("\141\143\x74\x69\157\156", function ($row) { $btn = "\x3c\144\151\166\40\143\x6c\x61\x73\x73\x3d\42\142\x74\156\55\147\162\157\165\x70\x20\x64\x72\x6f\160\154\145\146\x74\x22\76\12\40\x20\x20\40\40\40\40\40\40\x20\x20\x20\40\40\40\40\x3c\142\165\164\x74\x6f\x6e\40\164\171\x70\x65\x3d\42\142\165\164\164\157\156\x22\40\x63\154\141\x73\163\x3d\x22\x62\x74\156\40\142\x74\x6e\x2d\160\x72\x69\155\x61\x72\x79\40\144\162\157\160\144\x6f\x77\x6e\x2d\164\x6f\147\x67\154\x65\x22\x20\144\x61\x74\x61\x2d\x74\x6f\x67\147\154\145\x3d\x22\144\x72\x6f\160\144\157\x77\x6e\42\40\141\x72\151\x61\55\x68\x61\x73\x70\157\160\165\x70\x3d\x22\x74\162\x75\x65\42\40\141\x72\x69\x61\55\145\170\x70\141\156\x64\x65\x64\x3d\x22\146\x61\x6c\x73\145\42\x3e\12\x20\40\40\40\40\x20\40\x20\40\x20\x20\40\40\40\x20\x20\123\x65\x74\164\151\156\147\x73\12\x20\40\x20\x20\40\40\x20\40\x20\40\x20\40\x20\40\40\x20\74\57\142\165\x74\164\157\156\x3e\xa\40\40\x20\40\x20\40\40\40\x20\x20\40\x20\40\x20\40\x20\74\x64\151\x76\40\143\154\141\163\x73\x3d\42\x64\x72\x6f\x70\x64\157\x77\156\x2d\155\x65\156\165\40\x64\162\x6f\160\154\x65\146\164\x22\x3e\12\40\x20\40\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\40\x20\40\40\x3c\141\x20\143\x6c\141\163\163\75\42\144\162\x6f\x70\x64\x6f\167\156\55\x69\x74\x65\155\x20\x72\145\163\145\164\120\167\102\x74\156\42\40\150\162\145\x66\x3d\x22\x23\x22\x20\144\141\164\x61\55\151\x64\75\x22" . $row->id . "\42\76\122\145\x73\145\x74\x20\120\x61\x73\163\x77\x6f\x72\144\74\x2f\x61\x3e\xa\x20\x20\40\x20\x20\x20\40\40\40\x20\40\40\40\40\x20\x20\40\x20\x3c\x61\40\143\x6c\141\x73\163\75\x22\144\162\157\160\144\157\x77\156\55\151\x74\x65\x6d\40\165\x73\x65\x72\145\144\151\164\142\x74\156\42\40\x68\x72\x65\x66\75\x22\x23\42\x20\x64\x61\164\141\55\151\144\75\x22" . $row->id . "\x22\x3e\x45\144\151\x74\x20\x55\x73\x65\x72\x20\x41\143\143\x6f\165\x6e\164\74\x2f\141\76\12\x20\40\x20\x20\40\x20\40\40\40\x20\x20\40\40\40\40\40\x20\x20\x3c\141\40\143\154\x61\x73\x73\75\x22\144\x72\157\x70\x64\x6f\x77\x6e\55\151\x74\x65\155\40\141\x72\143\150\151\166\145\x42\164\156\42\40\150\x72\x65\146\75\x22\x23\x22\40\144\x61\x74\x61\55\x69\x64\x3d\42" . $row->id . "\42\76\101\x72\143\x68\x69\166\145\x20\x55\163\x65\162\40\x41\143\143\x6f\165\156\164\74\x2f\141\x3e\xa\x20\x20\40\x20\x20\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\x3c\x2f\x64\x69\x76\x3e\xa\40\40\40\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\74\x2f\144\151\166\76"; return $btn; })->rawColumns(array("\x61\x63\164\x69\x6f\156"))->make(true); } public function ProfFetch() { $UsersData = DB::table("\165\x73\145\162\x73")->where("\x73\164\x61\x74\165\x73", '')->where("\x72\x6f\154\145", "\x70\162\157\x66")->get(); return DataTables::of($UsersData)->addIndexColumn()->addColumn("\163\x65\154\145\x63\x74", function ($row) { $btn = "\74\x69\156\160\x75\x74\x20\x74\x79\x70\x65\x20\75\x20\42\x63\150\x65\x63\x6b\142\157\170\x22\x20\144\141\x74\141\55\x69\144\40\75\x20\42" . $row->id . "\x22\40\143\x6c\x61\163\x73\x20\x3d\40\x22\x63\150\x65\143\153\142\x6f\x78\x22\x20\156\141\x6d\x65\x3d\42\x61\x63\143\x6f\165\156\164\x45\156\x72\x6f\154\154\x5b\x5d\42\40\166\x61\x6c\x75\145\40\x3d\x20\42" . $row->id . "\x22\x3e"; return $btn; })->rawColumns(array("\x73\x65\154\145\143\x74"))->make(true); } public function StudentFetch() { $UsersData = DB::table("\165\x73\x65\162\163")->where("\163\x74\141\164\x75\x73", '')->where("\x72\157\154\145", "\x73\164\165\144\145\156\164")->get(); return DataTables::of($UsersData)->addIndexColumn()->addColumn("\x73\145\154\145\143\x74", function ($row) { $btn = "\74\x69\156\x70\165\x74\x20\x74\x79\x70\145\x20\75\40\42\143\x68\145\x63\153\142\x6f\170\42\40\144\141\164\141\x2d\x69\144\x20\75\x20\x22" . $row->id . "\42\x20\x63\x6c\x61\x73\163\40\75\x20\42\x63\150\145\x63\x6b\142\x6f\170\42\40\x6e\x61\x6d\x65\75\x22\x61\x63\x63\157\x75\x6e\x74\x45\x6e\x72\x6f\x6c\x6c\133\135\x22\40\x76\141\x6c\x75\145\x20\x3d\40\42" . $row->id . "\x22\x3e"; return $btn; })->rawColumns(array("\x73\x65\154\x65\x63\164"))->make(true); } public function ExperimentPending() { $ExperimentData = DB::table("\x63\x6c\141\163\163\x5f\x65\170\145\x73")->join("\x63\x6c\x61\x73\x73\145\x73", "\x63\154\141\163\163\137\x65\170\145\x73\56\143\154\x61\163\x73\137\151\144", "\x3d", "\x63\x6c\x61\x73\163\145\x73\x2e\x69\144")->whereNotNull("\x63\154\x61\x73\163\137\x65\170\x65\x73\x2e\x73\164\x61\x74\x75\163")->select("\x63\154\x61\x73\163\145\x73\56\143\154\x61\x73\163\x6e\x61\155\145", "\x63\x6c\141\x73\163\137\x65\x78\145\163\56\x2a")->get(); return DataTables::of($ExperimentData)->addIndexColumn()->addColumn("\x66\151\x6c\x65", function ($row) { $file = "\x3c\x61\x20\150\x72\x65\x66\x3d\x22\57\105\170\160\x65\162\151\x6d\x65\156\164\x52\x65\x70\x6f\162\164\57" . $row->ex_file . "\x22\76" . $row->ex_file . "\74\x2f\x61\76"; return $file; })->addColumn("\x61\143\x74\x69\157\156", function ($row) { $btn = "\x3c\x64\151\x76\x20\143\x6c\141\x73\x73\x3d\42\142\x74\156\55\147\162\157\165\160\x20\x64\x72\157\x70\x6c\x65\x66\164\42\x3e\xa\x20\40\x20\40\x20\x20\x20\40\40\x20\40\x20\x20\x20\40\x20\74\x62\165\164\164\x6f\x6e\x20\164\x79\160\x65\75\x22\x62\165\x74\x74\x6f\156\x22\x20\x63\x6c\x61\x73\163\75\42\x62\x74\156\40\142\164\156\55\160\162\151\x6d\x61\x72\171\x20\144\162\157\x70\144\157\167\156\x2d\x74\157\147\147\x6c\145\42\40\144\141\164\x61\55\164\x6f\147\147\x6c\145\x3d\x22\x64\x72\157\160\144\x6f\167\x6e\42\40\141\x72\151\x61\55\150\141\163\x70\x6f\160\165\160\x3d\42\164\162\165\x65\x22\40\x61\x72\x69\141\55\x65\170\160\x61\156\x64\x65\144\75\x22\x66\x61\x6c\163\145\x22\76\xa\x20\40\x20\40\x20\x20\40\40\x20\40\40\x20\40\40\40\x20\x53\145\164\x74\151\x6e\147\163\xa\40\x20\x20\40\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\40\74\57\x62\165\x74\164\157\156\76\12\x20\x20\x20\x20\x20\40\x20\x20\40\x20\40\x20\x20\40\40\40\74\144\x69\x76\40\143\x6c\141\163\x73\75\x22\144\162\x6f\160\144\x6f\167\156\55\x6d\x65\156\x75\x20\144\x72\157\160\x6c\145\146\x74\42\76\xa\40\x20\x20\x20\x20\40\40\x20\x20\40\x20\x20\40\x20\x20\x20\40\x20\x3c\141\x20\x63\x6c\141\163\163\x3d\42\144\x72\x6f\160\144\157\167\x6e\x2d\x69\x74\145\155\x20\141\x63\164\151\x76\x61\164\145\x42\164\x6e\x22\x20\x68\162\x65\x66\75\x22\43\42\x20\144\x61\164\141\55\151\144\x3d\42" . $row->id . "\x22\x3e\101\143\x74\x69\166\141\x74\145\x20\x45\170\x70\x65\x72\x69\155\x65\156\164\x3c\57\141\x3e\xa\40\40\x20\x20\40\40\x20\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\x3c\141\x20\143\154\x61\163\x73\75\x22\144\x72\x6f\160\144\157\x77\156\x2d\x69\164\145\x6d\40\x64\x65\154\x65\164\145\102\164\156\x22\40\x68\162\x65\146\x3d\x22\x23\x22\x20\144\141\x74\141\55\x69\x64\75\x22" . $row->id . "\x22\76\104\x69\x73\155\x69\163\163\40\105\170\160\145\x72\151\x6d\145\156\164\x3c\57\x61\76\xa\x20\40\40\40\40\40\40\40\x20\x20\40\x20\x20\40\x20\x20\74\x2f\x64\x69\166\x3e\xa\40\40\x20\x20\x20\x20\40\40\40\40\40\x20\40\40\x3c\57\x64\151\166\76"; return $btn; })->rawColumns(array("\146\151\x6c\145", "\141\143\x74\x69\157\156"))->make(true); } public function UserPending() { $UsersData = DB::table("\x75\x73\x65\162\163")->where("\x73\164\x61\x74\x75\163", "\x70\145\x6e\x64\151\156\x67")->get(); return DataTables::of($UsersData)->addIndexColumn()->addColumn("\141\x63\164\x69\157\156", function ($row) { $btn = "\74\x64\x69\166\x20\143\x6c\141\163\163\75\42\142\164\x6e\x2d\x67\162\x6f\165\160\40\144\162\x6f\160\154\x65\x66\164\42\76\xa\40\x20\x20\x20\x20\40\40\x20\40\x20\x20\40\40\40\40\40\74\x62\x75\164\164\x6f\156\x20\x74\171\160\x65\x3d\42\x62\x75\x74\164\x6f\x6e\42\40\143\x6c\x61\x73\163\75\42\x62\164\x6e\x20\x62\164\156\55\x70\x72\151\155\x61\162\x79\40\144\162\x6f\x70\144\x6f\167\x6e\x2d\x74\157\147\x67\x6c\145\x22\x20\144\x61\x74\141\55\164\x6f\x67\147\x6c\145\75\42\144\162\157\x70\x64\x6f\x77\x6e\42\x20\x61\x72\151\141\55\150\141\163\x70\157\160\x75\x70\x3d\x22\164\162\165\x65\x22\40\141\162\x69\x61\x2d\145\x78\160\x61\x6e\x64\145\144\75\42\x66\141\x6c\x73\145\42\x3e\12\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x20\x20\x20\40\40\123\145\x74\164\151\x6e\147\x73\12\40\x20\x20\40\40\40\x20\x20\x20\40\x20\40\x20\x20\40\40\74\x2f\x62\x75\164\x74\157\156\76\12\x20\40\40\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x20\40\x20\x3c\x64\151\x76\40\143\x6c\x61\x73\163\x3d\42\x64\x72\x6f\x70\144\157\167\x6e\x2d\155\x65\x6e\165\40\x64\x72\157\x70\x6c\145\x66\164\42\x3e\xa\x20\x20\x20\x20\40\40\40\x20\40\40\x20\40\x20\40\40\40\40\x20\74\x61\40\143\154\x61\x73\x73\x3d\x22\x64\162\157\x70\144\x6f\x77\156\55\x69\x74\x65\x6d\x20\x61\143\164\151\x76\x61\164\x65\102\164\x6e\x22\x20\150\162\x65\x66\75\42\43\42\x20\144\x61\x74\x61\x2d\x69\x64\x3d\42" . $row->id . "\42\76\x41\143\x74\151\x76\141\164\x65\x20\x41\x63\x63\x6f\x75\x6e\x74\x3c\x2f\x61\x3e\xa\x20\40\40\x20\x20\x20\40\40\40\x20\40\40\40\x20\40\40\40\x20\74\x61\x20\x63\x6c\x61\163\x73\x3d\42\x64\x72\157\160\144\x6f\167\156\x2d\151\164\x65\155\x20\x64\x65\x6c\145\164\145\x42\x74\x6e\x22\x20\x68\x72\x65\x66\x3d\x22\x23\x22\40\x64\x61\x74\x61\55\151\x64\75\42" . $row->id . "\x22\x3e\104\x69\x73\155\x69\163\163\x20\x41\143\x63\157\x75\156\164\x3c\57\x61\x3e\12\x20\x20\40\40\40\x20\x20\40\x20\x20\40\x20\40\40\40\x20\x3c\57\x64\151\166\x3e\12\40\x20\40\x20\40\x20\40\40\40\40\x20\40\40\x20\74\x2f\x64\151\x76\76"; return $btn; })->rawColumns(array("\141\143\x74\x69\157\156"))->make(true); } public function RubricArchiveList() { $archiveData = DB::table("\x72\x75\x62\x72\151\143\x73")->where("\163\x74\141\164\165\x73", "\141\x72\x63\150\x69\166\145")->get(); return DataTables::of($archiveData)->addIndexColumn()->addColumn("\x61\143\164\x69\157\156", function ($row) { $btn = "\74\x64\151\166\x20\143\x6c\141\x73\163\x3d\42\142\164\x6e\x2d\x67\x72\x6f\x75\160\x20\x64\x72\157\x70\x6c\145\146\164\x22\x3e\12\x20\40\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\40\x20\40\74\142\165\164\x74\x6f\x6e\40\164\x79\160\145\75\x22\142\165\x74\164\157\x6e\42\x20\143\154\x61\163\x73\x3d\x22\142\164\156\40\142\164\x6e\55\x70\x72\x69\155\x61\162\171\x20\x64\x72\157\x70\x64\157\x77\x6e\55\x74\157\x67\x67\x6c\145\x22\40\x64\x61\164\x61\x2d\x74\x6f\x67\x67\x6c\145\75\42\x64\x72\x6f\x70\144\x6f\167\x6e\42\40\x61\162\151\x61\55\x68\x61\163\160\157\160\x75\160\75\x22\x74\162\x75\x65\x22\x20\x61\162\x69\141\55\145\x78\x70\x61\156\144\x65\x64\x3d\x22\x66\141\154\x73\145\42\76\xa\40\x20\x20\x20\40\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\x53\145\164\x74\151\x6e\x67\163\xa\x20\x20\40\40\40\40\x20\40\x20\40\40\x20\40\40\40\x20\74\x2f\x62\x75\x74\164\157\156\76\xa\40\40\40\x20\40\x20\x20\x20\x20\x20\40\x20\x20\40\40\40\x3c\x64\151\166\x20\143\x6c\141\163\x73\75\42\144\162\157\x70\144\x6f\167\x6e\x2d\155\145\156\x75\40\144\162\x6f\160\154\145\146\x74\42\x3e\xa\x20\40\40\40\x20\x20\40\40\40\40\40\x20\40\40\x20\40\x20\40\74\141\x20\143\x6c\x61\163\163\x3d\x22\x64\x72\157\x70\x64\x6f\167\156\55\x69\164\145\x6d\x20\162\x65\x73\x74\x6f\x72\145\102\x74\x6e\42\x20\x68\x72\x65\x66\75\x22\43\42\x20\144\x61\x74\141\55\x69\x64\x3d\x22" . $row->id . "\x22\x3e\122\x65\163\164\x6f\x72\145\40\122\165\142\162\151\143\x3c\57\x61\x3e\12\x20\x20\x20\x20\40\x20\x20\40\40\40\x20\40\40\40\x20\x20\x3c\x2f\144\151\166\76\12\x20\40\40\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\x3c\x2f\x64\x69\x76\76"; return $btn; })->rawColumns(array("\141\x63\x74\x69\157\156"))->make(true); } public function UserArchive() { $UsersData = DB::table("\165\x73\x65\x72\x73")->where("\163\x74\141\x74\165\163", "\x61\x72\x63\x68\151\166\x65")->get(); return DataTables::of($UsersData)->addIndexColumn()->addColumn("\x61\143\164\x69\x6f\156", function ($row) { $btn = "\74\x64\151\166\x20\x63\154\x61\x73\163\x3d\x22\142\164\156\x2d\x67\162\x6f\165\160\x20\144\162\x6f\160\x6c\x65\146\x74\x22\x3e\12\40\x20\x20\40\40\x20\40\x20\40\40\40\40\40\x20\x20\40\74\x62\x75\164\x74\x6f\156\40\x74\171\160\x65\75\x22\142\165\x74\x74\157\156\x22\x20\143\x6c\141\163\163\x3d\x22\x62\x74\156\x20\x62\x74\156\x2d\x70\x72\151\155\x61\x72\x79\40\144\162\157\160\x64\x6f\167\156\x2d\x74\157\x67\x67\154\145\42\40\144\x61\x74\141\55\164\157\x67\x67\x6c\x65\75\42\144\x72\157\160\x64\157\x77\156\x22\40\141\x72\x69\141\x2d\x68\141\x73\x70\x6f\160\x75\x70\x3d\42\x74\162\165\145\x22\40\x61\x72\x69\x61\55\x65\170\160\141\156\x64\x65\x64\x3d\x22\146\x61\x6c\163\x65\42\76\xa\40\40\40\x20\x20\40\40\x20\40\x20\x20\x20\x20\40\40\x20\123\145\x74\164\151\x6e\x67\x73\12\x20\x20\x20\x20\x20\40\40\40\40\x20\x20\x20\x20\x20\40\x20\74\x2f\142\165\164\x74\x6f\x6e\x3e\12\x20\40\40\40\x20\40\40\40\x20\40\40\x20\40\40\40\x20\x3c\x64\x69\x76\40\x63\154\141\x73\x73\x3d\x22\x64\162\157\x70\144\157\x77\156\x2d\155\145\x6e\x75\40\144\x72\x6f\x70\x6c\x65\x66\164\42\x3e\xa\x20\40\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\40\40\x20\40\x3c\141\x20\x63\x6c\x61\163\x73\x3d\42\x64\x72\157\x70\144\157\167\x6e\55\x69\x74\145\x6d\x20\x72\145\163\164\157\x72\145\x42\x74\x6e\42\x20\150\162\x65\146\75\x22\43\42\x20\144\x61\164\x61\55\x69\144\x3d\42" . $row->id . "\x22\76\x52\x65\x73\164\x6f\162\x65\x20\101\x63\143\x6f\165\156\164\x3c\57\x61\76\xa\x20\40\40\40\40\40\x20\40\x20\40\40\40\x20\40\x20\x20\x20\40\74\141\x20\x63\154\x61\163\x73\75\x22\x64\162\x6f\160\144\x6f\x77\156\55\151\x74\x65\155\x20\x64\145\154\145\164\x65\102\164\156\x22\40\x68\x72\x65\146\75\42\43\x22\40\144\141\x74\141\x2d\x69\x64\75\x22" . $row->id . "\42\76\104\x65\154\145\164\x65\x20\x41\x63\x63\x6f\x75\156\x74\74\57\x61\76\xa\x20\40\40\x20\40\x20\40\x20\40\40\x20\40\40\40\x20\x20\x3c\x2f\x64\x69\x76\x3e\12\x20\x20\40\x20\x20\40\40\x20\x20\x20\x20\40\x20\x20\x3c\x2f\144\x69\x76\76"; return $btn; })->rawColumns(array("\141\x63\164\x69\157\156"))->make(true); } public function ClassArchiveList() { $ClassesData = DB::table("\143\x6c\x61\x73\163\145\163")->where("\x73\x74\x61\x74\x75\x73", "\141\162\143\x68\x69\166\x65")->get(); return DataTables::of($ClassesData)->addIndexColumn()->addColumn("\x61\143\164\151\x6f\x6e", function ($row) { $btn = "\74\x64\151\166\x20\143\x6c\x61\163\x73\x3d\x22\x62\x74\156\55\x67\162\x6f\x75\160\40\x64\162\157\160\154\145\146\x74\42\76\12\40\40\40\x20\40\x20\40\x20\x20\40\40\x20\40\x20\40\40\x3c\142\165\x74\164\x6f\x6e\x20\x74\171\x70\x65\x3d\x22\x62\165\164\x74\x6f\x6e\x22\40\x63\154\141\x73\163\75\42\142\164\156\40\142\x74\156\x2d\x70\162\151\155\141\x72\171\40\144\x72\x6f\160\x64\x6f\167\156\55\x74\x6f\x67\147\x6c\145\x22\40\x64\x61\x74\x61\55\164\157\x67\147\x6c\x65\75\x22\x64\x72\157\x70\x64\x6f\167\156\42\40\141\162\151\x61\55\150\141\163\x70\x6f\x70\165\x70\75\42\164\162\165\145\42\x20\x61\162\151\141\55\145\x78\x70\x61\x6e\144\x65\144\75\x22\146\x61\154\163\x65\x22\x3e\12\x20\40\x20\x20\40\x20\x20\40\x20\40\x20\40\x20\40\40\40\123\x65\164\x74\x69\156\147\x73\xa\40\x20\40\x20\x20\40\x20\40\x20\40\x20\x20\40\40\x20\40\x3c\57\142\165\164\164\157\x6e\76\12\40\x20\40\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\x20\x3c\x64\x69\x76\40\143\154\x61\163\163\75\42\144\162\157\160\144\x6f\x77\x6e\55\155\x65\x6e\x75\x20\x64\x72\x6f\160\154\145\146\x74\x22\76\12\40\x20\40\40\x20\x20\40\x20\40\40\40\40\x20\x20\x20\40\40\40\74\x61\x20\143\x6c\x61\163\163\x3d\42\x64\x72\x6f\160\144\x6f\x77\x6e\x2d\151\x74\145\155\40\162\145\163\164\x6f\162\x65\x42\164\x6e\x22\x20\150\162\145\x66\75\42\43\x22\40\144\141\x74\x61\55\151\144\x3d\42" . $row->id . "\x22\x3e\x52\145\163\x74\x6f\162\145\x20\103\154\141\163\x73\x3c\x2f\141\76\12\x20\x20\x20\40\x20\x20\x20\40\40\x20\x20\x20\40\40\x20\x20\40\x20\x3c\141\x20\x63\154\x61\163\163\75\x22\x64\162\157\x70\144\x6f\x77\x6e\x2d\151\x74\x65\x6d\x20\144\x65\x6c\x65\164\x65\102\164\156\42\40\x68\x72\x65\146\75\x22\43\42\40\x64\141\164\141\55\151\x64\x3d\42" . $row->id . "\x22\76\104\x65\154\x65\164\145\x20\103\154\x61\x73\x73\74\57\141\76\xa\x20\x20\x20\x20\40\40\40\40\40\x20\40\x20\x20\40\40\x20\x3c\x2f\144\151\166\x3e\12\x20\x20\40\x20\x20\40\40\40\x20\x20\40\40\40\40\x3c\57\144\x69\x76\76"; return $btn; })->addColumn("\x73\x63\x68\x65\144\x75\x6c\x65", function ($row) { $d1 = $row->m === "\x74\162\165\x65"; $d2 = $row->t === "\x74\162\165\x65"; $d3 = $row->w === "\164\x72\165\145"; $d4 = $row->th === "\x74\x72\165\x65"; $d5 = $row->f === "\164\162\x75\x65"; $d6 = $row->sat === "\x74\x72\165\x65"; $d7 = $row->s === "\164\x72\165\x65"; $start = date("\x68\72\x69\x41", strtotime($row->start)); $end = date("\x68\x3a\x69\101", strtotime($row->end)); $schedule = ''; if ($d1) { $schedule .= "\x4d\40"; } if ($d2) { $schedule .= "\x54\x20"; } if ($d3) { $schedule .= "\127\x20"; } if ($d4) { $schedule .= "\x54\x48\x20"; } if ($d5) { $schedule .= "\106\40"; } if ($d6) { $schedule .= "\123\141\x74\x20"; } if ($d7) { $schedule .= "\123\40"; } return $schedule . $start . "\40\x2d\40" . $end; })->rawColumns(array("\141\x63\164\x69\x6f\x6e"))->make(true); } public function UserAccountDeleteAction(Request $request) { $id = $request->UserID; Users::where("\151\x64", $id)->delete(); return response()->json(array("\x61\160\160\162\x6f\x76\145\x64" => "\101\x63\x63\x6f\165\156\x74\x20\x68\x61\163\40\142\x65\145\x6e\x20\144\145\x6c\x65\x74\145\x64\x20\x73\165\143\143\145\x73\163\146\165\x6c\154\x79\56")); } public function RubricArchive(Request $request) { try { $id = $request->UserID; $user = rubrics::findOrFail($id); $user->status = "\141\162\x63\x68\x69\166\x65"; $user->updated_by = Session::get("\x6e\141\155\145"); $user->save(); return response()->json(array("\141\162\x63\x68\x69\x76\145\144" => "\122\x75\142\162\151\x63\x20\150\x61\x73\x20\142\x65\145\x6e\40\141\162\143\150\151\x76\145\x64\40\163\165\x63\143\x65\163\163\146\165\154\x6c\171\56")); } catch (ModelNotFoundException $exception) { return response()->json(array("\145\x72\162\157\162" => "\x52\165\x62\x72\151\x63\40\156\157\164\x20\146\x6f\165\x6e\144\x2e")); } } public function UserAccountArchive(Request $request) { try { $id = $request->UserID; $user = Users::findOrFail($id); $user->status = "\141\162\x63\150\151\166\145"; $user->updated_by = Session::get("\156\x61\155\145"); $user->save(); return response()->json(array("\x61\x72\143\x68\x69\x76\x65\x64" => "\101\x63\143\x6f\165\x6e\x74\x20\x68\x61\x73\x20\x62\x65\145\x6e\x20\x61\x72\143\x68\151\166\145\x64\x20\163\165\143\x63\145\x73\x73\x66\165\154\x6c\x79\56")); } catch (ModelNotFoundException $exception) { return response()->json(array("\145\162\x72\157\x72" => "\125\x73\x65\x72\x20\156\x6f\x74\x20\146\157\165\156\144\56")); } } public function ClassArchive(Request $request) { try { $id = $request->UserID; $user = Classes::findOrFail($id); $user->status = "\x61\x72\143\150\x69\166\145"; $user->updated_by = Session::get("\156\141\x6d\x65"); $user->save(); return response()->json(array("\141\162\x63\150\x69\166\145\x64" => "\x43\x6c\x61\x73\x73\40\x68\141\163\40\142\x65\145\156\x20\141\162\143\x68\151\x76\x65\x64\x20\x73\x75\143\143\145\163\x73\x66\165\x6c\154\x79\x2e")); } catch (ModelNotFoundException $exception) { return response()->json(array("\145\x72\162\x6f\x72" => "\103\x6c\141\x73\163\x20\156\x6f\164\x20\146\157\165\156\x64\x2e")); } } public function UnenrollAccount(Request $request) { try { $id = $request->UserID; $data = DB::table("\143\154\141\x73\163\x65\x73\x5f\x61\163\x69\x67\156\163")->select("\143\154\141\163\x73\137\x69\144", "\165\x73\145\x72\137\151\x64")->where("\151\x64", $id)->first(); $class_id = $data->class_id; $user_id = $data->user_id; $experiment = ExperimentReport::where("\x75\163\x65\162\137\x69\x64", $user_id)->where("\x63\154\141\163\x73\x5f\151\144", $class_id)->delete(); $user = ClassesAsign::where("\151\144", $id)->delete(); return response()->json(array("\x75\x6e\145\x6e\162\x6f\x6c\154\145\144" => "\101\x63\x63\x6f\x75\156\164\40\150\141\163\x20\142\x65\145\x6e\40\x75\156\145\x6e\162\x6f\x6c\x6c\145\x64\x20\163\x75\143\143\145\163\x73\146\165\x6c\154\171\x2e")); } catch (ModelNotFoundException $exception) { return response()->json(array("\x65\x72\x72\x6f\162" => "\x43\x6c\x61\x73\163\40\156\x6f\x74\x20\x66\157\x75\156\144\56")); } } public function UnenrollClass(Request $request) { try { $id = $request->classID; $class = ClassesAsign::where("\143\x6c\x61\x73\x73\x5f\x69\x64", $id)->delete(); $experiment = ExperimentReport::where("\143\x6c\141\x73\x73\137\x69\144", $id)->delete(); return response()->json(array("\165\x6e\x65\156\x72\x6f\154\154\x65\144" => "\x41\154\x6c\x20\x41\143\143\x6f\x75\156\x74\163\40\x53\x75\x63\143\145\x73\163\146\165\154\x6c\x79\40\x55\156\145\x6e\x72\157\154\154\145\144\56")); } catch (ModelNotFoundException $exception) { return response()->json(array("\x65\x72\162\x6f\162" => "\103\x6c\141\x73\x73\40\x6e\157\x74\40\x66\x6f\x75\x6e\x64\x2e")); } } public function ExperimentActivation(Request $request) { try { $id = $request->UserID; $user = classEx::findOrFail($id); $user->status = null; $user->updated_by = Session::get("\156\141\x6d\x65"); $user->save(); return response()->json(array("\x72\145\x73\x74\x6f\162\x65\144" => "\105\x78\x70\x65\162\x69\155\145\156\164\40\150\x61\163\x20\x62\x65\x65\x6e\x20\x61\x63\164\151\x76\x61\x74\145\x64\x20\163\165\143\143\x65\x73\x73\146\165\x6c\154\x79\x2e")); } catch (ModelNotFoundException $exception) { return response()->json(array("\145\162\162\157\162" => "\x45\170\160\x65\162\151\155\x65\156\x74\40\x6e\157\x74\x20\x66\x6f\x75\156\x64\x2e")); } } public function AccountActivation(Request $request) { try { $id = $request->UserID; $user = Users::findOrFail($id); $user->status = ''; $user->updated_by = Session::get("\x6e\x61\155\x65"); $user->save(); return response()->json(array("\x72\x65\163\x74\x6f\x72\145\144" => "\x41\x63\x63\x6f\x75\156\164\40\150\x61\x73\x20\x62\x65\x65\156\40\141\x63\164\x69\166\141\164\145\144\40\163\x75\143\x63\145\163\163\x66\x75\x6c\x6c\171\x2e")); } catch (ModelNotFoundException $exception) { return response()->json(array("\x65\x72\x72\x6f\x72" => "\x55\163\145\162\40\156\x6f\x74\40\146\157\x75\156\x64\56")); } } public function RubricRestoration(Request $request) { try { $id = $request->UserID; $user = rubrics::findOrFail($id); $user->status = null; $user->updated_by = Session::get("\x6e\x61\x6d\145"); $user->save(); return response()->json(array("\x72\x65\x73\x74\157\162\145\144" => "\122\165\x62\x72\x69\143\x20\150\x61\163\x20\142\145\x65\156\40\162\145\163\164\157\x72\145\x64\40\x73\x75\143\143\145\163\163\x66\x75\x6c\x6c\x79\x2e")); } catch (ModelNotFoundException $exception) { return response()->json(array("\145\162\162\157\162" => "\125\163\x65\x72\x20\x6e\157\x74\40\x66\157\x75\x6e\x64\x2e")); } } public function AccountRestoration(Request $request) { try { $id = $request->UserID; $user = Users::findOrFail($id); $user->status = ''; $user->updated_by = Session::get("\156\x61\155\x65"); $user->save(); return response()->json(array("\x72\x65\x73\x74\x6f\x72\145\144" => "\x41\143\143\x6f\165\156\164\x20\x68\141\x73\x20\x62\x65\145\156\40\x72\145\x73\x74\157\x72\x65\x64\40\163\x75\x63\143\x65\163\163\146\165\154\154\x79\x2e")); } catch (ModelNotFoundException $exception) { return response()->json(array("\145\x72\162\157\x72" => "\x55\x73\145\x72\40\x6e\x6f\x74\x20\x66\157\165\x6e\144\56")); } } public function ClassRestoration(Request $request) { try { $id = $request->UserID; $user = Classes::findOrFail($id); $user->status = ''; $user->updated_by = Session::get("\x6e\x61\155\x65"); $user->save(); return response()->json(array("\162\145\x73\164\x6f\162\145\x64" => "\x41\143\143\157\165\x6e\x74\40\x68\x61\x73\x20\142\x65\145\156\x20\x72\x65\x73\164\157\162\145\x64\40\x73\x75\143\143\x65\x73\x73\146\165\x6c\x6c\x79\x2e")); } catch (ModelNotFoundException $exception) { return response()->json(array("\145\x72\x72\x6f\162" => "\125\x73\145\x72\40\156\157\x74\40\x66\157\165\156\x64\56")); } } public function UserPasswordReset(Request $request) { try { $id = $request->UserID; $user = Users::findOrFail($id); $user->password = Hash::make("\x53\x6d\x61\162\164\x6c\x61\x62\x32\60\62\63\x21"); $user->pass_string = "\123\155\x61\162\164\154\x61\142\62\x30\x32\63\x21"; $user->save(); return response()->json(array("\x72\145\x73\x65\164\x74\145\144" => "\x50\x61\163\x73\x77\157\162\x64\40\162\x65\x73\145\164\x20\x73\165\x63\x63\x65\x73\x73\146\x75\x6c\x6c\x79\x21")); } catch (ModelNotFoundException $exception) { return response()->json(array("\145\x72\x72\157\x72" => "\x55\163\145\x72\x20\156\157\164\x20\x66\x6f\x75\x6e\144\56")); } } public function UserEditbtnFetch(Request $request) { $data = Users::find($request->Uupdatebutton); return response()->json(array("\x55\x73\145\x72\x44\x61\x74\141" => $data)); } public function EditUserAccount(Request $request) { $validated = Validator::make($request->all(), array("\165\x73\145\x72\x6e\141\x6d\145" => "\x72\145\x71\x75\x69\162\x65\x64", "\156\x61\x6d\145" => "\162\145\161\x75\151\x72\x65\x64", "\x72\157\x6c\x65" => "\x72\x65\161\165\x69\x72\x65\x64", "\165\x73\145\162\x49\104" => "\162\x65\x71\165\x69\x72\145\144", "\145\x6d\x61\151\154" => "\x72\x65\x71\165\151\162\145\x64"), array("\x75\163\x65\x72\x6e\141\155\x65\56\x72\x65\x71\x75\x69\162\x65\144" => "\x54\150\145\x20\x55\x73\x65\162\x6e\141\155\x65\x20\146\x69\145\x6c\x64\x20\151\163\x20\x72\145\161\165\x69\162\145\x64", "\x6e\x61\155\x65\56\x72\145\x71\x75\151\162\x65\x64" => "\124\150\x65\x20\116\141\155\145\x20\x66\x69\145\154\144\40\151\163\x20\162\145\x71\x75\x69\x72\x65\144", "\162\x6f\x6c\145\x2e\x72\x65\x71\x75\151\x72\x65\x64" => "\x54\150\x65\x20\x52\x6f\154\145\40\x66\x69\145\x6c\x64\40\x69\163\x20\x72\x65\x71\165\x69\x72\x65\144", "\x65\155\x61\x69\x6c\56\x72\145\x71\x75\x69\162\145\x64" => "\124\150\145\x20\105\155\141\151\x6c\40\146\x69\x65\x6c\144\x20\151\x73\x20\162\145\161\x75\x69\x72\x65\144", "\165\163\x65\x72\111\104\56\x72\145\x71\x75\x69\x72\x65\x64" => "\x54\x68\145\x72\145\40\167\x61\x73\x20\156\157\x20\x61\x63\143\157\165\156\x74\x20\x68\151\147\150\154\x69\147\x68\164\145\144\54\x20\x50\x6c\x65\141\x73\145\x20\x72\x65\143\x6c\x69\143\153\x20\164\x68\x65\40\x45\x64\x69\164\40\142\165\164\x74\x6f\x6e")); if ($validated->fails()) { return response()->json(array("\145\162\x72\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\145\x72\x45\x64\151\x74\145\144" => "\x55\163\145\162\40\101\143\143\157\x75\156\x74\40\x68\x61\x73\40\142\x65\145\156\40\165\x70\x64\141\x74\145\144\56")); } } public function getClass() { $data = DB::table("\x63\154\x61\163\x73\145\163")->whereNull("\162\x75\x62\162\151\143\x5f\x61\x73\163\x69\147\156\145\144")->get(); return view("\x73\171\x73\164\x65\155\x70\x61\147\145\x73\56\x72\x75\x62\162\151\x63\55\142\157\x6f\153", array("\143\154\141\x73\163\x44\141\x74\141" => $data)); } public function displayRubric($rubric_id, $class_id, $act_id, $user_id) { $checkIfGrade = DB::table("\x72\165\142\162\151\143\x5f\x67\x72\x61\x64\145\163")->where("\151\x64\x5f\x72\x75\x62\x72\151\x63", $rubric_id)->where("\x75\137\x69\x64", $user_id)->where("\x63\x6c\x61\163\x73\137\151\x64", $class_id)->where("\141\143\x74\x5f\x69\144", $act_id)->where("\164\157\164\x61\154\x5f\x73\143\x6f\162\145", "\41\75", "\116\x2f\101")->first(); $activityData = DB::table("\x63\x6c\x61\x73\163\137\145\170\x65\x73")->where("\143\154\141\163\x73\x5f\151\144", $class_id)->where("\151\x64", $act_id)->first(); $rubricData = DB::table("\162\x75\142\162\151\x63\x73")->where("\151\x64", $rubric_id)->get(); $partData = DB::table("\162\165\142\162\151\x63\137\160\141\x72\x74\163")->where("\x72\x75\x62\162\151\143\137\151\144", $rubric_id)->get(); $criteriaData = DB::table("\162\x75\x62\x72\151\x63\x5f\143\x72\151\164\x65\162\151\x61\163")->where("\x72\x75\142\x72\151\143\137\x69\144", $rubric_id)->get(); $classData = Classes::find($class_id); $userData = Users::find($user_id); $checkUserIDClass = ClassesAsign::where("\143\x6c\141\163\163\x5f\x69\144", $class_id)->where("\x75\163\x65\162\137\151\x64", $user_id)->first(); if ($checkIfGrade) { return redirect("\x2f\x70\162\x65\166\151\x65\x77\55\147\x72\141\144\145\x2f" . $rubric_id . "\x2f" . $class_id . "\57" . $act_id . "\57" . $user_id); } else { if (!$classData) { return redirect("\x2f\144\x61\163\150\142\x6f\x61\x72\x64"); } else { if (!$checkUserIDClass) { return redirect("\x2f\144\x61\x73\150\142\x6f\141\x72\144"); } else { if (!$rubricData->isEmpty()) { return view("\163\171\x73\164\x65\x6d\x70\x61\x67\145\x73\x2e\x72\165\x62\x72\x69\143\x2d\147\162\x61\x64\x65", array("\x64\141\x74\x61" => $rubricData, "\x72\x75\142\x72\x69\143\137\x69\x64" => $rubric_id, "\x70\x61\x72\164\104\x61\164\141" => $partData, "\143\x72\151\164\145\x72\x69\x61\104\x61\164\141" => $criteriaData, "\x66\165\154\x6c\x6e\x61\x6d\x65" => $userData->name, "\x73\164\165\144\x65\x6e\164\111\104" => $userData->id, "\x63\154\x61\163\163\156\141\x6d\x65" => $classData->classname, "\x61\143\164\151\x76\151\164\171\x4e\141\x6d\145" => $activityData->ex_name)); } else { return redirect("\x2f\x64\141\x73\x68\x62\157\141\162\x64"); } } } } } public function displayRubricDB($id) { $rubricData = DB::table("\x72\165\x62\x72\151\x63\163")->where("\151\x64", $id)->get(); $partData = DB::table("\162\165\x62\x72\x69\143\x5f\x70\x61\162\164\x73")->where("\162\165\x62\162\x69\143\x5f\151\x64", $id)->get(); $criteriaData = DB::table("\162\x75\x62\x72\x69\x63\x5f\143\162\151\164\145\162\x69\x61\163")->where("\x72\165\142\162\x69\x63\137\x69\144", $id)->get(); if (!$rubricData->isEmpty()) { return view("\x73\x79\163\x74\x65\x6d\x70\x61\x67\x65\x73\56\x72\165\x62\162\151\143\x2d\x70\162\145\166\x69\145\167", array("\x64\x61\x74\141" => $rubricData, "\160\141\x72\x74\104\x61\164\x61" => $partData, "\x63\162\151\x74\145\x72\151\x61\x44\x61\164\141" => $criteriaData)); } else { return redirect("\x2f\144\141\x73\150\142\157\141\162\x64"); } } public function editRubricDB($id) { $rubricData = DB::table("\x72\x75\x62\x72\x69\x63\x73")->where("\151\144", $id)->get(); $partData = DB::table("\x72\165\x62\x72\151\x63\137\x70\x61\x72\164\163")->where("\162\165\x62\x72\151\x63\x5f\x69\144", $id)->get(); $criteriaData = DB::table("\x72\x75\x62\162\151\x63\x5f\x63\162\151\164\145\x72\x69\141\x73")->where("\162\x75\142\162\151\x63\x5f\151\144", $id)->get(); if (!$rubricData->isEmpty()) { return view("\x73\171\163\x74\x65\x6d\x70\141\147\x65\x73\x2e\145\144\151\164\x2d\x72\x75\142\x72\151\x63", array("\x64\x61\164\x61" => $rubricData, "\x70\x61\x72\x74\104\141\x74\x61" => $partData, "\x63\x72\151\164\x65\x72\x69\x61\x44\x61\x74\x61" => $criteriaData, "\151\144" => $id)); } else { return redirect("\57\x64\x61\163\x68\x62\x6f\x61\x72\144"); } } public function publishGrade(Request $request) { $totalPart = $request->input("\x70\x74\x74\157\x74\x61\154"); $score = $request->input("\146\x69\156\141\x6c\137\x73\143\x6f\162\145"); $feedback = $request->input("\146\145\x65\x64\x62\141\143\x6b\137"); $u_id = $request->input("\163\164\165\x64\145\x6e\164\x5f\151\x64"); $r_id = $request->input("\x72\x75\x62\162\x69\143\x5f\151\x64"); $class_id = $request->input("\x63\154\141\163\x73\x5f\151\144"); $act_id = $request->input("\x61\x63\164\x5f\x69\144"); $act_name = $request->input("\141\143\164\151\166\151\x74\171\x5f\x6e\141\x6d\145"); $check_weight = $request->input("\167\x65\x69\x67\x68\x74\x43\x68\x65\143\x6b"); $validated = Validator::make($request->all(), array("\x70\164\164\x6f\x74\x61\154\56\52" => "\162\x65\x71\x75\151\x72\x65\x64"), array("\x70\x74\164\x6f\x74\141\154\x2e\52\x2e\x72\145\161\165\x69\162\x65\144" => "\x54\x68\145\40\x43\162\x69\x74\x65\x72\151\141\40\x66\x69\x65\x6c\144\40\151\x73\40\x72\x65\161\165\151\x72\145\x64\56")); $checkIfGrade = DB::table("\x72\165\142\162\x69\x63\x5f\x67\x72\141\144\145\163")->where("\x69\144\x5f\162\165\x62\x72\151\x63", $r_id)->where("\165\137\x69\144", $u_id)->where("\143\154\141\163\x73\x5f\x69\144", $class_id)->where("\141\143\164\137\151\x64", $act_id)->where("\x74\157\x74\x61\154\137\163\x63\157\x72\x65", "\x21\75", "\x4e\57\x41")->first(); if ($validated->fails()) { return response()->json(array("\x65\162\162\157\x72\163" => $validated->errors()->first())); } else { if ($checkIfGrade) { return redirect("\x2f\x70\162\x65\166\151\145\167\55\147\x72\x61\x64\x65\x2f" . $r_id . "\x2f" . $class_id . "\x2f" . $act_id . "\57" . $u_id); } else { $conditions = array("\165\x5f\x69\144" => $u_id, "\x69\x64\137\162\165\x62\x72\x69\143" => $r_id, "\143\154\x61\x73\163\137\x69\144" => $class_id, "\141\143\164\x5f\x69\x64" => $act_id); RubricGrades::where($conditions)->update(array("\164\x6f\x74\141\154\x5f\163\x63\x6f\162\x65" => $score, "\162\x61\x6e\x6b" => '', "\x66\x65\x65\144\x62\x61\143\153" => $feedback, "\x61\143\164\x5f\156\x61\155\x65" => $act_name, "\143\x72\145\x61\x74\145\x64\137\142\171" => Session::get("\156\x61\155\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("\x73\x75\x63\143\x65\x73\x73" => "\107\162\x61\x64\x65\x20\157\146\x20\123\x74\165\x64\x65\156\164\x20\160\x75\142\x6c\x69\163\x68\145\x64\x20\x73\165\143\x63\x65\163\x73\146\165\154\x6c\171\x2e")); } } } public function gradePreview($rubric_id, $class_id, $act_id, $user_id) { $rubricData = RubricGrades::join("\162\x75\x62\x72\x69\143\x73", "\162\165\x62\162\x69\143\137\147\162\x61\144\x65\163\56\151\144\x5f\162\x75\x62\x72\151\143", "\75", "\x72\x75\142\162\x69\143\x73\x2e\151\x64")->where("\x72\x75\142\x72\151\143\163\56\x69\x64", $rubric_id)->where("\x72\165\142\x72\151\143\137\x67\162\141\x64\x65\x73\56\165\x5f\x69\144", $user_id)->where("\x61\x63\x74\137\x69\144", $act_id)->get(); $partData = PartGrades::join("\x72\165\x62\x72\151\x63\137\160\x61\x72\164\163", function ($join) { $join->on("\160\141\x72\x74\137\x67\x72\x61\144\145\x73\56\x69\144\x5f\x72\165\x62\162\x69\x63", "\x3d", "\162\165\x62\x72\151\x63\137\160\x61\x72\164\x73\x2e\162\x75\142\162\x69\143\137\x69\x64")->on("\160\141\162\164\x5f\147\162\x61\144\145\x73\x2e\x69\144\137\x70\x61\x72\x74", "\75", "\162\165\142\x72\x69\143\137\160\x61\162\x74\x73\x2e\x69\x64"); })->where("\x72\x75\x62\162\151\143\137\x70\141\x72\x74\x73\x2e\162\x75\x62\162\x69\x63\137\x69\x64", $rubric_id)->where("\160\141\162\164\137\147\x72\141\x64\145\x73\56\165\137\151\144", $user_id)->where("\x61\143\x74\137\151\x64", $act_id)->get(); $criteriaData = DB::table("\162\165\x62\162\x69\x63\x5f\x63\162\x69\164\x65\162\151\x61\163")->where("\x72\x75\x62\x72\x69\x63\x5f\151\x64", $rubric_id)->get(); $scoreData = DB::table("\x63\162\151\164\x65\162\151\x61\137\x67\x72\x61\144\145\163")->where("\151\144\137\x72\x75\x62\162\x69\x63", $rubric_id)->where("\x75\x5f\151\144", $user_id)->where("\x61\x63\164\x5f\151\x64", $act_id)->get(); $classData = Classes::find($class_id); $userData = Users::find($user_id); $checkUserIDClass = ClassesAsign::where("\143\154\x61\163\x73\x5f\151\x64", $class_id)->where("\165\163\145\x72\137\151\x64", $user_id)->first(); if (!$classData) { return redirect("\57\144\x61\x73\150\x62\x6f\141\x72\144"); } else { if (!$checkUserIDClass) { return redirect("\x2f\144\x61\163\x68\x62\157\141\x72\x64"); } else { if (!$rubricData->isEmpty()) { return view("\x73\171\x73\164\145\155\x70\x61\x67\145\x73\x2e\x67\162\x61\x64\145\55\160\x72\x65\x76\x69\145\167", array("\144\141\x74\141" => $rubricData, "\162\x75\x62\162\151\x63\137\151\x64" => $rubric_id, "\x70\141\162\x74\x44\141\164\x61" => $partData, "\x63\162\151\164\145\x72\x69\141\104\141\164\141" => $criteriaData, "\163\143\157\x72\145\104\x61\164\141" => $scoreData, "\146\x75\154\154\x6e\141\155\145" => $userData->name, "\x73\x74\x75\x64\145\156\x74\x49\104" => $userData->id, "\143\154\x61\163\x73\x6e\x61\155\145" => $classData->classname)); } else { return redirect("\x2f\144\141\163\150\142\157\141\162\144"); } } } } public function ClassEditFetch() { if (Session::get("\141\144\x6d\151\156") == "\141\144\155\151\x6e" || Session::get("\x61\144\155\151\156") == "\154\x6f\x77\137\141\144\155\x69\156") { $ClassData = DB::table("\x63\154\141\x73\x73\x65\163")->where("\163\164\141\x74\x75\x73", '')->get(); } elseif (Session::get("\141\x64\155\151\156") == "\160\x72\157\x66") { $ClassData = DB::table("\143\154\141\x73\x73\145\x73")->where("\x6f\x77\156\145\x72\137\151\x64", Session::get("\165\163\x65\x72\156\141\x6d\145"))->where("\163\x74\x61\x74\x75\x73", '')->get(); } return DataTables::of($ClassData)->addIndexColumn()->addColumn("\x53\143\150\145\x64\165\154\145", function ($row) { $class_time = DB::table("\x77\x65\x65\153\x5f\144\x61\x79\x73")->where("\x63\154\141\163\x73\137\151\x64", $row->schedule_id)->get(); $dataPassed = array(); $currentS = ''; $currentE = ''; foreach ($class_time as $timeData) { $timeS = date("\x68\72\x69\x41", strtotime($timeData->start)); $timeE = date("\150\x3a\x69\101", strtotime($timeData->end)); $currentS = $timeS; $currentE = $timeE; $day = $timeData->day; switch ($day) { case "\x4d\157\x6e\144\141\171": $dayString = "\x4d"; break; case "\124\x75\145\x73\x64\141\x79": $dayString = "\x54"; break; case "\x57\x65\x64\156\x65\163\144\x61\x79": $dayString = "\x57"; break; case "\x54\150\x75\x72\163\x64\141\x79": $dayString = "\124\110"; break; case "\x46\162\151\x64\x61\171": $dayString = "\106"; break; case "\x53\x61\164\165\162\x64\x61\171": $dayString = "\123\x61\164"; break; case "\x53\165\x6e\x64\141\x79": $dayString = "\x53"; break; } $dataPassed[] = '' . $dayString; } $dataPassed[] = "\x20" . $currentS . "\40\55\40" . $currentE . "\40"; if ($dataPassed) { return $dataPassed; } })->addColumn("\162\165\x62\162\x69\x63", function ($row) { $rubricName = DB::table("\162\x75\142\162\151\143\x73")->where("\x69\x64", $row->rubric_assigned)->value("\x72\x75\x62\162\151\x63\x5f\156\141\x6d\x65"); return "\x3c\x74\x64\76\x20{$rubricName}\40\x3c\x2f\164\144\76"; })->addColumn("\141\143\x74\151\x6f\156", function ($row) { if (Session::get("\x61\144\155\x69\x6e") == "\141\x64\x6d\x69\156" || Session::get("\x61\144\x6d\x69\156") == "\x6c\x6f\167\137\x61\144\x6d\151\156") { $btn = "\x3c\144\151\166\40\x63\154\141\163\163\x3d\x22\x62\164\x6e\x2d\147\162\x6f\x75\160\40\144\x72\157\160\154\x65\146\x74\42\x3e\xa\40\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x20\x20\40\x3c\x62\x75\x74\164\x6f\156\x20\164\x79\x70\x65\x3d\42\142\165\164\164\x6f\x6e\x22\40\x63\154\141\x73\163\x3d\x22\142\164\x6e\x20\142\164\x6e\x2d\160\x72\x69\155\141\x72\x79\x20\144\162\x6f\x70\x64\x6f\167\x6e\x2d\164\157\147\147\154\x65\42\40\144\141\x74\x61\x2d\164\157\x67\x67\x6c\x65\75\42\144\x72\x6f\160\x64\x6f\167\x6e\x22\40\x61\x72\151\141\x2d\150\141\x73\160\157\160\165\160\75\42\x74\162\165\x65\42\40\141\x72\151\x61\55\x65\170\x70\x61\156\x64\x65\144\x3d\x22\146\x61\154\163\145\x22\76\12\40\40\x20\40\40\40\40\40\x20\40\x20\x20\40\40\40\40\x53\x65\164\x74\x69\x6e\x67\163\xa\x20\40\x20\x20\x20\x20\x20\40\40\x20\40\40\40\x20\x20\x20\x3c\57\x62\x75\164\x74\x6f\156\x3e\12\x20\x20\x20\x20\x20\40\x20\x20\40\40\40\40\40\x20\40\40\74\144\151\166\40\143\x6c\141\x73\163\x3d\42\x64\x72\x6f\160\144\x6f\167\x6e\55\x6d\145\156\165\x20\144\x72\x6f\160\x6c\x65\x66\x74\x22\76\xa\x20\x20\x20\x20\x20\40\40\40\x20\x20\40\40\x20\40\40\x20\x20\40\x3c\x61\40\x63\x6c\x61\163\x73\75\42\144\x72\157\x70\x64\x6f\167\x6e\55\x69\164\145\155\40\103\154\x61\x73\x73\105\144\151\x74\x42\164\x6e\42\x20\x64\141\164\x61\55\151\x64\x3d\x22" . $row->id . "\42\x20\150\162\x65\x66\75\42\43\42\76\x45\x64\x69\164\x20\103\154\x61\163\163\40\123\x63\x68\x65\x64\165\154\x65\x3c\x2f\141\x3e\12\40\x20\x20\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\40\x20\x20\40\x3c\141\x20\x63\154\x61\163\163\75\42\144\162\x6f\160\x64\x6f\x77\156\x2d\x69\164\145\155\40\x41\144\144\x4e\145\167\105\x78\x70\145\162\x69\x6d\x65\156\164\42\40\x68\x72\x65\146\x3d\42\43\42\x20\x64\x61\x74\x61\x2d\x69\144\x3d\x22" . $row->id . "\x22\76\125\160\154\x6f\141\x64\x20\116\x65\x77\40\105\170\160\x65\x72\151\155\x65\x6e\x74\x3c\x2f\x61\x3e\xa\x20\x20\x20\40\x20\40\40\x20\40\40\40\40\40\40\40\x20\x20\x20\74\x61\40\143\154\x61\163\163\75\x22\144\x72\157\x70\x64\157\167\156\x2d\x69\164\145\x6d\x22\x20\150\x72\x65\146\x3d\x22\57\145\156\x72\157\154\154\145\144\55\x6c\151\x73\x74\x2f" . $row->id . "\42\40\x64\x61\164\141\x2d\151\144\x3d\42" . $row->id . "\x22\x20\164\x61\162\147\x65\164\40\75\40\42\137\x62\x6c\141\x6e\x6b\42\40\x3e\126\151\145\167\x20\x41\x63\143\x6f\165\x6e\164\x73\x20\105\x6e\162\157\154\154\145\x64\74\x2f\x61\x3e\12\x20\40\40\x20\40\40\x20\x20\x20\40\x20\40\x20\40\40\x20\40\40\74\141\40\x63\x6c\x61\x73\163\x3d\42\x64\x72\157\x70\144\157\167\x6e\x2d\x69\x74\145\155\x20\x76\151\x65\x77\105\x78\x70\145\162\x69\x6d\145\156\164\163\x22\40\150\162\145\x66\75\42\43\x22\x20\144\141\x74\x61\55\151\144\75\x22" . $row->id . "\42\76\x56\x69\145\x77\x20\x43\154\x61\163\163\40\105\x78\x70\x65\x72\151\155\145\156\164\163\x3c\57\x61\x3e\12\x20\x20\40\40\40\40\x20\40\x20\40\x20\x20\x20\x20\40\x20\40\x20\x3c\x61\x20\143\154\x61\x73\163\75\x22\144\x72\157\160\144\x6f\167\156\x2d\x69\x74\145\x6d\x20\x72\x65\155\157\x76\x65\x52\x75\142\162\x69\x63\x22\x20\150\162\145\x66\75\x22\43\42\x20\x64\x61\x74\x61\55\151\x64\x3d\42" . $row->id . "\x22\76\122\145\x6d\157\x76\145\x20\122\x75\x62\x72\151\143\x3c\57\x61\x3e\12\x20\x20\x20\x20\x20\40\x20\40\x20\40\x20\40\40\x20\40\x20\40\40\x3c\x61\x20\143\x6c\x61\x73\x73\75\42\x64\162\157\x70\x64\157\167\x6e\55\151\x74\145\155\x20\x61\x72\x63\150\x69\166\x65\102\x74\x6e\x22\x20\150\x72\145\146\x3d\42\x23\42\x20\x64\141\164\141\x2d\151\144\75\x22" . $row->id . "\x22\x3e\101\x72\143\150\x69\x76\145\x20\x43\x6c\x61\163\163\74\57\x61\76\xa\x20\40\40\40\40\40\x20\x20\40\40\40\40\40\x20\40\x20\x20\x20\74\141\40\143\154\x61\x73\163\x3d\x22\x64\162\x6f\x70\x64\x6f\x77\156\x2d\x69\164\145\x6d\40\155\x61\163\163\125\x6e\x65\x6e\x72\x6f\154\154\102\164\156\42\40\x68\162\145\x66\x3d\x22\x23\42\40\144\x61\x74\141\x2d\151\x64\75\42" . $row->id . "\42\x3e\115\x61\163\x73\x20\x55\156\145\x6e\x72\x6f\154\154\155\x65\x6e\x74\74\57\141\x3e\12\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\40\74\57\144\151\166\x3e\12\x20\40\40\40\40\40\x20\x20\40\40\x20\x20\x20\40\x3c\57\x64\151\166\76"; } else { $btn = "\x3c\x64\x69\x76\40\x63\154\x61\163\163\75\x22\x62\164\156\55\x67\x72\x6f\165\160\x20\x64\x72\157\x70\154\x65\x66\164\42\x3e\12\x20\40\x20\x20\40\40\40\40\40\40\40\x20\x20\x20\40\40\x3c\142\165\x74\x74\x6f\x6e\40\164\171\160\145\x3d\x22\x62\165\x74\164\157\156\x22\x20\143\x6c\x61\x73\x73\x3d\x22\142\164\156\40\x62\x74\156\55\x70\x72\151\x6d\x61\162\x79\x20\x64\x72\157\160\x64\157\x77\x6e\55\x74\x6f\147\147\154\145\x22\40\x64\141\x74\x61\55\164\157\147\147\x6c\145\75\42\144\162\157\x70\144\x6f\167\156\42\x20\141\162\x69\141\55\150\x61\163\x70\157\160\x75\160\x3d\x22\164\162\x75\145\42\40\x61\x72\151\x61\55\x65\170\160\x61\156\x64\x65\x64\x3d\42\146\x61\x6c\x73\145\42\76\12\40\40\x20\x20\40\x20\40\x20\40\40\x20\x20\40\x20\40\x20\x53\145\x74\x74\x69\x6e\x67\163\xa\x20\40\x20\x20\x20\40\40\x20\40\x20\x20\40\x20\40\x20\40\x3c\x2f\x62\165\x74\x74\157\156\76\12\40\40\x20\40\x20\40\40\40\x20\40\x20\x20\40\x20\40\40\74\x64\x69\x76\x20\143\x6c\141\x73\163\75\42\x64\162\x6f\160\x64\x6f\167\156\55\155\145\156\x75\40\x64\162\x6f\160\x6c\145\146\164\42\76\xa\40\40\40\40\40\x20\x20\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\x3c\x61\x20\x63\x6c\x61\x73\163\x3d\x22\144\162\x6f\160\144\157\x77\156\x2d\x69\164\145\x6d\40\103\154\x61\x73\x73\x45\x64\151\x74\x42\x74\156\x22\x20\x64\141\x74\x61\55\x69\x64\x3d\x22" . $row->id . "\42\40\150\x72\x65\146\x3d\x22\43\x22\x3e\105\x64\151\x74\40\x43\154\141\x73\163\40\123\143\x68\x65\144\x75\x6c\145\74\x2f\x61\76\12\40\40\x20\x20\x20\x20\x20\x20\40\40\40\x20\40\x20\x20\40\x20\40\74\x61\x20\143\x6c\x61\163\x73\75\x22\x64\x72\x6f\x70\x64\x6f\x77\x6e\55\x69\164\x65\155\x20\101\x64\144\x4e\145\167\105\170\x70\145\x72\x69\155\145\x6e\x74\42\x20\x68\162\145\x66\75\x22\43\42\40\x64\x61\164\141\x2d\x69\x64\75\42" . $row->id . "\x22\x3e\125\x70\154\x6f\x61\144\40\x4e\x65\167\40\x4d\157\144\165\154\x65\74\57\x61\x3e\xa\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\x20\40\x20\74\141\x20\x63\154\141\163\163\x3d\x22\x64\162\x6f\160\x64\157\x77\x6e\55\x69\164\x65\155\40\x63\162\x65\141\164\145\116\x65\167\x45\x78\x70\145\162\x69\155\145\x6e\x74\42\x20\x68\162\145\x66\x3d\42\x23\x22\x20\x64\141\164\141\x2d\x69\x64\x3d\x22" . $row->id . "\42\x3e\103\162\145\x61\x74\x65\x20\116\x65\x77\x20\x4d\157\x64\165\x6c\x65\x3c\x2f\x61\x3e\12\x20\40\40\x20\40\40\40\40\x20\x20\40\x20\x20\40\x20\40\x20\40\74\141\x20\143\x6c\141\163\163\75\42\144\162\x6f\160\x64\157\x77\x6e\55\x69\x74\145\x6d\x20\166\151\145\x77\105\170\160\x65\x72\151\x6d\145\x6e\164\x73\42\40\x68\x72\145\146\x3d\x22\x23\x22\40\144\x61\164\141\55\x69\x64\x3d\42" . $row->id . "\x22\x3e\x56\x69\145\x77\40\x43\x6c\141\163\x73\40\x45\170\x70\145\162\151\x6d\x65\x6e\164\163\x3c\x2f\141\76\12\x20\x20\40\40\40\x20\x20\40\40\x20\40\40\x20\x20\x20\x20\74\x2f\144\x69\166\76\xa\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\x20\40\x20\74\57\x64\151\166\76"; } return $btn; })->rawColumns(array("\x61\x63\x74\151\157\x6e", "\x72\165\x62\x72\x69\143", "\123\143\150\145\144\165\154\145"))->make(true); } public function RubricBookFetch() { $RubricBook = DB::table("\x72\x75\x62\162\151\x63\x73")->whereNull("\163\164\x61\x74\165\x73")->get(); return DataTables::of($RubricBook)->addIndexColumn()->addColumn("\x61\143\164\x69\x6f\156", function ($row) { $btn = "\x3c\144\151\166\40\143\154\x61\163\163\x3d\x22\142\164\x6e\x2d\147\162\157\165\x70\40\x64\162\x6f\160\154\145\146\164\x22\76\xa\11\x9\x9\11\x9\11\74\142\x75\164\164\x6f\156\40\x74\171\x70\145\75\42\142\x75\x74\x74\x6f\x6e\x22\40\143\x6c\x61\x73\163\x3d\42\142\x74\x6e\40\142\164\x6e\x2d\x70\x72\151\155\x61\162\171\40\x64\x72\157\160\144\157\167\x6e\x2d\164\157\147\x67\x6c\x65\x22\40\144\141\164\141\55\164\x6f\x67\x67\154\145\x3d\42\x64\162\157\x70\144\x6f\167\156\42\40\141\162\x69\141\x2d\150\141\x73\x70\157\160\165\x70\75\42\164\162\x75\145\42\x20\x61\x72\x69\141\55\145\170\160\x61\156\144\x65\x64\x3d\42\146\x61\x6c\163\145\42\x3e\xa\11\x9\x9\11\11\x9\11\x53\x65\x74\164\x69\x6e\x67\163\12\11\11\11\11\11\x9\x3c\x2f\142\165\164\x74\x6f\x6e\x3e\xa\x9\11\x9\x9\x9\x9\74\144\x69\x76\x20\x63\154\141\x73\163\75\x22\144\162\x6f\x70\x64\157\167\x6e\x2d\x6d\x65\x6e\165\x20\x64\162\x6f\x70\x6c\145\x66\x74\42\76\xa\11\x9\x9\x9\x9\x9\x9\x3c\x61\x20\x63\154\x61\x73\163\x3d\42\x64\x72\x6f\160\x64\x6f\x77\x6e\55\151\164\145\155\x20\162\165\142\x72\151\x63\x41\x73\x73\x69\147\156\103\x6c\151\143\153\42\40\x64\x61\x74\x61\x2d\151\144\x3d\42" . $row->id . "\x22\40\x68\162\x65\146\x3d\42\x23\x22\40\x64\141\x74\141\55\164\157\x67\147\154\145\75\x22\x6d\157\x64\x61\x6c\x22\40\x64\x61\x74\x61\x2d\x74\x61\162\147\145\164\75\x22\x23\141\x73\x73\151\147\x6e\x52\x75\x62\x72\x69\143\115\x6f\144\141\154\x22\x3e\101\x73\163\151\x67\x6e\x20\x52\x75\142\162\x69\x63\x20\164\157\x20\x43\x6c\x61\163\x73\x3c\57\141\76\xa\11\11\11\11\x9\x9\x9\x3c\141\x20\x63\154\141\163\x73\x3d\42\x64\162\x6f\160\144\157\x77\156\55\151\164\145\155\42\40\150\x72\x65\x66\75\42\57\x72\x75\142\162\x69\x63\x2d\160\162\145\x76\151\145\167\x2f" . $row->id . "\42\40\x74\x61\162\147\x65\164\x3d\42\x5f\142\x6c\141\x6e\153\42\76\x50\x72\x65\x76\x69\145\167\40\122\x75\142\162\151\143\74\57\141\x3e\xa\11\x9\11\x9\11\x9\x9\x3c\x61\40\x63\154\141\163\x73\x3d\x22\x64\x72\x6f\160\144\x6f\x77\156\x2d\x69\x74\145\155\42\x20\150\162\145\146\x3d\42\x2f\145\x64\151\164\x2d\162\165\x62\x72\x69\143\x2f" . $row->id . "\42\x20\164\141\x72\x67\145\x74\75\x22\137\x62\x6c\141\156\x6b\x22\76\x45\x64\x69\164\40\122\x75\x62\162\x69\143\74\x2f\141\76\xa\x9\x9\x9\x9\x9\x9\11\74\141\x20\143\x6c\x61\163\163\x3d\42\144\162\x6f\160\x64\x6f\x77\156\55\151\164\145\x6d\x20\x72\165\x62\x72\151\143\101\x72\143\150\x69\x76\145\x22\x20\x64\x61\x74\x61\x2d\x69\x64\75\42" . $row->id . "\x22\x20\40\x68\x72\x65\x66\75\x22\x23\x22\x3e\x41\162\143\150\151\166\x65\40\122\165\142\162\151\x63\74\57\x61\76\xa\11\11\11\11\x9\11\x3c\x2f\144\x69\166\x3e\xa\11\x9\x9\11\x9\x3c\x2f\x64\x69\166\x3e"; return $btn; })->rawColumns(array("\x61\143\164\x69\157\x6e"))->make(true); } public function ClassAccountDeleteAction(Request $request) { $id = $request->UserID; Classes::where("\151\144", $id)->delete(); return response()->json(array("\x61\160\x70\162\157\166\x65\144" => "\103\154\141\x73\x73\x20\150\x61\163\40\x62\145\145\x6e\40\144\x65\154\x65\x74\x65\144\40\163\x75\143\x63\145\163\163\x66\x75\x6c\x6c\x79\x2e")); } public function UnassignRubric(Request $request) { $id = $request->UserID; $result = Classes::where("\x69\x64", $id)->update(array("\x72\165\142\162\151\143\x5f\x61\163\163\151\147\156\x65\x64" => null)); if ($result) { return response()->json(array("\x75\x6e\x61\163\x73\151\x67\x6e\x65\x64" => "\122\165\142\x72\x69\143\x20\150\141\x73\x20\142\x65\145\x6e\x20\162\145\x6d\157\166\145\144\x20\163\165\143\143\x65\x73\163\146\x75\154\154\x79\56")); } } public function ClassEditbtnFetch(Request $request) { $data = Classes::find($request->Cupdatebutton); $week_days = DB::table("\x77\145\145\153\137\x64\x61\171\163")->where("\x63\x6c\x61\163\163\x5f\x69\144", $data->schedule_id)->get(); return response()->json(array("\103\154\x61\x73\x73\x44\x61\x74\x61" => $data, "\127\145\x65\x6b\104\141\171\x73\x5f\x64\141\x74\x61" => $week_days)); } public function fetchClass() { $data = DB::table("\143\x6c\141\x73\x73\145\163")->get(); return response()->json(array("\x63\x6c\141\x73\163\x44\x61\x74\x61" => $data)); } public function EditClassData(Request $request) { $validated = Validator::make($request->all(), array("\143\154\x61\x73\163\156\x61\x6d\145" => "\162\x65\161\x75\x69\x72\145\144", "\143\x6c\141\x73\163\151\x6e\146\x6f" => "\162\145\161\x75\151\162\x65\x64", "\143\154\x61\x73\163\111\x44" => "\x72\x65\161\x75\x69\162\x65\x64"), array("\x63\x6c\141\163\163\156\141\x6d\145\x2e\x72\x65\161\165\x69\x72\145\144" => "\x54\150\145\40\103\154\141\x73\x73\x20\x4e\141\155\x65\x20\146\151\x65\x6c\x64\40\151\163\x20\x72\x65\161\165\151\162\145\x64", "\x63\x6c\141\x73\x73\151\156\146\157\56\162\x65\161\165\x69\162\145\x64" => "\124\x68\x65\x20\x43\154\141\x73\163\x20\111\156\x66\157\40\146\151\x65\154\144\x20\151\163\x20\x72\145\161\x75\x69\162\145\144", "\x70\151\143\x2e\x72\x65\x71\165\x69\162\x65\x64" => "\x54\x68\145\x20\x50\x69\x63\x74\165\162\145\40\146\151\x65\154\144\40\x69\x73\40\162\145\x71\x75\151\x72\x65\x64", "\160\x69\143\56\x6d\x69\155\x65\x73" => "\x54\x68\145\x20\103\x6c\x61\x73\163\x20\x50\x69\x63\164\x75\162\x65\x20\x6d\165\x73\x74\40\142\x65\40\141\x20\x66\x69\154\x65\x20\x6f\146\40\x74\x79\x70\x65\72\40\x6a\x70\145\147\x2c\40\147\x69\x66\x2c\x20\x70\156\x67\x2c\x20\x4a\120\105\x47\x2c\x20\x47\111\x46\x2c\40\120\x4e\107\56")); if ($validated->fails()) { return response()->json(array("\145\162\162\157\162\x73" => $validated->errors()->first())); } else { if ($request->m == '') { $day_check = DB::table("\167\145\x65\x6b\137\x64\141\171\163")->where("\x63\x6c\x61\x73\163\x5f\x69\x64", $request->classID)->where("\x64\x61\171", "\115\x6f\x6e\x64\x61\x79")->first(); if ($day_check) { DB::table("\x77\145\x65\153\x5f\x64\x61\x79\x73")->where("\143\x6c\141\x73\x73\x5f\151\x64", $request->classID)->where("\x64\141\x79", "\x4d\x6f\x6e\144\141\x79")->delete(); } $m = "\146\141\154\163\x65"; } else { $m = $request->m; } if ($request->t == '') { $day_check = DB::table("\167\145\x65\153\137\x64\141\171\163")->where("\x63\x6c\x61\x73\163\x5f\151\144", $request->classID)->where("\x64\141\171", "\x54\165\145\163\144\x61\x79")->first(); if ($day_check) { DB::table("\167\145\x65\x6b\137\x64\x61\x79\x73")->where("\143\x6c\141\x73\x73\137\x69\x64", $request->classID)->where("\x64\x61\171", "\x54\165\145\x73\x64\141\171")->delete(); } $t = "\x66\x61\154\x73\145"; } else { $t = $request->t; } if ($request->w == '') { $day_check = DB::table("\x77\145\145\153\x5f\x64\141\x79\163")->where("\x63\154\x61\x73\x73\137\151\x64", $request->classID)->where("\x64\x61\x79", "\x57\145\x64\x6e\x65\x73\x64\141\x79")->first(); if ($day_check) { DB::table("\x77\145\145\x6b\137\144\141\171\x73")->where("\143\154\x61\x73\x73\137\151\x64", $request->classID)->where("\x64\x61\x79", "\127\x65\144\156\145\x73\144\141\x79")->delete(); } $w = "\146\141\x6c\163\x65"; } else { $w = $request->w; } if ($request->th == '') { $day_check = DB::table("\167\x65\145\x6b\x5f\x64\x61\171\163")->where("\x63\154\141\163\x73\x5f\151\x64", $request->classID)->where("\x64\141\x79", "\124\x68\x75\x72\x73\x64\141\171")->first(); if ($day_check) { DB::table("\167\x65\145\153\x5f\144\x61\x79\x73")->where("\143\x6c\141\163\163\137\151\144", $request->classID)->where("\x64\x61\x79", "\124\x68\x75\162\x73\144\x61\x79")->delete(); } $th = "\146\x61\x6c\x73\145"; } else { $th = $request->th; } if ($request->f == '') { $day_check = DB::table("\167\x65\x65\153\137\144\x61\x79\163")->where("\x63\x6c\x61\x73\163\137\x69\144", $request->classID)->where("\144\141\171", "\106\x72\x69\144\x61\x79")->first(); if ($day_check) { DB::table("\167\x65\145\x6b\x5f\144\x61\x79\163")->where("\x63\x6c\141\163\163\137\x69\x64", $request->classID)->where("\144\141\171", "\106\x72\x69\144\x61\171")->delete(); } $f = "\146\141\154\163\145"; } else { $f = $request->f; } if ($request->sat == '') { $day_check = DB::table("\167\x65\x65\153\137\x64\141\x79\163")->where("\143\x6c\x61\x73\x73\x5f\151\144", $request->classID)->where("\x64\141\x79", "\123\141\164\165\162\x64\x61\x79")->first(); if ($day_check) { DB::table("\x77\145\x65\153\137\144\141\x79\x73")->where("\143\154\141\x73\163\137\151\x64", $request->classID)->where("\x64\141\171", "\123\x61\164\x75\x72\144\141\x79")->delete(); } $sat = "\146\x61\x6c\x73\x65"; } else { $sat = $request->sat; } if ($request->s == '') { $day_check = DB::table("\x77\145\x65\x6b\137\x64\141\x79\163")->where("\143\x6c\x61\163\x73\137\151\144", $request->classID)->where("\x64\141\171", "\x53\165\156\x64\x61\x79")->first(); if ($day_check) { DB::table("\167\145\145\153\137\144\141\x79\x73")->where("\143\154\x61\x73\163\137\151\x64", $request->classID)->where("\x64\x61\171", "\x53\165\x6e\x64\x61\x79")->delete(); } $s = "\x66\x61\x6c\163\x65"; } else { $s = $request->s; } $ref_id = $request->classID; $class_id_fetch = DB::table("\x63\x6c\141\163\x73\145\163")->where("\x73\x63\150\x65\144\165\x6c\x65\x5f\151\x64", $request->classID)->first(); $editClass = Classes::find($class_id_fetch->id); $editClass->classname = $request->classname; $editClass->classinfo = $request->classinfo; $editClass->updated_by = Session::get("\x6e\141\155\x65"); $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("\167\145\145\x6b\137\144\x61\171\x73")->where("\x63\154\141\x73\163\x5f\151\x64", $request->classID)->where("\144\x61\x79", "\x4d\x6f\156\144\141\171")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\115\157\156\144\x61\x79"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } if ($request->t != '') { $day_check = DB::table("\167\x65\145\153\x5f\x64\x61\171\163")->where("\x63\154\141\163\x73\137\151\x64", $request->classID)->where("\x64\141\171", "\x54\165\145\x73\x64\x61\x79")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\x54\x75\x65\163\x64\141\x79"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } if ($request->w != '') { $day_check = DB::table("\x77\x65\145\153\137\144\141\171\x73")->where("\x63\x6c\141\x73\163\x5f\151\144", $request->classID)->where("\x64\141\x79", "\127\145\x64\156\145\163\144\x61\171")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\127\x65\144\156\145\163\x64\141\x79"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } if ($request->th != '') { $day_check = DB::table("\167\x65\x65\153\x5f\x64\141\171\163")->where("\143\154\x61\x73\163\x5f\151\144", $request->classID)->where("\144\141\171", "\124\150\x75\162\x73\144\x61\171")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\x54\x68\x75\162\163\144\x61\171"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } if ($request->f != '') { $day_check = DB::table("\167\x65\x65\x6b\137\144\141\x79\x73")->where("\x63\x6c\141\x73\163\137\151\144", $request->classID)->where("\x64\x61\x79", "\106\x72\151\x64\x61\171")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\106\162\x69\x64\141\x79"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } if ($request->sat != '') { $day_check = DB::table("\x77\x65\145\153\137\144\141\171\x73")->where("\x63\154\141\x73\x73\x5f\151\x64", $request->classID)->where("\x64\x61\x79", "\123\141\x74\x75\x72\x64\x61\171")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\x53\x61\x74\x75\x72\144\141\171"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } if ($request->s != '') { $day_check = DB::table("\167\x65\x65\153\x5f\144\x61\171\x73")->where("\143\x6c\141\163\163\137\x69\144", $request->classID)->where("\x64\141\x79", "\123\165\156\x64\141\171")->first(); if (!$day_check) { $NewSchedule = new weekDays(); $NewSchedule->class_id = $ref_id; $NewSchedule->day = "\123\x75\x6e\144\141\171"; $NewSchedule->start = $request->start; $NewSchedule->end = $request->end; $NewSchedule->save(); } } $all_day_check = DB::table("\167\145\x65\153\x5f\144\x61\x79\163")->where("\x63\x6c\141\x73\163\137\x69\x64", $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("\x69\156\x73\145\162\x74\x65\144" => "\x43\154\x61\163\163\x20\x44\x61\x74\x61\x20\150\141\163\x20\142\145\145\x6e\x20\165\160\x64\141\164\145\144\x2e")); } } public function store(Request $request) { $file = $request->upload; $fileName = $file->getClientOriginalName(); $New_name = time() . $fileName; $dir = "\163\164\x6f\162\141\147\x65\x2f\x48\x6f\x6d\x65\120\141\147\x65\120\x69\143\164\x75\x72\x65\163\x2f"; $file->move($dir, $New_name); $url = asset("\x73\164\157\x72\141\147\x65\57\x48\157\x6d\145\x50\x61\x67\145\x50\x69\143\x74\165\162\x65\163\x2f" . $New_name); $CkeditorFuncNum = $request->input("\x43\113\x45\144\x69\x74\x6f\162\x46\x75\x6e\143\x4e\x75\155"); $status = "\x3c\x73\x63\162\151\x70\x74\x3e\167\x69\156\144\157\167\x2e\x70\x61\162\x65\156\x74\x2e\x43\113\105\104\111\x54\117\122\x2e\x74\157\x6f\x6c\x73\56\143\141\154\x6c\x46\x75\x6e\143\164\151\157\156\x28\x27{$CkeditorFuncNum}\47\54\40\x27{$url}\47\x2c\40\x27\106\x69\x6c\145\x20\150\x61\163\40\x62\x65\145\x6e\x20\x75\x70\x6c\157\x61\x64\x65\144\x2e\47\x29\74\57\163\x63\x72\151\160\x74\x3e"; echo $status; } public function HomePageUpdate(Request $request) { $validated = Validator::make($request->all(), array("\x48\157\155\x65\x45\x64\x69\164\157\x72" => "\162\145\x71\x75\151\162\145\144"), array("\110\157\155\145\x45\144\x69\x74\x6f\162\x2e\x72\145\161\165\151\162\x65\x64" => "\124\150\145\40\105\x64\x69\164\x6f\x72\40\146\151\x65\x6c\144\x20\x69\163\40\162\x65\x71\x75\x69\162\x65\x64")); if ($validated->fails()) { return redirect()->back()->withErrors(array("\145\x6d\x70\x74\x79\x5f\145\x72\162\x6f\x72" => $validated->errors()->first())); } else { $HomeEdit = HomePage::find("\x31"); $HomeEdit->HomeContent = $request->HomeEditor; $HomeEdit->save(); return redirect()->back()->with(array("\x73\165\x63\x63\145\x73\x73" => "\x54\x68\x65\40\110\157\155\145\40\120\141\x67\x65\x20\x68\x61\163\40\142\145\x65\156\x20\165\x70\144\141\x74\145\144\x2e")); } } public function insertnewClassExWithEditor(Request $request) { $validated = Validator::make($request->all(), array("\x65\x78\x4e\141\x6d\145\105\x64\151\164\157\162" => "\x72\145\x71\165\x69\162\145\x64", "\x65\x78\x69\144\x45\144\x69\x74\x6f\x72" => "\162\145\x71\165\x69\162\x65\144", "\x45\x78\105\144\x69\x74\x6f\x72" => "\162\145\161\x75\151\x72\145\x64"), array("\145\x78\x4e\x61\x6d\145\x45\x64\x69\164\x6f\162\x2e\162\145\161\x75\x69\162\145\x64" => "\x54\x68\145\40\105\170\160\145\162\x69\155\145\x6e\164\x20\116\141\x6d\145\x20\x66\x69\145\154\144\40\151\163\x20\162\145\161\x75\151\x72\145\144", "\145\x78\151\144\x45\144\151\x74\157\x72\x2e\x72\145\x71\x75\x69\x72\x65\144" => "\105\162\x72\157\162\x20\x52\x65\154\157\x61\144\40\164\150\145\40\160\x61\x67\x65", "\x45\170\105\144\151\x74\x6f\162\56\x72\x65\x71\x75\x69\x72\x65\x64" => "\124\x68\x65\x20\105\170\x70\x65\162\x69\x6d\x65\x6e\164\140\163\40\105\x64\151\164\157\x72\x20\146\151\145\154\144\40\x69\163\x20\x72\145\161\x75\151\162\145\x64")); if ($validated->fails()) { return response()->json(array("\x65\x72\162\157\x72\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\156\163\x65\162\x74\x65\x64" => "\116\145\167\40\x45\x78\160\145\162\151\x6d\x65\156\x74\x20\x68\141\x73\40\142\145\145\x6e\40\163\x75\x62\x6d\x69\x74\x74\x65\144\56")); } } public function ViewExperiment(Request $request) { $apps_check = DB::table("\x73\x6d\141\162\164\154\141\142\137\141\160\160\x73")->where("\143\154\141\163\163\x45\170\137\x69\x64", $request->ID)->get(); if ($apps_check->isNotEmpty()) { $data = DB::table("\x63\154\141\x73\x73\x5f\x65\x78\145\163")->select("\143\x6c\141\163\163\137\x65\x78\x65\x73\x2e\x2a", "\163\155\x61\162\164\154\141\142\x5f\141\160\160\x73\56\52", "\143\154\141\x73\x73\x5f\145\170\145\163\56\x69\144\40\x61\x73\40\x6c\x69\x6e\153\116\141\x6d\145")->join("\163\155\141\162\x74\154\x61\x62\x5f\141\x70\160\x73", "\143\154\141\x73\x73\137\x65\x78\145\163\56\151\144", "\x3d", "\163\x6d\141\x72\164\154\141\x62\x5f\141\x70\x70\x73\56\143\x6c\x61\x73\163\105\x78\x5f\151\144")->where("\143\x6c\x61\x73\163\x5f\x65\x78\145\163\x2e\x63\154\x61\x73\163\x5f\x69\144", $request->ID)->get(); $data_score = DB::table("\x65\170\160\x65\162\x69\x6d\x65\156\164\x5f\162\145\160\157\162\x74\163")->where("\105\170\160\145\162\x69\x6d\x65\x6e\164\x5f\x69\144", $request->ID)->where("\165\x73\x65\x72\137\x69\x64", Session::get("\165\163\145\x72\x6e\141\x6d\x65"))->first(); return response()->json(array("\x44\141\x74\x61\x45\130" => $data, "\x44\x61\164\141\137\163\143\x6f\162\145" => $data_score)); } else { $data = DB::table("\143\154\141\163\163\137\145\x78\x65\x73")->select("\143\x6c\141\x73\x73\x5f\145\x78\145\x73\56\52", "\x73\155\x61\162\164\x6c\x61\x62\x5f\x61\x70\x70\163\x2e\52", "\x63\x6c\x61\x73\163\137\x65\x78\x65\163\x2e\x69\x64\x20\x61\163\x20\x6c\x69\156\153\116\141\x6d\x65")->join("\163\x6d\141\x72\x74\154\x61\x62\x5f\141\160\x70\163", "\143\x6c\x61\x73\x73\137\x65\x78\145\x73\56\151\x64", "\75", "\163\155\x61\x72\x74\x6c\141\142\x5f\141\160\160\163\56\x63\154\141\x73\163\105\170\137\x69\x64")->where("\143\154\x61\163\163\137\x65\170\x65\x73\56\x63\x6c\141\x73\163\x5f\x69\144", $request->ID)->get(); $data_score = DB::table("\145\170\160\x65\x72\x69\x6d\145\156\x74\x5f\x72\x65\x70\157\162\x74\163")->where("\x45\170\160\145\x72\151\155\x65\156\164\137\151\144", $request->ID)->where("\165\163\x65\162\137\151\144", Session::get("\x75\x73\145\162\156\x61\x6d\x65"))->first(); return response()->json(array("\104\141\164\141\105\x58" => $data, "\104\x61\164\141\x5f\163\x63\x6f\162\145" => $data_score)); } } public function AppsFetch(Request $request) { $data = DB::table("\x63\x6c\x61\x73\x73\x5f\x65\170\145\x73")->select("\x63\154\x61\163\163\137\x65\x78\x65\x73\x2e\52", "\163\155\x61\162\x74\x6c\141\x62\x5f\x61\160\160\x73\56\x2a", "\143\x6c\141\163\x73\x5f\145\170\x65\163\56\x69\x64\40\x61\x73\40\x6c\151\x6e\x6b\116\141\155\x65")->leftJoin("\163\155\x61\162\164\154\141\x62\x5f\x61\x70\160\163", "\x63\x6c\141\x73\163\x5f\x65\170\145\163\x2e\x69\144", "\75", "\x73\x6d\141\162\x74\154\x61\x62\x5f\x61\x70\160\x73\x2e\x63\154\141\x73\163\x45\170\137\x69\144")->where("\x63\154\x61\x73\x73\137\x65\170\145\x73\56\x69\x64", $request->ID)->get(); return DataTables::of($data)->addIndexColumn()->addColumn("\105\170\x70\145\162\151\x6d\x65\156\164\116\x61\155\145", function ($row) { if (!empty($row->ex_file)) { $btn = "\x3c\x61\x20\164\141\162\147\145\x74\75\x22\137\x62\x6c\141\156\153\42\x20\150\x72\x65\x66\x3d\x22\103\154\x61\163\163\x45\x78\57" . $row->ex_file . "\x22\76" . $row->ex_name . "\x3c\57\x61\x3e"; return $btn; } else { if (!empty($row->ExCreated)) { $btn = "\x3c\x61\40\164\141\x72\x67\145\164\75\42\x5f\x62\x6c\141\x6e\153\x22\40\x68\x72\x65\x66\x3d\42\145\x78\x70\x65\x72\151\155\145\156\x74\57" . $row->linkName . "\42\x3e" . $row->ex_name . "\74\57\x61\x3e"; return $btn; } } })->addColumn("\101\x70\x70", function ($row) { if ($row->app_name == "\x44\151\x67\151\x74\141\x6c\40\x43\x69\162\x63\x75\x69\x74") { $btn = "\74\x61\40\x74\141\162\x67\x65\x74\75\42\137\142\154\x61\x6e\153\42\40\x68\162\145\x66\x3d\x22\57\163\151\x6d\x75\154\141\x74\x6f\x72\x3f\141\x70\x70\x3d\x44\x43\42\x20\x63\154\141\163\163\x3d\x22\x62\164\156\x20\142\x74\156\55\x64\141\156\x67\x65\162\x22\x3e" . $row->app_name . "\74\x2f\141\x3e"; return $btn; } if ($row->app_name == "\x44\151\147\x69\x74\x61\x6c\40\x41\x72\144\x75\x69\156\x6f") { $btn = "\x3c\x61\40\164\141\162\x67\145\x74\75\42\x5f\142\154\141\156\x6b\x22\40\150\x72\145\x66\x3d\x22\57\x73\151\155\165\154\141\x74\157\162\x3f\x61\160\160\x3d\104\x41\x22\40\143\154\141\163\x73\75\x22\142\164\156\x20\142\164\x6e\x2d\x64\x61\x6e\x67\x65\162\x22\x3e" . $row->app_name . "\x3c\x2f\x61\x3e"; return $btn; } })->rawColumns(array("\x41\160\160", "\105\170\160\145\x72\151\x6d\145\x6e\164\x4e\141\x6d\145"))->make(true); } public function insertnewExperimentReport(Request $request) { $classID = $request->class_id; $validated = Validator::make($request->all(), array("\105\170\x70\145\162\151\x6d\145\x6e\x74\x49\x44" => "\162\x65\x71\x75\151\x72\145\144", "\122\145\160\157\162\x74\106\x69\x6c\x65" => "\162\145\161\165\x69\162\145\144", "\x52\x65\x70\x6f\x72\x74\x46\151\154\145" => "\162\145\x71\x75\x69\x72\x65\x64\x7c\x6d\x69\155\145\163\72\x70\144\146"), array("\x45\170\160\x65\x72\x69\155\x65\x6e\x74\x49\104\x2e\162\145\161\165\x69\x72\145\x64" => "\124\x68\145\x20\x45\x78\x70\145\x72\151\155\145\156\x74\x20\x4e\x61\155\x65\40\146\151\x65\154\144\40\x69\x73\x20\x72\145\x71\x75\151\162\145\144", "\145\170\151\144\x2e\162\145\x71\x75\x69\162\145\144" => "\105\162\162\157\x72\40\x52\145\154\157\141\144\40\164\x68\x65\40\x70\x61\147\145", "\122\145\x70\x6f\x72\164\x46\151\154\x65\56\x72\x65\161\165\151\x72\x65\144" => "\124\150\145\x20\105\x78\x70\x65\x72\x69\x6d\145\x6e\164\40\x52\x65\x70\157\162\164\x20\x66\x69\154\x65\40\x66\x69\145\154\144\40\x69\x73\40\162\x65\161\165\151\x72\145\144", "\122\145\x70\x6f\x72\164\106\x69\x6c\145\56\x6d\x69\x6d\x65\163" => "\124\x68\x65\x20\x45\x78\x70\145\162\151\x6d\145\156\x74\x20\122\x65\160\x6f\x72\164\x20\146\x69\x6c\145\x20\x6d\165\163\164\40\142\145\40\x61\x20\120\104\106\40\146\151\154\145")); if ($validated->fails()) { return response()->json(array("\145\x72\162\157\x72\x73" => $validated->errors()->first())); } else { $check_if_labReport_submitted = DB::table("\145\x78\160\x65\x72\151\x6d\x65\x6e\x74\x5f\x72\145\x70\x6f\x72\164\163")->where("\x45\170\160\x65\x72\x69\155\x65\156\x74\x5f\151\144", $request->ExperimentID)->where("\165\163\x65\x72\x5f\151\x64", Session::get("\165\x73\x65\162\156\141\155\x65"))->first(); if ($check_if_labReport_submitted) { if ($pdf = $request->file("\122\x65\x70\157\x72\x74\x46\x69\x6c\x65")) { $filename = $pdf->getClientOriginalName(); if ($pdf->move("\105\x78\x70\x65\x72\x69\x6d\145\x6e\164\x52\145\160\157\162\164", $filename)) { DB::table("\x65\x78\x70\145\x72\x69\155\x65\156\164\x5f\162\145\x70\157\162\x74\x73")->where("\105\170\160\x65\x72\151\155\x65\156\164\137\x69\x64", $request->ExperimentID)->where("\x75\163\145\x72\137\151\x64", Session::get("\x75\x73\145\x72\x6e\141\x6d\145"))->update(array("\x52\145\x70\x6f\x72\164\x5f\x66\x69\154\x65" => $filename)); return response()->json(array("\x69\156\163\x65\162\x74\145\144" => "\114\141\142\40\x52\x65\x70\x6f\162\164\x20\x68\x61\x73\40\142\x65\x65\156\x20\165\x70\x64\141\164\145\144\x2e")); } } } else { if ($pdf = $request->file("\122\x65\160\157\162\x74\106\151\x6c\145")) { $filename = $pdf->getClientOriginalName(); if ($pdf->move("\x45\x78\160\145\162\x69\x6d\145\x6e\x74\x52\145\160\x6f\x72\164", $filename)) { $check = DB::table("\143\x6c\141\163\163\145\163")->select("\162\165\x62\x72\x69\x63\137\x61\163\163\151\x67\x6e\x65\x64")->where("\x69\144", $classID)->get(); $newEx = new ExperimentReport(); $newEx->Experiment_id = $request->ExperimentID; $newEx->Report_file = $filename; $newEx->user_id = Session::get("\165\x73\x65\x72\156\x61\x6d\x65"); $newEx->class_id = $classID; $newEx->save(); $act_name = DB::table("\x63\x6c\141\163\x73\137\145\x78\145\x73")->select("\x65\170\x5f\156\x61\155\145")->where("\x69\x64", $request->ExperimentID)->get(); $saveGrade = new RubricGrades(); $saveGrade->u_id = Session::get("\165\x73\145\x72\x6e\141\155\x65"); $saveGrade->total_score = "\x4e\x2f\101"; $saveGrade->rank = "\116\x2f\101"; $saveGrade->id_rubric = $check[0]->rubric_assigned; $saveGrade->feedback = "\x4e\x2f\101"; $saveGrade->class_id = $classID; $saveGrade->act_id = $request->ExperimentID; $saveGrade->act_name = $act_name[0]->ex_name; $saveGrade->report_file = $filename; $saveGrade->created_by = "\116\x2f\101"; $saveGrade->save(); return response()->json(array("\151\156\x73\x65\162\x74\145\144" => "\116\x65\167\40\114\x61\x62\x20\x52\x65\x70\157\162\x74\x20\x68\x61\x73\40\x62\x65\145\x6e\40\x73\x75\142\155\151\x74\164\145\144\x2e")); } } } } } public function ReportsSubmitted(Request $request) { $classID = Classes::find(classEx::find($request->ID)->class_id)->id; $check = DB::table("\143\154\141\x73\x73\x65\x73")->select("\x72\x75\x62\162\x69\x63\137\141\x73\x73\151\147\x6e\x65\x64")->where("\x69\144", $classID)->get(); $hasRubric = DB::table("\143\x6c\x61\x73\x73\x65\x73")->select("\x72\x75\x62\x72\x69\143\137\141\x73\x73\151\x67\156\x65\144")->where("\151\144", $classID)->whereNotNull("\162\165\142\162\151\x63\x5f\x61\163\163\151\147\156\x65\x64")->first(); if ($hasRubric) { $data = DB::table("\x75\163\x65\162\x73")->select("\165\x73\145\x72\163\56\52", "\162\x75\142\x72\x69\x63\137\147\x72\141\x64\145\163\x2e\52", "\x75\x73\x65\162\x73\56\x69\x64\40\x61\x73\40\x55\163\x65\x72\111\x44")->join("\x72\x75\142\162\151\x63\137\x67\x72\x61\x64\x65\163", "\165\x73\x65\x72\x73\x2e\151\x64", "\x3d", "\x72\165\x62\x72\x69\x63\x5f\147\x72\x61\x64\145\163\x2e\165\137\x69\144")->where("\x72\x75\x62\x72\151\143\x5f\x67\162\x61\144\x65\163\56\x61\x63\x74\137\151\x64", $request->ID)->get(); return DataTables::of($data)->addIndexColumn()->addColumn("\x61\143\164\x69\x6f\x6e", 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\x61\x20\150\162\145\146\40\75\x20\x22\x2f\x72\165\x62\x72\x69\143\55\x67\x72\141\144\x65\x2f" . $rubricID . "\x2f" . $classID1 . "\57" . $row->act_id . "\x2f" . $userID . "\x22\x20\164\141\162\147\x65\x74\40\x3d\x20\x22\x5f\142\154\141\156\153\x22\40\x63\x6c\141\x73\x73\x3d\x22\142\x74\156\40\x20\x62\x74\156\x2d\163\x6d\x22\40\163\164\x79\x6c\x65\x3d\x22\x62\x61\x63\153\x67\162\x6f\165\x6e\144\x2d\x63\157\154\157\162\x3a\40\147\157\x6c\x64\x3b\40\x63\157\154\157\x72\x3a\x20\167\x68\151\164\x65\x3b\42\76\122\x75\142\162\x69\143\40\107\162\141\x64\x65\74\57\x61\76"; return $btn; })->addColumn("\106\x69\x6c\145\x53\x75\x62\x6d\151\164\x74\x65\144", function ($row) { $btn = "\x3c\x61\x20\x74\x61\x72\147\145\164\x3d\x22\x5f\x62\x6c\x61\156\153\x22\x20\150\162\x65\146\x3d\42\x45\170\x70\145\162\151\x6d\145\x6e\164\x52\x65\x70\x6f\162\164\x2f" . $row->report_file . "\42\x3e\x56\x69\145\167\40\114\101\x42\40\122\145\160\157\x72\x74\x3c\57\x61\76"; return $btn; })->rawColumns(array("\141\143\x74\151\x6f\x6e", "\106\x69\154\x65\123\x75\142\x6d\x69\164\x74\x65\x64"))->make(true); } else { $data = DB::table("\165\163\x65\162\x73")->select("\165\x73\x65\162\x73\x2e\x2a", "\x65\170\x70\x65\162\151\x6d\145\x6e\x74\137\162\x65\160\x6f\x72\164\163\56\x2a", "\145\170\x70\x65\x72\151\x6d\x65\156\164\x5f\x72\x65\160\x6f\162\x74\x73\56\105\170\x70\x65\x72\x69\x6d\x65\x6e\x74\137\x69\144\x20\141\163\x20\105\170\160\x65\x72\x69\155\x65\x6e\164\x49\104", "\165\163\145\x72\163\56\x69\144\x20\x61\x73\x20\125\163\145\x72\x49\x44", "\145\170\160\145\x72\x69\155\x65\x6e\164\x5f\162\145\x70\x6f\x72\x74\163\x2e\x69\144\40\x61\163\x20\105\x78\160\x65\162\151\155\x65\x6e\x74\x5f\111\x44")->join("\145\x78\x70\x65\x72\151\155\145\156\x74\137\x72\x65\x70\157\162\x74\x73", "\x75\163\x65\x72\x73\56\x69\x64", "\75", "\x65\x78\160\x65\162\x69\x6d\x65\156\164\137\x72\145\160\157\x72\x74\163\56\165\163\145\162\x5f\x69\x64")->where("\x65\x78\x70\x65\162\151\155\145\x6e\164\x5f\162\145\160\157\162\164\x73\56\x45\x78\x70\x65\x72\x69\155\145\x6e\164\x5f\151\x64", $request->ID)->get(); return DataTables::of($data)->addIndexColumn()->addColumn("\141\143\164\151\x6f\156", function ($row) { $btn = "\74\142\165\164\x74\157\x6e\40\x63\154\x61\x73\163\75\42\x62\164\156\x20\40\x62\164\x6e\x2d\163\x6d\40\x41\144\144\107\162\x61\144\145\x42\x74\156\x22\40\163\x74\x79\x6c\145\x3d\42\142\x61\x63\153\147\162\x6f\x75\156\x64\x2d\x63\157\x6c\x6f\162\72\x20\147\157\154\144\73\40\x63\x6f\154\x6f\x72\x3a\x20\x77\x68\x69\164\x65\73\x20\x22\x20\144\x61\x74\x61\x2d\151\144\75\42" . $row->Experiment_ID . "\42\x3e\x47\x72\x61\x64\145\74\57\x62\165\164\x74\157\156\x3e"; return $btn; })->addColumn("\x46\x69\154\x65\123\165\x62\155\x69\164\164\x65\x64", function ($row) { $btn = "\x3c\141\x20\164\x61\x72\x67\145\164\75\42\137\142\x6c\x61\x6e\x6b\x22\x20\150\162\x65\146\75\42\x45\170\160\145\162\151\155\145\156\x74\x52\x65\x70\x6f\x72\x74\x2f" . $row->Report_file . "\42\x3e\x56\151\x65\x77\40\114\x41\x42\40\122\145\160\157\162\164\x3c\x2f\141\76"; return $btn; })->rawColumns(array("\x61\143\164\151\x6f\156", "\106\151\154\x65\x53\x75\142\x6d\151\164\164\x65\144"))->make(true); } } public function aDDnewGradeToExperiment(Request $request) { $Experiment_Data = DB::table("\145\x78\x70\x65\162\x69\x6d\145\156\164\137\162\145\160\157\x72\x74\x73")->where("\x69\144", $request->ID)->first(); return response()->json(array("\105\170\x70\145\162\151\x6d\145\x6e\164\137\x49\104\137\106\145\164\143\x68\145\144" => $Experiment_Data)); } public function NewGrade(Request $request) { $validated = Validator::make($request->all(), array("\x45\x78\160\145\x72\151\x6d\x65\156\x74\137\151\144\x5f\x64\141\x74\x61" => "\162\x65\x71\x75\151\162\145\x64", "\165\163\145\x72\137\x69\x64\137\147\x72\141\x64\145" => "\162\145\x71\x75\151\162\145\144", "\147\162\141\x64\145" => "\162\x65\x71\165\151\162\145\x64"), array("\165\x73\145\162\156\141\x6d\145\56\162\x65\161\x75\x69\162\145\x64" => "\x54\150\145\40\x47\162\x61\144\x65\40\123\x63\157\x75\162\145\x20\146\x69\x65\154\144\x20\151\163\x20\162\145\x71\x75\151\x72\145\144", "\x45\170\160\x65\x72\151\155\x65\156\164\x5f\151\x64\137\144\141\x74\x61\x2e\162\x65\161\165\151\x72\x65\144" => "\x53\171\163\164\145\x6d\40\105\162\162\x6f\x72\x2e\x20\x50\x6c\145\141\163\145\x20\162\145\154\x6f\141\x64\40\164\x68\145\x20\160\141\147\x65\40\157\x72\40\x63\157\x6e\x6e\164\141\x63\x74\x20\163\171\x73\164\145\x6d\x20\x61\144\155\x69\x6e\x69\x73\x74\x72\x61\x74\157\x72\56", "\x75\x73\145\162\x5f\x69\x64\137\x67\162\141\144\x65\56\162\x65\x71\165\x69\x72\145\144" => "\x53\171\163\164\145\155\x20\105\x72\x72\x6f\x72\x2e\x20\x50\x6c\145\141\x73\145\40\x72\x65\154\x6f\x61\144\40\164\150\145\x20\x70\141\x67\x65\x20\x6f\x72\x20\143\x6f\x6e\x6e\x74\141\143\164\40\163\x79\x73\x74\x65\155\x20\141\144\x6d\x69\156\x69\163\x74\x72\x61\164\157\x72\x2e")); if ($validated->fails()) { return response()->json(array("\145\162\x72\x6f\162\163" => $validated->errors()->first())); } else { $check_grade = DB::table("\x65\170\160\x65\162\x69\155\x65\156\x74\x5f\x72\145\x70\157\162\164\163")->where("\151\x64", $request->Experiment_id_o)->first(); if ($request->grade_feedback == '') { if ($check_grade->feedback == "\116\x2f\101") { $New_grade = ExperimentReport::find($request->Experiment_id_o); $New_grade->total_score = $request->grade; $New_grade->feedback = "\116\57\101"; $New_grade->save(); $check_report = DB::table("\x65\170\x70\x65\x72\151\x6d\x65\x6e\164\x5f\x72\145\160\157\162\x74\163")->where("\x69\x64", $request->Experiment_id_o)->first(); $check_experiment = DB::table("\143\x6c\x61\x73\x73\137\x65\x78\x65\x73")->where("\151\x64", $check_report->Experiment_id)->first(); $notify = new Notifications(); $notify->notification_text = "\x59\157\165\x72\40\x47\x72\x61\x64\145\x20\x6f\x66\40{$check_experiment->ex_name}\x20\150\141\163\x20\142\x65\x65\156\40\x75\160\144\141\x74\145\144\x2e\x20"; $notify->user_id_notify = $check_report->user_id; $notify->status = "\x75\156\162\145\x61\144"; $notify->save(); return response()->json(array("\151\156\x73\x65\162\164\145\x64" => "\107\x72\141\x64\145\x20\x73\x63\157\162\145\x20\x68\x61\x73\40\142\145\x65\156\x20\x75\x70\x64\141\x74\145\x64\56")); } else { $New_grade = ExperimentReport::find($request->Experiment_id_o); $New_grade->total_score = $request->grade; $New_grade->save(); $check_report = DB::table("\x65\170\x70\145\162\x69\x6d\145\x6e\164\137\162\x65\x70\x6f\x72\x74\163")->where("\x69\144", $request->Experiment_id_o)->first(); $check_experiment = DB::table("\x63\154\141\x73\163\137\145\x78\145\x73")->where("\x69\x64", $check_report->Experiment_id)->first(); $notify = new Notifications(); $notify->notification_text = "\x59\157\x75\162\40\x47\162\141\x64\145\40\x6f\x66\x20{$check_experiment->ex_name}\x20\150\x61\163\x20\x62\x65\145\156\x20\x75\160\x64\141\164\145\144\56\x20"; $notify->user_id_notify = $check_report->user_id; $notify->status = "\165\x6e\162\x65\141\144"; $notify->save(); return response()->json(array("\151\x6e\163\145\162\x74\x65\144" => "\107\x72\141\x64\x65\40\163\143\157\162\145\x20\x68\x61\x73\x20\142\x65\x65\x6e\40\165\160\x64\141\164\x65\x64\x2e")); } } 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("\145\x78\160\145\162\151\x6d\145\156\x74\x5f\162\145\160\157\162\164\163")->where("\x69\144", $request->Experiment_id_o)->first(); $check_experiment = DB::table("\143\x6c\x61\x73\163\137\x65\170\x65\x73")->where("\151\144", $check_report->Experiment_id)->first(); $notify = new Notifications(); $notify->notification_text = "\x59\157\x75\x72\40\x47\x72\x61\144\145\40\x6f\x66\40{$check_experiment->ex_name}\x20\x68\141\163\40\x62\145\x65\x6e\40\165\160\144\141\164\x65\144\56\x20"; $notify->user_id_notify = $check_report->user_id; $notify->status = "\x75\x6e\162\145\141\144"; $notify->save(); return response()->json(array("\151\x6e\x73\145\x72\164\145\x64" => "\107\x72\141\x64\145\x20\x73\143\x6f\162\x65\x20\141\156\144\40\106\x65\145\x64\142\x61\143\153\x20\x68\141\166\x65\x20\142\x65\x65\x6e\40\x75\160\144\141\164\x65\x64\x2e")); } } } public function ExperimentsViewDetails(Request $request) { $class_Experiments_view = DB::table("\143\x6c\141\x73\163\x5f\145\x78\x65\x73")->where("\x63\x6c\141\x73\x73\x5f\151\144", $request->classID); return DataTables::of($class_Experiments_view)->addIndexColumn()->addColumn("\x41\143\x74\x69\x6f\156", function ($row) { $btn = "\74\x64\x69\x76\40\143\154\141\163\163\75\x22\142\164\156\x2d\147\162\x6f\165\x70\x20\x64\x72\x6f\x70\x6c\x65\146\x74\x22\x3e\12\x20\40\40\40\x20\40\40\40\40\40\x20\40\40\x20\40\40\74\x62\x75\x74\164\157\x6e\40\x74\x79\160\x65\x3d\42\142\x75\x74\164\157\x6e\42\40\x63\154\141\163\x73\75\42\142\164\x6e\40\x62\x74\x6e\55\x64\141\162\x6b\x20\144\162\x6f\160\144\x6f\167\x6e\x2d\164\x6f\x67\x67\x6c\145\42\40\144\141\164\x61\x2d\164\157\x67\147\x6c\145\75\42\144\162\157\x70\144\157\167\x6e\x22\x20\141\x72\151\x61\x2d\150\x61\x73\x70\x6f\160\165\x70\x3d\42\x74\162\165\x65\x22\40\x61\x72\x69\141\55\x65\x78\x70\141\156\144\x65\x64\75\x22\146\x61\x6c\x73\145\42\x3e\xa\40\x20\40\40\x20\x20\x20\40\40\x20\40\x20\40\x20\40\40\123\145\x74\164\x69\x6e\x67\163\12\x20\40\40\x20\x20\40\40\x20\x20\x20\x20\40\x20\x20\40\40\74\57\142\x75\164\x74\157\x6e\x3e\12\x20\40\40\x20\40\40\40\x20\x20\40\x20\40\40\40\x20\40\x3c\x64\x69\x76\40\x63\x6c\x61\x73\163\75\x22\144\162\x6f\160\x64\157\x77\x6e\x2d\155\145\156\x75\x20\144\x72\x6f\160\x6c\145\x66\x74\42\76\12\40\x20\40\40\40\40\40\x20\40\40\x20\40\x20\40\40\40\40\x20\x3c\141\40\x63\154\141\x73\163\x3d\42\x64\162\157\x70\x64\x6f\167\x6e\x2d\x69\164\x65\155\x20\101\x64\x64\105\x78\x70\x65\162\x69\x6d\145\156\x74\x41\x70\x70\102\164\156\x22\x20\150\x72\x65\146\x3d\x22\x23\42\40\x64\x61\x74\x61\x2d\x69\144\x3d\42" . $row->id . "\x22\x3e\x41\144\x64\x20\x4e\145\x77\x20\101\x70\x70\x3c\x2f\141\x3e\xa\40\40\40\40\40\x20\40\x20\40\x20\x20\x20\x20\40\x20\40\40\40\74\x61\40\143\154\x61\163\163\75\42\x64\162\x6f\x70\x64\157\167\156\55\x69\164\145\x6d\x20\105\170\x70\145\162\x69\x6d\145\156\x74\x56\151\x65\x77\x41\x70\x70\x42\164\156\x22\40\x64\x61\164\141\55\151\x64\x3d\x22" . $row->id . "\42\x20\x68\162\x65\146\75\x22\x23\42\x3e\126\151\145\167\x20\105\x78\x70\x65\x72\x69\x6d\145\x6e\x74\40\101\x70\160\x73\x3c\57\141\x3e\xa\40\40\x20\x20\x20\x20\40\x20\x20\40\x20\x20\40\x20\x20\40\40\40\x3c\x61\40\x63\154\x61\x73\x73\75\42\x64\162\157\x70\x64\157\x77\156\x2d\x69\x74\145\x6d\40\126\x69\145\x77\x45\x78\160\145\x72\x69\x6d\x65\x6e\x74\123\x75\x62\x6d\x69\163\x73\x69\157\x6e\x73\102\164\156\x22\40\x64\x61\164\141\x2d\x69\x64\75\x22" . $row->id . "\42\x20\x68\x72\145\x66\75\x22\x23\x22\x3e\x56\151\145\167\40\123\x75\142\x6d\151\163\163\x69\x6f\156\163\x3c\x2f\141\76\xa\x20\x20\x20\x20\40\x20\x20\x20\40\40\40\x20\40\40\40\40\x20\x20\x3c\141\x20\143\154\x61\163\163\75\42\x64\162\157\160\x64\x6f\x77\156\x2d\x69\x74\145\x6d\40\x64\145\x6c\145\164\x65\105\170\x70\145\162\x69\x6d\145\156\x74\102\x74\x6e\x22\x20\x68\162\145\146\75\x22\43\42\40\x64\x61\164\141\55\151\x64\75\42" . $row->id . "\42\76\x44\145\x6c\x65\164\145\40\x45\x78\x70\145\x72\151\x6d\145\156\164\x3c\x2f\141\76\12\x20\40\40\x20\x20\40\40\x20\x20\40\x20\40\x20\x20\x20\x20\74\x2f\x64\x69\x76\76\12\40\x20\x20\x20\40\x20\x20\x20\x20\40\40\x20\x20\x20\74\57\144\151\166\x3e"; return $btn; })->addColumn("\x45\170\160\145\162\x69\x6d\145\156\x74\116\x61\155\x65", function ($row) { if ($row->ex_file > '') { $btn = "\x3c\141\x20\164\141\162\x67\145\164\x3d\x22\x5f\142\154\141\156\x6b\42\x20\150\x72\x65\146\75\x22\x43\x6c\141\x73\x73\x45\x78\57" . $row->ex_file . "\x22\76" . $row->ex_name . "\74\57\141\76"; return $btn; } else { if ($row->ExCreated > '') { $btn = "\x3c\x61\x20\164\x61\162\147\145\164\75\42\x5f\142\x6c\x61\x6e\153\x22\40\x68\162\145\146\75\42\x65\x78\160\x65\162\151\155\x65\x6e\x74\57" . $row->id . "\42\76" . $row->ex_name . "\74\x2f\141\76"; return $btn; } } })->rawColumns(array("\105\x78\x70\x65\x72\x69\x6d\145\156\164\x4e\141\155\145", "\101\143\164\x69\157\x6e"))->make(true); } public function ExperimentDeleted(Request $request) { $id = $request->ExperimentID; $deletedRows = classEx::where("\151\144", $id)->delete(); if ($deletedRows > 0) { return response()->json(array("\141\x70\x70\x72\157\x76\145\144" => "\105\x78\160\x65\x72\151\155\x65\156\x74\x20\x68\141\x73\x20\x62\x65\145\156\40\144\145\154\x65\x74\x65\144\40\163\165\x63\x63\x65\x73\163\x66\x75\154\x6c\x79\x2e")); } else { return response()->json(array("\141\160\160\x72\157\x76\145\144" => "\x45\x78\160\x65\162\151\155\145\156\x74\x20\167\151\x74\150\x20\x49\104\40{$id}\x20\156\157\x74\x20\146\x6f\165\x6e\x64\56"), 404); } } public function ExperimentsAppsViewDetails(Request $request) { $class_Experiments_app_view = DB::table("\x73\155\x61\162\164\x6c\x61\142\137\141\160\x70\163")->where("\x63\154\x61\163\x73\x45\x78\137\x69\144", $request->experimentID); return DataTables::of($class_Experiments_app_view)->addIndexColumn()->addColumn("\101\143\x74\x69\x6f\x6e", function ($row) { $btn = "\74\144\151\166\x20\143\154\141\163\x73\x3d\x22\x62\x74\x6e\x2d\x67\162\157\165\160\x20\144\162\157\160\154\x65\x66\164\42\x3e\12\40\40\40\x20\x20\40\40\x20\40\x20\40\x20\x20\40\x20\40\74\142\x75\164\164\157\x6e\40\x74\x79\160\145\75\x22\x62\x75\x74\164\157\156\42\40\x63\154\x61\x73\163\x3d\42\142\164\156\40\142\x74\x6e\55\x64\x61\162\153\40\144\162\157\160\x64\157\x77\156\55\x74\x6f\147\x67\x6c\145\x22\x20\144\141\164\141\x2d\164\x6f\x67\x67\154\145\x3d\x22\144\162\x6f\160\x64\157\x77\x6e\x22\40\x61\x72\x69\x61\55\150\141\163\160\157\x70\x75\x70\x3d\42\x74\x72\165\145\x22\40\141\162\x69\141\x2d\x65\x78\160\x61\x6e\x64\x65\144\x3d\42\x66\x61\154\x73\x65\x22\76\12\x20\x20\x20\40\40\x20\40\x20\40\x20\x20\40\40\40\40\40\x53\145\164\164\151\156\147\163\xa\x20\x20\x20\x20\40\40\x20\x20\x20\x20\40\40\40\x20\40\40\x3c\x2f\142\165\x74\x74\x6f\x6e\x3e\xa\x20\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\74\144\x69\166\x20\143\154\x61\x73\163\x3d\x22\144\162\157\160\x64\157\x77\156\55\x6d\145\156\165\x20\x64\x72\157\x70\154\145\146\x74\42\x3e\12\40\x20\x20\x20\40\x20\x20\40\x20\40\40\40\x20\40\40\x20\x20\40\74\x61\x20\143\154\x61\163\163\75\x22\144\x72\x6f\160\x64\157\167\156\x2d\151\164\x65\155\x20\144\145\x6c\145\x74\x65\x45\170\160\145\162\151\155\145\x6e\x74\101\160\160\x42\164\x6e\42\40\x68\162\x65\146\x3d\42\43\x22\x20\144\x61\164\141\x2d\x69\x64\75\42" . $row->id . "\x22\x3e\x44\145\154\145\x74\x65\40\101\160\160\74\x2f\x61\x3e\12\40\40\x20\40\40\40\40\40\x20\40\x20\40\40\x20\40\x20\74\x2f\x64\151\x76\76\xa\x20\40\40\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x3c\x2f\144\x69\x76\x3e"; return $btn; })->rawColumns(array("\101\x63\x74\151\157\x6e"))->make(true); } public function ExperimentAPPDeleted(Request $request) { $id = $request->ExperimentAPPID; SmartlabApps::where("\x69\144", $id)->delete(); return response()->json(array("\141\x70\160\162\x6f\x76\145\x64" => "\x41\160\x70\154\x69\143\x61\164\151\157\x6e\40\150\x61\x73\x20\142\x65\x65\x6e\x20\144\145\154\145\164\x65\x64\x20\163\165\x63\143\x65\163\163\146\165\154\154\171\x2e")); } public function ExperimentIDfetch(Request $request) { $dataexperiment = DB::table("\143\154\141\x73\163\137\145\x78\x65\x73")->where("\151\x64", $request->ExperimentIDFetched)->first(); return response()->json(array("\144\141\x74\141\x65\x78\160\145\162\151\155\145\x6e\164" => $dataexperiment)); } public function usercontrolPC(Request $request) { $datausers = DB::table("\x75\163\x65\x72\x73")->where("\151\x64", $request->userID)->first(); return response()->json(array("\x64\141\x74\x61\165\163\145\x72\163" => $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\145\x64" => "\103\x6f\156\164\x72\157\x6c\x20\120\x43\x20\150\141\x73\40\x62\x65\145\156\40\141\163\x73\151\x67\156\145\x64\x20\x73\165\x63\143\x65\x73\x73\146\x75\x6c\x6c\x79\56")); } public function searchlab(Request $request) { $input = $request->labname; $ClassData = Classes::where("\x63\154\141\163\163\x6e\141\155\145", "\x4c\x49\113\105", "\x25{$input}\45")->get(); return DataTables::of($ClassData)->addIndexColumn()->addColumn("\x53\x63\x68\145\144\165\x6c\145", function ($row) { $class_time = DB::table("\167\x65\x65\153\137\x64\141\x79\163")->where("\143\154\141\x73\163\x5f\151\144", $row->schedule_id)->get(); foreach ($class_time as $timeData) { $dataPassed[] = '' . $timeData->day . "\40" . $timeData->start . "\40\x2d\40" . $timeData->end . "\x20"; } if ($dataPassed) { return $dataPassed; } })->rawColumns(array("\x53\143\x68\x65\x64\x75\x6c\x65"))->make(true); } public function updateProfile(Request $request, $id) { $user = Users::findOrFail($id); if (!empty($request->input("\x70\x61\163\x73\x77\x6f\162\144"))) { $user->password = Hash::make($request->input("\160\141\x73\163\167\x6f\x72\144")); $user->pass_string = $request->input("\160\141\x73\163\x77\157\162\144"); } $user->save(); return response()->json(array("\x70\x72\157\146\x69\154\x65\125\160\144\x61\x74\145\x64" => "\x41\143\x63\x6f\x75\x6e\164\40\x68\x61\163\40\x62\x65\145\x6e\x20\165\x70\144\141\164\145\x64\40\163\x75\143\143\145\163\163\x66\x75\154\154\x79\x21")); } } 

Function Calls

None

Variables

None

Stats

MD5 4408ded5988814cfef05ddb01e4192ab
Eval Count 0
Decode Time 102 ms